[llvm] [SandboxIR][NFC] Fixes for LoadInst::create functions (PR #100955)

Julius Alexandre via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 28 23:59:33 PDT 2024


================
@@ -624,7 +636,18 @@ LoadInst *LoadInst::create(Type *Ty, Value *Ptr, MaybeAlign Align,
 
 LoadInst *LoadInst::create(Type *Ty, Value *Ptr, MaybeAlign Align,
                            BasicBlock *InsertAtEnd, Context &Ctx,
-                           bool IsVolatile, const Twine &Name) {
+                           const Twine &Name) {
+  auto &Builder = Ctx.getLLVMIRBuilder();
+  Builder.SetInsertPoint(cast<llvm::BasicBlock>(InsertAtEnd->Val));
+  auto *NewLI = Builder.CreateAlignedLoad(Ty, Ptr->Val, Align,
+                                          /*IsVolatile=*/false, Name);
+  auto *NewSBI = Ctx.createLoadInst(NewLI);
+  return NewSBI;
----------------
medievalghoul wrote:

thanks for the suggestion! I fixed it.

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


More information about the llvm-commits mailing list