[llvm] expand-fp: Refactor modification status handling (NFC) (PR #163542)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 15 18:18:00 PDT 2025


================
@@ -941,10 +941,9 @@ static void scalarize(Instruction *I,
       llvm_unreachable("Unsupported instruction type");
 
     Result = Builder.CreateInsertElement(Result, NewOp, Idx);
-    if (auto *ScalarizedI = dyn_cast<Instruction>(NewOp)) {
-      ScalarizedI->copyIRFlags(I, true);
-      Worklist.push_back(ScalarizedI);
-    }
+    Instruction *ScalarizedI = cast<Instruction>(NewOp);
----------------
arsenm wrote:

I'm not sure removing the dyn_cast is safe, it's there to guard against the case where the IRBuilder constant folded something. I'm surprised there is no test for this case 

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


More information about the llvm-commits mailing list