summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused STL header includes.Jay Foad2011-04-231-1/+0
| | | | llvm-svn: 130068
* PR9214: Convert Metadata API to use ArrayRef.Jay Foad2011-04-212-3/+3
| | | | llvm-svn: 129932
* Trivial simplification.Jay Foad2011-04-191-2/+1
| | | | llvm-svn: 129759
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-155-5/+5
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129558
* rework FoldBranchToCommonDest to exit earlier when there is a bonusChris Lattner2011-04-141-39/+30
| | | | | | | | | | | | instruction around, reducing work. Greatly simplify handling of debug instructions. There is no need to build up a vector of them and then move them into the one predecessor if we're processing a block. Instead just rescan the block and *copy* them into the pred. If a block gets merged into multiple preds, this will retain more debug info. llvm-svn: 129502
* comment cleanup, use moveBefore instead of removeFromParent+insertBefore.Chris Lattner2011-04-111-9/+5
| | | | llvm-svn: 129319
* Don't include Operator.h from InstrTypes.h.Jay Foad2011-04-112-0/+2
| | | | llvm-svn: 129271
* Do not let debug info interfer with branch folding.Devang Patel2011-04-071-0/+6
| | | | llvm-svn: 129114
* While hoisting common code from if/else, hoist debug info intrinsics if they ↵Devang Patel2011-04-071-8/+18
| | | | | | match. llvm-svn: 129078
* Simplify. isIdenticalToWhenDefined() checks opcode.Devang Patel2011-04-071-4/+2
| | | | llvm-svn: 129041
* While folding branch to a common destination into a predecessor, copy dbg ↵Devang Patel2011-04-061-4/+17
| | | | | | values also. llvm-svn: 129035
* Attempt to fix breakage from r128782 reported by Francois Pichet onEli Friedman2011-04-041-0/+3
| | | | | | | llvm-commits. (Not sure why it only breaks on Windows; maybe it has something to do with the iterator representation...) llvm-svn: 128802
* PR9446: RecursivelyDeleteTriviallyDeadInstructions can delete the instructionEli Friedman2011-04-021-1/+4
| | | | | | | | | | | after the given instruction; make sure to handle that case correctly. (It's difficult to trigger; the included testcase involves a dead block, but I don't think that's a requirement.) While I'm here, get rid of the unnecessary warning about SimplifyInstructionsInBlock, since it should work correctly as far as I know. llvm-svn: 128782
* Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad2011-03-3010-24/+18
| | | | | | PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128537
* (Almost) always call reserveOperandSpace() on newly created PHINodes.Jay Foad2011-03-306-4/+11
| | | | llvm-svn: 128535
* Simplify.Devang Patel2011-03-211-5/+4
| | | | llvm-svn: 128030
* If an AllocaInst referred by DbgDeclareInst is used by a LoadInst then the ↵Devang Patel2011-03-181-0/+24
| | | | | | LoadInst should also get a corresponding llvm.dbg.value intrinsic. llvm-svn: 127924
* Remove dead code.Devang Patel2011-03-181-2/+0
| | | | llvm-svn: 127923
* Consider debug info intrinsics pointing to null value as dead instructions.Devang Patel2011-03-181-1/+14
| | | | llvm-svn: 127922
* Try to not lose variable's debug info during instcombine.Devang Patel2011-03-171-0/+26
| | | | | | | This is done by lowering dbg.declare intrinsic into dbg.value intrinsic. Radar 9143931. llvm-svn: 127834
* Refactor into a separate utility function.Devang Patel2011-03-172-29/+42
| | | | llvm-svn: 127832
* Clean up something noticed by Fritz.Cameron Zwarich2011-03-151-1/+1
| | | | llvm-svn: 127684
* Do not add PHIs with no users when creating LCSSA form. Patch by Andrew Clinton.Cameron Zwarich2011-03-151-0/+10
| | | | llvm-svn: 127674
* PR9450: Make switch optimization in SimplifyCFG not dependent on the orderingEli Friedman2011-03-151-7/+18
| | | | | | of pointers in an std::map. llvm-svn: 127650
* PR9420; an instruction before an unreachable is guaranteed not to have anyEli Friedman2011-03-091-1/+3
| | | | | | | | reachable uses, but there still might be uses in dead blocks. Use the standard solution of replacing all the uses with undef. This is a rare case because it's very sensitive to phase ordering in SimplifyCFG. llvm-svn: 127299
* DenseMap<uintptr_t,...> doesn't allow all values as keys.Jakob Stoklund Olesen2011-03-041-0/+2
| | | | | | | Avoid colliding with the sentinels, hopefully unbreaking llvm-gcc-x86_64-linux-selfhost. llvm-svn: 126982
* Teach SimplifyCFG that (switch (select cond, X, Y)) is better expressed as a ↵Frits van Bommel2011-02-281-1/+26
| | | | | | | | branch. Based on a patch by Alistair Lynn. llvm-svn: 126647
* Revert "SimplifyCFG: GEPs with just one non-constant index are also cheap."Benjamin Kramer2011-02-251-5/+3
| | | | | | | Yes, there are other types than i8* and GEPs on them can produce an add+multiply. We don't consider that cheap enough to be speculatively executed. llvm-svn: 126481
* SimplifyCFG: GEPs with just one non-constant index are also cheap.Benjamin Kramer2011-02-241-3/+5
| | | | llvm-svn: 126452
* SimplifyCFG: GEPs with constant indices are cheap enough to be executed ↵Benjamin Kramer2011-02-241-0/+5
| | | | | | unconditionally. llvm-svn: 126445
* Do not use DIFactory. Use DIBuilder.Devang Patel2011-02-241-6/+7
| | | | llvm-svn: 126398
* If the phi node was used by an unreachable instruction that ends up usingDuncan Sands2011-02-211-2/+3
| | | | | | | | | | | | itself without going via a phi node then we could return false here in spite of making a change. Also, tweak the comment because this method can (and always could) return true without deleting the original phi node. For example, if the phi node was used by a read-only invoke instruction which is used by another phi node phi2 which is only used by and only uses the invoke, then phi2 would be deleted but not the invoke instruction and not the original phi node. llvm-svn: 126129
* Simplify RecursivelyDeleteDeadPHINode. The only functionality changeDuncan Sands2011-02-211-28/+16
| | | | | | | | should be that if the phi is used by a side-effect free instruction with no uses then the phi and the instruction now get zapped (checked by the unittest). llvm-svn: 126124
* Make RecursivelyDeleteDeadPHINode delete a phi node that has no users and add aNick Lewycky2011-02-201-7/+12
| | | | | | | | | test for that. With this change, test/CodeGen/X86/codegen-dce.ll no longer finds any instructions to DCE, so delete the test. Also renamed J and JP to I and IP in RecursivelyDeleteDeadPHINode. llvm-svn: 126088
* Teach RecursivelyDeleteDeadPHINodes to handle multiple self-references. PatchNick Lewycky2011-02-201-5/+21
| | | | | | by Andrew Clinton! llvm-svn: 126077
* Don't unroll loops whose header block's address is taken.Chris Lattner2011-02-181-2/+10
| | | | | | | | | | | | | | | | | This is part of a futile attempt to not "break" bizzaro code like this: l1: printf("l1: %p\n", &&l1); ++x; if( x < 3 ) goto l1; Previously we'd fold &&l1 to 1, which is fine per our semantics but not helpful to the user. llvm-svn: 125827
* Rename 'loopsimplify' to 'loop-simplify'.Cameron Zwarich2011-02-101-3/+3
| | | | llvm-svn: 125317
* SimplifyCFG: Track the number of used icmps when turning a icmp chain into a ↵Benjamin Kramer2011-02-071-7/+22
| | | | | | | | switch. If we used only one icmp, don't turn it into a switch. Also prevent the switch-to-icmp transform from creating identity adds, noticed by Marius Wachtler. llvm-svn: 125056
* SimplifyCFG: Also transform switches that represent a range comparison but ↵Benjamin Kramer2011-02-031-6/+17
| | | | | | | | are not sorted into sub+icmp. This transforms another 1000 switches in gcc.c. llvm-svn: 124826
* SimplifyCFG: Turn switches into sub+icmp+branch if possible.Benjamin Kramer2011-02-021-0/+32
| | | | | | | | | | | | | | | | | This makes the job of the later optzn passes easier, allowing the vast amount of icmp transforms to chew on it. We transform 840 switches in gcc.c, leading to a 16k byte shrink of the resulting binary on i386-linux. The testcase from README.txt now compiles into decl %edi cmpl $3, %edi sbbl %eax, %eax andl $1, %eax ret llvm-svn: 124724
* Re-apply r124518 with fix. Watch out for invalidated iterator.Evan Cheng2011-01-292-21/+35
| | | | llvm-svn: 124526
* Revert r124518. It broke Linux self-host.Evan Cheng2011-01-292-35/+21
| | | | llvm-svn: 124522
* Re-commit r124462 with fixes. Tail recursion elim will now dup ret into ↵Evan Cheng2011-01-292-21/+35
| | | | | | unconditional predecessor to enable TCE on demand. llvm-svn: 124518
* Revert r124462. There are a few big regressions that I need to fix first.Evan Cheng2011-01-281-6/+1
| | | | llvm-svn: 124478
* - Stop simplifycfg from duplicating "ret" instructions into unconditionalEvan Cheng2011-01-281-1/+6
| | | | | | | | branches. PR8575, rdar://5134905, rdar://8911460. - Allow codegen tail duplication to dup small return blocks after register allocation is done. llvm-svn: 124462
* fix PR9017, a bug where we'd assert when promoting in unreachableChris Lattner2011-01-241-0/+3
| | | | | | code. llvm-svn: 124100
* fix PR9015, a crash linking recursive metadata.Chris Lattner2011-01-241-6/+11
| | | | llvm-svn: 124099
* Convert two std::vectors to SmallVectors for a 3.4% speedup running -scalarreplCameron Zwarich2011-01-231-2/+2
| | | | | | on test-suite + SPEC2000 & SPEC2006. llvm-svn: 124068
* Convert a std::map to a DenseMap for another 1.7% speedup on -scalarrepl.Cameron Zwarich2011-01-181-3/+3
| | | | llvm-svn: 123732
* Make a std::vector a SmallVector<*, 32> like the other vectors in the sameCameron Zwarich2011-01-181-1/+1
| | | | | | | function. This seems to be about a 1.5% speedup of -scalarrepl on test-suite with SPEC2000 and SPEC2006. llvm-svn: 123731
OpenPOWER on IntegriCloud