Skip to content
  1. Jan 25, 2008
  2. Jan 24, 2008
    • Chris Lattner's avatar
      Teach basicaa that 'byval' arguments define a new memory location that · 9104d712
      Chris Lattner authored
      can't be aliased to other known objects.  This allows us to know that byval 
      pointer args don't alias globals, etc.
      
      llvm-svn: 46315
      9104d712
    • Chris Lattner's avatar
      Significantly simplify and improve handling of FP function results on x86-32. · a91f77ea
      Chris Lattner authored
      This case returns the value in ST(0) and then has to convert it to an SSE
      register.  This causes significant codegen ugliness in some cases.  For 
      example in the trivial fp-stack-direct-ret.ll testcase we used to generate:
      
      _bar:
      	subl	$28, %esp
      	call	L_foo$stub
      	fstpl	16(%esp)
      	movsd	16(%esp), %xmm0
      	movsd	%xmm0, 8(%esp)
      	fldl	8(%esp)
      	addl	$28, %esp
      	ret
      
      because we move the result of foo() into an XMM register, then have to
      move it back for the return of bar.
      
      Instead of hacking ever-more special cases into the call result lowering code
      we take a much simpler approach: on x86-32, fp return is modeled as always 
      returning into an f80 register which is then truncated to f32 or f64 as needed.
      Similarly for a result, we model it as an extension to f80 + return.
      
      This exposes the truncate and extensions to the dag combiner, allowing target
      independent code to hack on them, eliminating them in this case.  This gives 
      us this code for the example above:
      
      _bar:
      	subl	$12, %esp
      	call	L_foo$stub
      	addl	$12, %esp
      	ret
      
      The nasty aspect of this is that these conversions are not legal, but we want
      the second pass of dag combiner (post-legalize) to be able to hack on them.
      To handle this, we lie to legalize and say they are legal, then custom expand
      them on entry to the isel pass (PreprocessForFPConvert).  This is gross, but
      less gross than the code it is replacing :)
      
      This also allows us to generate better code in several other cases.  For 
      example on fp-stack-ret-conv.ll, we now generate:
      
      _test:
      	subl	$12, %esp
      	call	L_foo$stub
      	fstps	8(%esp)
      	movl	16(%esp), %eax
      	cvtss2sd	8(%esp), %xmm0
      	movsd	%xmm0, (%eax)
      	addl	$12, %esp
      	ret
      
      where before we produced (incidentally, the old bad code is identical to what
      gcc produces):
      
      _test:
      	subl	$12, %esp
      	call	L_foo$stub
      	fstpl	(%esp)
      	cvtsd2ss	(%esp), %xmm0
      	cvtss2sd	%xmm0, %xmm0
      	movl	16(%esp), %eax
      	movsd	%xmm0, (%eax)
      	addl	$12, %esp
      	ret
      
      Note that we generate slightly worse code on pr1505b.ll due to a scheduling 
      deficiency that is unrelated to this patch.
      
      llvm-svn: 46307
      a91f77ea
    • Chris Lattner's avatar
      take these with a pr # · 001d781c
      Chris Lattner authored
      llvm-svn: 46303
      001d781c
    • Evan Cheng's avatar
      Let each target decide byval alignment. For X86, it's 4-byte unless the... · 35abd840
      Evan Cheng authored
      Let each target decide byval alignment. For X86, it's 4-byte unless the aggregare contains SSE vector(s). For x86-64, it's max of 8 or alignment of the type.
      
      llvm-svn: 46286
      35abd840
  3. Jan 23, 2008
  4. Jan 22, 2008
  5. Jan 21, 2008
  6. Jan 18, 2008
  7. Jan 17, 2008
    • Scott Michel's avatar
      Forward progress: crtbegin.c now compiles successfully! · e4d3e3c0
      Scott Michel authored
      Fixed CellSPU's A-form (local store) address mode, so that all globals,
      externals, constant pool and jump table symbols are now wrapped within
      a SPUISD::AFormAddr pseudo-instruction. This now identifies all local
      store memory addresses, although it requires a bit of legerdemain during
      instruction selection to properly select loads to and stores from local
      store, properly generating "LQA" instructions.
      
      Also added mul_ops.ll test harness for exercising integer multiplication.
      
      llvm-svn: 46142
      e4d3e3c0
    • Chris Lattner's avatar
      This commit changes: · 1ea55cf8
      Chris Lattner authored
      1. Legalize now always promotes truncstore of i1 to i8. 
      2. Remove patterns and gunk related to truncstore i1 from targets.
      3. Rename the StoreXAction stuff to TruncStoreAction in TLI.
      4. Make the TLI TruncStoreAction table a 2d table to handle from/to conversions.
      5. Mark a wide variety of invalid truncstores as such in various targets, e.g.
         X86 currently doesn't support truncstore of any of its integer types.
      6. Add legalize support for truncstores with invalid value input types.
      7. Add a dag combine transform to turn store(truncate) into truncstore when
         safe.
      
      The later allows us to compile CodeGen/X86/storetrunc-fp.ll to:
      
      _foo:
      	fldt	20(%esp)
      	fldt	4(%esp)
      	faddp	%st(1)
      	movl	36(%esp), %eax
      	fstps	(%eax)
      	ret
      
      instead of:
      
      _foo:
      	subl	$4, %esp
      	fldt	24(%esp)
      	fldt	8(%esp)
      	faddp	%st(1)
      	fstps	(%esp)
      	movl	40(%esp), %eax
      	movss	(%esp), %xmm0
      	movss	%xmm0, (%eax)
      	addl	$4, %esp
      	ret
      
      llvm-svn: 46140
      1ea55cf8
    • Chris Lattner's avatar
      new testcase. · 9f7fed1c
      Chris Lattner authored
      llvm-svn: 46139
      9f7fed1c
    • Evan Cheng's avatar
      Test case for varargs parameter attribute issue I just fixed. · 9a93dc95
      Evan Cheng authored
      llvm-svn: 46127
      9a93dc95
    • Chris Lattner's avatar
      add testcase that has been sitting in my tree for awhile. · 89126bde
      Chris Lattner authored
      llvm-svn: 46124
      89126bde
    • Evan Cheng's avatar
      When a live virtual register is being clobbered by an implicit def, it is spilled · 54c20b55
      Evan Cheng authored
      and the spill is its kill. However, if the local allocator has determined the
      register has not been modified (possible when its value was reloaded), it would
      not issue a restore. In that case, mark the last use of the virtual register as
      kill.
      
      llvm-svn: 46111
      54c20b55
    • Chris Lattner's avatar
      Fix arg promotion to propagate the correct attrs on the calls to · 5630c4f2
      Chris Lattner authored
      promoted functions.  This is important for varargs calls in 
      particular.  Thanks to duncan for providing a great testcase.
      
      llvm-svn: 46108
      5630c4f2
    • Evan Cheng's avatar
      Fixes a nasty dag combiner bug that causes a bunch of tests to fail at -O0. · 7be15280
      Evan Cheng authored
      It's not safe to use the two value CombineTo variant to combine away a dead load.
      e.g. 
      v1, chain2 = load chain1, loc
      v2, chain3 = load chain2, loc
      v3         = add v2, c 
      Now we replace use of v1 with undef, use of chain2 with chain1.
      ReplaceAllUsesWith() will iterate through uses of the first load and update operands:
      v1, chain2 = load chain1, loc
      v2, chain3 = load chain1, loc
      v3         = add v2, c 
      Now the second load is the same as the first load, SelectionDAG cse will ensure
      the use of second load is replaced with the first load.
      v1, chain2 = load chain1, loc
      v3         = add v1, c
      Then v1 is replaced with undef and bad things happen.
      
      llvm-svn: 46099
      7be15280
  8. Jan 16, 2008
  9. Jan 15, 2008
  10. Jan 14, 2008
Loading