[llvm] 4e93b16 - [llvm] Make InstSimplifyFolder constructor explicit (NFC) (#101654)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 2 06:45:53 PDT 2024
Author: Sergei Barannikov
Date: 2024-08-02T16:45:50+03:00
New Revision: 4e93b16f3fce467b2bbda4e5fd8b15fcad2bea93
URL: https://github.com/llvm/llvm-project/commit/4e93b16f3fce467b2bbda4e5fd8b15fcad2bea93
DIFF: https://github.com/llvm/llvm-project/commit/4e93b16f3fce467b2bbda4e5fd8b15fcad2bea93.diff
LOG: [llvm] Make InstSimplifyFolder constructor explicit (NFC) (#101654)
Added:
Modified:
llvm/include/llvm/Analysis/InstSimplifyFolder.h
llvm/lib/CodeGen/AtomicExpandPass.cpp
llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp
llvm/lib/Transforms/Utils/LoopUtils.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/InstSimplifyFolder.h b/llvm/include/llvm/Analysis/InstSimplifyFolder.h
index 6b3da534631a8..430c3edc2f0dc 100644
--- a/llvm/include/llvm/Analysis/InstSimplifyFolder.h
+++ b/llvm/include/llvm/Analysis/InstSimplifyFolder.h
@@ -38,7 +38,7 @@ class InstSimplifyFolder final : public IRBuilderFolder {
virtual void anchor();
public:
- InstSimplifyFolder(const DataLayout &DL) : ConstFolder(DL), SQ(DL) {}
+ explicit InstSimplifyFolder(const DataLayout &DL) : ConstFolder(DL), SQ(DL) {}
//===--------------------------------------------------------------------===//
// Value-based folders.
diff --git a/llvm/lib/CodeGen/AtomicExpandPass.cpp b/llvm/lib/CodeGen/AtomicExpandPass.cpp
index ebcf76175a36b..49836b914784f 100644
--- a/llvm/lib/CodeGen/AtomicExpandPass.cpp
+++ b/llvm/lib/CodeGen/AtomicExpandPass.cpp
@@ -142,7 +142,7 @@ struct ReplacementIRBuilder
// Preserves the DebugLoc from I, and preserves still valid metadata.
// Enable StrictFP builder mode when appropriate.
explicit ReplacementIRBuilder(Instruction *I, const DataLayout &DL)
- : IRBuilder(I->getContext(), DL,
+ : IRBuilder(I->getContext(), InstSimplifyFolder(DL),
IRBuilderCallbackInserter(
[this](Instruction *I) { addMMRAMD(I); })) {
SetInsertPoint(I);
diff --git a/llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp b/llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp
index 881be28bfe79e..06e7110280b9a 100644
--- a/llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp
@@ -504,7 +504,7 @@ bool RISCVGatherScatterLowering::tryCreateStridedLoadStore(IntrinsicInst *II,
return false;
LLVMContext &Ctx = PtrI->getContext();
- IRBuilder<InstSimplifyFolder> Builder(Ctx, *DL);
+ IRBuilder Builder(Ctx, InstSimplifyFolder(*DL));
Builder.SetInsertPoint(PtrI);
Value *BasePtr, *Stride;
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index 0abf6d77496dc..f1f2d522f1cba 100644
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -1901,8 +1901,7 @@ Value *llvm::addRuntimeChecks(
expandBounds(PointerChecks, TheLoop, Loc, Exp, HoistRuntimeChecks);
LLVMContext &Ctx = Loc->getContext();
- IRBuilder<InstSimplifyFolder> ChkBuilder(Ctx,
- Loc->getDataLayout());
+ IRBuilder ChkBuilder(Ctx, InstSimplifyFolder(Loc->getDataLayout()));
ChkBuilder.SetInsertPoint(Loc);
// Our instructions might fold to a constant.
Value *MemoryRuntimeCheck = nullptr;
@@ -1955,8 +1954,7 @@ Value *llvm::addDiffRuntimeChecks(
function_ref<Value *(IRBuilderBase &, unsigned)> GetVF, unsigned IC) {
LLVMContext &Ctx = Loc->getContext();
- IRBuilder<InstSimplifyFolder> ChkBuilder(Ctx,
- Loc->getDataLayout());
+ IRBuilder ChkBuilder(Ctx, InstSimplifyFolder(Loc->getDataLayout()));
ChkBuilder.SetInsertPoint(Loc);
// Our instructions might fold to a constant.
Value *MemoryRuntimeCheck = nullptr;
More information about the llvm-commits
mailing list