Owen Anderson
2ed352c8b6
Make this into a static method.
...
llvm-svn: 80170
2009-08-26 22:55:11 +00:00
Owen Anderson
9df206d02d
Push LLVMContexts through the IntegerType APIs.
...
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Dan Gohman
0831bdef1d
Fix GVN's debug output, now that operator<< on Value* doesn't print
...
a trailing newline.
llvm-svn: 77719
2009-07-31 20:24:18 +00:00
Owen Anderson
d0e6352c97
Move getTrue() and getFalse() to 2.5-like APIs.
...
llvm-svn: 77685
2009-07-31 17:39:07 +00:00
Owen Anderson
93ccaf5c60
Move more code back to 2.5 APIs.
...
llvm-svn: 77635
2009-07-30 23:03:37 +00:00
Dan Gohman
9a7deba67e
Convert a few more things to use raw_ostream.
...
llvm-svn: 77039
2009-07-25 01:43:01 +00:00
Daniel Dunbar
8496064116
More migration to raw_ostream, the water has dried up around the iostream hole.
...
- Some clients which used DOUT have moved to DEBUG. We are deprecating the
"magic" DOUT behavior which avoided calling printing functions when the
statement was disabled. In addition to being unnecessary magic, it had the
downside of leaving code in -Asserts builds, and of hiding potentially
unnecessary computations.
llvm-svn: 77019
2009-07-25 00:23:56 +00:00
Owen Anderson
cc287b28c9
Get rid of the Pass+Context magic.
...
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Owen Anderson
7f61f8dc30
Rename getConstantInt{True|False} to get{True|False} at Chris' behest.
...
llvm-svn: 76598
2009-07-21 18:03:38 +00:00
Torok Edwin
f955a6ef49
llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
...
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").
llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Torok Edwin
ae8a3ff177
assert(0) -> LLVM_UNREACHABLE.
...
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.
llvm-svn: 75379
2009-07-11 20:10:48 +00:00
Owen Anderson
49226b1075
This started as a small change, I swear. Unfortunately, lots of things call the [I|F]CmpInst constructors. Who knew!?
...
llvm-svn: 75200
2009-07-09 23:48:35 +00:00
Nick Lewycky
d46a7b2d22
Remove the vicmp and vfcmp instructions. Because we never had a release with
...
these instructions, no autoupgrade or backwards compatibility support is
provided.
llvm-svn: 74991
2009-07-08 03:04:38 +00:00
Owen Anderson
7fb95ff5dd
Convert the first batch of passes to use LLVMContext.
...
llvm-svn: 74748
2009-07-03 00:17:18 +00:00
Dale Johannesen
26f0dd9021
This fixes a bug introduced in 72661, which can
...
move loads back past a check that the load address
is valid, see new testcase. The test that went
in with 72661 has exactly this case, except that
the conditional it's moving past is checking
something else; I've settled for changing that
test to reference a global, not a pointer. It
may be possible to scan all the tests you pass and
make sure none of them are checking any component
of the address, but it's not trivial and I'm not
trying to do that here.
llvm-svn: 73632
2009-06-17 20:48:23 +00:00
Torok Edwin
09a9b85420
Add debug message about non-local loads being clobbered.
...
llvm-svn: 73625
2009-06-17 18:48:18 +00:00
Dan Gohman
59c4088e16
Make the EnableLoadPRE variable static.
...
llvm-svn: 73398
2009-06-15 18:30:15 +00:00
Dan Gohman
5f6f8101d5
Split the Add, Sub, and Mul instruction opcodes into separate
...
integer and floating-point opcodes, introducing
FAdd, FSub, and FMul.
For now, the AsmParser, BitcodeReader, and IRBuilder all preserve
backwards compatability, and the Core LLVM APIs preserve backwards
compatibility for IR producers. Most front-ends won't need to change
immediately.
This implements the first step of the plan outlined here:
http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt
llvm-svn: 72897
2009-06-04 22:49:04 +00:00
Owen Anderson
928040c625
Be more aggressive in doing LoadPRE by tracing backwards when a block only has
...
a single predecessor.
Patch by Jakub Staszak.
llvm-svn: 72661
2009-05-31 09:03:40 +00:00
Bill Wendling
f26f8a579e
Enable GVN Load PRE.
...
llvm-svn: 72589
2009-05-29 20:38:16 +00:00
Torok Edwin
845fc92978
just show the instruction, its not that slow.
...
llvm-svn: 72577
2009-05-29 16:58:36 +00:00
Torok Edwin
a4ebdef3e8
for instructions with void type we have no choice but print the instruction as
...
is, otherwise we get a <badref>.
llvm-svn: 72567
2009-05-29 10:28:44 +00:00
Torok Edwin
4a228edc3a
Add a DEBUG() output to GVN that prints the instruction clobbering a load.
...
This is useful when trying to figure out why GVN didn't eliminate redundant
loads.
llvm-svn: 72565
2009-05-29 09:46:03 +00:00
Owen Anderson
09c469ec35
Fix an issue where phiMap was not being updated properly when doing load PRE.
...
Diagnosis and patch thanks to Jakub Staszak.
llvm-svn: 72562
2009-05-29 05:37:54 +00:00
Duncan Sands
880eaf5278
Allow readonly functions to unwind exceptions. Teach
...
the optimizers about this. For example, a readonly
function with no uses cannot be removed unless it is
also marked nounwind.
llvm-svn: 71071
2009-05-06 06:49:50 +00:00
Owen Anderson
851ce6d1d5
Reapply r68211, with the miscompilations it caused fixed.
...
llvm-svn: 68262
2009-04-01 23:53:49 +00:00
Dan Gohman
a134448980
Revert r68172. It caused regressions in
...
Applications/Burg/burg
Applications/ClamAV/clamscan
and many other tests.
llvm-svn: 68211
2009-04-01 16:37:47 +00:00
Owen Anderson
d7c837bb4b
Enhance GVN to propagate simple conditionals. This fixes PR3921.
...
llvm-svn: 68172
2009-04-01 01:20:45 +00:00
John Criswell
d1fd7b1f72
Do not attempt to do parial redundancy elimination on void values.
...
Also fixed a punctuation error in the header comment.
This fixes PR3775.
llvm-svn: 66542
2009-03-10 15:04:53 +00:00
Devang Patel
9abfbc2e14
Skip DbgInfoIntrinsic.
...
llvm-svn: 66244
2009-03-06 02:59:27 +00:00
Chris Lattner
d093b49b81
improve naming of values in GVN, patch by Jay Foad!
...
llvm-svn: 64363
2009-02-12 07:00:35 +00:00
Bill Wendling
22173be9c5
Mistakenly turned this on.
...
llvm-svn: 64065
2009-02-08 01:32:00 +00:00
Bill Wendling
4ed0306d6f
Revert r63999. It was breaking self-hosting builds.
...
llvm-svn: 64062
2009-02-08 00:58:05 +00:00
Chris Lattner
45a7b5ce57
improve compatibility with cygwin, patch by Jay Foad!
...
llvm-svn: 62535
2009-01-19 22:00:18 +00:00
Owen Anderson
450f83fd54
Don't forget to remove phi nodes from the value numbering table after we collapse them.
...
llvm-svn: 61358
2008-12-23 00:49:51 +00:00
Bill Wendling
7c1a7f0c03
Comment clean-ups. No functionality change.
...
llvm-svn: 61354
2008-12-22 22:32:22 +00:00
Bill Wendling
ec7ce2e7f3
Check that the instruction isn't in the value numbering scope.
...
llvm-svn: 61353
2008-12-22 22:28:56 +00:00
Bill Wendling
a1d8e29851
Simplification: Negate the operator== method instead of implementing a full operator!= method.
...
llvm-svn: 61352
2008-12-22 22:16:31 +00:00
Bill Wendling
e42e5a263b
Add verification that deleted instruction isn't hiding in the PHI map.
...
llvm-svn: 61350
2008-12-22 22:14:07 +00:00
Bill Wendling
ac1c0d7f13
Verify removed in a few more places.
...
llvm-svn: 61349
2008-12-22 21:57:30 +00:00
Bill Wendling
b8ecde3d78
Add verification functions to GVN which check to see that an instruction was
...
truely deleted. These will be expanded with further checks of all of the data
structures.
llvm-svn: 61347
2008-12-22 21:36:08 +00:00
Bill Wendling
4ca9e94f91
Didn't mean to commit this.
...
llvm-svn: 61222
2008-12-18 22:19:50 +00:00
Bill Wendling
5ec9cb2217
Re-XFAIL this test until debug stuff settles down.
...
llvm-svn: 61219
2008-12-18 22:13:31 +00:00
Chris Lattner
d159077cb9
reapply this hunk from Bill's reversion in r61169, it is conservative
...
and safe and orthogonal from turning off load pre.
llvm-svn: 61177
2008-12-18 00:51:32 +00:00
Bill Wendling
3eb7c0254b
Temporarily revert r61027. It was causing a bootstrap failure in "release" mode
...
with everyone's favorite error messages:
Comparing stages 2 and 3
warning: ./cc1-checksum.o differs
warning: ./cc1plus-checksum.o differs
Bootstrap comparison failure!
./c-decl.o differs
./cp/decl.o differs
./df-core.o differs
./gcc.o differs
./i386.o differs
./stor-layout.o differs
./tree-pretty-print.o differs
./tree.o differs
make[2]: *** [compare] Error 1
make[1]: *** [stage3-bubble] Error 2
See PR3227.
llvm-svn: 61169
2008-12-17 23:31:20 +00:00
Chris Lattner
b467a5b4a5
Enable Load PRE. This teaches GVN to push partially redundant loads up the
...
CFG when there is exactly one predecessor where the load is not available.
This is designed to not increase code size but still eliminate partially
redundant loads. This fires 1765 times on 403.gcc even though it doesn't
do critical edge splitting yet (the most common reason for it to fail).
llvm-svn: 61027
2008-12-15 05:28:29 +00:00
Owen Anderson
90af4c9640
Ifdef out some code that I didn't mean to enable by default yet.
...
llvm-svn: 61024
2008-12-15 03:52:17 +00:00
Chris Lattner
22cfa14eed
make GVN try to rename inputs to the resultant replaced values, which
...
cleans up the generated code a bit. This should have the added benefit of
not randomly renaming functions/globals like my previous patch did. :)
llvm-svn: 61023
2008-12-15 03:46:38 +00:00
Owen Anderson
c2d2c0bdf3
Add support for slow-path GVN with full phi construction for scalars. This is disabled for now, as it actually pessimizes code in the abscence
...
of phi translation for load elimination. This slow down GVN a bit, by about 2% on 403.gcc.
llvm-svn: 61021
2008-12-15 02:03:00 +00:00
Owen Anderson
47efff5b14
Generalize GVN's phi construciton routine to work for things other than loads.
...
llvm-svn: 61009
2008-12-14 19:10:35 +00:00