[llvm] [SandboxIR] Added isVolatile args to existing LoadInst::create function (PR #100850)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 26 19:01:49 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 efd13eb305dcc394cd038d6c332df64e96276baa f66ee5e7c901bda1a2cb78a8554f7621dc96020b --extensions h,cpp -- llvm/include/llvm/SandboxIR/SandboxIR.h llvm/lib/SandboxIR/SandboxIR.cpp llvm/unittests/SandboxIR/SandboxIRTest.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/SandboxIR/SandboxIR.cpp b/llvm/lib/SandboxIR/SandboxIR.cpp
index 9e41bacf1a..fb780ed87a 100644
--- a/llvm/lib/SandboxIR/SandboxIR.cpp
+++ b/llvm/lib/SandboxIR/SandboxIR.cpp
@@ -616,8 +616,8 @@ LoadInst *LoadInst::create(Type *Ty, Value *Ptr, MaybeAlign Align,
   llvm::Instruction *BeforeIR = InsertBefore->getTopmostLLVMInstruction();
   auto &Builder = Ctx.getLLVMIRBuilder();
   Builder.SetInsertPoint(BeforeIR);
-  auto *NewLI = Builder.CreateAlignedLoad(Ty, Ptr->Val, Align,
-                                          isVolatile, Name);
+  auto *NewLI =
+      Builder.CreateAlignedLoad(Ty, Ptr->Val, Align, isVolatile, Name);
   auto *NewSBI = Ctx.createLoadInst(NewLI);
   return NewSBI;
 }
@@ -627,8 +627,8 @@ LoadInst *LoadInst::create(Type *Ty, Value *Ptr, MaybeAlign Align,
                            bool isVolatile, const Twine &Name) {
   auto &Builder = Ctx.getLLVMIRBuilder();
   Builder.SetInsertPoint(cast<llvm::BasicBlock>(InsertAtEnd->Val));
-  auto *NewLI = Builder.CreateAlignedLoad(Ty, Ptr->Val, Align,
-                                          isVolatile, Name);
+  auto *NewLI =
+      Builder.CreateAlignedLoad(Ty, Ptr->Val, Align, isVolatile, Name);
   auto *NewSBI = Ctx.createLoadInst(NewLI);
   return NewSBI;
 }
diff --git a/llvm/unittests/SandboxIR/SandboxIRTest.cpp b/llvm/unittests/SandboxIR/SandboxIRTest.cpp
index d1d326dab9..bcae8e999c 100644
--- a/llvm/unittests/SandboxIR/SandboxIRTest.cpp
+++ b/llvm/unittests/SandboxIR/SandboxIRTest.cpp
@@ -762,19 +762,17 @@ define void @foo(ptr %arg0, ptr %arg1) {
   // Check getAlign()
   EXPECT_EQ(Ld->getAlign(), 64);
   // Check create(InsertBefore)
-  sandboxir::LoadInst *NewLd =
-      sandboxir::LoadInst::create(Ld->getType(), Arg1, Align(8),
-                                  /*InsertBefore=*/Ret, Ctx, 
-                                  Ld->isVolatile(), "NewLd");
+  sandboxir::LoadInst *NewLd = sandboxir::LoadInst::create(
+      Ld->getType(), Arg1, Align(8),
+      /*InsertBefore=*/Ret, Ctx, Ld->isVolatile(), "NewLd");
   EXPECT_EQ(NewLd->getType(), Ld->getType());
   EXPECT_EQ(NewLd->getPointerOperand(), Arg1);
   EXPECT_EQ(NewLd->getAlign(), 8);
   EXPECT_EQ(NewLd->getName(), "NewLd");
-  
-  sandboxir::LoadInst *NewVld =
-      sandboxir::LoadInst::create(Vld->getType(), Arg1, Align(8),
-                                  /*InsertBefore=*/Ret, Ctx, 
-                                  Vld->isVolatile(), "NewVld");
+
+  sandboxir::LoadInst *NewVld = sandboxir::LoadInst::create(
+      Vld->getType(), Arg1, Align(8),
+      /*InsertBefore=*/Ret, Ctx, Vld->isVolatile(), "NewVld");
   EXPECT_EQ(NewVld->getType(), Vld->getType());
   EXPECT_EQ(NewVld->getPointerOperand(), Arg1);
   EXPECT_EQ(NewVld->isVolatile(), Vld->isVolatile());

``````````

</details>


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


More information about the llvm-commits mailing list