Eli Friedman
2599a202e2
Make sure IPSCCP never marks a tracked call as overdefined in SCCPSolver::ResolvedUndefsIn. If we do, we can end up in a situation where a function is resolved to return a constant, but the caller is marked overdefined, which confuses the code later.
...
<rdar://problem/9956541> (again).
llvm-svn: 140210
2011-09-20 23:28:51 +00:00
Andrew Trick
1dfb51c692
Reapply r139759. Disable IV rewriting by default. See PR10916.
...
llvm-svn: 139842
2011-09-15 20:58:37 +00:00
Dan Gohman
f4d52b917e
Don't mark objc_retainBlock as nounwind. It calls user copy constructors
...
which could theoretically throw.
llvm-svn: 139710
2011-09-14 18:33:34 +00:00
Dan Gohman
223fdfc56f
objc_retainBlock is not NoModRef because it can update forwarding pointers
...
in memory relevant to the optimizer. rdar://10050579.
llvm-svn: 139708
2011-09-14 18:13:00 +00:00
Andrew Trick
2e22ddc364
[indvars] Revert r139579 until 401.bzip -arch i386 miscompilation is fixed. PR10920.
...
llvm-svn: 139583
2011-09-13 05:23:49 +00:00
Andrew Trick
2bfa2824c6
Disable IV rewriting by default. See PR10916.
...
llvm-svn: 139579
2011-09-13 03:23:21 +00:00
Andrew Trick
2cc8637af2
[indvars] Fix bugs in floating point IV range checks noticed by inspection.
...
llvm-svn: 139574
2011-09-13 01:59:32 +00:00
Eli Friedman
3f92f87989
Add comment to clarify the behavior of a helper in DSE.
...
llvm-svn: 139571
2011-09-13 01:28:59 +00:00
Eli Friedman
ce1cbc7db5
Correct grammar.
...
llvm-svn: 139565
2011-09-13 00:44:16 +00:00
Eli Friedman
047d3de417
Change a bunch of isVolatile() checks to check for atomic load/store as well.
...
No tests; these changes aren't really interesting in the sense that the logic is the same for volatile and atomic.
I believe this completes all of the changes necessary for the optimizer to handle loads and stores correctly. I'm going to try and come up with some additional testing, though.
llvm-svn: 139533
2011-09-12 20:23:13 +00:00
Andrew Trick
09cf4287c2
Rename -disable-iv-rewrite to -enable-iv-rewrite=false in preparation for default change.
...
llvm-svn: 139517
2011-09-12 18:28:44 +00:00
Andrew Trick
cf4ef9bded
[disable-iv-rewrite] Allow WidenIV to handle NSW/NUW operations
...
better.
Don't immediately give up when an add operation can't be trivially
sign/zero-extended within a loop. If it has NSW/NUW flags, generate a
new expression with sign extended (non-recurrent) operand. As before,
if SCEV says that all sign extends are loop invariant, then we can
widen the operation.
llvm-svn: 139453
2011-09-10 01:24:17 +00:00
Andrew Trick
77fa88a786
Comment formatting.
...
llvm-svn: 139375
2011-09-09 17:35:10 +00:00
Andrew Trick
8145f71bab
Add -verify-indvars for imperfect SCEV trip count verification after indvars.
...
llvm-svn: 139169
2011-09-06 20:20:38 +00:00
Devang Patel
1366637777
Use IRBuilder.
...
llvm-svn: 139156
2011-09-06 18:49:53 +00:00
Owen Anderson
ca0326a423
Try again at r138809 (make DSE more aggressive in removing dead stores at the end of a function), now with less deleting stores before memcpy's.
...
llvm-svn: 139150
2011-09-06 18:14:09 +00:00
Bill Wendling
0506959970
Use Duncan's patch to delete the instructions in reverse order (minus the landingpad and terminator).
...
llvm-svn: 139090
2011-09-04 09:43:36 +00:00
Bill Wendling
3033d7846d
Update comments to reflect reality.
...
llvm-svn: 139023
2011-09-02 18:43:33 +00:00
Andrew Trick
36b96e4619
Enable SCEV-based unrolling by default.
...
This changes loop unrolling to use the same mechanism for trip count
computation as indvars. This is a stronger check that tends to unroll
more loops. A very common side-effect is that many single iteration
loops will be removed sooner. The real goal was simply to remove
dependence on canonical IVs.
x86 is break even.
ARM performance changes to expect (+ is good):
External/SPEC/CFP2000/183.equake/183.equake +13%
SingleSource/Benchmarks/Dhrystone/fldry +21%
MultiSource/Applications/spiff/spiff +3%
SingleSource/Benchmarks/Stanford/Puzzle -14%
The Puzzle regression is actually an improvement in loop optimization
that defeats GVN: rdar://problem/10065079.
llvm-svn: 139009
2011-09-02 17:26:28 +00:00
Jakub Staszak
b82758ae9b
Compare type size instead of type _store_ size to make sure that BitCastInst
...
will be valid. This fixes PR10820.
llvm-svn: 139005
2011-09-02 14:57:37 +00:00
Bill Wendling
759eb19f0b
Change worklist driven deletion to be an iterative process.
...
Duncan noticed this!
llvm-svn: 138967
2011-09-01 21:28:33 +00:00
Eli Friedman
00a62b2122
Fix an issue with the IR sink pass found by inspection. (I'm not sure anyone is actually using this, but might as well fix it since I found the issue.)
...
llvm-svn: 138965
2011-09-01 21:21:24 +00:00
Bill Wendling
df24e0d185
Make sure we aren't deleting the landingpad instruction.
...
The landingpad instruction is required in the landing pad block. Because we're
not deleting terminating instructions, the invoke may still jump to here (see
Transforms/SCCP/2004-11-16-DeadInvoke.ll). Remove all uses of the landingpad
instruction, but keep it around until code-gen can remove the basic block.
llvm-svn: 138890
2011-08-31 20:55:20 +00:00
Rafael Espindola
3bb0f9391c
Remove the old tail duplication pass. It is not used and is unable to update
...
ssa, so it has to be run really early in the pipeline. Any replacement
should probably use the SSAUpdater.
llvm-svn: 138841
2011-08-30 23:03:45 +00:00
Owen Anderson
d3a9f00a58
Speculatively revert r138809 in an attempt to fix DragonEgg.
...
llvm-svn: 138829
2011-08-30 21:11:06 +00:00
Owen Anderson
3ec8beb8c8
When walking backwards to eliminate final stores to allocas at the end of a function, encountering an unrelated store should not cause us to give up like encountering a load does.
...
llvm-svn: 138809
2011-08-30 18:51:55 +00:00
Bill Wendling
400ec8bd8f
Don't sink landingpad instructions during ind-var simplification.
...
llvm-svn: 138651
2011-08-26 20:40:15 +00:00
Bill Wendling
1eec5affec
LSR wants to split the landing pad's critical edge. Let it do it, but use the
...
proper function to do it.
llvm-svn: 138550
2011-08-25 05:55:40 +00:00
Bill Wendling
bc21b6ec6d
When inserting new instructions, use getFirstInsertionPt instead of
...
getFirstNonPHI so that it will skip over the landingpad instructions as well.
llvm-svn: 138537
2011-08-25 01:08:34 +00:00
Bill Wendling
15062f817a
Skip the landingpad instruction when determining the insertion point.
...
llvm-svn: 138481
2011-08-24 21:06:46 +00:00
Bill Wendling
0301dcfde8
Use getFirstInsertionPt instead of getFirstNonPHI so that it skips to the proper
...
insertion place.
llvm-svn: 138473
2011-08-24 20:28:43 +00:00
Dan Gohman
a6ceaf82c5
Add a comment.
...
llvm-svn: 138243
2011-08-22 17:29:37 +00:00
Dan Gohman
9619488506
Constant pointers to objects don't need reference counting.
...
llvm-svn: 138242
2011-08-22 17:29:11 +00:00
Bill Wendling
31d80032c6
The landingpad instruction isn't dead simply because it's value isn't used.
...
llvm-svn: 138102
2011-08-19 21:52:06 +00:00
Benjamin Kramer
0d60a5573c
Make a bunch of symbols private.
...
llvm-svn: 138025
2011-08-19 01:42:18 +00:00
Dan Gohman
c5d64c76e0
Track a retain+release nesting level independently of the
...
known-incremented level, because the two concepts can be used
to prove the saftey of a retain+release removal in different
ways.
llvm-svn: 138016
2011-08-19 00:26:36 +00:00
Bill Wendling
ba667af404
Use 'getFirstInsertionPt' when trying to insert new instructions during LICM.
...
llvm-svn: 138008
2011-08-18 23:42:36 +00:00
Dan Gohman
323adc0a3a
Make it clear that this code is iterating in reverse order through the array.
...
llvm-svn: 137985
2011-08-18 21:27:42 +00:00
Devang Patel
43e799cc40
Dramatically speedup codegen prepare by a) avoiding use of dominator tree and b) doing a separate pass over dbg.value instructions.
...
llvm-svn: 137908
2011-08-18 00:50:51 +00:00
Eli Friedman
775a316a06
Atomic load/store handling for the passes using memdep (GVN, DSE, memcpyopt).
...
llvm-svn: 137888
2011-08-17 22:22:24 +00:00
Bill Wendling
fa8d0e1aea
Disable PRE for landing pads.
...
PRE needs the landing pads to have their critical edges split. Doing this for a
landing pad is non-trivial. Abandon the attempt to perform PRE when we come
across a landing pad. (Reviewed by Owen!)
llvm-svn: 137876
2011-08-17 21:32:02 +00:00
Eli Friedman
e1655eebc3
Silly mistake from r137777; restore significant isStructTy() checks. While here, be a bit more defensive
...
with unknown instructions.
Fixes PR10687.
llvm-svn: 137836
2011-08-17 18:10:43 +00:00
Eli Friedman
b4733f623f
A bunch of misc fixes to SCCPSolver::ResolvedUndefsIn, including a fix to stop
...
making random bad assumptions about instructions which are not explicitly listed.
Includes fix for rdar://9956541, a version of "undef ^ undef should return
0 because it's easier than arguing with users".
llvm-svn: 137777
2011-08-16 22:06:31 +00:00
Eli Friedman
e0095e4339
Minor bug in SCCP found by inspection. (I don't think it's possible to hit this with a normal pass pipeline, but fixing for completeness.)
...
llvm-svn: 137755
2011-08-16 21:12:35 +00:00
Bill Wendling
3d7b8eaa78
Use the getFirstInsertionPt() method instead of getFirstNonPHI + an 'isa<>'
...
check for a LandingPadInst.
llvm-svn: 137745
2011-08-16 20:45:24 +00:00
Bill Wendling
3a5b0249c3
In places where it's using "getFirstNonPHI", skip the landingpad instruction if necessary.
...
llvm-svn: 137679
2011-08-15 23:19:54 +00:00
Eli Friedman
e18709e5b2
Atomic load/store support in LICM.
...
llvm-svn: 137648
2011-08-15 20:52:09 +00:00
Bill Wendling
a5dc9de3c4
Skip the insertion iterator past the landingpad instruction if there.
...
llvm-svn: 137626
2011-08-15 18:21:07 +00:00
Bill Wendling
4cbbcd4f82
Initial commit of the 'landingpad' instruction.
...
This implements the 'landingpad' instruction. It's used to indicate that a basic
block is a landing pad. There are several restrictions on its use (see
LangRef.html for more detail). These restrictions allow the exception handling
code to gather the information it needs in a much more sane way.
This patch has the definition, implementation, C interface, parsing, and bitcode
support in it.
llvm-svn: 137501
2011-08-12 20:24:12 +00:00
Duncan Sands
10a9e984bc
Silence a bunch (but not all) "variable written but not read" warnings
...
when building with assertions disabled.
llvm-svn: 137460
2011-08-12 14:54:45 +00:00