Dan Gohman
75d7d5e988
Move Instruction::isSafeToSpeculativelyExecute out of VMCore and
...
into Analysis as a standalone function, since there's no need for
it to be in VMCore. Also, update it to use isKnownNonZero and
other goodies available in Analysis, making it more precise,
enabling more aggressive optimization.
llvm-svn: 146610
2011-12-14 23:49:11 +00:00
Chris Lattner
6a144a2227
Upgrade syntax of tests using volatile instructions to use 'load volatile' instead of 'volatile load', which is archaic.
...
llvm-svn: 145171
2011-11-27 06:54:59 +00:00
Pete Cooper
9ee220915b
LICM pass now understands invariant load metadata. Nothing generates this yet so it will currently never get used in real tests
...
llvm-svn: 144107
2011-11-08 19:30:00 +00:00
Eli Friedman
91386c7be4
Atomic load/store support in LICM.
...
llvm-svn: 137648
2011-08-15 20:52:09 +00:00
Eli Friedman
02e737b08e
Move "atomic" and "volatile" designations on instructions after the opcode
...
of the instruction.
Note that this change affects the existing non-atomic load and store
instructions; the parser now accepts both forms, and the change is noted
in the release notes.
llvm-svn: 137527
2011-08-12 22:50:01 +00:00
Eli Friedman
0cdc148ab8
Bring LICM into compliance with the new "Memory Model for Concurrent Operations" in LangRef.
...
llvm-svn: 135625
2011-07-20 21:37:47 +00:00
Tobias Grosser
4a5d9a9c20
LICM: Do not loose alignment on promotion
...
The promotion code lost any alignment information, when hoisting loads and
stores out of the loop. This lead to incorrect aligned memory accesses. We now
use the largest alignment we can prove to be correct.
llvm-svn: 134520
2011-07-06 19:19:55 +00:00
Chris Lattner
b90ed2233c
manually upgrade a bunch of tests to modern syntax, and remove some that
...
are either unreduced or only test old syntax.
llvm-svn: 133228
2011-06-17 03:14:27 +00:00
Eli Friedman
17822fcde9
PR9604; try to deal with RAUW updates correctly in the AST. I'm not convinced
...
it's completely safe to cache the AST across LICM runs even with this fix,
but this fix can't hurt.
llvm-svn: 129198
2011-04-09 06:55:46 +00:00
Eli Friedman
4db39cefdb
Test for r129190.
...
llvm-svn: 129197
2011-04-09 06:39:43 +00:00
Eli Friedman
c5f22a7815
PR9634: Don't unconditionally tell the AliasSetTracker that the PreheaderLoad
...
is equivalent to any other relevant value; it isn't true in general.
If it is equivalent, the LoopPromoter will tell the AST the equivalence.
Also, delete the PreheaderLoad if it is unused.
Chris, since you were the last one to make major changes here, can you check
that this is sane?
llvm-svn: 129049
2011-04-07 01:35:06 +00:00
Devang Patel
97d0be8ee1
While sinking an instruction, do not lose llvm.dbg.value intrinsic.
...
llvm-svn: 127214
2011-03-08 03:06:19 +00:00
Cameron Zwarich
d8e66038f4
Rename 'loopsimplify' to 'loop-simplify'.
...
llvm-svn: 125317
2011-02-10 23:38:10 +00:00
Chris Lattner
408a684d29
Enhance LICM to promote alias sets whose pointers themselves are stored,
...
which doesn't affect the memory address being promoted.
llvm-svn: 122172
2010-12-19 05:57:25 +00:00
Chris Lattner
3337a81450
fix PR8602, a bug in an assertion: a volatile store *of* a pointer
...
does not make the alias set for that pointer volatile, just stores
*to* the pointer.
llvm-svn: 122171
2010-12-19 05:51:54 +00:00
Dan Gohman
02538ac4d3
Make BasicAliasAnalysis a normal AliasAnalysis implementation which
...
does normal initialization and normal chaining. Change the default
AliasAnalysis implementation to NoAlias.
Update StandardCompileOpts.h and friends to explicitly request
BasicAliasAnalysis.
Update tests to explicitly request -basicaa.
llvm-svn: 116720
2010-10-18 18:04:47 +00:00
Devang Patel
57da4caa85
Remove LoopIndexSplit pass. It is neither maintained nor used by anyone.
...
llvm-svn: 116004
2010-10-07 23:29:37 +00:00
Chris Lattner
f1144f0929
fix PR8102, a case where we'd copyValue from a value that we already
...
deleted. Fix this by doing the copyValue's before we delete stuff!
The testcase only repros the problem on my system with valgrind.
llvm-svn: 113820
2010-09-14 00:19:00 +00:00
Chris Lattner
be9019090e
fix PR8067, an over-aggressive assertion in LICM.
...
llvm-svn: 113146
2010-09-06 05:11:24 +00:00
Chris Lattner
50506787d1
fix a bug in my licm rewrite when a load from the promoted memory
...
location is being re-stored to the memory location. We would get
a dangling pointer from the SSAUpdate data structure and miss a
use. This fixes PR8068
llvm-svn: 113042
2010-09-04 00:12:30 +00:00
Chris Lattner
affc0e42f0
fix more AST updating bugs, correcting miscompilation in PR8041
...
llvm-svn: 112878
2010-09-02 22:19:10 +00:00
Chris Lattner
030f02021b
licm is wasting time hoisting constant foldable operations,
...
instead of hoisting them, just fold them away. This occurs in the
testcase for PR8041, for example.
llvm-svn: 112669
2010-08-31 23:00:16 +00:00
Chris Lattner
263f804699
LICM does get dead instructions input to it. Instead of sinking them
...
out of loops, just delete them.
llvm-svn: 112451
2010-08-29 18:22:25 +00:00
Devang Patel
be94f23992
Remove dead debug info intrinsics.
...
Intrinsic::dbg_stoppoint
Intrinsic::dbg_region_start
Intrinsic::dbg_region_end
Intrinsic::dbg_func_start
AutoUpgrade simply ignores these intrinsics now.
llvm-svn: 92557
2010-01-05 01:10:40 +00:00
Eric Christopher
1dba6ea72f
Add radar fixed in comment.
...
llvm-svn: 91312
2009-12-14 19:07:25 +00:00
Eric Christopher
4b91e0194b
Add a test for the fix in revision 91009.
...
llvm-svn: 91062
2009-12-10 21:11:40 +00:00
Dan Gohman
cbc6ebb6fd
Enable hoisting of loads from constant memory by default. In cases where
...
they are lowered to instruction sequences more complex than a simple
load, such that CodeGen cannot rematerialize them, a reload from a
spill slot is likely to be cheaper than the complex sequence.
llvm-svn: 89374
2009-11-19 19:00:10 +00:00
Edward O'Callaghan
e45ac76ee4
Convert a few tests to FileCheck for PR5307.
...
llvm-svn: 85171
2009-10-26 22:52:03 +00:00
Dan Gohman
a484d17ec5
Make these tests more interesting by using
...
-verify-dom-info and -verify-loop-info, which enable additional
(expensive) consistency checks.
llvm-svn: 85017
2009-10-24 23:23:04 +00:00
Torok Edwin
907ec36943
LICM shouldn't sink/delete debug information. Fix this and add a testcase.
...
For now the metadata of sinked/hoisted instructions is still wrong, but that'll
be fixed when instructions will have debug metadata directly attached.
llvm-svn: 83786
2009-10-11 19:15:54 +00:00
Dan Gohman
1880092722
Change tests from "opt %s" to "opt < %s" so that opt doesn't see the
...
input filename so that opt doesn't print the input filename in the
output so that grep lines in the tests don't unintentionally match
strings in the input filename.
llvm-svn: 81537
2009-09-11 18:01:28 +00:00
Dan Gohman
72a13d2476
Use opt -S instead of piping bitcode output through llvm-dis.
...
llvm-svn: 81257
2009-09-08 22:34:10 +00:00
Dan Gohman
9737a63ed8
Change these tests to feed the assembly files to opt directly, instead
...
of using llvm-as, now that opt supports this.
llvm-svn: 81226
2009-09-08 16:50:01 +00:00
Chris Lattner
394b95c005
rename test
...
llvm-svn: 80523
2009-08-30 22:14:17 +00:00
Chris Lattner
71d51a2d79
merge all sinking tests into one and convert them to filecheck.
...
llvm-svn: 80522
2009-08-30 22:13:26 +00:00
Chris Lattner
362654f51c
convert scalar_promote to filecheck style and merge 2003-12-13-VolatilePromote.ll into it.
...
llvm-svn: 80521
2009-08-30 22:08:19 +00:00
Devang Patel
4555618854
Before deleting a basic block, give other loop passes a chance cleanup analysis values, related to the instructions in the basic block.
...
llvm-svn: 67719
2009-03-25 23:57:48 +00:00
Owen Anderson
2a6adfa4f0
Remove GCSE and LoadVN from the testsuite.
...
llvm-svn: 54832
2008-08-16 00:00:54 +00:00
Dan Gohman
5f36a32e7b
Put the LICM of constant GlobalVariables, introduced in r53945, under a
...
command-line option, and disable it by default. It introduced performance
regressions because CodeGen is currently not able to remat such loads.
llvm-svn: 53997
2008-07-24 23:57:25 +00:00
Chris Lattner
8a8fb908dc
"Allow LICM to sink or lift loads from constant memory. Also add a test
...
case for this.
This allows instructions like loads from global variables declared to
be constant to be moved out of loops."
Patch by Stefanus Du Toit!
llvm-svn: 53945
2008-07-23 05:06:28 +00:00
Chris Lattner
b76ad168dc
Fix PR2346 by marking vaarg as volatile so that licm doesn't try to
...
hoist them.
llvm-svn: 51356
2008-05-20 22:05:28 +00:00
Gabor Greif
1e427c3264
sabre brings to my attention that the 'tr' suffix is also obsolete
...
llvm-svn: 51349
2008-05-20 21:00:03 +00:00
Gabor Greif
f45ff35bfe
Rename the last test with .llx extension to .ll, resolve duplicate test by renaming to isnan2. Now that no test has llx ending there is no need to search for them from dg.exp too.
...
llvm-svn: 51328
2008-05-20 19:52:04 +00:00
Owen Anderson
ecc12fe81d
Use loop deletion instead of ADCE in these tests.
...
llvm-svn: 51180
2008-05-16 04:33:37 +00:00
Chris Lattner
b839c05a05
rename *.llx -> *.ll, last batch.
...
llvm-svn: 49971
2008-04-19 22:32:52 +00:00
Tanya Lattner
f73582b17c
Remove llvm-upgrade and update tests.
...
llvm-svn: 48527
2008-03-19 03:47:13 +00:00
Bill Wendling
6f8c9a8372
Update this testcase. The output needs to be disabled to pass.
...
llvm-svn: 45478
2008-01-01 01:34:36 +00:00
Duncan Sands
8a3e9d2bee
Ding dong, the DoesntAccessMemoryFns and
...
OnlyReadsMemoryFns tables are dead! We
get more, and more accurate, information
from gcc via the readnone and readonly
function attributes.
llvm-svn: 44288
2007-11-23 19:30:27 +00:00
Devang Patel
2a60ff1aeb
Relax unsafe use check. If there is one unconditional use inside the loop then it is safe to promote value even if there is another conditional use inside the loop.
...
llvm-svn: 42493
2007-10-01 18:12:58 +00:00
Devang Patel
9e30e1a3be
Do not promote null values because it may be unsafe to do so.
...
llvm-svn: 42270
2007-09-24 20:02:42 +00:00