summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Apply some cleanups. No functionality changes.Nick Lewycky2009-10-291-27/+23
| | | | llvm-svn: 85498
* just for the hell of it, allow globalopt to statically evaluate Chris Lattner2009-10-291-0/+6
| | | | | | static constructors with indirect gotos :) llvm-svn: 85495
* teach various passes about blockaddress. We no longerChris Lattner2009-10-293-33/+57
| | | | | | crash on any clang tests. llvm-svn: 85465
* teach ValueMapper about BlockAddress', making bugpoint a lot more useful.Chris Lattner2009-10-291-7/+10
| | | | llvm-svn: 85458
* unindent massive blocks, no functionality change.Chris Lattner2009-10-291-69/+75
| | | | llvm-svn: 85457
* Extend getMallocArraySize() to determine the array size if the malloc ↵Victor Hernandez2009-10-281-11/+9
| | | | | | | | | | | | | | argument is: ArraySize * ElementSize ElementSize * ArraySize ArraySize << log2(ElementSize) ElementSize << log2(ArraySize) Refactor isArrayMallocHelper and delete isSafeToGetMallocArraySize, so that there is only 1 copy of the malloc array determining logic. Update users of getMallocArraySize() to not bother calling isArrayMalloc() as well. llvm-svn: 85421
* llvm.dbg.global_variables do not exist anymore.Devang Patel2009-10-281-9/+0
| | | | llvm-svn: 85402
* No newline at end of file.Edward O'Callaghan2009-10-281-1/+1
| | | | llvm-svn: 85390
* Update CMake file.Benjamin Kramer2009-10-281-0/+1
| | | | llvm-svn: 85389
* Treat lifetime begin/end markers as allocations/frees respectively for theOwen Anderson2009-10-282-0/+41
| | | | | | purposes for GVN/DSE. llvm-svn: 85383
* Add ABCD, a generalized implementation of the Elimination of Array BoundsNick Lewycky2009-10-281-0/+1108
| | | | | | | | Checks on Demand algorithm which looks at arbitrary branches instead of loop iterations. This is GSoC work by Andre Tavares with only editorial changes applied! llvm-svn: 85382
* Previously, all operands to Constant were themselves constant.Chris Lattner2009-10-281-5/+4
| | | | | | | | | In the new world order, BlockAddress can have a BasicBlock operand. This doesn't permute much, because if you have a ConstantExpr (or anything more specific than Constant) we still know the operand has to be a Constant. llvm-svn: 85375
* Factor out redundancy from clone() implementations.Devang Patel2009-10-272-2/+2
| | | | llvm-svn: 85327
* Rename MallocFreeHelper as MemoryBuiltinsVictor Hernandez2009-10-277-7/+7
| | | | llvm-svn: 85286
* Fix a pretty serious misfeature of the inliner: if it inlines a functionChris Lattner2009-10-271-0/+9
| | | | | | | | | | with multiple return values it inserts a PHI to merge them all together. However, if the return values are all the same, it ends up with a pointless PHI and this pointless PHI happens to really block SRoA from happening in at least a silly C++ example written by Doug, but probably others. This fixes rdar://7339069. llvm-svn: 85206
* VS build fix, patch by Marius Wachtler.Mike Stump2009-10-271-0/+1
| | | | llvm-svn: 85197
* Add objectsize intrinsic and hook it up through codegen. Doesn'tEric Christopher2009-10-271-0/+25
| | | | | | do anything than return "I don't know" at the moment. llvm-svn: 85189
* Add braces to avoid ambiguous else.Dan Gohman2009-10-271-1/+2
| | | | llvm-svn: 85185
* Rename MallocHelper as MallocFreeHelper, since it now also identifies calls ↵Victor Hernandez2009-10-267-7/+7
| | | | | | to free() llvm-svn: 85181
* Add a straight-forward implementation of SCCVN for aggressively eliminating ↵Owen Anderson2009-10-261-0/+721
| | | | | | scalar redundancies. llvm-svn: 85179
* Remove FreeInst.Victor Hernandez2009-10-269-183/+7
| | | | | | | Remove LowerAllocations pass. Update some more passes to treate free calls just like they were treating FreeInst. llvm-svn: 85176
* Simplify this code. LoopDeletion doesn't need to explicit check thatDan Gohman2009-10-261-24/+2
| | | | | | | the loop exiting block dominates the latch block; if ScalarEvolution can prove that the trip-count is finite, that's sufficient. llvm-svn: 85165
* Code that checks WillNotOverflowSignedAdd before creating an AddDan Gohman2009-10-261-8/+8
| | | | | | can safely use the NSW bit on the Add. llvm-svn: 85164
* Update CMake files.Ted Kremenek2009-10-261-0/+1
| | | | llvm-svn: 85161
* Check in the experimental GEP splitter pass. This pass splits complexDan Gohman2009-10-261-0/+81
| | | | | | | | | | GEPs (more than one non-zero index) into simple GEPs (at most one non-zero index). In some simple experiments using this it's not uncommon to see 3% overall code size wins, because it exposes redundancies that can be eliminated, however it's tricky to use because instcombine aggressively undoes the work that this pass does. llvm-svn: 85144
* Fix a typo in a comment.Dan Gohman2009-10-261-1/+1
| | | | llvm-svn: 85120
* reapply r85085 with a bugfix to avoid infinite looping.Chris Lattner2009-10-261-8/+47
| | | | | | | All of the 'demorgan' related xforms need to use dyn_castNotVal, not m_Not. llvm-svn: 85119
* Make LSR's OptimizeShadowIV ignore induction variables with negativeDan Gohman2009-10-261-0/+4
| | | | | | | | | | strides for now, because it doesn't handle them correctly. This fixes a miscompile of SingleSource/Benchmarks/Misc-C++/ray. This problem was usually hidden because indvars transforms such induction variables into negations of canonical induction variables. llvm-svn: 85118
* Revert 85085. It causes infinite looping during llvm-gcc build.Evan Cheng2009-10-261-45/+6
| | | | llvm-svn: 85090
* Implement PR3266 & PR5276, folding:Chris Lattner2009-10-261-6/+45
| | | | | | not (or (icmp, icmp)) -> and(icmp, icmp) llvm-svn: 85085
* Remove includes of Support/Compiler.h that are no longer needed after theNick Lewycky2009-10-2533-33/+1
| | | | | | VISIBILITY_HIDDEN removal. llvm-svn: 85043
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-2535-44/+43
| | | | | | | Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. llvm-svn: 85042
* Remove ICmpInst::isSignedPredicate which was a reimplementationNick Lewycky2009-10-253-25/+23
| | | | | | CmpInst::isSigned. llvm-svn: 85037
* MapValue doesn't needs its LLVMContext argument.Dan Gohman2009-10-243-18/+13
| | | | llvm-svn: 85020
* Rename isLoopExit to isLoopExiting, for consistency with the wordingDan Gohman2009-10-241-1/+1
| | | | | | | | used elsewhere - an exit block is a block outside the loop branched to from within the loop. An exiting block is a block inside the loop that branches out. llvm-svn: 85019
* Rewrite LoopRotation's SSA updating code using SSAUpdater.Dan Gohman2009-10-241-226/+70
| | | | llvm-svn: 85016
* Auto-upgrade free instructions to calls to the builtin free function.Victor Hernandez2009-10-249-190/+59
| | | | | | | Update all analysis passes and transforms to treat free calls just like FreeInst. Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised. llvm-svn: 84987
* Remove AllocationInst. Since MallocInst went away, AllocaInst is the only ↵Victor Hernandez2009-10-235-46/+45
| | | | | | subclass of AllocationInst, so it no longer is necessary. llvm-svn: 84969
* Make LoopDeletion check the maximum backedge taken count, rather than theDan Gohman2009-10-231-1/+1
| | | | | | | exact backedge taken count, when checking for infinite loops. This allows it to delete loops with multiple exit conditions. llvm-svn: 84952
* move another load optimization from instcombine -> libanalysis.Chris Lattner2009-10-221-12/+2
| | | | llvm-svn: 84841
* move 'loading i32 from string' optimization from instcombineChris Lattner2009-10-221-34/+0
| | | | | | | to libanalysis. Instcombine shrinking... does this even make sense??? llvm-svn: 84840
* Move some constant folding logic for loads out of instcombine intoChris Lattner2009-10-221-42/+18
| | | | | | | | | Analysis/ConstantFolding.cpp. This doesn't change the behavior of instcombine but makes other clients of ConstantFoldInstruction able to handle loads. This was partially extracted from Eli's patch in PR3152. llvm-svn: 84836
* fix PR5262.Chris Lattner2009-10-221-15/+42
| | | | llvm-svn: 84810
* Derive metadata hierarchy from Value instead of User.Devang Patel2009-10-212-5/+0
| | | | llvm-svn: 84801
* revert r84754, it isn't the right approach. Edwin, please propose Chris Lattner2009-10-211-60/+6
| | | | | | patches for fixes like this instead of committing them directly. llvm-svn: 84799
* Make changes to rev 84292 as requested by Chris Lattner.Victor Hernandez2009-10-212-4/+20
| | | | | | | Most changes are cleanup, but there is 1 correctness fix: I fixed InstCombine so that the icmp is removed only if the malloc call is removed (which requires explicit removal because the Worklist won't DCE any calls since they can have side-effects). llvm-svn: 84772
* Fix PR5262: when folding select into PHI, make sure all operands are availableTorok Edwin2009-10-211-6/+60
| | | | | | | in the PHI's Basic Block. This uses a conservative approach, because we don't have dominator info in instcombine. llvm-svn: 84754
* make GVN work better when TD is not around:Chris Lattner2009-10-211-15/+21
| | | | | | | | | | | | | | | | | "In the existing code, if the load and the value to replace it with are of different types *and* target data is available, it tries to use the target data to coerce the replacement value to the type of the load. Otherwise, it skips all effort to handle the type mismatch and just feeds the wrongly-typed replacement value to replaceAllUsesWith, which triggers an assertion. The patch replaces it with an outer if checking for type mismatch, and an inner if-else that checks whether target data is available and, if not, returns false rather than trying to replace the load." Patch by Kenneth Uildriks! llvm-svn: 84739
* Do not remove dead metadata for now.Devang Patel2009-10-211-1/+2
| | | | llvm-svn: 84731
* alternate fix for PR5258 which avoids worklist problems, with reduced testcase.Chris Lattner2009-10-201-11/+6
| | | | llvm-svn: 84667
OpenPOWER on IntegriCloud