Skip to content
  1. Mar 31, 2009
    • Evan Cheng's avatar
      Throttle back "fold select into operand" transformation. InstCombine should... · 826b6f0f
      Evan Cheng authored
      Throttle back "fold select into operand" transformation. InstCombine should not generate selects of two constants unless they are selects of 0 and 1.
      
      e.g.
      define i32 @t1(i32 %c, i32 %x) nounwind {
             %t1 = icmp eq i32 %c, 0
             %t2 = lshr i32 %x, 18
             %t3 = select i1 %t1, i32 %t2, i32 %x
             ret i32 %t3
      }
      
      was turned into
      
      define i32 @t2(i32 %c, i32 %x) nounwind {
             %t1 = icmp eq i32 %c, 0
             %t2 = select i1 %t1, i32 18, i32 0
             %t3 = lshr i32 %x, %t2
             ret i32 %t3
      }
      
      For most targets, that means materializing two constants and then a select. e.g. On x86-64
      
      movl    %esi, %eax
      shrl    $18, %eax
      testl   %edi, %edi
      cmovne  %esi, %eax
      ret
      
      =>
      
      xorl    %eax, %eax
      testl   %edi, %edi
      movl    $18, %ecx
      cmovne  %eax, %ecx
      movl    %esi, %eax
      shrl    %cl, %eax
      ret
      
      Also, the optimizer and codegen can reason about shl / and / add, etc. by a constant. This optimization will hinder optimizations using ComputeMaskedBits.
      
      llvm-svn: 68142
      826b6f0f
    • Devang Patel's avatar
      Loop Index Split can eliminate a loop if it can determin if loop body is... · 6e68bd00
      Devang Patel authored
      Loop Index Split can eliminate a loop if it can determin if loop body is executed only once. There was a bug in determining IV based value of the iteration for which the loop body is executed. Fix it.
      
      llvm-svn: 68071
      6e68bd00
  2. Mar 27, 2009
    • Duncan Sands's avatar
      Revert r67798: it breaks llvm-gcc bootstrap on x86-64-linux, presumably due to · 3241b74f
      Duncan Sands authored
      a miscompilation.
      
      make[4]: Entering directory `gcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include'
      if [ ! -d "./x86_64-unknown-linux-gnu/bits/stdtr1c++.h.gch" ]; then \
                mkdir -p ./x86_64-unknown-linux-gnu/bits/stdtr1c++.h.gch; \
              fi; \
              gcc-4.2.llvm-objects/./gcc/xgcc -shared-libgcc -Bgcc-4.2.llvm-objects/./gcc -nostdinc++ 
      -Lgcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/src -Lgcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs 
      -B/usr/local/gnat-llvm/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gnat-llvm/x86_64-unknown-linux-gnu/lib/ -isystem 
      /usr/local/gnat-llvm/x86_64-unknown-linux-gnu/include -isystem /usr/local/gnat-llvm/x86_64-unknown-linux-gnu/sys-include -Winvalid-pch -Wno-deprecated -x 
      c++-header -g -O2  -D_GNU_SOURCE -Igcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu 
      -Igcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include -Igcc-4.2.llvm/libstdc++-v3/libsupc++ -O2 -g 
      gcc-4.2.llvm/libstdc++-v3/include/precompiled/stdtr1c++.h -o x86_64-unknown-linux-gnu/bits/stdtr1c++.h.gch/O2g.gch
      In file included from gcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include/tr1/repeat.h:247,
                       from gcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include/tr1/functional:1098,
                       from gcc-4.2.llvm/libstdc++-v3/include/precompiled/stdtr1c++.h:53:
      gcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include/tr1/functional_iterate.h:417: internal compiler error: in ggc_recalculate_in_use_p, at 
      ggc-page.c:1602
      Please submit a full bug report,
      with preprocessed source if appropriate.
      See <URL:http://llvm.org/bugs/> for instructions.
      make[4]: *** [x86_64-unknown-linux-gnu/bits/stdtr1c++.h.gch/O2g.gch] Error 1
      
      llvm-svn: 67839
      3241b74f
    • Dale Johannesen's avatar
      One more place to skip debug info. · 4026b041
      Dale Johannesen authored
      llvm-svn: 67811
      4026b041
    • Devang Patel's avatar
      While hoisting an instruction, update alias info set tracker. · fe7c0492
      Devang Patel authored
      llvm-svn: 67798
      fe7c0492
  3. Mar 26, 2009
  4. Mar 25, 2009
  5. Mar 24, 2009
    • Chris Lattner's avatar
      canonicalize inttoptr and ptrtoint instructions which cast pointers · 306813cb
      Chris Lattner authored
      to/from integer types that are not intptr_t to convert to intptr_t
      then do an integer conversion to the dest type.  This exposes the
      cast to the optimizer.
      
      llvm-svn: 67638
      306813cb
    • Chris Lattner's avatar
      two changes: · d9eb4117
      Chris Lattner authored
      1. Make instcombine always canonicalize trunc x to i1 into an icmp(x&1).  This 
         exposes the AND to other instcombine xforms and is more of what the code
         generator expects.
      2. Rewrite the remaining trunc pattern match to use 'match', which 
         simplifies it a lot.
         
      
      llvm-svn: 67635
      d9eb4117
  6. Mar 21, 2009
  7. Mar 20, 2009
  8. Mar 19, 2009
  9. Mar 18, 2009
  10. Mar 17, 2009
  11. Mar 13, 2009
    • 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
    • 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
    • Dale Johannesen's avatar
      One more place where debug info affects codegen. · c6583051
      Dale Johannesen authored
      llvm-svn: 66930
      c6583051
    • 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
    • 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
  12. 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
  13. Mar 11, 2009
  14. Mar 10, 2009
  15. Mar 09, 2009
Loading