Skip to content
  1. Mar 14, 2009
  2. Mar 13, 2009
    • Dale Johannesen's avatar
      Fix -strip-debug-declare to work when there are · a4ac7355
      Dale Johannesen authored
      llvm.global.variable's but no llvm.declare's.
      
      llvm-svn: 66977
      a4ac7355
    • Evan Cheng's avatar
      Fix PR3784: If the source of a phi comes from a bb ended with an invoke, make... · 94419d6f
      Evan Cheng authored
      Fix PR3784: If the source of a phi comes from a bb ended with an invoke, make sure the copy is inserted before the try range (unless it's used as an input to the invoke, then insert it after the last use), not at the end of the bb.
      
      Also re-apply r66140 which was disabled as a workaround.
      
      llvm-svn: 66976
      94419d6f
    • Stuart Hastings's avatar
      Fix a hashing bug in APInt. A certain pathological testcase (too · 7440952c
      Stuart Hastings authored
      large for the testsuite) took over six minutes to compile on my Mac.
      The patched LLVM-GCC compiles that testcase in three seconds (GCC
      takes less than one second).  This hash function is more complex
      (about 35 instructions on x86) than what Chris wanted, but I expect it
      will be well-behaved with arbitrary inputs.
      
      Thank you to everyone who responded to my previous request for advice.
      
      llvm-svn: 66962
      7440952c
    • Bill Wendling's avatar
      Revert r66920. It was causing failures in the self-hosting buildbot (in release · 4bb96e9a
      Bill Wendling authored
      mode).
      
      Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/dg.exp ...
      FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll
      Failed with signal(SIGBUS) at line 1
      while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes > /dev/null
      0   bugpoint          0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
      1   bugpoint          0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
      2   libSystem.B.dylib 0x92f112bb _sigtramp + 43
      3   libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
      4   bugpoint          0x00021d1c main + 92
      5   bugpoint          0x00002106 start + 54
      6   bugpoint          0x00000004 start + 18446744073709543220
      Stack dump:
      0.    Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes 
      
      FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll
      Failed with signal(SIGBUS) at line 1
      while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes
      0   bugpoint          0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
      1   bugpoint          0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
      2   libSystem.B.dylib 0x92f112bb _sigtramp + 43
      3   libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
      4   bugpoint          0x00021d1c main + 92
      5   bugpoint          0x00002106 start + 54
      6   bugpoint          0x00000006 start + 18446744073709543222
      Stack dump:
      0.    Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes 
      
      FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll
      Failed with signal(SIGBUS) at line 1
      while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll  -bugpoint-crashcalls -silence-passes
      0   bugpoint          0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
      1   bugpoint          0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
      2   libSystem.B.dylib 0x92f112bb _sigtramp + 43
      3   libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
      4   bugpoint          0x00021d1c main + 92
      5   bugpoint          0x00002106 start + 54
      Stack dump:
      0.    Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes 
      
      --- Reverse-merging (from foreign repository) r66920 into '.':
      U    include/llvm/Support/CallSite.h
      U    include/llvm/Instructions.h
      U    lib/Analysis/IPA/GlobalsModRef.cpp
      U    lib/Analysis/IPA/Andersens.cpp
      U    lib/Bitcode/Writer/BitcodeWriter.cpp
      U    lib/VMCore/Instructions.cpp
      U    lib/VMCore/Verifier.cpp
      U    lib/VMCore/AsmWriter.cpp
      U    lib/Transforms/Utils/LowerInvoke.cpp
      U    lib/Transforms/Scalar/SimplifyCFGPass.cpp
      U    lib/Transforms/IPO/PruneEH.cpp
      U    lib/Transforms/IPO/DeadArgumentElimination.cpp
      
      llvm-svn: 66953
      4bb96e9a
    • Dan Gohman's avatar
      Fix FastISel's assumption that i1 values are always zero-extended · c0bb9595
      Dan Gohman authored
      by inserting explicit zero extensions where necessary. Included
      is a testcase where SelectionDAG produces a virtual register
      holding an i1 value which FastISel previously mistakenly assumed
      to be zero-extended.
      
      llvm-svn: 66941
      c0bb9595
    • Rafael Espindola's avatar
      add 8 and 16 bit TLS moves. · 997b74ac
      Rafael Espindola authored
      add a fixme note on how to remove code duplication.
      
      llvm-svn: 66932
      997b74ac
    • Dale Johannesen's avatar
      One more place where debug info affects codegen. · c6583051
      Dale Johannesen authored
      llvm-svn: 66930
      c6583051
    • Rafael Espindola's avatar
      Improve sext and zext of TLS variables. · 71144973
      Rafael Espindola authored
      llvm-svn: 66922
      71144973
    • Gabor Greif's avatar
      Second installment of "BasicBlock operands to the back" · 258232fb
      Gabor Greif authored
      changes.
      
      For InvokeInst now all arguments begin at op_begin().
      The Callee, Cont and Fail are now faster to get by
      access relative to op_end().
      
      This patch introduces some temporary uglyness in CallSite.
      Next I'll bring CallInst up to a similar scheme and then
      the uglyness will magically vanish.
      
      This patch also exposes all the reliance of the libraries
      on InvokeInst's operand ordering. I am thinking of taking
      care of that too.
      
      llvm-svn: 66920
      258232fb
    • Chris Lattner's avatar
      generalize this code so that fast isel handles integer truncates to i1, which · 3fb71c8f
      Chris Lattner authored
      codegen to the same thing as integer truncates to i8 (the top bits are 
      just undefined).  This implements rdar://6667338
      
      llvm-svn: 66902
      3fb71c8f
    • Bill Wendling's avatar
      These instructions have special lowering that may lower them to SSE · 798fd56d
      Bill Wendling authored
      instructions. Prevent that if we don't want implicit uses of SSE.
      
      llvm-svn: 66877
      798fd56d
    • Evan Cheng's avatar
      Fix some significant problems with constant pools that resulted in unnecessary... · 1fb8aedd
      Evan Cheng authored
      Fix some significant problems with constant pools that resulted in unnecessary paddings between constant pool entries, larger than necessary alignments (e.g. 8 byte alignment for .literal4 sections), and potentially other issues.
      
      1. ConstantPoolSDNode alignment field is log2 value of the alignment requirement. This is not consistent with other SDNode variants.
      2. MachineConstantPool alignment field is also a log2 value.
      3. However, some places are creating ConstantPoolSDNode with alignment value rather than log2 values. This creates entries with artificially large alignments, e.g. 256 for SSE vector values.
      4. Constant pool entry offsets are computed when they are created. However, asm printer group them by sections. That means the offsets are no longer valid. However, asm printer uses them to determine size of padding between entries.
      5. Asm printer uses expensive data structure multimap to track constant pool entries by sections.
      6. Asm printer iterate over SmallPtrSet when it's emitting constant pool entries. This is non-deterministic.
      
      
      Solutions:
      1. ConstantPoolSDNode alignment field is changed to keep non-log2 value.
      2. MachineConstantPool alignment field is also changed to keep non-log2 value.
      3. Functions that create ConstantPool nodes are passing in non-log2 alignments.
      4. MachineConstantPoolEntry no longer keeps an offset field. It's replaced with an alignment field. Offsets are not computed when constant pool entries are created. They are computed on the fly in asm printer and JIT.
      5. Asm printer uses cheaper data structure to group constant pool entries.
      6. Asm printer compute entry offsets after grouping is done.
      7. Change JIT code to compute entry offsets on the fly.
      
      llvm-svn: 66875
      1fb8aedd
    • Owen Anderson's avatar
      Convert VirtRegMap to a MachineFunctionPass. · d37ddf5b
      Owen Anderson authored
      llvm-svn: 66870
      d37ddf5b
    • Chris Lattner's avatar
      generalize the previous code to use the full generality of LEA · 99cc1337
      Chris Lattner authored
      for i32/i64 expressions (we could also do i16 on cpus where
      i16 lea is fast, but I didn't add this).  On the example, we now
      generate:
      
      _test:
      	movl	4(%esp), %eax
      	cmpl	$42, (%eax)
      	setl	%al
      	movzbl	%al, %eax
      	leal	4(%eax,%eax,8), %eax
      	ret
      
      instead of:
      
      _test:
      	movl	4(%esp), %eax
      	cmpl	$41, (%eax)
      	movl	$4, %ecx
      	movl	$13, %eax
      	cmovg	%ecx, %eax
      	ret
      
      llvm-svn: 66869
      99cc1337
    • Chris Lattner's avatar
      optimize the case of cond ? 42 : 41 and friends. This compiles the · 4be6df5d
      Chris Lattner authored
      example to:
      
      _test:
      	movl	4(%esp), %eax
      	cmpl	$41, (%eax)
      	setg	%al
      	movzbl	%al, %eax
      	orl	$4294967294, %eax
      	ret
      
      instead of:
      
              movl    4(%esp), %eax
              cmpl    $41, (%eax)
      	movl	$4294967294, %ecx
      	movl	$4294967295, %eax
      	cmova	%ecx, %eax
      	ret
      
      which is smaller in code size and faster. rdar://6668608
      
      llvm-svn: 66868
      4be6df5d
    • Bill Wendling's avatar
      Oops...I committed too much. · fa54bc20
      Bill Wendling authored
      llvm-svn: 66867
      fa54bc20
    • Bill Wendling's avatar
      Temporarily XFAIL this test. · b02eadf6
      Bill Wendling authored
      llvm-svn: 66866
      b02eadf6
    • Dan Gohman's avatar
      Enhance address-mode folding of ISD::ADD to handle cases where the · a1d92423
      Dan Gohman authored
      operands can't both be fully folded at the same time. For example,
      in the included testcase, a global variable is being added with
      an add of two values. The global variable wants RIP-relative
      addressing, so it can't share the address with another base
      register, but it's still possible to fold the initial add.
      
      llvm-svn: 66865
      a1d92423
    • Dale Johannesen's avatar
      Fix one more place where debug info affected · cecfa6e0
      Dale Johannesen authored
      codegen (speculative execution).
      
      llvm-svn: 66859
      cecfa6e0
    • Chris Lattner's avatar
      b858c0eb
    • Chris Lattner's avatar
      Eliminate a 9640 byte static mutable initialized data item by moving it · 0bf18690
      Chris Lattner authored
      to the stack.  This shrinks all llvm tools by 9k, and improves reentrancy.
      
      llvm-svn: 66847
      0bf18690
    • Chris Lattner's avatar
      static functions don't need an anonymous namespace. · 91702096
      Chris Lattner authored
      llvm-svn: 66845
      91702096
    • Dan Gohman's avatar
      Fix a typo in a comment. · a19c662a
      Dan Gohman authored
      llvm-svn: 66843
      a19c662a
    • Dale Johannesen's avatar
      Previous debug info fix to this code wasn't quite · ed6f5a82
      Dale Johannesen authored
      right; did the wrong thing when there are exactly 11
      non-debug instructions, followed by debug info.
      Remove a FIXME since it's apparently been fixed along the way.
      
      llvm-svn: 66840
      ed6f5a82
  3. Mar 12, 2009
    • Duncan Sands's avatar
      Revert commit 66140 since it caused several failures · 1f853d6a
      Duncan Sands authored
      in the Ada testcase.  Reverting this only covers up
      the real problem, which is a nasty conceptual difficulty
      in the phi elimination pass: when eliminating phi nodes
      in landing pads, the register copies need to come before
      the invoke, not at the end of the basic block which is
      too late...  See PR3784.
      
      llvm-svn: 66826
      1f853d6a
    • Dale Johannesen's avatar
      There already was a class to force deterministic · 7f99d22f
      Dale Johannesen authored
      sorting of ConstantInt's; unreinvent wheel.
      
      llvm-svn: 66824
      7f99d22f
    • Gabor Greif's avatar
      Rearrange operands of the BranchInst, to be able to · c91aa9b8
      Gabor Greif authored
      access each with a fixed negative index from op_end().
      
      This has two important implications:
      - getUser() will work faster, because there are less iterations
        for the waymarking algorithm to perform. This is important
        when running various analyses that want to determine callers
        of basic blocks.
      - getSuccessor() now runs faster, because the indirection via OperandList
        is not necessary: Uses corresponding to the successors are at fixed
        offset to "this".
      
      The price we pay is the slightly more complicated logic in the operator
      User::delete, as it has to pick up the information whether it has to free
      the memory of an original unconditional BranchInst or a BranchInst that
      was originally conditional, but has been shortened to unconditional.
      I was not able to come up with a nicer solution to this problem. (And
      rest assured, I tried *a lot*).
      
      Similar reorderings will follow for InvokeInst and CallInst. After that
      some optimizations to pred_iterator and CallSite will fall out naturally.
      
      llvm-svn: 66815
      c91aa9b8
    • Evan Cheng's avatar
      Re-apply 66024 with fixes: 1. Fixed indirect call to immediate address... · 2a332aa8
      Evan Cheng authored
      Re-apply 66024 with fixes: 1. Fixed indirect call to immediate address assembly. 2. Fixed JIT encoding by making the address pc-relative.
      
      llvm-svn: 66803
      2a332aa8
    • Dale Johannesen's avatar
      Another missing check for debug intrinsics. · 578d8bfc
      Dale Johannesen authored
      llvm-svn: 66800
      578d8bfc
    • Owen Anderson's avatar
      Reorganize some #include's. · 36a99378
      Owen Anderson authored
      llvm-svn: 66780
      36a99378
    • Chris Lattner's avatar
      Move 3 "(add (select cc, 0, c), x) -> (select cc, x, (add, x, c))" · 4147f08e
      Chris Lattner authored
      related transformations out of target-specific dag combine into the
      ARM backend.  These were added by Evan in r37685 with no testcases
      and only seems to help ARM (e.g. test/CodeGen/ARM/select_xform.ll).
      
      Add some simple X86-specific (for now) DAG combines that turn things
      like cond ? 8 : 0  -> (zext(cond) << 3).  This happens frequently
      with the recently added cp constant select optimization, but is a
      very general xform.  For example, we now compile the second example
      in const-select.ll to:
      
      _test:
              movsd   LCPI2_0, %xmm0
              ucomisd 8(%esp), %xmm0
              seta    %al
              movzbl  %al, %eax
              movl    4(%esp), %ecx
              movsbl  (%ecx,%eax,4), %eax
              ret
      
      instead of:
      
      _test:
              movl    4(%esp), %eax
              leal    4(%eax), %ecx
              movsd   LCPI2_0, %xmm0
              ucomisd 8(%esp), %xmm0
              cmovbe  %eax, %ecx
              movsbl  (%ecx), %eax
              ret
      
      This passes multisource and dejagnu.
      
      llvm-svn: 66779
      4147f08e
    • Chris Lattner's avatar
      improve comment. · a492d29c
      Chris Lattner authored
      llvm-svn: 66778
      a492d29c
    • Evan Cheng's avatar
      Enable Chris' value propagation change. It make available known sign, zero,... · 44659546
      Evan Cheng authored
      Enable Chris' value propagation change. It make available known sign, zero, one bits information for values that are live out of basic blocks. The goal is to eliminate unnecessary sext, zext, truncate of values that are live-in to blocks. This does not handle PHI nodes yet.
      
      llvm-svn: 66777
      44659546
    • Evan Cheng's avatar
      On x86, if the only use of a i64 load is a i64 store, generate a pair of... · ef0b7cc2
      Evan Cheng authored
      On x86, if the only use of a i64 load is a i64 store, generate a pair of double load and store instead.
      
      llvm-svn: 66776
      ef0b7cc2
    • Sanjiv Gupta's avatar
      Forgot to check-in this as part of 7761. · 8bb50e23
      Sanjiv Gupta authored
      llvm-svn: 66763
      8bb50e23
    • Sanjiv Gupta's avatar
      Banksel optimization is now based on the section names of symbols, since the... · f883419b
      Sanjiv Gupta authored
      Banksel optimization is now based on the section names of symbols, since the symbols in one section will always be put into one bank.
      
      llvm-svn: 66761
      f883419b
    • Dale Johannesen's avatar
      Allow for switch values bigger than 64 bits. · 9cdb9bb3
      Dale Johannesen authored
      llvm-svn: 66751
      9cdb9bb3
Loading