[llvm] [AMDGPU] expand-fp: unify scalarization (NFC) (PR #158588)

Frederik Harwath via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 15 06:12:57 PDT 2025


================
@@ -948,12 +927,21 @@ static void scalarize(Instruction *I, SmallVectorImpl<Instruction *> &Replace) {
   Value *Result = PoisonValue::get(VTy);
   for (unsigned Idx = 0; Idx < NumElements; ++Idx) {
     Value *Ext = Builder.CreateExtractElement(I->getOperand(0), Idx);
-    Value *Cast = Builder.CreateCast(cast<CastInst>(I)->getOpcode(), Ext,
-                                     I->getType()->getScalarType());
-    Result = Builder.CreateInsertElement(Result, Cast, Idx);
-    if (isa<Instruction>(Cast))
-      Replace.push_back(cast<Instruction>(Cast));
+    Value *Op;
----------------
frederik-h wrote:

I agree. But not necessarily as a part of this PR, right?

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


More information about the llvm-commits mailing list