[llvm] [RISCV] Port Gather/Scatter Lowering to NewPM (PR #215669)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 15:54:07 PDT 2026


================
@@ -640,3 +640,32 @@ bool RISCVGatherScatterLowering::runOnFunction(Function &F) {
 
   return Changed;
 }
+
+bool RISCVGatherScatterLoweringLegacy::runOnFunction(Function &F) {
+  if (skipFunction(F))
+    return false;
+
+  auto &TPC = getAnalysis<TargetPassConfig>();
+  auto &TM = TPC.getTM<RISCVTargetMachine>();
+  auto *ST = &TM.getSubtarget<RISCVSubtarget>(F);
+  if (!ST->hasVInstructions() || !ST->useRVVForFixedLengthVectors())
----------------
topperc wrote:

Can we sink these checks into the run() function instead of duplicating in both passes?

https://github.com/llvm/llvm-project/pull/215669


More information about the llvm-commits mailing list