Skip to content

Commit 7fc5838

Browse files
authored
[VPlan] Enable DebugLoc coverage tracking (llvm#156045)
Post 92195f6 (Reapply "[DLCov] Implement DebugLoc coverage tracking"), we should use DebugLoc::getUnknown() instead of the default constructor.
1 parent c13de14 commit 7fc5838

File tree

1 file changed

+23
-19
lines changed
  • llvm/lib/Transforms/Vectorize

1 file changed

+23
-19
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ class LLVM_ABI_FOR_TEST VPRecipeBase
400400

401401
public:
402402
VPRecipeBase(const unsigned char SC, ArrayRef<VPValue *> Operands,
403-
DebugLoc DL = {})
403+
DebugLoc DL = DebugLoc::getUnknown())
404404
: VPDef(SC), VPUser(Operands), DL(DL) {}
405405

406406
virtual ~VPRecipeBase() = default;
@@ -518,11 +518,11 @@ class LLVM_ABI_FOR_TEST VPRecipeBase
518518
class VPSingleDefRecipe : public VPRecipeBase, public VPValue {
519519
public:
520520
VPSingleDefRecipe(const unsigned char SC, ArrayRef<VPValue *> Operands,
521-
DebugLoc DL = {})
521+
DebugLoc DL = DebugLoc::getUnknown())
522522
: VPRecipeBase(SC, Operands, DL), VPValue(this) {}
523523

524524
VPSingleDefRecipe(const unsigned char SC, ArrayRef<VPValue *> Operands,
525-
Value *UV, DebugLoc DL = {})
525+
Value *UV, DebugLoc DL = DebugLoc::getUnknown())
526526
: VPRecipeBase(SC, Operands, DL), VPValue(this, UV) {}
527527

