From 5ff5b460d9fa67b7184dda86bc929b652d86acbc Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Wed, 15 Jun 2022 18:48:02 +0100 Subject: [PATCH] [LV] Remove unneeded CustomBuilder arg from setDebugLocFromInst (NFC). The only user that passed in a custom builder was passing in VPTransformState::Builder, which is the same as ILV::Builder. --- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 677633a..72e27a6 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -512,8 +512,7 @@ public: /// Set the debug location in the builder \p Ptr using the debug location in /// \p V. If \p Ptr is None then it uses the class member's Builder. - void setDebugLocFromInst(const Value *V, - Optional CustomBuilder = None); + void setDebugLocFromInst(const Value *V); /// Fix the non-induction PHIs in \p Plan. void fixNonInductionPHIs(VPlan &Plan, VPTransformState &State); @@ -927,8 +926,7 @@ static Instruction *getDebugLocFromInstOrOperands(Instruction *I) { } void InnerLoopVectorizer::setDebugLocFromInst( - const Value *V, Optional CustomBuilder) { - IRBuilderBase *B = (CustomBuilder == None) ? &Builder : *CustomBuilder; + const Value *V) { if (const Instruction *Inst = dyn_cast_or_null(V)) { const DILocation *DIL = Inst->getDebugLoc(); @@ -940,15 +938,15 @@ void InnerLoopVectorizer::setDebugLocFromInst( auto NewDIL = DIL->cloneByMultiplyingDuplicationFactor(UF * VF.getKnownMinValue()); if (NewDIL) - B->SetCurrentDebugLocation(NewDIL.getValue()); + Builder.SetCurrentDebugLocation(NewDIL.getValue()); else LLVM_DEBUG(dbgs() << "Failed to create new discriminator: " << DIL->getFilename() << " Line: " << DIL->getLine()); } else - B->SetCurrentDebugLocation(DIL); + Builder.SetCurrentDebugLocation(DIL); } else - B->SetCurrentDebugLocation(DebugLoc()); + Builder.SetCurrentDebugLocation(DebugLoc()); } /// Write a \p DebugMsg about vectorization to the debug output stream. If \p I @@ -9710,7 +9708,7 @@ void VPWidenPHIRecipe::execute(VPTransformState &State) { } void VPBlendRecipe::execute(VPTransformState &State) { - State.ILV->setDebugLocFromInst(Phi, &State.Builder); + State.ILV->setDebugLocFromInst(Phi); // We know that all PHIs in non-header blocks are converted into // selects, so we don't have to worry about the insertion order and we // can just use the builder. -- 2.7.4