summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Implement releaseMemory in CodeGenPrepare and free the BackEdgesDan Gohman2010-02-051-0/+4
| | | | | | | container data. This prevents it from holding onto dangling pointers and potentially behaving unpredictably. llvm-svn: 95409
* When doing address-mode sinking, expand the base register first, ratherDan Gohman2010-01-191-12/+17
| | | | | | | | | | | | than the scaled register. This makes it more likely that subsequent AddrModeMatcher queries will match the new address the same way as the old, instead of accidentally matching what had been the base register as the new scaled register, and then failing to match the scaled register. This fixes some problems with address-mode sinking multiple muls into a block, which will be a lot more common with some upcoming LoopStrengthReduction changes. llvm-svn: 93935
* Change errs() to dbgs().David Greene2010-01-051-6/+6
| | | | llvm-svn: 92611
* Revert 91280-91283, 91286-91289, 91291, 91293, 91295-91296. It apparently ↵Evan Cheng2009-12-171-8/+8
| | | | | | introduced a non-deterministic behavior in the optimizer somewhere. llvm-svn: 91598
* Remove unnecessary #include "llvm/LLVMContext.h".Nick Lewycky2009-12-081-1/+0
| | | | llvm-svn: 90836
* Fix a comment typo.Bob Wilson2009-12-031-1/+1
| | | | llvm-svn: 90487
* llvm::SplitEdge should refuse to split an edge from an indirectbr.Chris Lattner2009-10-311-1/+2
| | | | | | Fix CodeGenPrepare to not try to split edges from indirectbr. llvm-svn: 85690
* Move zext and sext casts fed by loads into the same block as theDan Gohman2009-10-161-1/+41
| | | | | | | load, to help SelectionDAG fold them into the loads, unless conditions are unfavorable. llvm-svn: 84271
* Preserve ProfileInfo during CodeGenPrepare.Andreas Neustifter2009-09-161-1/+15
| | | | llvm-svn: 82034
* eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861Chris Lattner2009-09-021-2/+1
| | | | llvm-svn: 80766
* Eliminate the unused Context argument on one of the ICmpInst and FCmpInstDan Gohman2009-08-251-1/+1
| | | | | | constructors. llvm-svn: 80049
* eliminate the "Value" printing methods that print to a std::ostream.Chris Lattner2009-08-231-3/+3
| | | | | | This required converting a bunch of stuff off DOUT and other cleanups. llvm-svn: 79819
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-1/+2
| | | | llvm-svn: 78948
* Add contexts to some of the MVT APIs. No functionality change yet, just the ↵Owen Anderson2009-08-121-4/+4
| | | | | | infrastructure work needed to get the contexts to where they need to be first. llvm-svn: 78759
* Rename MVT to EVT, in preparation for splitting SimpleValueType out into its ↵Owen Anderson2009-08-101-2/+2
| | | | | | own struct type. llvm-svn: 78610
* Move a few more APIs back to 2.5 forms. The only remaining ones left to ↵Owen Anderson2009-07-311-3/+1
| | | | | | | | change back are metadata related, which I'm waiting on to avoid conflicting with Devang. llvm-svn: 77721
* Convert a few more uses of llvm/Support/Streams.h to raw_ostream.Dan Gohman2009-07-251-5/+6
| | | | llvm-svn: 77033
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-241-2/+2
| | | | | | thanks to contexts-on-types. More to come. llvm-svn: 77011
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-4/+6
| | | | llvm-svn: 76702
* use ExpandInlineAsm on TargetLowering instead of TargetAsmInfo.Chris Lattner2009-07-201-14/+10
| | | | llvm-svn: 76442
* This started as a small change, I swear. Unfortunately, lots of things call ↵Owen Anderson2009-07-091-1/+2
| | | | | | the [I|F]CmpInst constructors. Who knew!? llvm-svn: 75200
* Convert the first batch of passes to use LLVMContext.Owen Anderson2009-07-031-4/+5
| | | | llvm-svn: 74748
* Fix old-style type names in comments.Dan Gohman2009-06-141-2/+2
| | | | llvm-svn: 73362
* Fix CodeGenPrepare's address-mode sinking to handle unusualDan Gohman2009-06-021-1/+4
| | | | | | | addresses, involving Base values which do not have Pointer type. This fixes PR4297. llvm-svn: 72739
* Factor loop backedge finding out of CodeGenPrepare into a new Chris Lattner2009-05-041-42/+9
| | | | | | FindFunctionBackedges function. llvm-svn: 70819
* remove empty sectionChris Lattner2009-04-071-4/+0
| | | | llvm-svn: 68485
* One more place to skip debug info.Dale Johannesen2009-03-271-7/+14
| | | | llvm-svn: 67811
* 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
* 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 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
* Do not split edges to EH landing pads. It will cause code size explosion.Evan Cheng2009-03-051-0/+6
| | | | llvm-svn: 66140
* Factor address mode matcher out of codegen prepare to make it available to ↵Evan Cheng2009-02-201-643/+1
| | | | | | other passes, e.g. loop strength reduction. llvm-svn: 65134
* In CodeGenPrepare's debug output, use WriteAsOperand instead ofDan Gohman2009-02-131-6/+16
| | | | | | printing getName(), so that unnamed values are printed correctly. llvm-svn: 64468
* fix PR3537: if resetting bbi back to the start of a block, we need toChris Lattner2009-02-121-4/+9
| | | | | | forget about already inserted expressions. llvm-svn: 64362
* Simplify the logic of getting hold of a PHI predecessor block.Gabor Greif2009-01-231-2/+1
| | | | | | | | | There is now a direct way from value-use-iterator to incoming block in PHINode's API. This way we avoid the iterator->index->iterator trip, and especially the costly getOperandNo() invocation. Additionally there is now an assertion that the iterator really refers to one of the PHI's Uses. llvm-svn: 62869
* Fix rdar://6505632, an llc crash on 483.xalancbmkChris Lattner2009-01-181-1/+2
| | | | llvm-svn: 62470
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-121-1/+1
| | | | | | suggested by Chris. llvm-svn: 62099
* Find loop back edges only after empty blocks are eliminated.Evan Cheng2009-01-051-2/+3
| | | | llvm-svn: 61752
* - CodeGenPrepare does not split loop back edges but it only knows about back ↵Evan Cheng2008-12-191-45/+135
| | | | | | | | edges of single block loops. It now does a DFS walk to find loop back edges. - Use SplitBlockPredecessors to factor out common predecessors of the critical edge destination. This is disabled for now due to some regressions. llvm-svn: 61248
* don't call MergeBasicBlockIntoOnlyPred on a block whose onlyChris Lattner2008-11-281-10/+12
| | | | | | | predecessor is itself. This doesn't make sense, and this is a dead infinite loop anyway. llvm-svn: 60210
OpenPOWER on IntegriCloud