[llvm] [SimplifyCFG] Supporting hoisting/sinking callbases with differing attrs (PR #109472)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 20 13:44:25 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 f7c3309b1361443cded697255995fade24838ef8 dbab2cf4825ee2c994581731b6e9e09726ba16ee --extensions h,cpp -- llvm/include/llvm/IR/Attributes.h llvm/include/llvm/IR/Instruction.h llvm/lib/IR/Attributes.cpp llvm/lib/IR/Instruction.cpp llvm/lib/Transforms/Utils/SimplifyCFG.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index cd17dc454f..cfbc3155bd 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -1621,7 +1621,7 @@ static std::optional<AttributeList> tryIntersectAttrs(const CallBase *CB0,
       if (!Attr.isValid())
         return std::nullopt;
 
-	  // Only supporting enum attrs for now.
+      // Only supporting enum attrs for now.
       if (!Attr.hasKindAsEnum())
         return std::nullopt;
 
@@ -1699,7 +1699,7 @@ static std::optional<AttributeList> tryIntersectAttrs(const CallBase *CB0,
         }
       }
     }
-	return Intersected;
+    return Intersected;
   };
 
   // Intersect all attribute types (ret/fn/param).
@@ -2196,7 +2196,7 @@ static bool canSinkInstructions(
           return false;
       }
     }
-	// Check that we can intersect the attributes if we sink.
+    // Check that we can intersect the attributes if we sink.
     for (const Instruction *I : Insts) {
       if (I != I0 && !tryIntersectAttrs(CB, cast<CallBase>(I)))
         return false;

``````````

</details>


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


More information about the llvm-commits mailing list