aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineCombiner.cpp
diff options
context:
space:
mode:
authorGuozhi Wei <carrot@google.com>2022-06-28 21:42:51 +0000
committerGuozhi Wei <carrot@google.com>2022-06-28 21:42:51 +0000
commitddc9e8861ccf8ac3cf45e9d8cda58bdb2b0be63b (patch)
treeba95035430506b2426f3c9a2fc5dc0bb9a05b135 /llvm/lib/CodeGen/MachineCombiner.cpp
parent906f52f2c4fc4cedbe37d420cbd3031da0641d81 (diff)
downloadllvm-ddc9e8861ccf8ac3cf45e9d8cda58bdb2b0be63b.zip
llvm-ddc9e8861ccf8ac3cf45e9d8cda58bdb2b0be63b.tar.gz
llvm-ddc9e8861ccf8ac3cf45e9d8cda58bdb2b0be63b.tar.bz2
[MachineCombiner, AArch64] Add a new pattern A-(B+C) => (A-B)-C to reduce latency
Add a new pattern A - (B + C) ==> (A - B) - C to give machine combiner a chance to evaluate which instruction sequence has lower latency. Differential Revision: https://reviews.llvm.org/D124564
Diffstat (limited to 'llvm/lib/CodeGen/MachineCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCombiner.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineCombiner.cpp b/llvm/lib/CodeGen/MachineCombiner.cpp
index 05e4a1e..722a709 100644
--- a/llvm/lib/CodeGen/MachineCombiner.cpp
+++ b/llvm/lib/CodeGen/MachineCombiner.cpp
@@ -277,6 +277,8 @@ static CombinerObjective getCombinerObjective(MachineCombinerPattern P) {
case MachineCombinerPattern::REASSOC_XA_YB:
case MachineCombinerPattern::REASSOC_XY_AMM_BMM:
case MachineCombinerPattern::REASSOC_XMM_AMM_BMM:
+ case MachineCombinerPattern::SUBADD_OP1:
+ case MachineCombinerPattern::SUBADD_OP2:
return CombinerObjective::MustReduceDepth;
case MachineCombinerPattern::REASSOC_XY_BCA:
case MachineCombinerPattern::REASSOC_XY_BAC: