Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | Convert CallInst and InvokeInst APIs to use ArrayRef. | Jay Foad | 2011-07-15 | 1 | -4/+2 | |
| | | | | llvm-svn: 135265 | |||||
* | Add r134057 back, but splice the predecessor after the successors phi | Rafael Espindola | 2011-06-30 | 1 | -1/+1 | |
| | | | | | | | | | nodes. Original message: Let simplify cfg simplify bb with only debug and lifetime intrinsics. llvm-svn: 134182 | |||||
* | Temporarily revert r134057: "Let simplify cfg simplify bb with only debug and | Chad Rosier | 2011-06-29 | 1 | -1/+1 | |
| | | | | | | lifetime intrinsics" due to buildbot failures. llvm-svn: 134071 | |||||
* | Let simplify cfg simplify bb with only debug and lifetime intrinsics. | Rafael Espindola | 2011-06-29 | 1 | -1/+1 | |
| | | | | llvm-svn: 134057 | |||||
* | Fix PR10103: Less code for enum type translation. | Hans Wennborg | 2011-06-18 | 1 | -0/+74 | |
| | | | | | | | | | | | In cases such as the attached test, where the case value for a switch destination is used in a phi node that follows the destination, it might be better to replace that value with the condition value of the switch, so that more blocks can be folded away with TryToSimplifyUncondBranchFromEmptyBlock because there are less conflicts in the phi node. llvm-svn: 133344 | |||||
* | If the block that we're threading through is jumped to by an indirect branch, | Bill Wendling | 2011-06-04 | 1 | -1/+3 | |
| | | | | | | | | | | | | then we don't want to set the destination in the indirect branch to the destination. This is because the indirect branch needs its destinations to have had their block addresses taken. This isn't so of the new critical edge that's split during this process. If it turns out that the destination block has only one predecessor, and that being a BB with an indirect branch, then it won't be marked as 'used' and may be removed. PR10072 llvm-svn: 132638 | |||||
* | Add a parameter to ConstantFoldTerminator() that callers can use to ask it ↵ | Frits van Bommel | 2011-05-22 | 1 | -1/+1 | |
| | | | | | | | | to also clean up the condition of any conditional terminator it folds to be unconditional, if that turns the condition into dead code. This just means it calls RecursivelyDeleteTriviallyDeadInstructions() in strategic spots. It defaults to the old behavior. I also changed -simplifycfg, -jump-threading and -codegenprepare to use this to produce slightly better code without any extra cleanup passes (AFAICT this was the only place in -simplifycfg where now-dead conditions of replaced terminators weren't being cleaned up). The only other user of this function is -sccp, but I didn't read that thoroughly enough to figure out whether it might be holding pointers to instructions that could be deleted by this. llvm-svn: 131855 | |||||
* | Reapply r131605. This time with a fix, which is to use NoFolder. | Devang Patel | 2011-05-19 | 1 | -30/+34 | |
| | | | | llvm-svn: 131673 | |||||
* | revert 131605 to fix PR9946. | Rafael Espindola | 2011-05-19 | 1 | -36/+31 | |
| | | | | llvm-svn: 131620 | |||||
* | Use IRBuilder. | Devang Patel | 2011-05-19 | 1 | -2/+2 | |
| | | | | llvm-svn: 131609 | |||||
* | Use IRBuilder while simplifying unreachable. | Devang Patel | 2011-05-19 | 1 | -7/+8 | |
| | | | | llvm-svn: 131607 | |||||
* | Use IRBuilder while simplifying conditional branch. | Devang Patel | 2011-05-18 | 1 | -31/+36 | |
| | | | | llvm-svn: 131605 | |||||
* | Use IRBuilder while simplifying branch. | Devang Patel | 2011-05-18 | 1 | -12/+13 | |
| | | | | llvm-svn: 131598 | |||||
* | Use IRBuilder while simplifying return instruction. | Devang Patel | 2011-05-18 | 1 | -11/+13 | |
| | | | | llvm-svn: 131580 | |||||
* | Spread use of IRBuilder even more. | Devang Patel | 2011-05-18 | 1 | -10/+12 | |
| | | | | llvm-svn: 131571 | |||||
* | Use IRBuilder while simplifying switch instruction. | Devang Patel | 2011-05-18 | 1 | -15/+18 | |
| | | | | llvm-svn: 131566 | |||||
* | Use IRBuilder while simplifying unwind. | Devang Patel | 2011-05-18 | 1 | -7/+9 | |
| | | | | llvm-svn: 131561 | |||||
* | Use IRBuilder while simplifying terminator. | Devang Patel | 2011-05-18 | 1 | -4/+7 | |
| | | | | llvm-svn: 131552 | |||||
* | Use IRBuilder while simplifying unconditional branch. | Devang Patel | 2011-05-18 | 1 | -6/+11 | |
| | | | | llvm-svn: 131551 | |||||
* | Use IRBuilder while folding two entry PHINode. | Devang Patel | 2011-05-18 | 1 | -6/+8 | |
| | | | | llvm-svn: 131548 | |||||
* | Set up IRBuilder for use during simplification. | Devang Patel | 2011-05-18 | 1 | -0/+3 | |
| | | | | llvm-svn: 131545 | |||||
* | Preseve line numbers while simplifying CFG. | Devang Patel | 2011-05-17 | 1 | -6/+16 | |
| | | | | llvm-svn: 131508 | |||||
* | SimplifyCFG: Use ComputeMaskedBits to prune dead cases from switch instructions. | Benjamin Kramer | 2011-05-14 | 1 | -1/+36 | |
| | | | | llvm-svn: 131345 | |||||
* | SimplifyCFG: Expose phi node folding cost threshold as command line parameter | Peter Collingbourne | 2011-04-29 | 1 | -1/+6 | |
| | | | | llvm-svn: 130528 | |||||
* | SimplifyCFG: Add CostRemaining parameter to DominatesMergePoint | Peter Collingbourne | 2011-04-29 | 1 | -9/+38 | |
| | | | | llvm-svn: 130527 | |||||
* | SimplifyCFG: Add Trunc, ZExt and SExt to the list of cheap instructions for ↵ | Peter Collingbourne | 2011-04-29 | 1 | -0/+3 | |
| | | | | | | phi node folding llvm-svn: 130526 | |||||
* | rework FoldBranchToCommonDest to exit earlier when there is a bonus | Chris Lattner | 2011-04-14 | 1 | -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 Lattner | 2011-04-11 | 1 | -9/+5 | |
| | | | | llvm-svn: 129319 | |||||
* | Do not let debug info interfer with branch folding. | Devang Patel | 2011-04-07 | 1 | -0/+6 | |
| | | | | llvm-svn: 129114 | |||||
* | While hoisting common code from if/else, hoist debug info intrinsics if they ↵ | Devang Patel | 2011-04-07 | 1 | -8/+18 | |
| | | | | | | match. llvm-svn: 129078 | |||||
* | Simplify. isIdenticalToWhenDefined() checks opcode. | Devang Patel | 2011-04-07 | 1 | -4/+2 | |
| | | | | llvm-svn: 129041 | |||||
* | While folding branch to a common destination into a predecessor, copy dbg ↵ | Devang Patel | 2011-04-06 | 1 | -4/+17 | |
| | | | | | | values also. llvm-svn: 129035 | |||||
* | Remove PHINode::reserveOperandSpace(). Instead, add a parameter to | Jay Foad | 2011-03-30 | 1 | -1/+1 | |
| | | | | | | PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128537 | |||||
* | (Almost) always call reserveOperandSpace() on newly created PHINodes. | Jay Foad | 2011-03-30 | 1 | -1/+3 | |
| | | | | llvm-svn: 128535 | |||||
* | PR9450: Make switch optimization in SimplifyCFG not dependent on the ordering | Eli Friedman | 2011-03-15 | 1 | -7/+18 | |
| | | | | | | of pointers in an std::map. llvm-svn: 127650 | |||||
* | PR9420; an instruction before an unreachable is guaranteed not to have any | Eli Friedman | 2011-03-09 | 1 | -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 | |||||
* | Teach SimplifyCFG that (switch (select cond, X, Y)) is better expressed as a ↵ | Frits van Bommel | 2011-02-28 | 1 | -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 Kramer | 2011-02-25 | 1 | -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 Kramer | 2011-02-24 | 1 | -3/+5 | |
| | | | | llvm-svn: 126452 | |||||
* | SimplifyCFG: GEPs with constant indices are cheap enough to be executed ↵ | Benjamin Kramer | 2011-02-24 | 1 | -0/+5 | |
| | | | | | | unconditionally. llvm-svn: 126445 | |||||
* | SimplifyCFG: Track the number of used icmps when turning a icmp chain into a ↵ | Benjamin Kramer | 2011-02-07 | 1 | -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 Kramer | 2011-02-03 | 1 | -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 Kramer | 2011-02-02 | 1 | -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 Cheng | 2011-01-29 | 1 | -18/+7 | |
| | | | | llvm-svn: 124526 | |||||
* | Revert r124518. It broke Linux self-host. | Evan Cheng | 2011-01-29 | 1 | -7/+18 | |
| | | | | llvm-svn: 124522 | |||||
* | Re-commit r124462 with fixes. Tail recursion elim will now dup ret into ↵ | Evan Cheng | 2011-01-29 | 1 | -18/+7 | |
| | | | | | | 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 Cheng | 2011-01-28 | 1 | -6/+1 | |
| | | | | llvm-svn: 124478 | |||||
* | - Stop simplifycfg from duplicating "ret" instructions into unconditional | Evan Cheng | 2011-01-28 | 1 | -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 | |||||
* | Factor the actual simplification out of SimplifyIndirectBrOnSelect and into ↵ | Frits van Bommel | 2011-01-11 | 1 | -26/+37 | |
| | | | | | | | | a new helper function so it can be reused in e.g. an upcoming SimplifySwitchOnSelect. No functional change. llvm-svn: 123234 | |||||
* | simplify this a bit. | Chris Lattner | 2010-12-18 | 1 | -2/+1 | |
| | | | | llvm-svn: 122156 |