summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* avoid redundant lookups in BBExecutable, and make it a SmallPtrSet.Chris Lattner2009-11-021-14/+16
| | | | llvm-svn: 85790
* Use the libanalysis 'ConstantFoldLoadFromConstPtr' functionChris Lattner2009-11-021-18/+11
| | | | | | | instead of reinventing SCCP-specific logic. This gives us new powers. llvm-svn: 85789
* switch the main 'ValueState' map from being an std::map to beingChris Lattner2009-11-021-311/+281
| | | | | | | | | | | a DenseMap. Doing this required being aware of subtle iterator invalidation issues, but it provides a big speedup. In a release-asserts build, this sped up optimizing 403.gcc from 1.34s -> 0.79s (IPSCCP) and 1.11s -> 0.44s (SCCP). This commit also conflates in a bunch of general cleanups, sorry. llvm-svn: 85788
* fix a bug exposed by moving SRoA earlier which caused a crash building kc++Chris Lattner2009-11-021-1/+6
| | | | llvm-svn: 85786
* only IPSCCP incoming arguments if the function is executable, this fixesChris Lattner2009-11-021-15/+17
| | | | | | an assertion on the buildbot. llvm-svn: 85784
* add a new ValueState::getConstantInt() helper, use it to Chris Lattner2009-11-021-52/+53
| | | | | | simplify some code. llvm-svn: 85783
* tidy up some more: remove some extraneous inline specifiers, return harder.Chris Lattner2009-11-021-126/+95
| | | | llvm-svn: 85780
* eliminate the SCCPSolver::getValueMapping method.Chris Lattner2009-11-021-25/+23
| | | | llvm-svn: 85778
* fix failures introduced in r85774Chris Lattner2009-11-021-1/+2
| | | | llvm-svn: 85777
* factor duplicated code into a new DeleteInstructionInBlockChris Lattner2009-11-021-92/+80
| | | | | | function, eliminate temporary (and pointless) smallvector. llvm-svn: 85776
* Chris used to use '...' instead of proper grammar.Chris Lattner2009-11-021-30/+32
| | | | llvm-svn: 85775
* remove some extraneous llvmcontext stuff.Chris Lattner2009-11-021-31/+26
| | | | llvm-svn: 85774
* change LatticeVal to use PointerIntPair to save some space.Chris Lattner2009-11-021-49/+52
| | | | llvm-svn: 85773
* fix instcombine to only do store sinking when the alignmentsChris Lattner2009-11-021-4/+8
| | | | | | of the two loads agree. Propagate that onto the new store. llvm-svn: 85772
* when merging two loads, make sure to take the min of their alignment,Chris Lattner2009-11-011-1/+1
| | | | | | | not the max. This didn't matter until the previous patch because instcombine would refuse to sink loads with differenting alignments. llvm-svn: 85738
* split load sinking out to its own function, like gep sinking.Chris Lattner2009-11-011-66/+101
| | | | llvm-svn: 85737
* fix a bug noticed by inspection: when instcombine sinks loads throughChris Lattner2009-11-011-4/+24
| | | | | | | | phis, it didn't preserve the alignment of the load. This is a missed optimization of the alignment is high and a miscompilation when the alignment is low. llvm-svn: 85736
* cleanups, switch GlobalDCE to SmallPtrSet instead of std::setChris Lattner2009-11-012-16/+10
| | | | llvm-svn: 85730
* remove a bunch of locking from LLVMContextImpl. Since only one threadChris Lattner2009-11-011-0/+3
| | | | | | | can be banging on a context at a time, this isn't needed. Owen, please review. llvm-svn: 85728
* improve comment.Chris Lattner2009-11-011-1/+1
| | | | llvm-svn: 85725
* Reverting 85714, 85715, 85716, which are breaking the buildDouglas Gregor2009-11-011-1/+0
| | | | llvm-svn: 85717
* Remove the #include of Pass.h from PassManager.h. This breaks a significantDan Gohman2009-11-011-0/+1
| | | | | | #include dependency, as frontends commonly pull in PassManager.h. llvm-svn: 85714
* teach ipsccp and ipconstprop that a blockaddress doesn't 'take the address' ↵Chris Lattner2009-11-012-2/+7
| | | | | | | | | of a function in a way that should prevent ip constprop. This allows clang/test/CodeGen/indirect-goto.c to pass with the new indirect goto lowering. llvm-svn: 85709
* change llvm::MergeBlockIntoPredecessor to not merge two blocks BB1->BB2 Chris Lattner2009-11-011-3/+7
| | | | | | | | | when BB2 has its address taken. Since it ends up doing BB2->rauw(BB1), this can cause the address of the entry block to be taken. Since it is generally undesirable to nuke blocks whose address is taken, even when we can, just unconditionally stop this xform. llvm-svn: 85708
* strengthen an assumption: RevectorBlockTo knows that PredBB Chris Lattner2009-11-011-12/+14
| | | | | | | | ended in an uncond branch because the pass requires BreakCriticalEdges. However, BCE doesn't eliminate critical adges from indbrs. llvm-svn: 85707
* if CostMetrics says to never duplicate some code, don't unswitch a loop.Chris Lattner2009-11-011-1/+2
| | | | | | This prevents unswitching from duplicating indbr's. llvm-svn: 85705
* constant fold indirectbr(blockaddress(%bb)) -> br label %bb.Chris Lattner2009-11-011-9/+46
| | | | llvm-svn: 85704
* Revert 85678/85680. The decision is to stay with the current form of Chris Lattner2009-11-012-8/+4
| | | | | | | indirectbr, thus we don't need "blockaddr(@func, null)". Eliminate it for simplicity. llvm-svn: 85699
* Make sure PRE doesn't split crit edges from indirectbr.Chris Lattner2009-10-311-1/+5
| | | | llvm-svn: 85692
* llvm::SplitEdge should refuse to split an edge from an indirectbr.Chris Lattner2009-10-312-1/+4
| | | | | | Fix CodeGenPrepare to not try to split edges from indirectbr. llvm-svn: 85690
* update the comment above llvm::SplitCriticalEdge, and makeChris Lattner2009-10-311-6/+21
| | | | | | it abort on IndirectBrInst as describe in the comment. llvm-svn: 85688
* adjust a couple xforms to work with null bb's in BlockAddress.Chris Lattner2009-10-312-4/+8
| | | | llvm-svn: 85680
* add a comment.Chris Lattner2009-10-311-0/+4
| | | | llvm-svn: 85671
* Revert r85667. LoopUnroll currently can't call utility functions whichDan Gohman2009-10-312-24/+94
| | | | | | | auto-update the DominatorTree because it doesn't keep the DominatorTree current while it works. llvm-svn: 85670
* Remove redundant code.Dan Gohman2009-10-311-3/+0
| | | | llvm-svn: 85668
* Merge the enhancements from LoopUnroll's FoldBlockIntoPredecessor intoDan Gohman2009-10-312-94/+24
| | | | | | | MergeBlockIntoPredecessor. This makes SimplifyCFG slightly more aggressive, and makes it unnecessary for LoopUnroll to have its own copy of this code. llvm-svn: 85667
* Rename forgetLoopBackedgeTakenCount to forgetLoop, because itDan Gohman2009-10-313-3/+3
| | | | | | clears out more information than just the stored backedge taken count. llvm-svn: 85664
* Replace LoopUnrollPass.cpp's custom code-size estimation code usingDan Gohman2009-10-311-30/+5
| | | | | | the new common CodeMetrics code. llvm-svn: 85663
* Simplify this code.Dan Gohman2009-10-311-2/+2
| | | | llvm-svn: 85662
* Remove an unnecessary #include.Dan Gohman2009-10-311-1/+0
| | | | llvm-svn: 85661
* Update CMakeLists for recent renames.Dan Gohman2009-10-312-2/+2
| | | | llvm-svn: 85660
* Rename UnrollLoop.cpp to LoopUnroll.cpp, and LoopUnroll.cpp toDan Gohman2009-10-312-0/+0
| | | | | | | LoopUnrollPass.cpp, for consistency with other passes which are similarly split. llvm-svn: 85659
* Remove CodeGenLICM. It's largely obsoleted by MachineLICM's new abilityDan Gohman2009-10-312-113/+0
| | | | | | to unfold loop-invariant loads. llvm-svn: 85657
* Reapply r85634, with the bug fixed.Dan Gohman2009-10-311-15/+17
| | | | llvm-svn: 85655
* Revert 85634. It's breaking consumer-typeset (and others).Evan Cheng2009-10-311-17/+15
| | | | llvm-svn: 85641
* Add a comment about a missed opportunity.Dan Gohman2009-10-301-0/+5
| | | | llvm-svn: 85635
* Optimize around the fact that pred_iterator is slow: instead of sortingDan Gohman2009-10-301-15/+17
| | | | | | | PHI operands by the predecessor order, sort them by the order used by the first PHI in the block. This is still suffucient to expose duplicates. llvm-svn: 85634
* Teach SimplifyCFG how to eliminate duplicate PHI nodes within a block.Dan Gohman2009-10-301-0/+61
| | | | | | | This reduces codesize on a variety of codes by 1-2% on x86-64. It also helps clean up after SSAUpdater. llvm-svn: 85626
* Sort the incoming values in PHI nodes to match the predecessor order.Dan Gohman2009-10-301-0/+19
| | | | | | | This helps expose duplicate PHIs, which will make it easier for them to be eliminated. llvm-svn: 85623
* Add option to createGVNPass to disable PRE.Evan Cheng2009-10-301-2/+3
| | | | llvm-svn: 85609
OpenPOWER on IntegriCloud