[llvm] [DLCov][NFC] Annotate intentionally-blank DebugLocs in existing code (PR #136192)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 17 13:16:59 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-debuginfo
Author: Stephen Tozer (SLTozer)
<details>
<summary>Changes</summary>
Following the work in PR #<!-- -->107279, this patch applies the annotative DebugLocs, which indicate that a particular instruction is intentionally missing a location for a given reason, to existing sites in the compiler where their conditions apply. This is NFC in ordinary LLVM builds (each function `DebugLoc::getFoo()` is inlined as `DebugLoc()`), but marks the instruction in coverage-tracking builds so that it will be ignored by Debugify, allowing only real errors to be reported. From a developer standpoint, it also communicates the intentionality and reason for a missing DebugLoc.
Some notes for reviewers:
- The difference between `I->dropLocation()` and `I->setDebugLoc(DebugLoc::getDropped())` is that the former _may_ decide to keep some debug info alive, while the latter will always be empty; in this patch, I always used the latter (even if the former could technically be correct), because the former could result in some (barely) different output, and I'd prefer to keep this patch purely NFC.
- I've generally documented the uses of `DebugLoc::getUnknown()`, with the exception of the vectorizers - in summary, they are a huge cause of dropped source locations, and I don't have the time or the domain knowledge currently to solve that, so I've plastered it all over them as a form of "fixme".
---
Patch is 26.14 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/136192.diff
19 Files Affected:
- (modified) llvm/lib/Transforms/IPO/GlobalOpt.cpp (+8-2)
- (modified) llvm/lib/Transforms/IPO/IROutliner.cpp (+2-2)
- (modified) llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp (+8-1)
- (modified) llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp (+2-1)
- (modified) llvm/lib/Transforms/Scalar/IndVarSimplify.cpp (+1)
- (modified) llvm/lib/Transforms/Scalar/JumpThreading.cpp (+3-1)
- (modified) llvm/lib/Transforms/Scalar/LICM.cpp (+4-2)
- (modified) llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp (+2-1)
- (modified) llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp (+3)
- (modified) llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp (+3-1)
- (modified) llvm/lib/Transforms/Utils/InlineFunction.cpp (+5)
- (modified) llvm/lib/Transforms/Utils/Local.cpp (+2-1)
- (modified) llvm/lib/Transforms/Utils/SCCPSolver.cpp (+3-1)
- (modified) llvm/lib/Transforms/Utils/SSAUpdater.cpp (+1)
- (modified) llvm/lib/Transforms/Utils/SimplifyCFG.cpp (+6-4)
- (modified) llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h (+11-11)
- (modified) llvm/lib/Transforms/Vectorize/LoopVectorize.cpp (+9-5)
- (modified) llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp (+9-3)
- (modified) llvm/lib/Transforms/Vectorize/VPlan.h (+1-1)
``````````diff
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 83cc1e5f04f3d..73b59c374d50f 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -1482,8 +1482,14 @@ processInternalGlobal(GlobalVariable *GV, const GlobalStatus &GS,
// FIXME: Pass Global's alignment when globals have alignment
AllocaInst *Alloca = new AllocaInst(ElemTy, DL.getAllocaAddrSpace(),
nullptr, GV->getName(), FirstI);
- if (!isa<UndefValue>(GV->getInitializer()))
- new StoreInst(GV->getInitializer(), Alloca, FirstI);
+ Alloca->setDebugLoc(DebugLoc::getCompilerGenerated());
+ if (!isa<UndefValue>(GV->getInitializer())) {
+ auto *SI = new StoreInst(GV->getInitializer(), Alloca, FirstI);
+ // FIXME: We're localizing a global and creating a store instruction for
+ // the initial value of that global. Could we logically use the global
+ // variable's (if one exists) line for this?
+ SI->setDebugLoc(DebugLoc::getCompilerGenerated());
+ }
GV->replaceAllUsesWith(Alloca);
GV->eraseFromParent();
diff --git a/llvm/lib/Transforms/IPO/IROutliner.cpp b/llvm/lib/Transforms/IPO/IROutliner.cpp
index eec869d57a6db..d60d8090b6c87 100644
--- a/llvm/lib/Transforms/IPO/IROutliner.cpp
+++ b/llvm/lib/Transforms/IPO/IROutliner.cpp
@@ -730,7 +730,7 @@ static void moveFunctionData(Function &Old, Function &New,
// other outlined instructions.
if (!isa<CallInst>(&Val)) {
// Remove the debug information for outlined functions.
- Val.setDebugLoc(DebugLoc());
+ Val.setDebugLoc(DebugLoc::getDropped());
// Loop info metadata may contain line locations. Update them to have no
// value in the new subprogram since the outlined code could be from
@@ -1864,7 +1864,7 @@ replaceArgumentUses(OutlinableRegion &Region,
Value *ValueOperand = SI->getValueOperand();
StoreInst *NewI = cast<StoreInst>(I->clone());
- NewI->setDebugLoc(DebugLoc());
+ NewI->setDebugLoc(DebugLoc::getDropped());
BasicBlock *OutputBB = VBBIt->second;
NewI->insertInto(OutputBB, OutputBB->end());
LLVM_DEBUG(dbgs() << "Move store for instruction " << *I << " to "
diff --git a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
index 80308bf92dbbc..60ec6eb1a201f 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
@@ -870,7 +870,14 @@ Instruction *InstCombinerImpl::foldPHIArgZextsIntoPHI(PHINode &Phi) {
NewPhi->addIncoming(NewIncoming[I], Phi.getIncomingBlock(I));
InsertNewInstBefore(NewPhi, Phi.getIterator());
- return CastInst::CreateZExtOrBitCast(NewPhi, Phi.getType());
+ auto *CI = CastInst::CreateZExtOrBitCast(NewPhi, Phi.getType());
+
+ // We use a dropped location here because the new ZExt is necessarily a merge
+ // of ZExtInsts and at least one constant from incoming branches; the presence
+ // of the constant means we have no viable DebugLoc from that branch, and
+ // therefore we must use a dropped location.
+ CI->setDebugLoc(DebugLoc::getDropped());
+ return CI;
}
/// If all operands to a PHI node are the same "unary" operator and they all are
diff --git a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
index 5226aeb66f65a..f18edb2bf84ad 100644
--- a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
+++ b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
@@ -419,7 +419,8 @@ static bool processSwitch(SwitchInst *I, LazyValueInfo *LVI,
BasicBlock *NewUnreachableBB =
BasicBlock::Create(BB->getContext(), "default.unreachable",
BB->getParent(), DefaultDest);
- new UnreachableInst(BB->getContext(), NewUnreachableBB);
+ auto *UI = new UnreachableInst(BB->getContext(), NewUnreachableBB);
+ UI->setDebugLoc(DebugLoc::getTemporary());
DefaultDest->removePredecessor(BB);
SI->setDefaultDest(NewUnreachableBB);
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 9619dfdbf4123..829b2f475dab9 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -1527,6 +1527,7 @@ bool IndVarSimplify::canonicalizeExitCondition(Loop *L) {
auto *NewRHS = CastInst::Create(
Instruction::Trunc, RHS, LHSOp->getType(), "",
L->getLoopPreheader()->getTerminator()->getIterator());
+ NewRHS->setDebugLoc(DebugLoc::getDropped());
ICmp->setOperand(Swapped ? 1 : 0, LHSOp);
ICmp->setOperand(Swapped ? 0 : 1, NewRHS);
// Samesign flag cannot be preserved after narrowing the compare.
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
index ba598d8415b18..6a2b3a766d9e5 100644
--- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
@@ -2976,8 +2976,10 @@ bool JumpThreadingPass::tryToUnfoldSelectInCurrBB(BasicBlock *BB) {
continue;
// Expand the select.
Value *Cond = SI->getCondition();
- if (!isGuaranteedNotToBeUndefOrPoison(Cond, nullptr, SI))
+ if (!isGuaranteedNotToBeUndefOrPoison(Cond, nullptr, SI)) {
Cond = new FreezeInst(Cond, "cond.fr", SI->getIterator());
+ cast<FreezeInst>(Cond)->setDebugLoc(DebugLoc::getTemporary());
+ }
MDNode *BranchWeights = getBranchWeightMDNode(*SI);
Instruction *Term =
SplitBlockAndInsertIfThen(Cond, SI, false, BranchWeights);
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index 889b43a843bef..ffcd49d2d4631 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -1724,7 +1724,7 @@ static bool sink(Instruction &I, LoopInfo *LI, DominatorTree *DT,
Instruction *New = sinkThroughTriviallyReplaceablePHI(
PN, &I, LI, SunkCopies, SafetyInfo, CurLoop, MSSAU);
// As we sink the instruction out of the BB, drop its debug location.
- New->dropLocation();
+ New->setDebugLoc(DebugLoc::getDropped());
PN->replaceAllUsesWith(New);
eraseInstruction(*PN, *SafetyInfo, MSSAU);
Changed = true;
@@ -2249,7 +2249,7 @@ bool llvm::promoteLoopAccessesToScalars(
if (SawUnorderedAtomic)
PreheaderLoad->setOrdering(AtomicOrdering::Unordered);
PreheaderLoad->setAlignment(Alignment);
- PreheaderLoad->setDebugLoc(DebugLoc());
+ PreheaderLoad->dropLocation();
if (AATags && LoadIsGuaranteedToExecute)
PreheaderLoad->setAAMetadata(AATags);
@@ -2802,6 +2802,7 @@ static bool hoistMulAddAssociation(Instruction &I, Loop &L,
auto *NewBO =
BinaryOperator::Create(Ins->getOpcode(), LHS, RHS,
Ins->getName() + ".reass", Ins->getIterator());
+ NewBO->setDebugLoc(DebugLoc::getDropped());
NewBO->copyIRFlags(Ins);
if (VariantOp == Ins)
VariantOp = NewBO;
@@ -2858,6 +2859,7 @@ static bool hoistBOAssociation(Instruction &I, Loop &L,
auto *NewBO = BinaryOperator::Create(
Opcode, LV, Inv, BO->getName() + ".reass", BO->getIterator());
+ NewBO->setDebugLoc(DebugLoc::getDropped());
// Copy NUW for ADDs if both instructions have it.
if (Opcode == Instruction::Add && BO->hasNoUnsignedWrap() &&
diff --git a/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp b/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
index 39e8d702a692e..6bdf76f789a49 100644
--- a/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
@@ -442,7 +442,7 @@ class LoadEliminationForLoop {
assert(PH && "Preheader should exist!");
Value *InitialPtr = SEE.expandCodeFor(PtrSCEV->getStart(), Ptr->getType(),
PH->getTerminator());
- Value *Initial =
+ Instruction *Initial =
new LoadInst(Cand.Load->getType(), InitialPtr, "load_initial",
/* isVolatile */ false, Cand.Load->getAlign(),
PH->getTerminator()->getIterator());
@@ -450,6 +450,7 @@ class LoadEliminationForLoop {
// into the loop's preheader. A debug location inside the loop will cause
// a misleading stepping when debugging. The test update-debugloc-store
// -forwarded.ll checks this.
+ Initial->setDebugLoc(DebugLoc::getDropped());
PHINode *PHI = PHINode::Create(Initial->getType(), 2, "store_forwarded");
PHI->insertBefore(L->getHeader()->begin());
diff --git a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
index 4c6f6f12d7138..540249ac9b6ab 100644
--- a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
+++ b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
@@ -274,6 +274,7 @@ static void buildPartialUnswitchConditionalBranch(
BasicBlock &UnswitchedSucc, BasicBlock &NormalSucc, bool InsertFreeze,
const Instruction *I, AssumptionCache *AC, const DominatorTree &DT) {
IRBuilder<> IRB(&BB);
+ IRB.SetCurrentDebugLocation(DebugLoc::getCompilerGenerated());
SmallVector<Value *> FrozenInvariants;
for (Value *Inv : Invariants) {
@@ -326,6 +327,7 @@ static void buildPartialInvariantUnswitchConditionalBranch(
}
IRBuilder<> IRB(&BB);
+ IRB.SetCurrentDebugLocation(DebugLoc::getCompilerGenerated());
Value *Cond = VMap[ToDuplicate[0]];
IRB.CreateCondBr(Cond, Direction ? &UnswitchedSucc : &NormalSucc,
Direction ? &NormalSucc : &UnswitchedSucc);
@@ -2365,6 +2367,7 @@ static void unswitchNontrivialInvariants(
// BI (`dyn_cast<BranchInst>(TI)`) is an in-loop instruction hoisted
// out of the loop.
Cond = new FreezeInst(Cond, Cond->getName() + ".fr", BI->getIterator());
+ cast<Instruction>(Cond)->setDebugLoc(DebugLoc::getDropped());
}
BI->setCondition(Cond);
DTUpdates.push_back({DominatorTree::Insert, SplitBB, ClonedPH});
diff --git a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
index 7dd6c60370ed9..c71c5a70a12fd 100644
--- a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
@@ -515,7 +515,8 @@ void TailRecursionEliminator::createTailRecurseLoopHeader(CallInst *CI) {
BasicBlock *NewEntry = BasicBlock::Create(F.getContext(), "", &F, HeaderBB);
NewEntry->takeName(HeaderBB);
HeaderBB->setName("tailrecurse");
- BranchInst::Create(HeaderBB, NewEntry);
+ auto *BI = BranchInst::Create(HeaderBB, NewEntry);
+ BI->setDebugLoc(DebugLoc::getCompilerGenerated());
// If the new branch preserves the debug location of CI, it could result in
// misleading stepping, if CI is located in a conditional branch.
// So, here we don't give any debug location to the new branch.
@@ -801,6 +802,7 @@ void TailRecursionEliminator::cleanupAndFinalize() {
SelectInst *SI =
SelectInst::Create(RetKnownPN, RetPN, RI->getOperand(0),
"current.ret.tr", RI->getIterator());
+ SI->setDebugLoc(DebugLoc::getCompilerGenerated());
RetSelects.push_back(SI);
RI->setOperand(0, SI);
}
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 6913a9e976a29..31d9399e8ef72 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -1770,6 +1770,7 @@ static Value *HandleByValArgument(Type *ByValType, Value *Arg,
AllocaInst *NewAlloca =
new AllocaInst(ByValType, Arg->getType()->getPointerAddressSpace(),
nullptr, Alignment, Arg->getName());
+ NewAlloca->setDebugLoc(DebugLoc::getCompilerGenerated());
NewAlloca->insertBefore(Caller->begin()->begin());
IFI.StaticAllocas.push_back(NewAlloca);
@@ -3240,6 +3241,8 @@ llvm::InlineResult llvm::InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
// Add an unconditional branch to make this look like the CallInst case...
CreatedBranchToNormalDest = BranchInst::Create(II->getNormalDest(), CB.getIterator());
+ // We intend to replace this DebugLoc with another later.
+ CreatedBranchToNormalDest->setDebugLoc(DebugLoc::getTemporary());
// Split the basic block. This guarantees that no PHI nodes will have to be
// updated due to new incoming edges, and make the invoke case more
@@ -3343,6 +3346,8 @@ llvm::InlineResult llvm::InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
} else if (!CB.use_empty()) {
// No returns, but something is using the return value of the call. Just
// nuke the result.
+ if (CreatedBranchToNormalDest)
+ CreatedBranchToNormalDest->setDebugLoc(DebugLoc::getUnknown());
CB.replaceAllUsesWith(PoisonValue::get(CB.getType()));
}
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index b3204da93049b..8e68ec6a312da 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -3131,7 +3131,8 @@ static bool markAliveBlocks(Function &F,
BasicBlock *UnreachableNormalDest = BasicBlock::Create(
Ctx, OrigNormalDest->getName() + ".unreachable",
II->getFunction(), OrigNormalDest);
- new UnreachableInst(Ctx, UnreachableNormalDest);
+ auto *UI = new UnreachableInst(Ctx, UnreachableNormalDest);
+ UI->setDebugLoc(DebugLoc::getTemporary());
II->setNormalDest(UnreachableNormalDest);
if (DTU)
DTU->applyUpdates(
diff --git a/llvm/lib/Transforms/Utils/SCCPSolver.cpp b/llvm/lib/Transforms/Utils/SCCPSolver.cpp
index c64254140cf22..41ac066894f79 100644
--- a/llvm/lib/Transforms/Utils/SCCPSolver.cpp
+++ b/llvm/lib/Transforms/Utils/SCCPSolver.cpp
@@ -322,7 +322,9 @@ bool SCCPSolver::removeNonFeasibleEdges(BasicBlock *BB, DomTreeUpdater &DTU,
NewUnreachableBB =
BasicBlock::Create(DefaultDest->getContext(), "default.unreachable",
DefaultDest->getParent(), DefaultDest);
- new UnreachableInst(DefaultDest->getContext(), NewUnreachableBB);
+ auto *UI =
+ new UnreachableInst(DefaultDest->getContext(), NewUnreachableBB);
+ UI->setDebugLoc(DebugLoc::getTemporary());
}
DefaultDest->removePredecessor(BB);
diff --git a/llvm/lib/Transforms/Utils/SSAUpdater.cpp b/llvm/lib/Transforms/Utils/SSAUpdater.cpp
index 48d9528f0c3df..155bcaaae1512 100644
--- a/llvm/lib/Transforms/Utils/SSAUpdater.cpp
+++ b/llvm/lib/Transforms/Utils/SSAUpdater.cpp
@@ -318,6 +318,7 @@ class SSAUpdaterTraits<SSAUpdater> {
SSAUpdater *Updater) {
PHINode *PHI =
PHINode::Create(Updater->ProtoType, NumPreds, Updater->ProtoName);
+ PHI->setDebugLoc(DebugLoc::getUnknown());
PHI->insertBefore(BB->begin());
return PHI;
}
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 7f53aa7d4f73d..06c6cde11d571 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -1135,7 +1135,7 @@ static void cloneInstructionsIntoPredecessorBlockAndUpdateSSAUses(
// branch, drop it. When we fold the bonus instructions we want to make
// sure we reset their debug locations in order to avoid stepping on
// dead code caused by folding dead branches.
- NewBonusInst->setDebugLoc(DebugLoc());
+ NewBonusInst->setDebugLoc(DebugLoc::getDropped());
}
RemapInstruction(NewBonusInst, VMap,
@@ -2811,7 +2811,8 @@ static void mergeCompatibleInvokesImpl(ArrayRef<InvokeInst *> Invokes,
// so just form a new block with unreachable terminator.
BasicBlock *MergedNormalDest = BasicBlock::Create(
Ctx, II0BB->getName() + ".cont", Func, InsertBeforeBlock);
- new UnreachableInst(Ctx, MergedNormalDest);
+ auto *UI = new UnreachableInst(Ctx, MergedNormalDest);
+ UI->setDebugLoc(DebugLoc::getTemporary());
MergedInvoke->setNormalDest(MergedNormalDest);
}
@@ -3376,7 +3377,7 @@ bool SimplifyCFGOpt::speculativelyExecuteBB(BranchInst *BI,
if (!SpeculatedStoreValue || &I != SpeculatedStore) {
// Don't update the DILocation of dbg.assign intrinsics.
if (!isa<DbgAssignIntrinsic>(&I))
- I.setDebugLoc(DebugLoc());
+ I.setDebugLoc(DebugLoc::getDropped());
}
I.dropUBImplyingAttrsAndMetadata();
@@ -5694,7 +5695,8 @@ static void createUnreachableSwitchDefault(SwitchInst *Switch,
BasicBlock *NewDefaultBlock = BasicBlock::Create(
BB->getContext(), BB->getName() + ".unreachabledefault", BB->getParent(),
OrigDefaultBlock);
- new UnreachableInst(Switch->getContext(), NewDefaultBlock);
+ auto *UI = new UnreachableInst(Switch->getContext(), NewDefaultBlock);
+ UI->setDebugLoc(DebugLoc::getTemporary());
Switch->setDefaultDest(&*NewDefaultBlock);
if (DTU) {
SmallVector<DominatorTree::UpdateType, 2> Updates;
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
index f639f0adb9c43..890a57862e12c 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
@@ -152,7 +152,7 @@ class VPBuilder {
VPInstruction *createNaryOp(unsigned Opcode, ArrayRef<VPValue *> Operands,
Instruction *Inst = nullptr,
const Twine &Name = "") {
- DebugLoc DL;
+ DebugLoc DL = DebugLoc::getUnknown();
if (Inst)
DL = Inst->getDebugLoc();
VPInstruction *NewVPInst = createInstruction(Opcode, Operands, DL, Name);
@@ -166,7 +166,7 @@ class VPBuilder {
VPInstruction *createNaryOp(unsigned Opcode,
std::initializer_list<VPValue *> Operands,
std::optional<FastMathFlags> FMFs = {},
- DebugLoc DL = {}, const Twine &Name = "") {
+ DebugLoc DL = DebugLoc::getUnknown(), const Twine &Name = "") {
if (FMFs)
return tryInsertInstruction(
new VPInstruction(Opcode, Operands, *FMFs, DL, Name));
@@ -184,22 +184,22 @@ class VPBuilder {
VPInstruction *createOverflowingOp(unsigned Opcode,
std::initializer_list<VPValue *> Operands,
VPRecipeWithIRFlags::WrapFlagsTy WrapFlags,
- DebugLoc DL = {}, const Twine &Name = "") {
+ DebugLoc DL = DebugLoc::getUnknown(), const Twine &Name = "") {
return tryInsertInstruction(
new VPInstruction(Opcode, Operands, WrapFlags, DL, Name));
}
- VPValue *createNot(VPValue *Operand, DebugLoc DL = {},
+ VPValue *createNot(VPValue *Operand, DebugLoc DL = DebugLoc::getUnknown(),
const Twine &Name = "") {
return createInstruction(VPInstruction::Not, {Operand}, DL, Name);
}
- VPValue *createAnd(VPValue *LHS, VPValue *RHS, DebugLoc DL = {},
+ VPValue *createAnd(VPValue *LHS, VPValue *RHS, DebugLoc DL = DebugLoc::getUnknown(),
const Twine &Name = "") {
return createInstruction(Instruction::BinaryOps::And, {LHS, RHS}, DL, Name);
}
- VPValue *createOr(VPValue *LHS, VPValue *RHS, DebugLoc DL = {},
+ VPValue *createOr(VPValue *LHS, VPValue *RHS, DebugLoc DL = DebugLoc::getUnknown(),
const Twine &Name = "") {
return tryInsertInstruction(new VPInstruction(
@@ -207,14 +207,14 @@ class VPBuilder {
VPRecipeWithIRFlags::DisjointFlagsTy(false), DL, Name));
}
- VPValue *createLogicalAnd(VPValue *LHS, VPValue *RHS, DebugLoc DL = {},
+ VPValue *createLogicalAnd(VPValue *LHS, VPValue *RHS, DebugLoc DL = DebugLoc::getUnknown(),
const Twine &Name = "") {
return tryInsertInstruction(
new VPInstruction(VPInstruction::LogicalAnd, {LHS, RHS}, DL, Name));
}
VPValue *createSelect(VPValue *Cond, VPValue *TrueVal, VPValue *FalseVal,
- DebugLoc DL = {}, const Twine &Name = ...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/136192
More information about the llvm-commits
mailing list