[llvm] [VectorCombine] Fix duplicate freeze scheduling for shared indexes (PR #213461)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 22:47:18 PDT 2026


================
@@ -2106,8 +2106,10 @@ bool VectorCombine::scalarizeLoadExtract(LoadInst *LI, VectorType *VecTy,
     if (ScalarIdx.isUnsafe())
       return false;
     if (ScalarIdx.isSafeWithFreeze()) {
-      NeedFreeze.try_emplace(UI, ScalarIdx);
-      ScalarIdx.discard();
+      if (auto *IdxInst = dyn_cast<Instruction>(UI->getIndexOperand())) {
----------------
ParkHanbum wrote:

we can use cast without if

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


More information about the llvm-commits mailing list