summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/Util/PredicateInfo
Commit message (Collapse)AuthorAgeFilesLines
* [PredicateInfo] Use SmallVector instead of SmallPtrSet.Florian Hahn2019-07-252-16/+16
| | | | | | | | | | | | | | | | | | | | We do not need the SmallPtrSet to avoid adding duplicates to OpsToRename, because we already keep a ValueInfo mapping. If we see an op for the first time, Infos will be empty and we can also add it to OpsToRename. We process operands by visiting BBs depth-first and then iterate over all instructions & users, so the order should be deterministic. Therefore we can skip one round of sorting, which we purely needed for guaranteeing a deterministic order when iterating over the SmallPtrSet. Reviewers: efriedma, davide Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D64816 llvm-svn: 367028
* [PredicateInfo] Do not process unreachable operands.Taewook Oh2019-05-151-0/+25
| | | | | | | | | | | | | | Summary: We should excluded unreachable operands from processing as their DFS visitation order is undefined. When `renameUses` function sorts `OpsToRename` (https://fburl.com/d2wubn60), the comparator assumes that the parent block of the operand has a corresponding dominator tree node. This is not the case for unreachable operands and crashes the compiler. Reviewers: dberlin, mgrang, davide Subscribers: efriedma, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61154 llvm-svn: 360796
* Revert "Temporarily Revert "Add basic loop fusion pass.""Eric Christopher2019-04-178-0/+1268
| | | | | | | | The reversion apparently deleted the test/Transforms directory. Will be re-reverting again. llvm-svn: 358552
* Temporarily Revert "Add basic loop fusion pass."Eric Christopher2019-04-178-1268/+0
| | | | | | | | As it's causing some bot failures (and per request from kbarton). This reverts commit r358543/ab70da07286e618016e78247e4a24fcb84077fda. llvm-svn: 358546
* [PredicateInfo] Use custom mangling to support ssa_copy with unnamed types.Florian Hahn2018-07-245-66/+102
| | | | | | | | | | | | | | | | | | This is a workaround and it would be better to fix this generally, but doing it generally is quite tricky. See D48541 and PR38117. Doing it in PredicateInfo directly allows us to use the type address to differentiate different unnamed types, because neither the created declarations nor the ssa_copy calls should be visible after PredicateInfo got destroyed. Reviewers: efriedma, davide Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D49126 llvm-svn: 337828
* [PredicateInfo] Order instructions in different BBs by DFSNumIn.Florian Hahn2018-06-201-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | Using OrderedInstructions::dominates as comparator for instructions in BBs without dominance relation can cause a non-deterministic order between such instructions. That in turn can cause us to materialize copies in a non-deterministic order. While this does not effect correctness, it causes some minor non-determinism in the final generated code, because values have slightly different labels. Without this patch, running -print-predicateinfo on a reasonably large module produces slightly different output on each run. This patch uses the dominator trees DFSInNum to order instruction from different BBs, which should enforce a deterministic ordering and guarantee that dominated instructions come after the instructions that dominate them. Reviewers: dberlin, efriedma, davide Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D48230 llvm-svn: 335150
* [ADT] Enable reverse iteration for DenseMapMandeep Singh Grang2017-08-242-688/+0
| | | | | | | | | | | | Reviewers: mehdi_amini, dexonsmith, dblaikie, davide, chandlerc, davidxl, echristo, efriedma Reviewed By: dblaikie Subscribers: rsmith, mgorny, emaste, llvm-commits Differential Revision: https://reviews.llvm.org/D35043 llvm-svn: 311730
* PredicateInfo: Don't insert conditional info when a conditional branch jumps ↵Daniel Berlin2017-06-142-0/+161
| | | | | | to the same target regardless of condition llvm-svn: 305416
* Introduce the new feature "abi-breaking-checks" to satisfy -reverse-iterate ↵NAKAMURA Takumi2017-06-072-2/+2
| | | | | | | | | | | | | in llvm/test/Transforms/Util/PredicateInfo/ A few tests in llvm/test/Transforms/Util/PredicateInfo/ are using -reverse-iterate. The option -reverse-iterate is enabled with +Asserts in usual cases, but it can be turned on/off regardless of LLVM_ENABLE_ASSERTIONS. I wonder if this were incompatible to https://reviews.llvm.org/D33908 (r304757). Differential Revision: https://reviews.llvm.org/D33854 llvm-svn: 304851
* [PredicateInfo] Enable -reverse-iterate tests only for +Asserts buildsMandeep Singh Grang2017-06-014-2/+688
| | | | | | | | | | | | | | Summary: The flag -reverse-iterate is present only on +Asserts builds. Reviewers: dberlin, davide, RKSimon, efriedma, chapuni Reviewed By: efriedma, chapuni Subscribers: chapuni, llvm-commits Differential Revision: https://reviews.llvm.org/D33795 llvm-svn: 304498
* [PredicateInfo] Fix non-determinism in codegen uncovered by reverse ↵Mandeep Singh Grang2017-06-012-16/+18
| | | | | | | | | | | | | | | | | | | iterating SmallPtrSet Summary: Sort OpsToRename before iterating to make iteration order deterministic. Thanks to Daniel Berlin for the sorting logic. Reviewers: dberlin, RKSimon, efriedma, davide Reviewed By: dberlin, davide Subscribers: sanjoy, davide, llvm-commits Differential Revision: https://reviews.llvm.org/D33265 llvm-svn: 304447
* PredicateInfo: Support switch statementsDaniel Berlin2017-02-222-5/+13
| | | | | | | | | | | | | | | | | | | 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
* PredicateInfo: Clean up predicate info a little, using insertionDaniel Berlin2017-02-182-8/+15
| | | | | | helpers, and fixing support for the renaming the comparison. llvm-svn: 295581
* PredicateInfo: Handle critical edgesDaniel Berlin2017-02-124-42/+351
| | | | | | | | | | | | | | | | | Summary: This adds support for placing predicateinfo such that it affects critical edges. This fixes the issues mentioned by Nuno on the mailing list. Depends on D29519 Reviewers: davide, nlopes Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29606 llvm-svn: 294921
* Add PredicateInfo utility and printing passDaniel Berlin2017-02-072-0/+668
Summary: This patch adds a utility to build extended SSA (see "ABCD: eliminating array bounds checks on demand"), and an intrinsic to support it. This is then used to get functionality equivalent to propagateEquality in GVN, in NewGVN (without having to replace instructions as we go). It would work similarly in SCCP or other passes. This has been talked about a few times, so i built a real implementation and tried to productionize it. Copies are inserted for operands used in assumes and conditional branches that are based on comparisons (see below for more) Every use affected by the predicate is renamed to the appropriate intrinsic result. E.g. %cmp = icmp eq i32 %x, 50 br i1 %cmp, label %true, label %false true: ret i32 %x false: ret i32 1 will become %cmp = icmp eq i32, %x, 50 br i1 %cmp, label %true, label %false true: ; Has predicate info ; branch predicate info { TrueEdge: 1 Comparison: %cmp = icmp eq i32 %x, 50 } %x.0 = call @llvm.ssa_copy.i32(i32 %x) ret i32 %x.0 false: ret i23 1 (you can use -print-predicateinfo to get an annotated-with-predicateinfo dump) This enables us to easily determine what operations are affected by a given predicate, and how operations affected by a chain of predicates. Reviewers: davide, sanjoy Subscribers: mgorny, llvm-commits, Prazek Differential Revision: https://reviews.llvm.org/D29519 Update for review comments Fix a bug Nuno noticed where we are giving information about and/or on edges where the info is not useful and easy to use wrong Update for review comments llvm-svn: 294351
OpenPOWER on IntegriCloud