[llvm] [RISCV] Move RISCVInsertVSETVLI to after phi elimination (PR #91440)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Wed May 15 22:01:44 PDT 2024
================
@@ -541,9 +541,16 @@ void RISCVPassConfig::addPreRegAlloc() {
addPass(createRISCVPreRAExpandPseudoPass());
if (TM->getOptLevel() != CodeGenOptLevel::None)
addPass(createRISCVMergeBaseOffsetOptPass());
+
addPass(createRISCVInsertReadWriteCSRPass());
addPass(createRISCVInsertWriteVXRMPass());
- addPass(createRISCVInsertVSETVLIPass());
+
+ // Run RISCVInsertVSETVLI after PHI elimination. On O1 and above do it after
+ // register coalescing so needVSETVLIPHI doesn't need to look through COPYs.
+ if (TM->getOptLevel() == CodeGenOptLevel::None)
+ insertPass(&PHIEliminationID, createRISCVInsertVSETVLIPass());
----------------
lukel97 wrote:
Should be fixed in #92303
https://github.com/llvm/llvm-project/pull/91440
More information about the llvm-commits
mailing list