[llvm] [InstCombine] Avoid crash on aggregate types in SimplifyDemandedUseFPClass (PR #111128)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 4 03:29:10 PDT 2024


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 b9bb77f0c76be88d824e87c713ae8457046b1ac6 d92961a7c80807b3e706a9ef552a68ff11f3e41a --extensions cpp -- llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index cb8c0dff7b..6e246ce7dc 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -1921,15 +1921,15 @@ Value *InstCombinerImpl::SimplifyDemandedVectorElts(Value *V,
 static Constant *getFPClassConstant(Type *Ty, FPClassTest Mask) {
   // TODO: Support aggregate types that are allowed by FPMathOperator.
   switch (Mask) {
-    case fcPosZero:
-    case fcNegZero:
-    case fcPosInf:
-    case fcNegInf:
-      if (Ty->isAggregateType())
-        return nullptr;
-      break;
-    default:
-      break;
+  case fcPosZero:
+  case fcNegZero:
+  case fcPosInf:
+  case fcNegInf:
+    if (Ty->isAggregateType())
+      return nullptr;
+    break;
+  default:
+    break;
   }
 
   switch (Mask) {

``````````

</details>


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


More information about the llvm-commits mailing list