diff --git a/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp b/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp index f97b82d8fa0b..fcd525d7dd5e 100644 --- a/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp +++ b/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp @@ -254,10 +254,10 @@ void RISCVPassConfig::addMachineSSAOptimization() { if (TM->getTargetTriple().getArch() == Triple::riscv64) addPass(createRISCVSExtWRemovalPass()); - addPass(createRISCVPreRAExpandPseudoPass()); } void RISCVPassConfig::addPreRegAlloc() { + addPass(createRISCVPreRAExpandPseudoPass()); if (TM->getOptLevel() != CodeGenOpt::None) addPass(createRISCVMergeBaseOffsetOptPass()); addPass(createRISCVInsertVSETVLIPass()); diff --git a/llvm/test/CodeGen/RISCV/O0-pipeline.ll b/llvm/test/CodeGen/RISCV/O0-pipeline.ll index 534f2e092a32..15d1247f825b 100644 --- a/llvm/test/CodeGen/RISCV/O0-pipeline.ll +++ b/llvm/test/CodeGen/RISCV/O0-pipeline.ll @@ -35,6 +35,7 @@ ; CHECK-NEXT: RISCV DAG->DAG Pattern Instruction Selection ; CHECK-NEXT: Finalize ISel and expand pseudo-instructions ; CHECK-NEXT: Local Stack Slot Allocation +; CHECK-NEXT: RISCV Pre-RA pseudo instruction expansion pass ; CHECK-NEXT: RISCV Insert VSETVLI pass ; CHECK-NEXT: Eliminate PHI nodes for register allocation ; CHECK-NEXT: Two-Address instruction pass