1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

3343 Commits

Author SHA1 Message Date
Reid Spencer
9496d63260 Return Undef if the block has no dominator. This was required to allow
llvm-gcc build to succeed. Without this change it fails in libstdc++
compilation. This causes no regressions in dejagnu tests. However, 
someone who knows this code better might want to review it.

llvm-svn: 39924
2007-07-16 21:03:44 +00:00
Dan Gohman
0ba554c0c8 Fix comments about vectors to use the current wording.
llvm-svn: 39921
2007-07-16 14:29:03 +00:00
Chris Lattner
66b7f0c956 Repair a regression in Transforms/InstCombine/mul.ll that Reid noticed.
llvm-svn: 39896
2007-07-16 04:15:34 +00:00
Nick Lewycky
6cdd641e1d Start adding and cleaning up comments.
llvm-svn: 39894
2007-07-16 02:58:37 +00:00
Chris Lattner
f6a91d74e0 Implement shift-simplify.ll:test[45].
First teach instcombine that sign bit checks only demand the 
sign bit, this allows simplify demanded bits to hack on 
expressions better.

Second, teach instcombine that ashr is useless if only the
sign bit is demanded.

llvm-svn: 39880
2007-07-15 20:54:51 +00:00
Chris Lattner
9cb8da1cb8 Implement shift-simplify.ll:test3, turning:
(X << 31) <s 0  --> (X&1) != 0

This happens dozens of times in the CFE.

llvm-svn: 39879
2007-07-15 20:42:37 +00:00
Nick Lewycky
93d39c53b6 Use maximal intersection algorithm exclusively. Fixes miscompile bug.
llvm-svn: 39852
2007-07-14 04:28:04 +00:00
Devang Patel
9166ad7658 Make LCSSA a loop pass.
llvm-svn: 39844
2007-07-13 23:57:11 +00:00
Owen Anderson
9ade055c0f Handle GEPs with all-zero indices in the same way we handle pointer-pointer bitcasts. Also, fix a potentia infinite loop.
This brings FastDSE to parity with old DSE on 175.vpr.

llvm-svn: 39839
2007-07-13 22:50:48 +00:00
Devang Patel
cfdf3b6eff Disable claims to preserve analysis until open issues are resolved.
llvm-svn: 39834
2007-07-13 21:53:42 +00:00
Owen Anderson
275a5ef481 Be more aggressive in removing dead stores, and in removing instructions trivially dead after DSE.
This drastically improves the effect of FastDSE on kimwitu++.

llvm-svn: 39819
2007-07-13 18:26:26 +00:00
Owen Anderson
0ad3e0795b Reimplement removing stores to allocas at the end of a function. This should be safe now.
llvm-svn: 39790
2007-07-12 21:41:30 +00:00
Owen Anderson
999d27d563 Make the condition-checking for free with non-trivial dependencies more correct.
llvm-svn: 39789
2007-07-12 18:08:51 +00:00
Owen Anderson
6edb47d8be Remove the end-block handling code. It was unsafe, and making it safe would have resulted in falling back to the slow DSE case. I need to think some more about the right way to handle this.
llvm-svn: 39788
2007-07-12 17:52:20 +00:00
Gabor Greif
33f07df616 checked in as obvious,
thanks Benoit Boissinot!

llvm-svn: 39774
2007-07-12 13:31:38 +00:00
Owen Anderson
b6211f5b50 Let MemoryDependenceAnalysis take care of updating AliasAnalysis.
llvm-svn: 39769
2007-07-12 00:06:21 +00:00
Devang Patel
f26f0ea111 Preserve analysis info.
llvm-svn: 39767
2007-07-11 23:47:28 +00:00
Owen Anderson
733ff7bbc0 Handle the case where an entire structure is freed, and its dependency is a store to a field within
that structure.

Also, refactor the runOnBasicBlock() function, splitting some of the special cases into separate functions.

llvm-svn: 39762
2007-07-11 23:19:17 +00:00
Owen Anderson
fb23f70dbf Add support for eliminate stores to stack-allocated memory locations at the end
of a function.

llvm-svn: 39754
2007-07-11 21:06:56 +00:00
Owen Anderson
2388e80b0a Handle eliminating stores that occur right before a free.
llvm-svn: 39753
2007-07-11 20:38:34 +00:00
Owen Anderson
28789d81c5 Clean up a few things based on Chris' feedback.
llvm-svn: 39747
2007-07-11 19:03:09 +00:00
Tanya Lattner
a715bbe152 Adding ability to demote phi to stack.
llvm-svn: 39744
2007-07-11 18:41:34 +00:00
Owen Anderson
1eaba31f12 Add FastDSE, a new algorithm for doing dead store elimination. This algorithm is not as accurate
as the current DSE, but it only a linear scan over each block, rather than quadratic.  Eventually
(once it has been improved somewhat), this will replace the current DSE.

