Skip to content

Commit 63f902d

Browse files
committed
[RISCV] Disable this transform by default, except for SpacemiT X60
1 parent 6df5335 commit 63f902d

15 files changed

+2248
-1824
lines changed

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,9 @@ def TuneVentanaVeyron : SubtargetFeature<"ventana-veyron", "RISCVProcFamily", "V
14171417
def TuneVXRMPipelineFlush : SubtargetFeature<"vxrm-pipeline-flush", "HasVXRMPipelineFlush",
14181418
"true", "VXRM writes causes pipeline flush">;
14191419

1420+
def TuneCheapVWMul : SubtargetFeature<"cheap-vwmul", "HasCheapVWMul", "true",
1421+
"Fold vector shift of sign/zero extension to widening multiply">;
1422+
14201423
// Assume that lock-free native-width atomics are available, even if the target
14211424
// and operating system combination would not usually provide them. The user
14221425
// is responsible for providing any necessary __sync implementations. Code

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17350,6 +17350,9 @@ static SDValue combineSHL(SDNode *N, TargetLowering::DAGCombinerInfo &DCI,
1735017350
// (shl (sext x), C) -> (vwmulsu x, 1u << C)
1735117351
// (shl (zext x), C) -> (vwmulu x, 1u << C)
1735217352

17353+
if (!Subtarget.hasCheapVWMul())
17354+
return SDValue();
17355+
1735317356
if (!DCI.isAfterLegalizeDAG())
1735417357
return SDValue();
1735517358

llvm/lib/Target/RISCV/RISCVProcessors.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,8 @@ def SPACEMIT_X60 : RISCVProcessorModel<"spacemit-x60",
553553
TuneOptimizedNF2SegmentLoadStore,
554554
TuneOptimizedNF3SegmentLoadStore,
555555
TuneOptimizedNF4SegmentLoadStore,
556-
TuneVXRMPipelineFlush]> {
556+
TuneVXRMPipelineFlush,
557+
TuneCheapVWMul]> {
557558
let MVendorID = 0x710;
558559
let MArchID = 0x8000000058000001;
559560
let MImpID = 0x1000000049772200;

0 commit comments

Comments
 (0)