Skip to content

Commit 26a396c

Browse files
author
Chen Zheng
committed
[PowerPC] support register pressure reduction in machine combiner.
Reassociating some patterns to generate more fma instructions to reduce register pressure. Reviewed By: jsji Differential Revision: https://reviews.llvm.org/D92071
1 parent e561906 commit 26a396c

File tree

5 files changed

+621
-45
lines changed

5 files changed

+621
-45
lines changed

llvm/include/llvm/CodeGen/MachineCombinerPattern.h

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ enum class MachineCombinerPattern {
2929
REASSOC_XY_AMM_BMM,
3030
REASSOC_XMM_AMM_BMM,
3131

32+
// These are patterns matched by the PowerPC to reassociate FMA and FSUB to
33+
// reduce register pressure.
34+
REASSOC_XY_BCA,
35+
REASSOC_XY_BAC,
36+
3237
// These are multiply-add patterns matched by the AArch64 machine combiner.
3338
MULADDW_OP1,
3439
MULADDW_OP2,

llvm/lib/CodeGen/MachineCombiner.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,9 @@ static CombinerObjective getCombinerObjective(MachineCombinerPattern P) {
279279
case MachineCombinerPattern::REASSOC_XY_AMM_BMM:
280280
case MachineCombinerPattern::REASSOC_XMM_AMM_BMM:
281281
return CombinerObjective::MustReduceDepth;
282+
case MachineCombinerPattern::REASSOC_XY_BCA:
283+
case MachineCombinerPattern::REASSOC_XY_BAC:
284+
return CombinerObjective::MustReduceRegisterPressure;
282285
default:
283286
return CombinerObjective::Default;
284287
}

0 commit comments

Comments
 (0)