[llvm] [InitUndef] handleSubReg should skip artificial subregs. (PR #116248)

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 08:04:30 PST 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 576865a50e6ccb74196c9491fa79575d6d7f0b0b 96e9c3a61617adfb4909fb575910f3cf6924514a --extensions cpp -- llvm/lib/CodeGen/InitUndef.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/InitUndef.cpp b/llvm/lib/CodeGen/InitUndef.cpp
index 4545113029..d8b3190f31 100644
--- a/llvm/lib/CodeGen/InitUndef.cpp
+++ b/llvm/lib/CodeGen/InitUndef.cpp
@@ -167,10 +167,9 @@ bool InitUndef::handleSubReg(MachineFunction &MF, MachineInstr &MI,
     // It's not possible to create the INIT_UNDEF when there is no register
     // class associated for the subreg. This may happen for artificial subregs
     // that are not directly addressable.
-    if (any_of(SubRegIndexNeedInsert,
-               [&](unsigned Ind) -> bool {
-                 return !TRI->getSubRegisterClass(TargetRegClass, Ind);
-               }))
+    if (any_of(SubRegIndexNeedInsert, [&](unsigned Ind) -> bool {
+          return !TRI->getSubRegisterClass(TargetRegClass, Ind);
+        }))
       continue;
 
     Register LatestReg = Reg;

``````````

</details>


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


More information about the llvm-commits mailing list