[llvm] [SandboxIR] Added setVolatile member function to LoadInst and StoreInst (PR #101284)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 31 18:44:44 PDT 2024


================
@@ -584,3 +584,38 @@ define void @foo(i8 %arg) {
   Ctx.revert();
   EXPECT_EQ(CallBr->getIndirectDest(0), OrigIndirectDest);
 }
+
+TEST_F(TrackerTest, SetVolatile) {
+  parseIR(C, R"IR(
+define void @foo(ptr %arg0, i8 %val) {
+  %ld = load i8, ptr %arg0, align 64
+  store i8 %val, ptr %arg0, align 64 
+  ret void
+}
+)IR");
+  Function &LLVMF = *M->getFunction("foo");
+  sandboxir::Context Ctx(C);
+
+  auto *F = Ctx.createFunction(&LLVMF);
+  unsigned ArgIdx = 0;
+  [[maybe_unused]] auto *Arg0 = F->getArg(ArgIdx++);
+  [[maybe_unused]] auto *Val = F->getArg(ArgIdx++);
----------------
vporpo wrote:

`Arg0`, `Val` and `ArgIdx` seem to be unused, delete these lines?

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


More information about the llvm-commits mailing list