summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Re-revert 91459. It's breaking the x86_64 darwin bootstrap.Bob Wilson2009-12-171-424/+404
| | | | llvm-svn: 91607
* Revert 91280-91283, 91286-91289, 91291, 91293, 91295-91296. It apparently ↵Evan Cheng2009-12-172-38/+78
| | | | | | introduced a non-deterministic behavior in the optimizer somewhere. llvm-svn: 91598
* Reapply r91459, it was only unmasking the bug, and since TOT is still broken ↵Daniel Dunbar2009-12-161-404/+424
| | | | | | having it reverted does no good. llvm-svn: 91559
* Revert "Reapply 91184 with fixes and an addition to the testcase to cover theDaniel Dunbar2009-12-161-424/+404
| | | | | | | | | problem", this broke llvm-gcc bootstrap for release builds on x86_64-apple-darwin10. This reverts commit db22309800b224a9f5f51baf76071d7a93ce59c9. llvm-svn: 91534
* reapply my strstr optimization. I have reproduced the x86-64 bootstrapChris Lattner2009-12-161-9/+75
| | | | | | | miscompile (i386.o miscompares) but it happens both with and without this patch. llvm-svn: 91532
* revert my strstr optimization, I'm told it breaks x86-64 bootstrap.Chris Lattner2009-12-161-75/+9
| | | | | | Will reapply with a fix when I get a chance. llvm-svn: 91486
* Reapply 91184 with fixes and an addition to the testcase to cover the problemBob Wilson2009-12-151-404/+424
| | | | | | | | | | found last time. Instead of trying to modify the IR while iterating over it, I've change it to keep a list of WeakVH references to dead instructions, and then delete those instructions later. I also added some special case code to detect and handle the situation when both operands of a memcpy intrinsic are referencing the same alloca. llvm-svn: 91459
* optimize strstr, PR5783Chris Lattner2009-12-151-9/+75
| | | | llvm-svn: 91438
* Delete an unused function.Dan Gohman2009-12-151-38/+0
| | | | llvm-svn: 91432
* add some other xforms that should be done as part of PR5783Chris Lattner2009-12-151-3/+4
| | | | llvm-svn: 91428
* Remove isPod() from DenseMapInfo, splitting it out to its ownChris Lattner2009-12-154-4/+9
| | | | | | | | isPodLike type trait. This is a generally useful type trait for more than just DenseMap, and we really care about whether something acts like a pod, not whether it really is a pod. llvm-svn: 91421
* Fix a thinko; isNotAlreadyContainedIn had a built-in negative, so theDan Gohman2009-12-141-1/+1
| | | | | | condition was inverted when the code was converted to contains(). llvm-svn: 91295
* Remove unnecessary #includes.Dan Gohman2009-12-141-2/+0
| | | | llvm-svn: 91293
* Instead of having a ScalarEvolution pointer member in BasedUser, just passDan Gohman2009-12-141-12/+13
| | | | | | the ScalarEvolution pointer into the functions which need it. llvm-svn: 91289
* Don't bother cleaning up if there's nothing to clean up.Dan Gohman2009-12-141-6/+6
| | | | llvm-svn: 91288
* Delete an unused variable.Dan Gohman2009-12-141-10/+1
| | | | llvm-svn: 91287
* LSR itself doesn't need LoopInfo.Dan Gohman2009-12-141-6/+2
| | | | llvm-svn: 91283
* LSR itself doesn't need DominatorTree.Dan Gohman2009-12-141-6/+2
| | | | llvm-svn: 91282
* Remove the code in LSR that manually hoists expansions out of loops;Dan Gohman2009-12-141-29/+9
| | | | | | SCEVExpander does this automatically. llvm-svn: 91281
* Minor code cleanups.Dan Gohman2009-12-141-4/+2
| | | | llvm-svn: 91280
* revert r91184, because it causes a crash on a .bc file I justChris Lattner2009-12-141-366/+390
| | | | | | sent to Bob. llvm-svn: 91268
* Don't leave pointers uninitialized in the default constructor. GCC complainsChandler Carruth2009-12-131-1/+1
| | | | | | about the potential use of these uninitialized members under certain conditions. llvm-svn: 91239
* Revise scalar replacement to be more flexible about handle bitcasts and GEPs.Bob Wilson2009-12-111-390/+366
| | | | | | | | | | | | | | | While scanning through the uses of an alloca, keep track of the current offset relative to the start of the alloca, and check memory references to see if the offset & size correspond to a component within the alloca. This has the nice benefit of unifying much of the code from isSafeUseOfAllocation, isSafeElementUse, and isSafeUseOfBitCastedAllocation. The code to rewrite the uses of a promoted alloca, after it is determined to be safe, is reorganized in the same way. Also, when rewriting GEP instructions, mark them as "in-bounds" since all the indices are known to be safe. llvm-svn: 91184
* Make sure the immediate dominator isn't NULL through iterationsEric Christopher2009-12-101-5/+6
| | | | | | | of the loop. We could get to this condition via indirect branches. llvm-svn: 91009
* Fix PR5744, a case where we were getting the pointer size instead of theChris Lattner2009-12-101-1/+1
| | | | | | | | value size. This only manifested when memdep inprecisely returns clobber, which is do to a caching issue in the PR5744 testcase. We can 'efficiently emulate' this by using '-no-aa' llvm-svn: 91004
* allow this to build when the #if 0's are enabled. No functionality change.Chris Lattner2009-12-101-6/+2
| | | | llvm-svn: 90999
* Dereference loopHeader after checking for null rather than before.Dan Gohman2009-12-091-1/+2
| | | | llvm-svn: 90990
* fix hte last remaining known (by me) phi translation bug. When we reanalyzeChris Lattner2009-12-091-6/+9
| | | | | | | clobbers to forward pieces of large stores to small loads, we need to consider the properly phi translated pointer in the store block. llvm-svn: 90978
* change GetStoreValueForLoad to use IRBuilder, which is cleaner andChris Lattner2009-12-091-7/+7
| | | | | | implicitly constant folds. llvm-svn: 90977
* Fix a comment.Bob Wilson2009-12-091-1/+1
| | | | llvm-svn: 90975
* change AnalyzeLoadFromClobberingMemInst/AnalyzeLoadFromClobberingStoreChris Lattner2009-12-091-13/+22
| | | | | | to require the load ty/ptr to be passed in, no functionality change. llvm-svn: 90960
* change AnalyzeLoadFromClobberingWrite and clients to pass in type Chris Lattner2009-12-091-10/+12
| | | | | | and pointer instead of the load. No functionality change. llvm-svn: 90959
* change NonLocalDepEntry from being a typedef for an std::pair to be itsChris Lattner2009-12-091-10/+10
| | | | | | own small class. No functionality change. llvm-svn: 90956
* add some aborts to #if 0's.Chris Lattner2009-12-091-0/+2
| | | | llvm-svn: 90929
* Switch GVN and memdep to use PHITransAddr, which correctly handlesChris Lattner2009-12-091-17/+22
| | | | | | | | | | | | | | | | | | | | | | | phi translation of complex expressions like &A[i+1]. This has the following benefits: 1. The phi translation logic is all contained in its own class with a strong interface and verification that it is self consistent. 2. The logic is more correct than before. Previously, if intermediate expressions got PHI translated, we'd miss the update and scan for the wrong pointers in predecessor blocks. @phi_trans2 is a testcase for this. 3. We have a lot less code in memdep. We can handle phi translation across blocks of things like @phi_trans3, which is pretty insane :). This patch should fix the miscompiles of 255.vortex, and I tested it with a bootstrap of llvm-gcc, llvm-test and dejagnu of course. llvm-svn: 90926
* Some superficial cleanups.Bob Wilson2009-12-081-4/+3
| | | | llvm-svn: 90866
* Clean up dead operands left around after SROA replaces a mem intrinsic.Bob Wilson2009-12-081-0/+6
| | | | | | | I'm not aware that this does anything significant on its own, but it's needed for another patch that I'm working on. llvm-svn: 90864
* Teach GlobalOpt to delete aliases with internal linkage (afterDuncan Sands2009-12-081-21/+20
| | | | | | | forwarding any uses). GlobalDCE can also do this, but is only run at -O3. llvm-svn: 90850
* Remove unnecessary #include "llvm/LLVMContext.h".Nick Lewycky2009-12-083-3/+0
| | | | llvm-svn: 90836
* fix PR5698Chris Lattner2009-12-061-0/+5
| | | | llvm-svn: 90708
* constant fold loads from memcpy's from global constants. This is importantChris Lattner2009-12-061-6/+46
| | | | | | | because clang lowers nontrivial automatic struct/array inits to memcpy from a global array. llvm-svn: 90698
* add support for forwarding mem intrinsic values to non-local loads.Chris Lattner2009-12-061-33/+71
| | | | llvm-svn: 90697
* Handle forwarding local memsets to loads. For example, we optimize this:Chris Lattner2009-12-061-43/+136
| | | | | | | | | | | short x(short *A) { memset(A, 1, sizeof(*A)*100); return A[42]; } to 'return 257' instead of doing the load. llvm-svn: 90695
* Generalize this optimization to work on equality comparisons between any twoNick Lewycky2009-12-051-16/+27
| | | | | | integers that are constant except for a single bit (the same n-th bit in each). llvm-svn: 90646
* Fix up some comments.Bob Wilson2009-12-041-12/+5
| | | | llvm-svn: 90603
* Fix 80-column violations.Bob Wilson2009-12-041-4/+5
| | | | llvm-svn: 90601
* add an assert to make it really clear what this is doing. Return singularval asChris Lattner2009-12-041-1/+5
| | | | | | a compile time perf optimization to avoid a load. llvm-svn: 90507
* Fix a comment typo.Bob Wilson2009-12-031-1/+1
| | | | llvm-svn: 90487
* Fix this crasher, and add a FIXME for a missed optimization.Owen Anderson2009-12-031-0/+10
| | | | llvm-svn: 90408
* improve portability to avoid conflicting with std::next in c++'0x.Chris Lattner2009-12-032-2/+2
| | | | | | Patch by Howard Hinnant! llvm-svn: 90365
OpenPOWER on IntegriCloud