From f8b5bff72e58b096378467580e106aa47688a31d Mon Sep 17 00:00:00 2001 From: Min-Yih Hsu Date: Fri, 12 Dec 2025 14:55:51 -0800 Subject: [PATCH] [RISCV] Guard zero-stride SchedPredicate with subtarget feature --- llvm/lib/Target/RISCV/RISCVInstrPredicates.td | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/RISCV/RISCVInstrPredicates.td b/llvm/lib/Target/RISCV/RISCVInstrPredicates.td index dcae9772c2e81..8851ee44ac937 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrPredicates.td +++ b/llvm/lib/Target/RISCV/RISCVInstrPredicates.td @@ -12,7 +12,12 @@ // This predicate is true when the rs2 operand of vlse or vsse is x0, false // otherwise. -def VLDSX0Pred : MCSchedPredicate>; +// Note: in our pseudo RVV MachinInstr, rs2 is the fourth operand. However, +// it's the third operand of its MCInst form, so this predicate will not +// be triggered by llvm-mca, which checks against MCInst. +def VLDSX0Pred + : AllOfSchedPreds<[FeatureSchedPredicate, + MCSchedPredicate>]>; // This scheduling predicate is true when subtarget feature TuneHasSingleElementVecFP64 // is enabled.