diff options
author | QingShan Zhang <qshanz@cn.ibm.com> | 2019-12-10 03:10:21 +0000 |
---|---|---|
committer | QingShan Zhang <qshanz@cn.ibm.com> | 2019-12-10 03:10:21 +0000 |
commit | 05b0c76aa76ebdd77cae6c13aacb0079d49b4350 (patch) | |
tree | a091954b133ca74981a61c44871f3c5f37a71d0d /llvm/lib/CodeGen/MacroFusion.cpp | |
parent | 22d516261a98fd56ccce39b3031fdba8d64de696 (diff) | |
download | bcm5719-llvm-05b0c76aa76ebdd77cae6c13aacb0079d49b4350.tar.gz bcm5719-llvm-05b0c76aa76ebdd77cae6c13aacb0079d49b4350.zip |
[NFC][MacroFusion] Adding the assertion if someone want to fuse more than 2 instructions
As discussed in https://reviews.llvm.org/D69998, we miss to create some dependency edges
if chained more than 2 instructions. Adding an assertion here if someone want to chain
more than 2 instructions.
Differential Revision: https://reviews.llvm.org/D71180
Diffstat (limited to 'llvm/lib/CodeGen/MacroFusion.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MacroFusion.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MacroFusion.cpp b/llvm/lib/CodeGen/MacroFusion.cpp index 26cbc14166b..d2ee21c8720 100644 --- a/llvm/lib/CodeGen/MacroFusion.cpp +++ b/llvm/lib/CodeGen/MacroFusion.cpp @@ -71,6 +71,14 @@ static bool fuseInstructionPair(ScheduleDAGInstrs &DAG, SUnit &FirstSU, if (!DAG.addEdge(&SecondSU, SDep(&FirstSU, SDep::Cluster))) return false; + // TODO - If we want to chain more than two instructions, we need to create + // artifical edges to make dependencies from the FirstSU also dependent + // on other chained instructions, and other chained instructions also + // dependent on the dependencies of the SecondSU, to prevent them from being + // scheduled into these chained instructions. + assert(hasLessThanNumFused(FirstSU, 2) && + "Currently we only support chaining together two instructions"); + // Adjust the latency between both instrs. for (SDep &SI : FirstSU.Succs) if (SI.getSUnit() == &SecondSU) |