summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make more passes preserve dominators (or state that they preserve dominators ifCameron Zwarich2011-01-081-0/+11
| | | | | | | | | | they all ready do). This removes two dominator recomputations prior to isel, which is a 1% improvement in total llc time for 403.gcc. The only potentially suspect thing is making GCStrategy recompute dominators if it used a custom lowering strategy. llvm-svn: 123064
* Add the CallInst optimizations that don't involve expanding inline assembly toCameron Zwarich2011-01-061-0/+7
| | | | | | OptimizeInst() so that they can be used on a worklist instruction. llvm-svn: 122945
* Move the GEP handling in CodeGenPrepare to OptimizeInst().Cameron Zwarich2011-01-061-12/+12
| | | | llvm-svn: 122944
* Split the optimizations in CodeGenPrepare that don't manipulate the iteratorsCameron Zwarich2011-01-061-41/+52
| | | | | | | into a separate function, so that it can be called from a loop using a worklist rather than a loop traversing a whole basic block. llvm-svn: 122943
* Stop reallocating SunkAddrs for each basic block. When we move to an instructionCameron Zwarich2011-01-061-4/+10
| | | | | | worklist, the key will need to become std::pair<BasicBlock*, Value*>. llvm-svn: 122932
* Add some more statistics to CodeGenPrepare.Cameron Zwarich2011-01-051-0/+4
| | | | llvm-svn: 122891
* Add some stats to CodeGenPrepare to make it easier to speed it up withoutCameron Zwarich2011-01-051-3/+15
| | | | | | regressing code quality. llvm-svn: 122887
* Avoid finding loop back edges when we are not splitting critical edges inCameron Zwarich2011-01-041-2/+4
| | | | | | CodeGenPrepare (which is the default behavior). llvm-svn: 122801
* Switch a worklist in CodeGenPrepare to SmallVector and increase the inlineCameron Zwarich2011-01-031-2/+2
| | | | | | | | | capacity on the Visited SmallPtrSet. On 403.gcc, this is about a 4.5% speedup of CodeGenPrepare time (which itself is 10% of time spent in the backend). This is progress towards PR8889. llvm-svn: 122741
* It is possible for SimplifyCFG to cause PHI nodes to become redundant too ↵Owen Anderson2010-12-231-1/+10
| | | | | | | | | | late in the optimization pipeline to be caught by instcombine, and it's not feasible to catch them in SimplifyCFG because the use-lists are in an inconsistent state at the point where it could know that it need to simplify them. Instead, have CodeGenPrepare look for trivially redundant PHIs as part of its general cleanup effort. llvm-svn: 122516
* revert r122164, I'm going to go with a different approach.Chris Lattner2010-12-191-11/+0
| | | | llvm-svn: 122168
* first step to fixing PR8642: don't fold away empty basic blocksChris Lattner2010-12-191-0/+11
| | | | | | | | which have trapping constant exprs in them due to PHI nodes. Eliminating them can cause the constant expr to be evalutated on new paths if the input edges are critical. llvm-svn: 122164
* Second attempt at fixing the performance regressions introducedOwen Anderson2010-11-271-24/+55
| | | | | | | | by my recent GVN improvement. Looking through a single layer of PHI nodes when attempting to sink GEPs, we need to iteratively look through arbitrary PHI nests. llvm-svn: 120202
* When folding addressing modes in CodeGenPrepare, attempt to look through PHI ↵Owen Anderson2010-11-191-3/+29
| | | | | | | | | nodes if all the operands of the PHI are equivalent. This allows CodeGenPrepare to undo unprofitable PRE transforms. llvm-svn: 119853
* Inline asm multiple alternative constraints development phase 2 - improved ↵John Thompson2010-10-291-1/+1
| | | | | | basic logic, added initial platform support. llvm-svn: 117667
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-191-1/+3
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-1/+1
| | | | llvm-svn: 115996
* Try again to disable critical edge splitting in CodeGenPrepare.Jakob Stoklund Olesen2010-09-301-1/+5
| | | | | | The bug that broke i386 linux has been fixed in r115191. llvm-svn: 115204
* Revert "Disable codegen prepare critical edge splitting. Machine instruction ↵Jakob Stoklund Olesen2010-09-271-5/+1
| | | | | | | | | | | | | | | passes now" This reverts revision 114633. It was breaking llvm-gcc-i386-linux-selfhost. It seems there is a downstream bug that is exposed by -cgp-critical-edge-splitting=0. When that bug is fixed, this patch can go back in. Note that the changes to tailcallfp2.ll are not reverted. They were good are required. llvm-svn: 114859
* Disable codegen prepare critical edge splitting. Machine instruction passes nowEvan Cheng2010-09-231-1/+5
| | | | | | break critical edges on demand. llvm-svn: 114633
* When moving zext/sext to be folded with a load, ignore the issue of whetherBob Wilson2010-09-221-1/+2
| | | | | | | | truncates are free only in the case where the extended type is legal but the load type is not. If both types are illegal, such as when they are too big, the load may not be legalized into an extended load. llvm-svn: 114568
* Move a sign-extend or a zero-extend of a load to the same basic block as theBob Wilson2010-09-211-1/+2
| | | | | | | load when the type of the load is not legal, even if truncates are not free. The load is going to be legalized to an extending load anyway. llvm-svn: 114488
* Clarify a comment.Bob Wilson2010-09-211-1/+1
| | | | llvm-svn: 114487
* When substituting sunkaddrs into indirect arguments an asm, we wereDale Johannesen2010-09-161-2/+4
| | | | | | | | | walking the asm arguments once and stashing their Values. This is wrong because the same memory location can be in the list twice, and if the first one has a sunkaddr substituted, the stashed value for the second one will be wrong (use-after-free). PR 8154. llvm-svn: 114104
* Remove unused variable.Eric Christopher2010-09-131-1/+0
| | | | llvm-svn: 113769
* Added skeleton for inline asm multiple alternative constraint support.John Thompson2010-09-131-27/+4
| | | | llvm-svn: 113766
* remove some llvmcontext arguments that are now dead post-refactoring.Chris Lattner2010-08-251-2/+2
| | | | llvm-svn: 112104
* Add an option to disable codegen prepare critical edge splitting. In theory, ↵Evan Cheng2010-08-171-6/+14
| | | | | | PHI elimination is already doing all (most?) of the splitting needed. But machine-licm and machine-sink seem to miss some important optimizations when splitting is disabled. llvm-svn: 111224
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110460
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110410
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-1/+1
| | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
* Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson2010-07-211-2/+2
| | | | llvm-svn: 109045
* eliminate CallInst::ArgOffsetGabor Greif2010-07-161-3/+3
| | | | llvm-svn: 108522
* use getArgOperand (corrected by CallInst::ArgOffset) instead of getOperandGabor Greif2010-06-301-1/+2
| | | | llvm-svn: 107273
* The hasMemory argument is irrelevant to how the argumentDale Johannesen2010-06-251-2/+1
| | | | | | | | | for an "i" constraint should get lowered; PR 6309. While this argument was passed around a lot, this is the only place it was used, so it goes away from a lot of other places. llvm-svn: 106893
* use ArgOperand APIGabor Greif2010-06-241-1/+1
| | | | llvm-svn: 106707
* Revert 101465, it broke internal OpenGL testing.Eric Christopher2010-04-161-1/+1
| | | | | | | Probably the best way to know that all getOperand() calls have been handled is to replace that API instead of updating. llvm-svn: 101579
* reapply r101434Gabor Greif2010-04-161-1/+1
| | | | | | | | | | | | | with a fix for self-hosting rotate CallInst operands, i.e. move callee to the back of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary llvm-svn: 101465
* back out r101423 and r101397, they break llvm-gcc self-host on darwin10Gabor Greif2010-04-161-1/+1
| | | | llvm-svn: 101434
* shift intrinsic operandGabor Greif2010-04-161-1/+1
| | | | llvm-svn: 101423
* Fix a nasty dangling-pointer heisenbug that couldDale Johannesen2010-03-311-1/+5
| | | | | | | | | | | | | | | | | | generate wrong code pretty much anywhere AFAICT. A case that hits the bug reproducibly is impossible, but the situation was like this: Addr = ... Store -> Addr Addr2 = GEP , 0, 0 Store -> Addr2 Handling the first store, the code changed replaced Addr with a sunkaddr and deleted Addr, but not its table entry. Code in OptimizedBlock replaced Addr2 with a bitcast; if that happened to reuse the memory of Addr, the old table entry was erroneously found when handling the second store. llvm-svn: 100044
* rename use_const_iterator to const_use_iterator for consistency's sakeGabor Greif2010-03-251-1/+1
| | | | llvm-svn: 99564
* Factor checked library call optimization into a common helper class and use itBenjamin Kramer2010-03-121-96/+19
| | | | | | to unify the almost identical code in CodeGenPrepare and InstCombineCalls. llvm-svn: 98338
* stpcpy is so similar to strcpy, it doesn't deserve a complete copy of the ↵Benjamin Kramer2010-03-111-15/+3
| | | | | | __strcpy_chk -> strcpy code. llvm-svn: 98284
* Lower stpcpy_chk when possible.Eric Christopher2010-03-111-6/+9
| | | | llvm-svn: 98274
* Do some final lowering in CodeGenPrepare of _chk calls similar toEric Christopher2010-03-111-0/+134
| | | | | | | | that in InstCombineCalls. More call lowering needed. llvm-svn: 98228
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-2/+2
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* remove dead code.Chris Lattner2010-02-131-46/+7
| | | | llvm-svn: 96109
* Split some code out to a helper function (FindReusablePredBB)Chris Lattner2010-02-131-50/+72
| | | | | | | | | | | | and add a doxygen comment. Cache the phi entry to avoid doing tons of PHINode::getBasicBlockIndex calls in the common case. On my insane testcase from re2c, this speeds up CGP from 617.4s to 7.9s (78x). llvm-svn: 96083
* speed up CGP a bit by scanning predecessors through phi operandsChris Lattner2010-02-131-22/+22
| | | | | | instead of with pred_begin/end. llvm-svn: 96078
OpenPOWER on IntegriCloud