1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 13:02:52 +02:00
Commit Graph

1649 Commits

Author SHA1 Message Date
Cameron Zwarich
462b5db500 Make LoadAndStorePromoter preserve debug info and create llvm.dbg.values when
promoting allocas to SSA variables. Fixes <rdar://problem/9479036>.

llvm-svn: 131953
2011-05-24 03:10:43 +00:00
Frits van Bommel
df58ece78a Add a parameter to ConstantFoldTerminator() that callers can use to ask it 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
2011-05-22 16:24:18 +00:00
Nick Lewycky
9f7644d549 Teach the inliner to emit llvm.lifetime.start/end, to scope the local variables
of the inlinee to the code representing the original function.

llvm-svn: 131838
2011-05-22 05:22:10 +00:00
Devang Patel
8d9eb3b0f7 Reapply r131605. This time with a fix, which is to use NoFolder.
llvm-svn: 131673
2011-05-19 20:52:46 +00:00
Rafael Espindola
4ebe940cd4 revert 131605 to fix PR9946.
llvm-svn: 131620
2011-05-19 02:26:30 +00:00
Devang Patel
c5390e2f7f Use IRBuilder.
llvm-svn: 131609
2011-05-19 00:13:33 +00:00
Devang Patel
ecb22f0544 Use IRBuilder while simplifying unreachable.
llvm-svn: 131607
2011-05-19 00:09:21 +00:00
Devang Patel
fa6d0b4f84 Use IRBuilder while simplifying conditional branch.
llvm-svn: 131605
2011-05-18 23:59:51 +00:00
Devang Patel
877a16ea33 Use IRBuilder while simplifying branch.
llvm-svn: 131598
2011-05-18 23:18:47 +00:00
Devang Patel
3f94bed4e4 Use IRBuilder while simplifying return instruction.
llvm-svn: 131580
2011-05-18 21:33:11 +00:00
Devang Patel
3549e33227 Spread use of IRBuilder even more.
llvm-svn: 131571
2011-05-18 20:53:17 +00:00
Devang Patel
fd9b1daf82 Use IRBuilder while simplifying switch instruction.
llvm-svn: 131566
2011-05-18 20:35:38 +00:00
Devang Patel
40690a2df4 Use IRBuilder while simplifying unwind.
llvm-svn: 131561
2011-05-18 20:01:18 +00:00
Devang Patel
f0b8a243b9 Use IRBuilder while simplifying terminator.
llvm-svn: 131552
2011-05-18 18:43:31 +00:00
Devang Patel
faedd704bb Use IRBuilder while simplifying unconditional branch.
llvm-svn: 131551
2011-05-18 18:28:48 +00:00
Devang Patel
9249a85cdc Use IRBuilder while folding two entry PHINode.
llvm-svn: 131548
2011-05-18 18:16:44 +00:00
Devang Patel
6eb1a7bd09 Set up IRBuilder for use during simplification.
llvm-svn: 131545
2011-05-18 18:01:27 +00:00
Matt Beaumont-Gay
7472bb0a7e fix typo
llvm-svn: 131543
2011-05-18 17:37:10 +00:00
Devang Patel
a6e4c7a441 Use IRBuiler while constant folding terminator.
llvm-svn: 131541
2011-05-18 17:26:46 +00:00
Devang Patel
b75e746499 Preseve line numbers while simplifying CFG.
llvm-svn: 131508
2011-05-17 23:29:05 +00:00
Devang Patel
8a2b06e577 Preserve line number information.
llvm-svn: 131480
2011-05-17 19:43:06 +00:00
Devang Patel
8cf3c94ae5 There is no need to force DebugLoc on a PHI at this point.
llvm-svn: 131427
2011-05-16 22:05:03 +00:00
Devang Patel
9f871794b6 Preserve debug info for unused zero extended boolean argument.
Radar 9422775.