528528
static inline bool classof(const VPRecipeBase *R) {
@@ -864,15 +864,16 @@ class VPIRFlags {
864864
/// using IR flags.
865865
struct VPRecipeWithIRFlags : public VPSingleDefRecipe, public VPIRFlags {
866866
VPRecipeWithIRFlags(const unsigned char SC, ArrayRef<VPValue *> Operands,
867-
DebugLoc DL = {})
867+
DebugLoc DL = DebugLoc::getUnknown())
868868
: VPSingleDefRecipe(SC, Operands, DL), VPIRFlags() {}
869869

870870
VPRecipeWithIRFlags(const unsigned char SC, ArrayRef<VPValue *> Operands,
871871
Instruction &I)
872872
: VPSingleDefRecipe(SC, Operands, &I, I.getDebugLoc()), VPIRFlags(I) {}
873873

874874
VPRecipeWithIRFlags(const unsigned char SC, ArrayRef<VPValue *> Operands,
875-
const VPIRFlags &Flags, DebugLoc DL = {})
875+
const VPIRFlags &Flags,
876+
DebugLoc DL = DebugLoc::getUnknown())
876877
: VPSingleDefRecipe(SC, Operands, DL), VPIRFlags(Flags) {}
877878

878879
static inline bool classof(const VPRecipeBase *R) {
@@ -1081,13 +1082,13 @@ class LLVM_ABI_FOR_TEST VPInstruction : public VPRecipeWithIRFlags,
10811082
#endif
10821083

10831084
public:
1084-
VPInstruction(unsigned Opcode, ArrayRef<VPValue *> Operands, DebugLoc DL = {},
1085-
const Twine &Name = "")
1085+
VPInstruction(unsigned Opcode, ArrayRef<VPValue *> Operands,
1086+
DebugLoc DL = DebugLoc::getUnknown(), const Twine &Name = "")
10861087
: VPRecipeWithIRFlags(VPDef::VPInstructionSC, Operands, DL),
10871088
VPIRMetadata(), Opcode(Opcode), Name(Name.str()) {}
10881089

10891090
VPInstruction(unsigned Opcode, ArrayRef<VPValue *> Operands,
1090-
const VPIRFlags &Flags, DebugLoc DL = {},
1091+
const VPIRFlags &Flags, DebugLoc DL = DebugLoc::getUnknown(),
10911092
const Twine &Name = "");
10921093

10931094
VP_CLASSOF_IMPL(VPDef::VPInstructionSC)
@@ -1480,7 +1481,8 @@ class VPWidenCastRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
14801481
}
14811482

14821483
VPWidenCastRecipe(Instruction::CastOps Opcode, VPValue *Op, Type *ResultTy,
1483-
const VPIRFlags &Flags = {}, DebugLoc DL = {})
1484+
const VPIRFlags &Flags = {},
1485+
DebugLoc DL = DebugLoc::getUnknown())
14841486
: VPRecipeWithIRFlags(VPDef::VPWidenCastSC, Op, Flags, DL),
14851487
VPIRMetadata(), Opcode(Opcode), ResultTy(ResultTy) {
14861488
assert(flagsValidForOpcode(Opcode) &&
@@ -1538,7 +1540,7 @@ class VPWidenIntrinsicRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
15381540
public:
15391541
VPWidenIntrinsicRecipe(CallInst &CI, Intrinsic::ID VectorIntrinsicID,
15401542
ArrayRef<VPValue *> CallArguments, Type *Ty,
1541-
DebugLoc DL = {})
1543+
DebugLoc DL = DebugLoc::getUnknown())
15421544
: VPRecipeWithIRFlags(VPDef::VPWidenIntrinsicSC, CallArguments, CI),
15431545
VPIRMetadata(CI), VectorIntrinsicID(VectorIntrinsicID), ResultTy(Ty),
15441546
MayReadFromMemory(CI.mayReadFromMemory()),
@@ -1547,7 +1549,7 @@ class VPWidenIntrinsicRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
15471549

15481550
VPWidenIntrinsicRecipe(Intrinsic::ID VectorIntrinsicID,
15491551
ArrayRef<VPValue *> CallArguments, Type *Ty,
1550-
DebugLoc DL = {})
1552+
DebugLoc DL = DebugLoc::getUnknown())
15511553
: VPRecipeWithIRFlags(VPDef::VPWidenIntrinsicSC, CallArguments, DL),
15521554
VPIRMetadata(), VectorIntrinsicID(VectorIntrinsicID), ResultTy(Ty) {
15531555
LLVMContext &Ctx = Ty->getContext();
@@ -1616,7 +1618,8 @@ class LLVM_ABI_FOR_TEST VPWidenCallRecipe : public VPRecipeWithIRFlags,
16161618

16171619
public:
16181620
VPWidenCallRecipe(Value *UV, Function *Variant,
1619-
ArrayRef<VPValue *> CallArguments, DebugLoc DL = {})
1621+
ArrayRef<VPValue *> CallArguments,
1622+
DebugLoc DL = DebugLoc::getUnknown())
16201623
: VPRecipeWithIRFlags(VPDef::VPWidenCallSC, CallArguments,
16211624
*cast<Instruction>(UV)),
16221625
VPIRMetadata(*cast<Instruction>(UV)), Variant(Variant) {
@@ -1666,7 +1669,7 @@ class VPHistogramRecipe : public VPRecipeBase {
16661669

16671670
public:
16681671
VPHistogramRecipe(unsigned Opcode, ArrayRef<VPValue *> Operands,
1669-
DebugLoc DL = {})
1672+
DebugLoc DL = DebugLoc::getUnknown())
16701673
: VPRecipeBase(VPDef::VPHistogramSC, Operands, DL), Opcode(Opcode) {}
16711674

16721675
~VPHistogramRecipe() override = default;
@@ -2228,8 +2231,8 @@ class LLVM_ABI_FOR_TEST VPWidenPHIRecipe : public VPSingleDefRecipe,
22282231
public:
22292232
/// Create a new VPWidenPHIRecipe for \p Phi with start value \p Start and
22302233
/// debug location \p DL.
2231-
VPWidenPHIRecipe(PHINode *Phi, VPValue *Start = nullptr, DebugLoc DL = {},
2232-
const Twine &Name = "")
2234+
VPWidenPHIRecipe(PHINode *Phi, VPValue *Start = nullptr,
2235+
DebugLoc DL = DebugLoc::getUnknown(), const Twine &Name = "")
22332236
: VPSingleDefRecipe(VPDef::VPWidenPHISC, ArrayRef<VPValue *>(), Phi, DL),
22342237
Name(Name.str()) {
22352238
if (Start)
@@ -2559,14 +2562,14 @@ class LLVM_ABI_FOR_TEST VPReductionRecipe : public VPRecipeWithIRFlags {
25592562
public:
25602563
VPReductionRecipe(RecurKind RdxKind, FastMathFlags FMFs, Instruction *I,
25612564
VPValue *ChainOp, VPValue *VecOp, VPValue *CondOp,
2562-
bool IsOrdered, DebugLoc DL = {})
2565+
bool IsOrdered, DebugLoc DL = DebugLoc::getUnknown())
25632566
: VPReductionRecipe(VPDef::VPReductionSC, RdxKind, FMFs, I,
25642567
ArrayRef<VPValue *>({ChainOp, VecOp}), CondOp,
25652568
IsOrdered, DL) {}
25662569

25672570
VPReductionRecipe(const RecurKind RdxKind, FastMathFlags FMFs,
25682571
VPValue *ChainOp, VPValue *VecOp, VPValue *CondOp,
2569-
bool IsOrdered, DebugLoc DL = {})
2572+
bool IsOrdered, DebugLoc DL = DebugLoc::getUnknown())
25702573
: VPReductionRecipe(VPDef::VPReductionSC, RdxKind, FMFs, nullptr,
25712574
ArrayRef<VPValue *>({ChainOp, VecOp}), CondOp,
25722575
IsOrdered, DL) {}
@@ -2684,7 +2687,7 @@ class VPPartialReductionRecipe : public VPReductionRecipe {
26842687
class LLVM_ABI_FOR_TEST VPReductionEVLRecipe : public VPReductionRecipe {
26852688
public:
26862689
VPReductionEVLRecipe(VPReductionRecipe &R, VPValue &EVL, VPValue *CondOp,
2687-
DebugLoc DL = {})
2690+
DebugLoc DL = DebugLoc::getUnknown())
26882691
: VPReductionRecipe(
26892692
VPDef::VPReductionEVLSC, R.getRecurrenceKind(),
26902693
R.getFastMathFlags(),
@@ -3535,7 +3538,8 @@ class LLVM_ABI_FOR_TEST VPScalarIVStepsRecipe : public VPRecipeWithIRFlags,
35353538
InductionOpcode(Opcode) {}
35363539

35373540
VPScalarIVStepsRecipe(const InductionDescriptor &IndDesc, VPValue *IV,
3538-
VPValue *Step, VPValue *VF, DebugLoc DL = {})
3541+
VPValue *Step, VPValue *VF,
3542+
DebugLoc DL = DebugLoc::getUnknown())
35393543
: VPScalarIVStepsRecipe(
35403544
IV, Step, VF, IndDesc.getInductionOpcode(),
35413545
dyn_cast_or_null<FPMathOperator>(IndDesc.getInductionBinOp())

0 commit comments

Comments
 (0)