summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/GlobalISel
Commit message (Collapse)AuthorAgeFilesLines
* Fix warnings as errors that occur on sanitizer-x86_64-linuxDaniel Sanders2020-01-071-4/+4
|
* Remove extraneous semicolon.Bill Wendling2020-01-071-1/+1
|
* [gicombiner] Add GIMatchTree and use it for the code generationDaniel Sanders2020-01-0710-0/+1570
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: GIMatchTree's job is to build a decision tree by zipping all the GIMatchDag's together. Each DAG is added to the tree builder as a leaf and partitioners are used to subdivide each node until there are no more partitioners to apply. At this point, the code generator is responsible for testing any untested predicates and following any unvisited traversals (there shouldn't be any of the latter as the getVRegDef partitioner handles them all). Note that the leaves don't always fit into partitions cleanly and the partitions may overlap as a result. This is resolved by cloning the leaf into every partition it belongs to. One example of this is a rule that can match one of N opcodes. The leaf for this rule would end up in N partitions when processed by the opcode partitioner. A similar example is the getVRegDef partitioner where having rules (add $a, $b), and (add ($a, $b), $c) will result in the former being in the partition for successfully following the vreg-def and failing to do so as it doesn't care which happens. Depends on D69151 Fixed the issues with the windows bots which were caused by stdout/stderr interleaving. Reviewers: bogner, volkan Reviewed By: volkan Subscribers: lkail, mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69152
* Revert "[gicombiner] Add GIMatchTree and use it for the code generation"Daniel Sanders2020-01-0310-1570/+0
| | | | | | | | | All the windows bots are failing match-tree.td and there's no obvious cause that I can see. It's not just the %p formatting problem. My best guess is that there's an ordering issue too but I'll need further information to figure that out. Revert while I'm investigating. This reverts commit 64f1bb5cd2c6d69af7c74ec68840029603560238 and 77d4b5f5feff663e70b347516cc4c77fa5cd2a20
* [gicombiner] Add GIMatchTree and use it for the code generationDaniel Sanders2020-01-0310-0/+1570
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: GIMatchTree's job is to build a decision tree by zipping all the GIMatchDag's together. Each DAG is added to the tree builder as a leaf and partitioners are used to subdivide each node until there are no more partitioners to apply. At this point, the code generator is responsible for testing any untested predicates and following any unvisited traversals (there shouldn't be any of the latter as the getVRegDef partitioner handles them all). Note that the leaves don't always fit into partitions cleanly and the partitions may overlap as a result. This is resolved by cloning the leaf into every partition it belongs to. One example of this is a rule that can match one of N opcodes. The leaf for this rule would end up in N partitions when processed by the opcode partitioner. A similar example is the getVRegDef partitioner where having rules (add $a, $b), and (add ($a, $b), $c) will result in the former being in the partition for successfully following the vreg-def and failing to do so as it doesn't care which happens. Depends on D69151 Reviewers: bogner, volkan Reviewed By: volkan Subscribers: lkail, mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69152
* Revert "Temporarily Revert "[gicombiner] Add the MatchDag structure and ↵Daniel Sanders2019-12-1813-0/+1088
| | | | | | | | | | | | | | | | | | | parse instruction DAG's from the input"" This reverts commit e62e760f29567fe0841af870c65a4f8ef685d217. The issue @uweigand raised should have been fixed by iterating over the vector that owns the operand list data instead of the FoldingSet. The MSVC issue raised by @thakis should have been fixed by relaxing the regexes a little. I don't have a Windows machine available to test that so I tested it by using `perl -p -e 's/0x([0-9a-f]+)/\U\1\E/g' to convert the output of %p to the windows style. I've guessed at the issue @phosek raised as there wasn't enough information to investigate it. What I think is happening on that bot is the -debug option isn't available because the second stage build is a release build. I'm not sure why other release-mode bots didn't report it though.
* Temporarily Revert "[gicombiner] Add the MatchDag structure and parse ↵Eric Christopher2019-12-1713-1088/+0
| | | | | | | | | | | | instruction DAG's from the input" and follow-on patches. This is breaking a few build bots and local builds with follow-up already on the patch thread. This reverts commits 390c8baa5440dda8907688d9ef860f6982bd925f and 520e3d66e7257c77f1226185504bbe1cb90afcfa.
* [gicombiner] Process the MatchDag such that every node is reachable from the ↵Daniel Sanders2019-12-173-0/+35
| | | | | | | | | | | | | | | | | roots Summary: When we build the walk across these DAG's we need to be able to reach every node from the roots. Flip and traversal edges (so that use->def becomes def->uses) that make nodes unreachable. Note that early on we'll just error out on these flipped edges as def->uses edges are more complicated to match due to their one->many nature. Depends on D69077 Reviewers: volkan, bogner Subscribers: llvm-commits
* [gicombiner] Add the MatchDag structure and parse instruction DAG's from the ↵Daniel Sanders2019-12-1713-0/+1053
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | input Summary: The MatchDag structure is a representation of the checks that need to be performed and the dependencies that limit when they can happen. There are two kinds of node in the MatchDag: * Instrs - Represent a MachineInstr * Predicates - Represent a check that needs to be performed (i.e. opcode, is register, same machine operand, etc.) and two kinds of edges: * (Traversal) Edges - Represent a register that can be traversed to find one instr from another * Predicate Dependency Edges - Indicate that a predicate requires a piece of information to be tested. For example, the matcher: (match (MOV $t, $s), (MOV $d, $t)) with MOV declared as an instruction of the form: %dst = MOV %src1 becomes the following MatchDag with the following instruction nodes: __anon0_0 // $t=getOperand(0), $s=getOperand(1) __anon0_1 // $d=getOperand(0), $t=getOperand(1) traversal edges: __anon0_1[src1] --[t]--> __anon0_0[dst] predicate nodes: <<$mi.getOpcode() == MOV>>:$__anonpred0_2 <<$mi.getOpcode() == MOV>>:$__anonpred0_3 and predicate dependencies: __anon0_0 ==> __anonpred0_2[mi] __anon0_0 ==> __anonpred0_3[mi] The result of this parse is currently unused but can be tested using -gicombiner-stop-after-parse as done in parse-match-pattern.td. The dump for testing includes a graphviz format dump to allow the rule to be viewed visually. Later on, these MatchDag's will be used to generate code and to build an efficient decision tree. Reviewers: volkan, bogner Reviewed By: volkan Subscribers: arsenm, mgorny, mgrang, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69077
* [gicombiner] Add a CodeExpander to handle C++ fragments with variable expansionDaniel Sanders2019-10-034-0/+198
| | | | | | | | | | | | | | | | | | | | | | | Summary: This will handle expansion of C++ fragments in the declarative combiner including custom predicates, and escapes into C++ to aid the migration effort. Fixed the -DLLVM_LINK_LLVM_DYLIB=ON using DISABLE_LLVM_LINK_LLVM_DYLIB when creating the library. Apparently it automatically links to libLLVM.dylib and we don't want that from tablegen. Reviewers: bogner, volkan Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68288 > llvm-svn: 373551 llvm-svn: 373651
* Revert 373551 (CodeExpander.cpp CMake issue)Kristina Brooks2019-10-034-198/+0
| | | | | | | | Fix buildbots and revert the CodeExpander commit. (See http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190930/699857.html ) llvm-svn: 373581
* Revert 373555: libLLVM+modules failure with CMake 3.10.2Kristina Brooks2019-10-031-1/+1
| | | | | | | | | This reverts rL373555. I've sent an email out regarding the issue. Commit on GitHub: https://github.com/llvm/llvm-project/commit/45f682f47129c05414d4c5ae7be851772273978f llvm-svn: 373579
* [gicombiner] Make rL373551 compatible with older cmakesDaniel Sanders2019-10-031-1/+1
| | | | | | | Newer cmakes appear to be more flexible w.r.t object libraries. Convert to a static library so that it works with older cmakes too llvm-svn: 373555
* [gicombiner] Add a CodeExpander to handle C++ fragments with variable expansionDaniel Sanders2019-10-034-0/+198
Summary: This will handle expansion of C++ fragments in the declarative combiner including custom predicates, and escapes into C++ to aid the migration effort. Reviewers: bogner, volkan Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68288 llvm-svn: 373551
OpenPOWER on IntegriCloud