[llvm] [RISCV] Run EarlyMachineLICM before VLOptimizer to hoist constant splats (PR #210028)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 05:49:04 PDT 2026


================
@@ -623,8 +623,10 @@ void RISCVPassConfig::addPreEmitPass2() {
 void RISCVPassConfig::addMachineSSAOptimization() {
   // It's beneficial to reduce the VL to enable more
   // Machine SSA optimizations.
-  if (TM->getOptLevel() != CodeGenOptLevel::None)
+  if (TM->getOptLevel() != CodeGenOptLevel::None) {
+    addPass(&EarlyMachineLICMID);
----------------
lukel97 wrote:

Yeah we run it twice with this PR, VLOptimizer used to be run after LICM but https://github.com/llvm/llvm-project/pull/179377 intentionally moved it before for some other SSA opts

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


More information about the llvm-commits mailing list