Skip to content

Commit

Permalink
[llvm] Make InstSimplifyFolder constructor explicit (NFC) (llvm#101654)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-barannikov authored Aug 2, 2024
1 parent 4a98f52 commit 4e93b16
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion llvm/include/llvm/Analysis/InstSimplifyFolder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/AtomicExpandPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions llvm/lib/Transforms/Utils/LoopUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4e93b16

Please sign in to comment.