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

Pengcheng Wang via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 05:41:49 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);
----------------
wangpc-pp wrote:

Does this mean we will run `EarlyMachineLICM` twice? Is it possible that we insert `RISCVVLOptimizer` after `EarlyMachineLICM`?

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


More information about the llvm-commits mailing list