summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/NewGVN.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* NewGVN: Remove DebugUnknownExprs, just mark the instructions as unusedDaniel Berlin2017-03-061-7/+3
| | | | llvm-svn: 297047
* NewGVN: Only call isInstructionTrivially dead once per instruction.Daniel Berlin2017-03-061-9/+10
| | | | llvm-svn: 297046
* NewGVN: Be consistent in what order we compare operands for swapping.Daniel Berlin2017-03-041-2/+2
| | | | | | NFC. llvm-svn: 296935
* NewGVN: Add debug counter for value numberingDaniel Berlin2017-03-011-5/+15
| | | | llvm-svn: 296665
* PredicateInfo: Support switch statementsDaniel Berlin2017-02-221-14/+22
| | | | | | | | | | | | | | | | | | | 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
* NewGVN: Start making use of predicateinfo pass.Daniel Berlin2017-02-181-18/+275
| | | | | | | | | | | | 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
* NewGVN: Make ranking prefer undef to constants. Fix direction ofDaniel Berlin2017-02-181-8/+9
| | | | | | shouldSwapOperands to be correct. llvm-svn: 295582
* [NewGVN] isOnlyReachableViaThisEdge() is dead now. NFCI.Davide Italiano2017-02-171-18/+0
| | | | llvm-svn: 295503
* [NewGVN] createVariableOrConstant is not required anymore. NFCI.Davide Italiano2017-02-171-8/+0
| | | | llvm-svn: 295500
* NewGVN: Reverse order of congruence class elimination to maximize trivial ↵Daniel Berlin2017-02-121-2/+2
| | | | | | deadness llvm-svn: 294926
* NewGVN: Use shouldSwapOperands in one more placeDaniel Berlin2017-02-121-1/+1
| | | | llvm-svn: 294925
* Revert accidental commit titled "testing"Daniel Berlin2017-02-121-1/+1
| | | | | | This reverts commit r294919 llvm-svn: 294923
* NewGVN: Apply the fast math flags fix in r267113 to NewGVN as well.Daniel Berlin2017-02-121-23/+26
| | | | llvm-svn: 294922
* NewGVN: Fix missed call that should be to shouldSwapOperandsDaniel Berlin2017-02-121-1/+0
| | | | llvm-svn: 294920
* testingDaniel Berlin2017-02-121-1/+2
| | | | llvm-svn: 294919
* NewGVN: Reverse sense of this test to make it clearerDaniel Berlin2017-02-111-5/+7
| | | | llvm-svn: 294851
* NewGVN: Add missing initialization of NumFuncArgs lost due to bad merge.Daniel Berlin2017-02-111-0/+1
| | | | llvm-svn: 294850
* NewGVN: Rank and order commutative operands consistently.Daniel Berlin2017-02-111-2/+40
| | | | llvm-svn: 294849
* NewGVN: Clean up how we handle the INITIAL class so that everything inDaniel Berlin2017-02-111-16/+38
| | | | | | | | | | | | | | | | | | 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
* Move symbols from the global namespace into (anonymous) namespaces. NFC.Benjamin Kramer2017-02-111-9/+2
| | | | llvm-svn: 294837
* NewGVN: Dead argument cleanupDaniel Berlin2017-01-311-91/+63
| | | | llvm-svn: 293708
* NewGVN: Cleanup conditions to match realityDaniel Berlin2017-01-311-13/+8
| | | | llvm-svn: 293707
* NewGVN: Add basic support for symbolic comparison evaluationDaniel Berlin2017-01-311-3/+20
| | | | llvm-svn: 293706
* NewGVN: Formatting cleanup after lookupOperandLeader changeDaniel Berlin2017-01-311-6/+3
| | | | llvm-svn: 293705
* NewGVN: Remove the unsued two arguments from lookupOperandLeader.Daniel Berlin2017-01-311-21/+17
| | | | llvm-svn: 293704
* NewGVN: Cleanup header files we are using.Daniel Berlin2017-01-311-5/+0
| | | | llvm-svn: 293703
* NewGVN: Instead of changeToUnreachable, insert an instruction SimplifyCFG ↵Daniel Berlin2017-01-301-4/+5
| | | | | | will turn into unreachable when it runs llvm-svn: 293515
* Revert "NewGVN: Make unreachable blocks be marked with unreachable"Daniel Berlin2017-01-301-13/+18
| | | | | | | | | 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
* NewGVN: Fix where newline is printed in debug printing of memory equivalenceDaniel Berlin2017-01-291-1/+1
| | | | llvm-svn: 293428
* Remove inclusion of SSAUpdater from several passes.Davide Italiano2017-01-291-1/+0
| | | | | | | | It is, in fact, unused. Found while reviewing Danny's new SSAUpdater and porting passes to it to see how the new API looked like. llvm-svn: 293407
* Fix unused variable warning.Richard Trieu2017-01-271-0/+1
| | | | llvm-svn: 293260
* NewGVN: Add basic dead and redundant store eliminationDaniel Berlin2017-01-271-29/+114
| | | | | | | | | | | | | | | | | | | | Summary: This adds basic dead and redundant store elimination to NewGVN. Unlike our current DSE, it will happily do cross-block DSE if it meets our requirements. We get a bunch of DSE's simple.ll cases, and some stuff it doesn't. Unlike DSE, however, we only try to eliminate stores of the same value to the same memory location, not just general stores to the same memory location. Reviewers: davide Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29149 llvm-svn: 293258
* NewGVN: Fix bug exposed by PR31761Daniel Berlin2017-01-261-43/+83
| | | | | | | | | | | | | | | | | | | Summary: This does not actually fix the testcase in PR31761 (discussion is ongoing on the testcase), but does fix a bug it exposes, where stores were not properly clobbering loads. We accomplish this by unifying the memory equivalence infratructure back into the normal congruence infrastructure, and then properly destroying congruence classes when memory state leaders disappear. Reviewers: davide Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29195 llvm-svn: 293216
* NewGVN: Add algorithm overviewDaniel Berlin2017-01-261-0/+21
| | | | llvm-svn: 293212
* NewGVN: Make unreachable blocks be marked with unreachableDaniel Berlin2017-01-261-18/+13
| | | | llvm-svn: 293196
* [NewGVN] Skip uses in unreachable blocks.Davide Italiano2017-01-261-0/+6
| | | | | | | | Otherwise we ask for a domtree node that's not there, and we crash. Differential Revision: https://reviews.llvm.org/D29145 llvm-svn: 293122
* [NewGVN] Simplify folding a lambda used only once. NFCI.Davide Italiano2017-01-251-5/+3
| | | | llvm-svn: 293112
* [NewGVN] Optimize processing for instructions found trivially dead.Davide Italiano2017-01-201-3/+19
| | | | | | | | | | | Don't call `isTriviallyDeadInstructions()` once we discover that an instruction is dead. Instead, set DFS number zero (as suggested by Danny) and forget about it (this also speeds up things as we won't try to reprocess that block). Differential Revision: https://reviews.llvm.org/D28930 llvm-svn: 292676
* NewGVN: Fix PR 31686 and PR 31698 by rewriting store leader handling.Daniel Berlin2017-01-201-36/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This rewrites store expression/leader handling. We no longer use the value operand as the leader, instead, we store it separately. We also now store the stored value as part of the expression, and compare it when comparing stores for equality. This enables us to get rid of a bunch of our previous hacks and machinations, as the existing machinery takes care of everything *except* updating the stored value on classes. The only time we have to update it is if the storecount goes to 0, and when we do, we destroy it. Since we no longer use the value operand as the leader, during elimination, we have to use the value operand. Doing this also fixes a bunch of store forwarding cases we were missing. Any value operand we use is guaranteed to either be updated by previous eliminations, or minimized by future ones. (IE the fact that we don't use the most dominating value operand when it's not a constant does not affect anything). Sadly, this change also exposes that we didn't pay attention to the output of the pr31594.ll test, as it also very clearly exposes the same store leader bug we are fixing here. (I added pr31682.ll anyway, but maybe we think that's too large to be useful) On the plus side, propagate-ir-flags.ll now passes due to the corrected store forwarding. This change was 3 stage'd on darwin and linux, with the full test-suite. Reviewers: davide Subscribers: llvm-commits llvm-svn: 292648
* NewGVN: Fix PR 31682, an overactive assert.Daniel Berlin2017-01-201-10/+16
| | | | | | | | Part of the assert has been left active for further debugging. The other part has been turned into a stat for tracking for the moment. llvm-svn: 292583
* [NewGVN] We don't use postdom info anymore. Update.Davide Italiano2017-01-181-1/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D28842 llvm-svn: 292421
* NewGVN: Change a bunch of densemap find_or_creates to lookups, since they ↵Daniel Berlin2017-01-151-8/+8
| | | | | | should not be creating new entries llvm-svn: 292059
* [NewGVN] Fix a warning from GCC.Davide Italiano2017-01-141-7/+6
| | | | | | | Patch by Gonsolo. Differential Revision: https://reviews.llvm.org/D28731 llvm-svn: 292031
* [NewGVN] clang-format this file after recent changes.Davide Italiano2017-01-141-6/+7
| | | | llvm-svn: 292026
* [NewGVN] Try to be consistent wit the style used in this file. NFCI.Davide Italiano2017-01-141-1/+1
| | | | llvm-svn: 292025
* NewGVN: Kill unneeded DFSDomMap, cleanup a few comments.Daniel Berlin2017-01-141-13/+7
| | | | llvm-svn: 291981
* NewGVN: Move leaders around properly to ensure we have a canonical ↵Daniel Berlin2017-01-131-40/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | dominating leader. Fixes PR 31613. Summary: This is a testcase where phi node cycling happens, and because we do not order the leaders by domination or anything similar, the leader keeps changing. Using std::set for the members is too expensive, and we actually don't need them sorted all the time, only at leader changes. We could keep both a set and a vector, and keep them mostly sorted and resort as necessary, or use a set and a fibheap, but all of this seems premature. After running some statistics, we are able to avoid the vast majority of sorting by keeping a "next leader" field. Most congruence classes only have leader changes once or twice during GVN. Reviewers: davide Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28594 llvm-svn: 291968
* [NewGVN] Fixup store count for the `initial` congruency class.Davide Italiano2017-01-111-3/+6
| | | | | | | | | | | | It was always zero. When we move a store from `initial` to its own congruency class, we end up with a negative store count, which is obviously wrong. Also, while here, change StoreCount to be signed so that the assertions actually fire. Ack'ed by Daniel Berlin. llvm-svn: 291725
* Revert "[NewGVN] Strengthen a couple of assertions."Davide Italiano2017-01-111-2/+2
| | | | | | It's breaking some bots. Will investigate and recommit. llvm-svn: 291712
* [NewGVN] Parenthesise assertion condition (-Wparenthesis).Davide Italiano2017-01-111-5/+4
| | | | | | Format an assertion message while I'm here. llvm-svn: 291710
OpenPOWER on IntegriCloud