[llvm] Fix CodeExtractor when using aggregated arguments. (PR #94294)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 3 17:12:28 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 bda8d1ad72fc72f21f6c536692594376d00db8b6 94e7095320c91233f3873cb0998fb8ca03866aa3 -- llvm/lib/Transforms/Utils/CodeExtractor.cpp llvm/unittests/Transforms/Utils/CodeExtractorTest.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/unittests/Transforms/Utils/CodeExtractorTest.cpp b/llvm/unittests/Transforms/Utils/CodeExtractorTest.cpp
index ce72d345b7..8fb71e51f1 100644
--- a/llvm/unittests/Transforms/Utils/CodeExtractorTest.cpp
+++ b/llvm/unittests/Transforms/Utils/CodeExtractorTest.cpp
@@ -173,8 +173,8 @@ TEST(CodeExtractor, AggInputOutputMonitoring) {
   SetVector<Value *> Inputs, Outputs;
   Function *Outlined = CE.extractCodeRegion(CEAC, Inputs, Outputs);
   EXPECT_TRUE(Outlined);
-  //Ensure that the outlined function has a single argument with
-  //the input and output values in an aggregated structure.
+  // Ensure that the outlined function has a single argument with
+  // the input and output values in an aggregated structure.
   EXPECT_EQ(Outlined->arg_size(), 1u);
 
   EXPECT_EQ(Inputs.size(), 3u);
@@ -183,12 +183,13 @@ TEST(CodeExtractor, AggInputOutputMonitoring) {
   EXPECT_EQ(Inputs[2], Func->getArg(1));
 
   EXPECT_EQ(Outputs.size(), 1u);
-  //The output value must be stored in the appropriate element inside the
-  //aggregated structure.
-  GetElementPtrInst *GEP = cast<GetElementPtrInst>(Outlined->getArg(0)->user_back());
+  // The output value must be stored in the appropriate element inside the
+  // aggregated structure.
+  GetElementPtrInst *GEP =
+      cast<GetElementPtrInst>(Outlined->getArg(0)->user_back());
   APInt Offset(M->getDataLayout().getMaxIndexSizeInBits(), 0);
   EXPECT_TRUE(GEP->accumulateConstantOffset(M->getDataLayout(), Offset));
-  EXPECT_EQ(Offset, 3u*4u); //Fourth i32 element, with 4-bytes each.
+  EXPECT_EQ(Offset, 3u * 4u); // Fourth i32 element, with 4-bytes each.
   StoreInst *SI = cast<StoreInst>(GEP->user_back());
   Value *OutputVal = SI->getValueOperand();
   EXPECT_EQ(Outputs[0], OutputVal);

``````````

</details>


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


More information about the llvm-commits mailing list