[llvm] SROA generate a noundef instead of splatting a noundef int (PR #145122)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 21 00:33:59 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- llvm/lib/Transforms/Scalar/SROA.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp
index 028bcde5a..403baed93 100644
--- a/llvm/lib/Transforms/Scalar/SROA.cpp
+++ b/llvm/lib/Transforms/Scalar/SROA.cpp
@@ -3222,14 +3222,14 @@ private:
 
     Type *SplatIntTy = Type::getIntNTy(VTy->getContext(), Size * 8);
     if (isa<UndefValue>(V)) {
-        V = UndefValue::get(VTy);
+      V = UndefValue::get(VTy);
     } else {
-        V = IRB.CreateMul(
-            IRB.CreateZExt(V, SplatIntTy, "zext"),
-            IRB.CreateUDiv(Constant::getAllOnesValue(SplatIntTy),
-                           IRB.CreateZExt(Constant::getAllOnesValue(V->getType()),
-                                          SplatIntTy)),
-            "isplat");
+      V = IRB.CreateMul(
+          IRB.CreateZExt(V, SplatIntTy, "zext"),
+          IRB.CreateUDiv(Constant::getAllOnesValue(SplatIntTy),
+                         IRB.CreateZExt(Constant::getAllOnesValue(V->getType()),
+                                        SplatIntTy)),
+          "isplat");
     }
     return V;
   }

``````````

</details>


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


More information about the llvm-commits mailing list