[llvm] [LiveDebugValues] Use getNumSupportedRegs to reduce compile time, NFCI (PR #114944)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 05:10:16 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 c72a751dabff4260dcc309e48008941d51b31d21 b2b2b10c97f6cf16cbf56c7fd995b0e11ea00a01 --extensions cpp,h -- llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index 05f43f6ee1..b28de7c5f1 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -1348,8 +1348,8 @@ bool InstrRefBasedLDV::isCalleeSaved(LocIdx L) const {
   return isCalleeSavedReg(Reg);
 }
 bool InstrRefBasedLDV::isCalleeSavedReg(Register R) const {
-  for (MCRegAliasIterator RAI(R, TRI, true);
-       RAI.isValid() && *RAI < NumRegs; ++RAI)
+  for (MCRegAliasIterator RAI(R, TRI, true); RAI.isValid() && *RAI < NumRegs;
+       ++RAI)
     if (CalleeSavedRegs.test(*RAI))
       return true;
   return false;
@@ -2646,8 +2646,8 @@ void InstrRefBasedLDV::placeMLocPHIs(
     InstallPHIsAtLoc(L);
 
     // Now find aliases and install PHIs for those.
-    for (MCRegAliasIterator RAI(R, TRI, true);
-         RAI.isValid() && *RAI < NumRegs; ++RAI) {
+    for (MCRegAliasIterator RAI(R, TRI, true); RAI.isValid() && *RAI < NumRegs;
+         ++RAI) {
       // Super-registers that are "above" the largest register read/written by
       // the function will alias, but will not be tracked.
       if (!MTracker->isRegisterTracked(*RAI))

``````````

</details>


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


More information about the llvm-commits mailing list