NOTE: This has not yet been extensively tested.
llvm-svn: 38517
2007-07-11 00:46:18 +00:00
Owen Anderson
7d38ac8a37 Make the pass registration static.
llvm-svn: 38508
2007-07-10 20:20:19 +00:00
Anton Korobeynikov
7971c2c9b7 During module cloning copy aliases too. This fixes PR1544
llvm-svn: 38505
2007-07-10 19:07:35 +00:00
Nick Lewycky
ea767d42e8 Update the ValueRanges interface to use value numbers instead of Value*s.
llvm-svn: 38483
2007-07-10 03:28:21 +00:00
Owen Anderson
4ce919d799 Move some key maps from std::map to DenseMap. This improves the time to optimize Anton's testcase from 17.5s
to 15.7s.

llvm-svn: 38480
2007-07-10 00:27:22 +00:00
Owen Anderson
65f9dd6973 Use a cheaper test, delaying calling find_leader() until we know that it's necessary. This improves
the time to optimize Anton's testcase from 21.1s to 17.6s.

llvm-svn: 38479
2007-07-10 00:09:25 +00:00
Owen Anderson
2106613ce6 Add an assertion if find_leader fails.
llvm-svn: 38477
2007-07-09 23:57:18 +00:00
Owen Anderson
8d4339f8db Take advantage of the new fast SmallPtrSet assignment operator when propagating AVAIL_OUT sets.
This reduces the time to optimize Anton's testcase from 31.2s to 21.s!

llvm-svn: 38475
2007-07-09 22:29:50 +00:00
Devang Patel
65f3717db9 Expose struct size threhold to allow users to tweak their own setting.
llvm-svn: 38472
2007-07-09 21:19:23 +00:00
Owen Anderson
08020078f3 Fix a comment.
llvm-svn: 38459
2007-07-09 16:43:55 +00:00
Owen Anderson
25d57adc4a Improve a hotspot that was making build_sets() slower by calling lookup() too
often.  This improves Anton's testcase from 36s to 32s.

llvm-svn: 38441
2007-07-09 07:56:55 +00:00
Owen Anderson
f695fa9257 Start using a set representation that remembers the set of value numbers represented
in the set.  For the moment, this results in a slight performance decrease, but
it lays the groundwork for future improvements.

llvm-svn: 38439
2007-07-09 06:50:06 +00:00
Owen Anderson
30fc1decdc Fix an error where ANTIC_OUT was ending up with more than one expression of
the same value number.  This fixes an infinite loop on 444.namd.

llvm-svn: 37967
2007-07-07 20:13:57 +00:00
Nick Lewycky
dc39ec317a Back out Devang's fix for PR1320 because it causes PR1542.
llvm-svn: 37966
2007-07-07 16:23:34 +00:00
Devang Patel
91939a6a55 These rountines are now available as part of basic block utilities.
llvm-svn: 37955
2007-07-06 22:03:47 +00:00
Devang Patel
8803061b9e Request DominanceFrontiner in advance.
llvm-svn: 37954
2007-07-06 21:43:22 +00:00
Devang Patel
a7af16c808 Preserve various analysis info.
llvm-svn: 37953
2007-07-06 21:40:13 +00:00
Devang Patel
d9043c7501 Add SplitEdge and SplitBlock utility routines.
llvm-svn: 37952
2007-07-06 21:39:20 +00:00
Owen Anderson
16d027ce3e Be more aggressive in the heuristic. This mostly exposes more opportunities
for the GVN part of GVNPRE to apply.

llvm-svn: 37951
2007-07-06 20:29:43 +00:00
Owen Anderson
d50fe47cf3 Achieve what the incorrect test was trying to do by simply requiring that all
critical edges be split before we begin.

llvm-svn: 37949
2007-07-06 18:12:36 +00:00
Owen Anderson
da85a8134e Remove an incorrect check.
llvm-svn: 37948
2007-07-06 16:52:47 +00:00
Zhou Sheng
2a79b1ae13 Correct a typo.
llvm-svn: 37936
2007-07-06 06:01:16 +00:00
Owen Anderson
7cf3a2aa1f Fix a bunch of issues found in a testcase from 400.perlbench.
llvm-svn: 37929
2007-07-05 23:11:26 +00:00
Nick Lewycky
c744dbdd30 Break "variable canonicalization" out of InequalityGraph and into its own class
"ValueNumbering".

llvm-svn: 37881
2007-07-05 03:15:00 +00:00
Owen Anderson
2024c08f65 Fix another bug, this time in PREing select instructions.
llvm-svn: 37878
2007-07-04 22:33:23 +00:00
Owen Anderson
ac8fe6b8ca Fix a typo that was killing GVNPRE of select instructions.
llvm-svn: 37871
2007-07-04 18:26:18 +00:00
Owen Anderson
06dd016177 Fix an error in phi translation of GEPs that was causing failures.
llvm-svn: 37868
2007-07-04 04:51:16 +00:00
Owen Anderson
4a5c005585 Add support for performing GVNPRE on GEP instructions.
llvm-svn: 37862
2007-07-03 23:51:19 +00:00