Skip to content

[DLCov][NFC] Annotate intentionally-blank DebugLocs in existing code #136192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions llvm/lib/Transforms/IPO/GlobalOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/IPO/IROutliner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 "
Expand Down
9 changes: 8 additions & 1 deletion llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why temporary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Temporary" is used for instructions that won't have generated machine code, i.e. when we finish compilation, we wouldn't expect to see any line table entry for that instruction. UnreachableInsts are the most typical case of this, though there may be exceptions (off the top of my head there might be a case in the LoopVectorizer where we assign a meaningful DebugLoc to an unreachable).


DefaultDest->removePredecessor(BB);
SI->setDefaultDest(NewUnreachableBB);
Expand Down
1 change: 1 addition & 0 deletions llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is dropped right here, why not getCompilerGenerated? (and are there docs / comments explain which to use?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are docs on the "How to update debug info" page and in lighter detail in DebugLoc.h, added by the previous patch in the stack. In this particular case, I didn't immediately recall the rationale - meaning this should have a comment. I believe in this case though, NewRHS is a sub-operation of ICmp, where ICmp is an instruction in the loop and NewRHS is inserted into the loop-header (to hoist work out of the loop). Given this, NewRHS should have ICmp's DebugLoc, but since it is hoisted past a conditional branch it must be dropped, hence we just assign a "dropped" DebugLoc to the new instruction here.

ICmp->setOperand(Swapped ? 1 : 0, LHSOp);
ICmp->setOperand(Swapped ? 0 : 1, NewRHS);
// Samesign flag cannot be preserved after narrowing the compare.
Expand Down
4 changes: 3 additions & 1 deletion llvm/lib/Transforms/Scalar/JumpThreading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions llvm/lib/Transforms/Scalar/LICM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -2249,7 +2249,7 @@ bool llvm::promoteLoopAccessesToScalars(
if (SawUnorderedAtomic)
PreheaderLoad->setOrdering(AtomicOrdering::Unordered);
PreheaderLoad->setAlignment(Alignment);
PreheaderLoad->setDebugLoc(DebugLoc());
PreheaderLoad->dropLocation();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the change to dropLocation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a mistake on my part, along with replacing dropLocation() with DebugLoc::getDropped() above - it should be the other way around (i.e. this uses getDropped() and the above keeps using dropLocation()).

if (AATags && LoadIsGuaranteedToExecute)
PreheaderLoad->setAAMetadata(AATags);

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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() &&
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,14 +442,15 @@ 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());
// We don't give any debug location to Initial, because it is inserted
// 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());
Expand Down
3 changes: 3 additions & 0 deletions llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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});
Expand Down
4 changes: 3 additions & 1 deletion llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
}
Expand Down
9 changes: 9 additions & 0 deletions llvm/lib/Transforms/Utils/InlineFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -3341,6 +3344,12 @@ llvm::InlineResult llvm::InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
Returns[0]->eraseFromParent();
ReturnBB->eraseFromParent();
} else if (!CB.use_empty()) {
// In this case there are no returns to use, so there is no clear source
// location for the "return".
// FIXME: It may be correct to use the scope end line of the function here,
// since this likely means we are falling out of the function.
if (CreatedBranchToNormalDest)
CreatedBranchToNormalDest->setDebugLoc(DebugLoc::getUnknown());
// No returns, but something is using the return value of the call. Just
// nuke the result.
CB.replaceAllUsesWith(PoisonValue::get(CB.getType()));
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Transforms/Utils/Local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion llvm/lib/Transforms/Utils/SCCPSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions llvm/lib/Transforms/Utils/SSAUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ class SSAUpdaterTraits<SSAUpdater> {
SSAUpdater *Updater) {
PHINode *PHI =
PHINode::Create(Updater->ProtoType, NumPreds, Updater->ProtoName);
// FIXME: Ordinarily we don't care about or try to assign DebugLocs to PHI
// nodes, but loop optimizations may try to use a PHI node as a DebugLoc
// source (e.g. if this is an induction variable), and it's not clear what
// location we could attach here, so mark this unknown for now.
PHI->setDebugLoc(DebugLoc::getUnknown());
PHI->insertBefore(BB->begin());
return PHI;
}
Expand Down
10 changes: 6 additions & 4 deletions llvm/lib/Transforms/Utils/SimplifyCFG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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;
Expand Down
22 changes: 11 additions & 11 deletions llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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));
Expand All @@ -184,37 +184,37 @@ 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(
Instruction::BinaryOps::Or, {LHS, RHS},
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 = "",
DebugLoc DL = DebugLoc::getUnknown(), const Twine &Name = "",
std::optional<FastMathFlags> FMFs = std::nullopt) {
auto *Select =
FMFs ? new VPInstruction(Instruction::Select, {Cond, TrueVal, FalseVal},
Expand All @@ -228,19 +228,19 @@ class VPBuilder {
/// and \p B.
/// TODO: add createFCmp when needed.
VPValue *createICmp(CmpInst::Predicate Pred, VPValue *A, VPValue *B,
DebugLoc DL = {}, const Twine &Name = "") {
DebugLoc DL = DebugLoc::getUnknown(), const Twine &Name = "") {
assert(Pred >= CmpInst::FIRST_ICMP_PREDICATE &&
Pred <= CmpInst::LAST_ICMP_PREDICATE && "invalid predicate");
return tryInsertInstruction(
new VPInstruction(Instruction::ICmp, Pred, A, B, DL, Name));
}

VPInstruction *createPtrAdd(VPValue *Ptr, VPValue *Offset, DebugLoc DL = {},
VPInstruction *createPtrAdd(VPValue *Ptr, VPValue *Offset, DebugLoc DL = DebugLoc::getUnknown(),
const Twine &Name = "") {
return tryInsertInstruction(
new VPInstruction(Ptr, Offset, GEPNoWrapFlags::none(), DL, Name));
}
VPValue *createInBoundsPtrAdd(VPValue *Ptr, VPValue *Offset, DebugLoc DL = {},
VPValue *createInBoundsPtrAdd(VPValue *Ptr, VPValue *Offset, DebugLoc DL = DebugLoc::getUnknown(),
const Twine &Name = "") {
return tryInsertInstruction(
new VPInstruction(Ptr, Offset, GEPNoWrapFlags::inBounds(), DL, Name));
Expand Down
Loading
Loading