Daniel Berlin
a823656ce7
NewGVN: Make CongruenceClass a real class in preparation for splitting
...
NewGVN into analysis and eliminator.
llvm-svn: 299792
2017-04-07 18:38:09 +00:00
Daniel Berlin
21279bd37a
NewGVN: Rename some functions for consistency
...
llvm-svn: 299685
2017-04-06 18:52:58 +00:00
Daniel Berlin
08fe6e0f74
NewGVN: Fixup some small issues
...
llvm-svn: 299684
2017-04-06 18:52:55 +00:00
Daniel Berlin
5845e0549e
NewGVN: Fix a small formatting issue in performSymbolicLoadEvaluation.
...
llvm-svn: 299683
2017-04-06 18:52:53 +00:00
Daniel Berlin
1316a94ebc
NewGVN: This patch makes memory congruence work for all types of
...
memorydefs, not just stores. Along the way, we audit and fixup issues
about how we were tracking memory leaders, and improve the verifier
to notice more memory congruency issues.
llvm-svn: 299682
2017-04-06 18:52:50 +00:00
Daniel Berlin
3082b8e062
MemorySSA: Fix and use optimized_def_chain
...
llvm-svn: 299566
2017-04-05 17:26:25 +00:00
Daniel Berlin
07daac8a36
NewGVN: Handle coercion of constant stores, loads, memory insts.
...
Summary:
Depends on D30928.
This adds support for coercion of stores and memory instructions that do not require insertion to process.
Another few tests down.
I added the relevant tests from rle.ll
Reviewers: davide
Subscribers: llvm-commits, Prazek
Differential Revision: https://reviews.llvm.org/D30929
llvm-svn: 299330
2017-04-02 13:23:44 +00:00
Daniel Berlin
9a9c9ff260
NewGVN: Don't try to kill off the stored value of stores when
...
processing the congruence class of the store.
Because we use the stored value of a store as the def, it isn't dead
just because it appears as a def when it comes from a store.
Note: I have not hit any cases with the memory code as it is where
this breaks anything, just because of what memory congruences we
actually allow. In a followup that improves memory congruence,
this bug actually breaks real stuff (but the verifier catches it).
llvm-svn: 299300
2017-04-01 09:44:33 +00:00
Daniel Berlin
9b4984926c
NewGVN: Clean up GVNExpression memory hierarchy, restructure hash computation a bit so we don't have to redefine it for loads, stores, and calls
...
llvm-svn: 299299
2017-04-01 09:44:29 +00:00
Daniel Berlin
871ecd90ca
NewGVN: Use def_chain iterator in singleReachablePhiPath instead of recursion
...
llvm-svn: 299298
2017-04-01 09:44:24 +00:00
Davide Italiano
e9781e7b2f
[NewGVN] Adjust NDEBUG markers.
...
This avoids 'used but not defined' warnings in Release builds
with GCC.
llvm-svn: 298760
2017-03-25 02:40:02 +00:00
Daniel Berlin
ffc30781f4
NewGVN: Small cleanup of two dominance related functions to make
...
them easier to understand.
llvm-svn: 298692
2017-03-24 06:33:51 +00:00
Daniel Berlin
0e9001131d
NewGVN: Small cleanup of useless expression deletion, and don't uselessly create two expressions in symbolic store evaluation.
...
llvm-svn: 298691
2017-03-24 06:33:48 +00:00
Daniel Berlin
9d0796e5d0
NewGVN: Fix PR32403 - Handling of undef in phis was not quite correct
...
due to LLVM's view of phi nodes. It would cause NewGVN not to fixpoint
in some interesting edge cases.
llvm-svn: 298687
2017-03-24 05:30:34 +00:00
Daniel Berlin
46b72e6de6
NewGVN: Now that we have a better verifier, we can prove that we can erase the predicateuser set each time we mark it touched
...
llvm-svn: 298199
2017-03-19 00:07:32 +00:00
Daniel Berlin
d43f0ee7e1
NewGVN: Remove dead code (for now)
...
llvm-svn: 298198
2017-03-19 00:07:27 +00:00
Daniel Berlin
06329a98e3
NewGVN: Greatly enhance the ability of the NewGVN verifier to detect
...
issues, subsuming previous verifier.
llvm-svn: 298188
2017-03-18 15:41:40 +00:00
Daniel Berlin
41b39169e2
NewGVN: Fix PHI evaluation bug exposed by new verifier. We were checking whether the incoming block was reachable instead of whether the specific edge was reachable
...
llvm-svn: 298187
2017-03-18 15:41:36 +00:00
Daniel Berlin
64e689938d
Split NewGVN class into a legacy pass and an impl, instead of a merged class.
...
llvm-svn: 297576
2017-03-12 04:46:45 +00:00
Daniel Berlin
5c338ff7a3
NewGVN: Rename InitialClass to TOP, which is what most people would expect it to be called
...
llvm-svn: 297494
2017-03-10 19:05:04 +00:00
Daniel Berlin
e3e69e1680
NewGVN: Rewrite DCE during elimination so we do it as well as old GVN did.
...
llvm-svn: 297428
2017-03-10 00:32:33 +00:00
Daniel Berlin
c0e008d807
NewGVN: Rename a few things for clarity
...
llvm-svn: 297427
2017-03-10 00:32:26 +00:00
Daniel Berlin
343576a6f4
NewGVN: Remove DebugUnknownExprs, just mark the instructions as unused
...
llvm-svn: 297047
2017-03-06 18:42:39 +00:00
Daniel Berlin
856fa14e06
NewGVN: Only call isInstructionTrivially dead once per instruction.
...
llvm-svn: 297046
2017-03-06 18:42:27 +00:00
Daniel Berlin
0350a87ce3
NewGVN: Be consistent in what order we compare operands for swapping.
...
NFC.
llvm-svn: 296935
2017-03-04 00:44:43 +00:00
Daniel Berlin
283a60875e
NewGVN: Add debug counter for value numbering
...
llvm-svn: 296665
2017-03-01 19:59:26 +00:00
Daniel Berlin
fccbda967a
PredicateInfo: Support switch statements
...
Summary:
Depends on D29606 and D29682
Makes us pass GVN's edge.ll (we also will pass a few other testcases
they just need cleaning up).
Thoughts on the Predicate* hiearchy of classes especially welcome :)
(it's not clear to me how best to organize it, and currently, the getBlock* seems ... uglier than maybe wasting a field somewhere or something).
Reviewers: davide
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D29747
llvm-svn: 295889
2017-02-22 22:20:58 +00:00
Daniel Berlin
f7d9580a08
NewGVN: Start making use of predicateinfo pass.
...
Summary: This begins using the predicateinfo pass in NewGVN.
Reviewers: davide
Subscribers: llvm-commits, Prazek
Differential Revision: https://reviews.llvm.org/D29682
llvm-svn: 295583
2017-02-18 23:06:50 +00:00
Daniel Berlin
b355c4ff5f
NewGVN: Make ranking prefer undef to constants. Fix direction of
...
shouldSwapOperands to be correct.
llvm-svn: 295582
2017-02-18 23:06:47 +00:00
Davide Italiano
bca05df38b
[NewGVN] isOnlyReachableViaThisEdge() is dead now. NFCI.
...
llvm-svn: 295503
2017-02-17 22:12:30 +00:00
Davide Italiano
6db0ecafd7
[NewGVN] createVariableOrConstant is not required anymore. NFCI.
...
llvm-svn: 295500
2017-02-17 21:55:47 +00:00
Daniel Berlin
4d54796f87
NewGVN: Reverse order of congruence class elimination to maximize trivial deadness
...
llvm-svn: 294926
2017-02-12 23:24:45 +00:00
Daniel Berlin
508a1dec94
NewGVN: Use shouldSwapOperands in one more place
...
llvm-svn: 294925
2017-02-12 23:24:42 +00:00
Daniel Berlin
31e1b8fe48
Revert accidental commit titled "testing"
...
This reverts commit r294919
llvm-svn: 294923
2017-02-12 22:40:10 +00:00
Daniel Berlin
86eab15f2b
NewGVN: Apply the fast math flags fix in r267113 to NewGVN as well.
...
llvm-svn: 294922
2017-02-12 22:25:20 +00:00
Daniel Berlin
eccb8740d1
NewGVN: Fix missed call that should be to shouldSwapOperands
...
llvm-svn: 294920
2017-02-12 22:02:47 +00:00
Daniel Berlin
3fecad0d3e
testing
...
llvm-svn: 294919
2017-02-12 22:02:20 +00:00
Daniel Berlin
22a4a01ffa
NewGVN: Reverse sense of this test to make it clearer
...
llvm-svn: 294851
2017-02-11 15:20:15 +00:00
Daniel Berlin
1529bb93c9
NewGVN: Add missing initialization of NumFuncArgs lost due to bad merge.
...
llvm-svn: 294850
2017-02-11 15:13:49 +00:00
Daniel Berlin
1c08767f88
NewGVN: Rank and order commutative operands consistently.
...
llvm-svn: 294849
2017-02-11 15:07:01 +00:00
Daniel Berlin
b79f53669a
NewGVN: Clean up how we handle the INITIAL class so that everything in
...
it is dead or unreachable, as it should be.
This also makes the leader of INITIAL undef, enabling us to handle
irreducibility properly.
Summary:
This lets us verify, more than we do now, that we didn't screw up
value numbering.
Reviewers: davide
Subscribers: Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D29842
llvm-svn: 294844
2017-02-11 12:48:50 +00:00
Benjamin Kramer
efcf06f5f2
Move symbols from the global namespace into (anonymous) namespaces. NFC.
...
llvm-svn: 294837
2017-02-11 11:06:55 +00:00
Daniel Berlin
97718e6081
NewGVN: Dead argument cleanup
...
llvm-svn: 293708
2017-01-31 22:32:03 +00:00
Daniel Berlin
ff12c922fe
NewGVN: Cleanup conditions to match reality
...
llvm-svn: 293707
2017-01-31 22:32:01 +00:00
Daniel Berlin
c22aafe5b3
NewGVN: Add basic support for symbolic comparison evaluation
...
llvm-svn: 293706
2017-01-31 22:31:58 +00:00
Daniel Berlin
808e3ff8a2
NewGVN: Formatting cleanup after lookupOperandLeader change
...
llvm-svn: 293705
2017-01-31 22:31:56 +00:00
Daniel Berlin
203f47bbd8
NewGVN: Remove the unsued two arguments from lookupOperandLeader.
...
llvm-svn: 293704
2017-01-31 22:31:53 +00:00
Daniel Berlin
74d300361a
NewGVN: Cleanup header files we are using.
...
llvm-svn: 293703
2017-01-31 22:31:50 +00:00
Daniel Berlin
a53a72243a
NewGVN: Instead of changeToUnreachable, insert an instruction SimplifyCFG will turn into unreachable when it runs
...
llvm-svn: 293515
2017-01-30 18:12:56 +00:00
Daniel Berlin
e19f0e01a8
Revert "NewGVN: Make unreachable blocks be marked with unreachable"
...
This reverts commit r293196
Besides making things look nicer, ATM, we'd like to preserve analysis
more than we'd like to destroy the CFG. We'll probably revisit in the future
llvm-svn: 293501
2017-01-30 17:06:55 +00:00