llvm-svn: 131422
2011-05-16 21:24:05 +00:00
Benjamin Kramer
5943d0a3ee SimplifyCFG: Use ComputeMaskedBits to prune dead cases from switch instructions.
llvm-svn: 131345
2011-05-14 15:57:25 +00:00
Devang Patel
236dc68956 Set debug location for new PHI nodes created in exit block.
llvm-svn: 130894
2011-05-04 23:58:22 +00:00
Devang Patel
4127ad57df Scanning entire basic block may be too expensive in terms of compile time. Instead, just use whatever location info first non-phi instruction has.
llvm-svn: 130729
2011-05-02 21:57:00 +00:00
Devang Patel
60fb94e8bf Assing line number info to new PHIs created by SSA updater.
llvm-svn: 130551
2011-04-29 22:28:59 +00:00
Peter Collingbourne
d78bf257ad SimplifyCFG: Expose phi node folding cost threshold as command line parameter
llvm-svn: 130528
2011-04-29 18:47:38 +00:00
Peter Collingbourne
0994e869f9 SimplifyCFG: Add CostRemaining parameter to DominatesMergePoint
llvm-svn: 130527
2011-04-29 18:47:31 +00:00
Peter Collingbourne
06646aa091 SimplifyCFG: Add Trunc, ZExt and SExt to the list of cheap instructions for phi node folding
llvm-svn: 130526
2011-04-29 18:47:25 +00:00
Devang Patel
5e9ca7876e Remove DbgDeclare only if all uses are converted.
llvm-svn: 130431
2011-04-28 20:32:02 +00:00
Jay Foad
c146569beb Remove unused STL header includes.
llvm-svn: 130068
2011-04-23 19:53:52 +00:00
Jay Foad
32fce4d563 PR9214: Convert Metadata API to use ArrayRef.
llvm-svn: 129932
2011-04-21 19:59:31 +00:00
Jay Foad
0dcd432074 Trivial simplification.
llvm-svn: 129759
2011-04-19 15:23:29 +00:00
Chris Lattner
0304b82f80 Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!

llvm-svn: 129558
2011-04-15 05:18:47 +00:00
Chris Lattner
88e2acc24c rework FoldBranchToCommonDest to exit earlier when there is a bonus
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
2011-04-14 02:44:53 +00:00
Chris Lattner
2871dd44cb comment cleanup, use moveBefore instead of removeFromParent+insertBefore.
llvm-svn: 129319
2011-04-11 23:24:57 +00:00
Jay Foad
0d5ca4cf44 Don't include Operator.h from InstrTypes.h.
llvm-svn: 129271
2011-04-11 09:35:34 +00:00
Devang Patel
47e1db49c9 Do not let debug info interfer with branch folding.
llvm-svn: 129114
2011-04-07 23:11:25 +00:00
Devang Patel
17670a995c While hoisting common code from if/else, hoist debug info intrinsics if they match.
llvm-svn: 129078
2011-04-07 17:27:36 +00:00
Devang Patel
bb234bb5dd Simplify. isIdenticalToWhenDefined() checks opcode.
llvm-svn: 129041
2011-04-07 00:30:15 +00:00
Devang Patel
12a95842b2 While folding branch to a common destination into a predecessor, copy dbg values also.
llvm-svn: 129035
2011-04-06 22:37:20 +00:00
Eli Friedman
f739e21880 Attempt to fix breakage from r128782 reported by Francois Pichet on
llvm-commits.  (Not sure why it only breaks on Windows; maybe it has
something to do with the iterator representation...)

llvm-svn: 128802
2011-04-04 00:37:38 +00:00
Eli Friedman
8b6d220330 PR9446: RecursivelyDeleteTriviallyDeadInstructions can delete the instruction
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
2011-04-02 22:45:17 +00:00
Jay Foad
53632b7c03 Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

llvm-svn: 128537
2011-03-30 11:28:46 +00:00
Jay Foad
dc5a008237 (Almost) always call reserveOperandSpace() on newly created PHINodes.
llvm-svn: 128535
2011-03-30 11:19:20 +00:00
Devang Patel
05641a9b85 Simplify.
llvm-svn: 128030
2011-03-21 22:04:45 +00:00
Devang Patel
c8b77563dc If an AllocaInst referred by DbgDeclareInst is used by a LoadInst then the LoadInst should also get a corresponding llvm.dbg.value intrinsic.
llvm-svn: 127924
2011-03-18 23:45:43 +00:00
Devang Patel
a5de669faa Remove dead code.
llvm-svn: 127923
2011-03-18 23:33:58 +00:00
Devang Patel
bafc4fec54 Consider debug info intrinsics pointing to null value as dead instructions.
llvm-svn: 127922
2011-03-18 23:28:02 +00:00