summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* fix rdar://6762290, a crash compiling cxx filt with clang.Chris Lattner2009-04-071-3/+4
| | | | llvm-svn: 68500
* remove empty sectionChris Lattner2009-04-071-4/+0
| | | | llvm-svn: 68485
* Let the strcat optimizer return the pointer to the start of the buffer,Ed Schouten2009-04-061-2/+2
| | | | | | | | | instead of the place where it started to perform the string copy. - PR3661 - Patch by Benjamin Kramer! llvm-svn: 68443
* Reapply r68211, with the miscompilations it caused fixed.Owen Anderson2009-04-011-9/+30
| | | | llvm-svn: 68262
* Revert r68172. It caused regressions inDan Gohman2009-04-011-38/+10
| | | | | | | | Applications/Burg/burg Applications/ClamAV/clamscan and many other tests. llvm-svn: 68211
* Enhance GVN to propagate simple conditionals. This fixes PR3921.Owen Anderson2009-04-011-10/+38
| | | | llvm-svn: 68172
* Make the key of ValueRankMap an AssertingVH, so that we die violentlyChris Lattner2009-03-311-6/+7
| | | | | | if it dangles. llvm-svn: 68150
* Throttle back "fold select into operand" transformation. InstCombine should ↵Evan Cheng2009-03-311-52/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Update call graph after inlining invoke.Devang Patel2009-03-311-2/+19
| | | | | | Patch by Jay Foad. llvm-svn: 68120
* Loop Index Split can eliminate a loop if it can determin if loop body is ↵Devang Patel2009-03-301-8/+24
| | | | | | 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
* Revert r67798: it breaks llvm-gcc bootstrap on x86-64-linux, presumably due toDuncan Sands2009-03-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* One more place to skip debug info.Dale Johannesen2009-03-271-7/+14
| | | | llvm-svn: 67811
* While hoisting an instruction, update alias info set tracker.Devang Patel2009-03-261-0/+1
| | | | llvm-svn: 67798
* Skip debug info one more place. (This one getsDale Johannesen2009-03-261-6/+12
| | | | | | | called from llc, not opt, but it's an IR level optimization nevertheless.) llvm-svn: 67724
* Before deleting a basic block, give other loop passes a chance cleanup ↵Devang Patel2009-03-251-1/+1
| | | | | | analysis values, related to the instructions in the basic block. llvm-svn: 67719
* Fix PR3874 by restoring a condition I removed, but making it moreChris Lattner2009-03-251-1/+2
| | | | | | precise than it used to be. llvm-svn: 67662
* oops, I intended to remove this, not comment it out. Thanks Duncan!Chris Lattner2009-03-241-2/+1
| | | | llvm-svn: 67657
* canonicalize inttoptr and ptrtoint instructions which cast pointers Chris Lattner2009-03-241-5/+37
| | | | | | | | 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
* two changes:Chris Lattner2009-03-241-45/+29
| | | | | | | | | | | 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
* Use a SmallPtrSet instead of std::set.Dale Johannesen2009-03-231-2/+2
| | | | llvm-svn: 67578
* Now that errs() is properly non-buffered, there's no need toDan Gohman2009-03-231-2/+1
| | | | | | explicitly flush it. llvm-svn: 67526
* Factorize out a concept - no functionality change.Duncan Sands2009-03-213-8/+6
| | | | llvm-svn: 67454
* Fix instcombine to not introduce undefined shifts when merging twoChris Lattner2009-03-201-2/+14
| | | | | | shifts together. This fixes PR3851. llvm-svn: 67411
* Don't load values out of global constants with weakDuncan Sands2009-03-203-6/+8
| | | | | | | | | linkage: the value may be replaced with something different at link time. (Frontends that want to allow values to be loaded out of weak constants can give their constants weak_odr linkage). llvm-svn: 67407
* Clear the cached cost when removing a function inDale Johannesen2009-03-192-10/+17
| | | | | | | | | the inliner; prevents nondeterministic behavior when the same address is reallocated. Don't build call graph nodes for debug intrinsic calls; they're useless, and there were typically a lot of them. llvm-svn: 67311
* Fix comment typo.Dale Johannesen2009-03-191-1/+1
| | | | llvm-svn: 67307
* This pass keeps a map of Instructions to Rank numbers,Dale Johannesen2009-03-191-8/+14
| | | | | | | | | and was deleting Instructions without clearing the corresponding map entry. This led to nondeterministic behavior if the same address got allocated to another Instruction within a short time. llvm-svn: 67306
* Remove strange extra semicolons.Nick Lewycky2009-03-192-2/+2
| | | | llvm-svn: 67287
* aha, DAE does have to think about PHI nodes. Many thanks to "Dr Evil" (aka ↵Chris Lattner2009-03-181-3/+3
| | | | | | | | Duncan) for pointing this out :) llvm-svn: 67212
* Fix PR3826 - InstComb assert with vector shift, by not calling ↵Chris Lattner2009-03-181-7/+8
| | | | | | ComputeNumSignBits on a vector. llvm-svn: 67211
* add an assertion to make it clear that PHI nodes are not allowed.Chris Lattner2009-03-181-1/+4
| | | | llvm-svn: 67210
* Explicitly check for StoreInst, do not lose the chance to delete Zhou Sheng2009-03-181-1/+1
| | | | | | unused loads or bitcasts. llvm-svn: 67202
* Revert my previous change on Local.cpp, instead, fix the bug on scalarrepl.Zhou Sheng2009-03-182-4/+1
| | | | | | | If the instruction has no users, it is also not only used by debug info and should not be deleted. llvm-svn: 67194
* Fix a bug.Zhou Sheng2009-03-181-0/+3
| | | | | | If I->use_empty(), this method should return false. llvm-svn: 67180
* Fix PR3807 by inserting 'insertelement' instructions in the normal dest of Chris Lattner2009-03-181-5/+10
| | | | | | an invoke instead of after the invoke (in its block), which is invalid. llvm-svn: 67139
* LSR shouldn't ever try to hack on integer IV's larger than 64-bits. Right nowChris Lattner2009-03-171-0/+6
| | | | | | | | | it is not APInt clean, but even when it is it needs to be evaluated carefully to determine whether it is actually profitable. This fixes a crash on PR3806 llvm-svn: 67134
* Remove a condition which is always true.Chris Lattner2009-03-171-3/+3
| | | | llvm-svn: 67089
* Fix a debug info dependency in jump threading.Dale Johannesen2009-03-171-2/+5
| | | | llvm-svn: 67064
* Fix -strip-debug-declare to work when there areDale Johannesen2009-03-131-19/+17
| | | | | | llvm.global.variable's but no llvm.declare's. llvm-svn: 66977
* Fix PR3784: If the source of a phi comes from a bb ended with an invoke, ↵Evan Cheng2009-03-131-0/+6
| | | | | | | | 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
* Revert r66920. It was causing failures in the self-hosting buildbot (in releaseBill Wendling2009-03-134-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* One more place where debug info affects codegen.Dale Johannesen2009-03-131-1/+2
| | | | llvm-svn: 66930
* Second installment of "BasicBlock operands to the back"Gabor Greif2009-03-134-7/+7
| | | | | | | | | | | | | | | | | | 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
* Oops...I committed too much.Bill Wendling2009-03-132-34/+31
| | | | llvm-svn: 66867
* Temporarily XFAIL this test.Bill Wendling2009-03-132-31/+34
| | | | llvm-svn: 66866
* Fix one more place where debug info affectedDale Johannesen2009-03-131-2/+5
| | | | | | codegen (speculative execution). llvm-svn: 66859
* Previous debug info fix to this code wasn't quiteDale Johannesen2009-03-121-5/+4
| | | | | | | | 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
* Revert commit 66140 since it caused several failuresDuncan Sands2009-03-121-6/+0
| | | | | | | | | | | 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
* There already was a class to force deterministicDale Johannesen2009-03-121-23/+14
| | | | | | sorting of ConstantInt's; unreinvent wheel. llvm-svn: 66824
* Another missing check for debug intrinsics.Dale Johannesen2009-03-121-1/+1
| | | | llvm-svn: 66800
OpenPOWER on IntegriCloud