forked from OSchip/llvm-project
[DebugInfo][NFC] Update LDV to use generic DBG_VALUE* MI interface
Currently, InstrRefLDV only handles DBG_VALUE instructions, not DBG_VALUE_LIST, and as a result of this it handles these instructions using functions that only work for that type of debug value, i.e. using getOperand(0) to get the debug operand. This patch changes this to use the generic debug value functions, such as getDebugOperand and isDebugOffsetImm, as well as adding an IsVariadic field to the DbgValueProperties class and a few other minor changes to acknowledge DBG_VALUE_LISTs. Note that this patch does not add support for DBG_VALUE_LIST here, but is a precursor to other patches that do add that support. Differential Revision: https://reviews.llvm.org/D128174
This commit is contained in:
parent
aa59c9810a
commit
11ce014a12
|
@ -442,6 +442,10 @@ public:
|
||||||
if (!ShouldEmitDebugEntryValues)
|
if (!ShouldEmitDebugEntryValues)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// We don't currently emit entry values for DBG_VALUE_LISTs.
|
||||||
|
if (Prop.IsVariadic)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Is the variable appropriate for entry values (i.e., is a parameter).
|
// Is the variable appropriate for entry values (i.e., is a parameter).
|
||||||
if (!isEntryValueVariable(Var, Prop.DIExpr))
|
if (!isEntryValueVariable(Var, Prop.DIExpr))
|
||||||
return false;
|
return false;
|
||||||
|
@ -456,7 +460,8 @@ public:
|
||||||
Register Reg = MTracker->LocIdxToLocID[Num.getLoc()];
|
Register Reg = MTracker->LocIdxToLocID[Num.getLoc()];
|
||||||
MachineOperand MO = MachineOperand::CreateReg(Reg, false);
|
MachineOperand MO = MachineOperand::CreateReg(Reg, false);
|
||||||
|
|
||||||
PendingDbgValues.push_back(emitMOLoc(MO, Var, {NewExpr, Prop.Indirect}));
|
PendingDbgValues.push_back(
|
||||||
|
emitMOLoc(MO, Var, {NewExpr, Prop.Indirect, Prop.IsVariadic}));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -466,7 +471,7 @@ public:
|
||||||
MI.getDebugLoc()->getInlinedAt());
|
MI.getDebugLoc()->getInlinedAt());
|
||||||
DbgValueProperties Properties(MI);
|
DbgValueProperties Properties(MI);
|
||||||
|
|
||||||
const MachineOperand &MO = MI.getOperand(0);
|
const MachineOperand &MO = MI.getDebugOperand(0);
|
||||||
|
|
||||||
// Ignore non-register locations, we don't transfer those.
|
// Ignore non-register locations, we don't transfer those.
|
||||||
if (!MO.isReg() || MO.getReg() == 0) {
|
if (!MO.isReg() || MO.getReg() == 0) {
|
||||||
|
@ -861,13 +866,38 @@ MachineInstrBuilder MLocTracker::emitLoc(Optional<LocIdx> MLoc,
|
||||||
DebugLoc DL = DILocation::get(Var.getVariable()->getContext(), 0, 0,
|
DebugLoc DL = DILocation::get(Var.getVariable()->getContext(), 0, 0,
|
||||||
Var.getVariable()->getScope(),
|
Var.getVariable()->getScope(),
|
||||||
const_cast<DILocation *>(Var.getInlinedAt()));
|
const_cast<DILocation *>(Var.getInlinedAt()));
|
||||||
auto MIB = BuildMI(MF, DL, TII.get(TargetOpcode::DBG_VALUE));
|
|
||||||
|
const MCInstrDesc &Desc = Properties.IsVariadic
|
||||||
|
? TII.get(TargetOpcode::DBG_VALUE_LIST)
|
||||||
|
: TII.get(TargetOpcode::DBG_VALUE);
|
||||||
|
|
||||||
|
auto GetRegOp = [](unsigned Reg) -> MachineOperand {
|
||||||
|
return MachineOperand::CreateReg(
|
||||||
|
/* Reg */ Reg, /* isDef */ false, /* isImp */ false,
|
||||||
|
/* isKill */ false, /* isDead */ false,
|
||||||
|
/* isUndef */ false, /* isEarlyClobber */ false,
|
||||||
|
/* SubReg */ 0, /* isDebug */ true);
|
||||||
|
};
|
||||||
|
|
||||||
|
SmallVector<MachineOperand> MOs;
|
||||||
|
|
||||||
|
auto EmitUndef = [&]() {
|
||||||
|
MOs.clear();
|
||||||
|
MOs.assign(Properties.getLocationOpCount(), GetRegOp(0));
|
||||||
|
return BuildMI(MF, DL, Desc, false, MOs, Var.getVariable(),
|
||||||
|
Properties.DIExpr);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Only 1 location is currently supported.
|
||||||
|
if (Properties.IsVariadic && Properties.getLocationOpCount() != 1)
|
||||||
|
return EmitUndef();
|
||||||
|
|
||||||
|
bool Indirect = Properties.Indirect;
|
||||||
|
|
||||||
const DIExpression *Expr = Properties.DIExpr;
|
const DIExpression *Expr = Properties.DIExpr;
|
||||||
if (!MLoc) {
|
if (!MLoc) {
|
||||||
// No location -> DBG_VALUE $noreg
|
// No location -> DBG_VALUE $noreg
|
||||||
MIB.addReg(0);
|
return EmitUndef();
|
||||||
MIB.addReg(0);
|
|
||||||
} else if (LocIdxToLocID[*MLoc] >= NumRegs) {
|
} else if (LocIdxToLocID[*MLoc] >= NumRegs) {
|
||||||
unsigned LocID = LocIdxToLocID[*MLoc];
|
unsigned LocID = LocIdxToLocID[*MLoc];
|
||||||
SpillLocationNo SpillID = locIDToSpill(LocID);
|
SpillLocationNo SpillID = locIDToSpill(LocID);
|
||||||
|
@ -884,7 +914,7 @@ MachineInstrBuilder MLocTracker::emitLoc(Optional<LocIdx> MLoc,
|
||||||
if (Offset == 0) {
|
if (Offset == 0) {
|
||||||
const SpillLoc &Spill = SpillLocs[SpillID.id()];
|
const SpillLoc &Spill = SpillLocs[SpillID.id()];
|
||||||
unsigned Base = Spill.SpillBase;
|
unsigned Base = Spill.SpillBase;
|
||||||
MIB.addReg(Base);
|
MOs.push_back(GetRegOp(Base));
|
||||||
|
|
||||||
// There are several ways we can dereference things, and several inputs
|
// There are several ways we can dereference things, and several inputs
|
||||||
// to consider:
|
// to consider:
|
||||||
|
@ -923,7 +953,6 @@ MachineInstrBuilder MLocTracker::emitLoc(Optional<LocIdx> MLoc,
|
||||||
Expr = TRI.prependOffsetExpression(
|
Expr = TRI.prependOffsetExpression(
|
||||||
Expr, DIExpression::ApplyOffset | DIExpression::DerefAfter,
|
Expr, DIExpression::ApplyOffset | DIExpression::DerefAfter,
|
||||||
Spill.SpillOffset);
|
Spill.SpillOffset);
|
||||||
MIB.addImm(0);
|
|
||||||
} else if (UseDerefSize) {
|
} else if (UseDerefSize) {
|
||||||
// We're loading a value off the stack that's not the same size as the
|
// We're loading a value off the stack that's not the same size as the
|
||||||
// variable. Add / subtract stack offset, explicitly deref with a size,
|
// variable. Add / subtract stack offset, explicitly deref with a size,
|
||||||
|
@ -933,7 +962,6 @@ MachineInstrBuilder MLocTracker::emitLoc(Optional<LocIdx> MLoc,
|
||||||
Expr = DIExpression::prependOpcodes(Expr, Ops, true);
|
Expr = DIExpression::prependOpcodes(Expr, Ops, true);
|
||||||
unsigned Flags = DIExpression::StackValue | DIExpression::ApplyOffset;
|
unsigned Flags = DIExpression::StackValue | DIExpression::ApplyOffset;
|
||||||
Expr = TRI.prependOffsetExpression(Expr, Flags, Spill.SpillOffset);
|
Expr = TRI.prependOffsetExpression(Expr, Flags, Spill.SpillOffset);
|
||||||
MIB.addReg(0);
|
|
||||||
} else if (Expr->isComplex()) {
|
} else if (Expr->isComplex()) {
|
||||||
// A variable with no size ambiguity, but with extra elements in it's
|
// A variable with no size ambiguity, but with extra elements in it's
|
||||||
// expression. Manually dereference the stack location.
|
// expression. Manually dereference the stack location.
|
||||||
|
@ -941,34 +969,26 @@ MachineInstrBuilder MLocTracker::emitLoc(Optional<LocIdx> MLoc,
|
||||||
Expr = TRI.prependOffsetExpression(
|
Expr = TRI.prependOffsetExpression(
|
||||||
Expr, DIExpression::ApplyOffset | DIExpression::DerefAfter,
|
Expr, DIExpression::ApplyOffset | DIExpression::DerefAfter,
|
||||||
Spill.SpillOffset);
|
Spill.SpillOffset);
|
||||||
MIB.addReg(0);
|
|
||||||
} else {
|
} else {
|
||||||
// A plain value that has been spilt to the stack, with no further
|
// A plain value that has been spilt to the stack, with no further
|
||||||
// context. Request a location expression, marking the DBG_VALUE as
|
// context. Request a location expression, marking the DBG_VALUE as
|
||||||
// IsIndirect.
|
// IsIndirect.
|
||||||
Expr = TRI.prependOffsetExpression(Expr, DIExpression::ApplyOffset,
|
Expr = TRI.prependOffsetExpression(Expr, DIExpression::ApplyOffset,
|
||||||
Spill.SpillOffset);
|
Spill.SpillOffset);
|
||||||
MIB.addImm(0);
|
Indirect = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// This is a stack location with a weird subregister offset: emit an undef
|
// This is a stack location with a weird subregister offset: emit an undef
|
||||||
// DBG_VALUE instead.
|
// DBG_VALUE instead.
|
||||||
MIB.addReg(0);
|
return EmitUndef();
|
||||||
MIB.addReg(0);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Non-empty, non-stack slot, must be a plain register.
|
// Non-empty, non-stack slot, must be a plain register.
|
||||||
unsigned LocID = LocIdxToLocID[*MLoc];
|
unsigned LocID = LocIdxToLocID[*MLoc];
|
||||||
MIB.addReg(LocID);
|
MOs.push_back(GetRegOp(LocID));
|
||||||
if (Properties.Indirect)
|
|
||||||
MIB.addImm(0);
|
|
||||||
else
|
|
||||||
MIB.addReg(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MIB.addMetadata(Var.getVariable());
|
return BuildMI(MF, DL, Desc, Indirect, MOs, Var.getVariable(), Expr);
|
||||||
MIB.addMetadata(Expr);
|
|
||||||
return MIB;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Default construct and initialize the pass.
|
/// Default construct and initialize the pass.
|
||||||
|
@ -1063,7 +1083,7 @@ bool InstrRefBasedLDV::transferDebugValue(const MachineInstr &MI) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MachineOperand &MO = MI.getOperand(0);
|
const MachineOperand &MO = MI.getDebugOperand(0);
|
||||||
|
|
||||||
// MLocTracker needs to know that this register is read, even if it's only
|
// MLocTracker needs to know that this register is read, even if it's only
|
||||||
// read by a debug inst.
|
// read by a debug inst.
|
||||||
|
@ -1081,9 +1101,8 @@ bool InstrRefBasedLDV::transferDebugValue(const MachineInstr &MI) {
|
||||||
VTracker->defVar(MI, Properties, MTracker->readReg(MO.getReg()));
|
VTracker->defVar(MI, Properties, MTracker->readReg(MO.getReg()));
|
||||||
else
|
else
|
||||||
VTracker->defVar(MI, Properties, None);
|
VTracker->defVar(MI, Properties, None);
|
||||||
} else if (MI.getOperand(0).isImm() || MI.getOperand(0).isFPImm() ||
|
} else if (MO.isImm() || MO.isFPImm() || MO.isCImm()) {
|
||||||
MI.getOperand(0).isCImm()) {
|
VTracker->defVar(MI, MO);
|
||||||
VTracker->defVar(MI, MI.getOperand(0));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1267,7 +1286,7 @@ bool InstrRefBasedLDV::transferDebugInstrRef(MachineInstr &MI,
|
||||||
// it. The rest of this LiveDebugValues implementation acts exactly the same
|
// it. The rest of this LiveDebugValues implementation acts exactly the same
|
||||||
// for DBG_INSTR_REFs as DBG_VALUEs (just, the former can refer to values that
|
// for DBG_INSTR_REFs as DBG_VALUEs (just, the former can refer to values that
|
||||||
// aren't immediately available).
|
// aren't immediately available).
|
||||||
DbgValueProperties Properties(Expr, false);
|
DbgValueProperties Properties(Expr, false, false);
|
||||||
if (VTracker)
|
if (VTracker)
|
||||||
VTracker->defVar(MI, Properties, NewID);
|
VTracker->defVar(MI, Properties, NewID);
|
||||||
|
|
||||||
|
@ -1307,7 +1326,8 @@ bool InstrRefBasedLDV::transferDebugInstrRef(MachineInstr &MI,
|
||||||
// later instruction in this block, this is a block-local use-before-def.
|
// later instruction in this block, this is a block-local use-before-def.
|
||||||
if (!FoundLoc && NewID && NewID->getBlock() == CurBB &&
|
if (!FoundLoc && NewID && NewID->getBlock() == CurBB &&
|
||||||
NewID->getInst() > CurInst)
|
NewID->getInst() > CurInst)
|
||||||
TTracker->addUseBeforeDef(V, {MI.getDebugExpression(), false}, *NewID);
|
TTracker->addUseBeforeDef(V, {MI.getDebugExpression(), false, false},
|
||||||
|
*NewID);
|
||||||
|
|
||||||
// Produce a DBG_VALUE representing what this DBG_INSTR_REF meant.
|
// Produce a DBG_VALUE representing what this DBG_INSTR_REF meant.
|
||||||
// This DBG_VALUE is potentially a $noreg / undefined location, if
|
// This DBG_VALUE is potentially a $noreg / undefined location, if
|
||||||
|
@ -2683,7 +2703,7 @@ void InstrRefBasedLDV::buildVLocValueMap(
|
||||||
|
|
||||||
// Initialize all values to start as NoVals. This signifies "it's live
|
// Initialize all values to start as NoVals. This signifies "it's live
|
||||||
// through, but we don't know what it is".
|
// through, but we don't know what it is".
|
||||||
DbgValueProperties EmptyProperties(EmptyExpr, false);
|
DbgValueProperties EmptyProperties(EmptyExpr, false, false);
|
||||||
for (unsigned int I = 0; I < NumBlocks; ++I) {
|
for (unsigned int I = 0; I < NumBlocks; ++I) {
|
||||||
DbgValue EmptyDbgValue(I, EmptyProperties, DbgValue::NoVal);
|
DbgValue EmptyDbgValue(I, EmptyProperties, DbgValue::NoVal);
|
||||||
LiveIns.push_back(EmptyDbgValue);
|
LiveIns.push_back(EmptyDbgValue);
|
||||||
|
|
|
@ -199,26 +199,35 @@ public:
|
||||||
/// the value, and Boolean of whether or not it's indirect.
|
/// the value, and Boolean of whether or not it's indirect.
|
||||||
class DbgValueProperties {
|
class DbgValueProperties {
|
||||||
public:
|
public:
|
||||||
DbgValueProperties(const DIExpression *DIExpr, bool Indirect)
|
DbgValueProperties(const DIExpression *DIExpr, bool Indirect, bool IsVariadic)
|
||||||
: DIExpr(DIExpr), Indirect(Indirect) {}
|
: DIExpr(DIExpr), Indirect(Indirect), IsVariadic(IsVariadic) {}
|
||||||
|
|
||||||
/// Extract properties from an existing DBG_VALUE instruction.
|
/// Extract properties from an existing DBG_VALUE instruction.
|
||||||
DbgValueProperties(const MachineInstr &MI) {
|
DbgValueProperties(const MachineInstr &MI) {
|
||||||
assert(MI.isDebugValue());
|
assert(MI.isDebugValue());
|
||||||
|
assert(MI.getDebugExpression()->getNumLocationOperands() == 0 ||
|
||||||
|
MI.isDebugValueList() || MI.isUndefDebugValue());
|
||||||
|
IsVariadic = MI.isDebugValueList();
|
||||||
DIExpr = MI.getDebugExpression();
|
DIExpr = MI.getDebugExpression();
|
||||||
Indirect = MI.getOperand(1).isImm();
|
Indirect = MI.isDebugOffsetImm();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const DbgValueProperties &Other) const {
|
bool operator==(const DbgValueProperties &Other) const {
|
||||||
return std::tie(DIExpr, Indirect) == std::tie(Other.DIExpr, Other.Indirect);
|
return std::tie(DIExpr, Indirect, IsVariadic) ==
|
||||||
|
std::tie(Other.DIExpr, Other.Indirect, Other.IsVariadic);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!=(const DbgValueProperties &Other) const {
|
bool operator!=(const DbgValueProperties &Other) const {
|
||||||
return !(*this == Other);
|
return !(*this == Other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned getLocationOpCount() const {
|
||||||
|
return IsVariadic ? DIExpr->getNumLocationOperands() : 1;
|
||||||
|
}
|
||||||
|
|
||||||
const DIExpression *DIExpr;
|
const DIExpression *DIExpr;
|
||||||
bool Indirect;
|
bool Indirect;
|
||||||
|
bool IsVariadic;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Class recording the (high level) _value_ of a variable. Identifies either
|
/// Class recording the (high level) _value_ of a variable. Identifies either
|
||||||
|
@ -704,7 +713,7 @@ public:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
VLocTracker(const OverlapMap &O, const DIExpression *EmptyExpr)
|
VLocTracker(const OverlapMap &O, const DIExpression *EmptyExpr)
|
||||||
: OverlappingFragments(O), EmptyProperties(EmptyExpr, false) {}
|
: OverlappingFragments(O), EmptyProperties(EmptyExpr, false, false) {}
|
||||||
|
|
||||||
void defVar(const MachineInstr &MI, const DbgValueProperties &Properties,
|
void defVar(const MachineInstr &MI, const DbgValueProperties &Properties,
|
||||||
Optional<ValueIDNum> ID) {
|
Optional<ValueIDNum> ID) {
|
||||||
|
|
|
@ -1800,7 +1800,7 @@ TEST_F(InstrRefLDVTest, pickVPHILocDiamond) {
|
||||||
ValueIDNum RspPHIInBlk3(RetBlk, 0, RspLoc);
|
ValueIDNum RspPHIInBlk3(RetBlk, 0, RspLoc);
|
||||||
|
|
||||||
DebugVariable Var(FuncVariable, None, nullptr);
|
DebugVariable Var(FuncVariable, None, nullptr);
|
||||||
DbgValueProperties EmptyProps(EmptyExpr, false);
|
DbgValueProperties EmptyProps(EmptyExpr, false, false);
|
||||||
SmallVector<DbgValue, 32> VLiveOuts;
|
SmallVector<DbgValue, 32> VLiveOuts;
|
||||||
VLiveOuts.resize(4, DbgValue(EmptyProps, DbgValue::Undef));
|
VLiveOuts.resize(4, DbgValue(EmptyProps, DbgValue::Undef));
|
||||||
InstrRefBasedLDV::LiveIdxT VLiveOutIdx;
|
InstrRefBasedLDV::LiveIdxT VLiveOutIdx;
|
||||||
|
@ -1888,13 +1888,13 @@ TEST_F(InstrRefLDVTest, pickVPHILocDiamond) {
|
||||||
// different indirectness or DIExpression.
|
// different indirectness or DIExpression.
|
||||||
DIExpression *NewExpr =
|
DIExpression *NewExpr =
|
||||||
DIExpression::prepend(EmptyExpr, DIExpression::ApplyOffset, 4);
|
DIExpression::prepend(EmptyExpr, DIExpression::ApplyOffset, 4);
|
||||||
DbgValueProperties PropsWithExpr(NewExpr, false);
|
DbgValueProperties PropsWithExpr(NewExpr, false, false);
|
||||||
VLiveOuts[1] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
|
VLiveOuts[1] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
|
||||||
VLiveOuts[2] = DbgValue(LiveInRsp, PropsWithExpr, DbgValue::Def);
|
VLiveOuts[2] = DbgValue(LiveInRsp, PropsWithExpr, DbgValue::Def);
|
||||||
Result = pickVPHILoc(*MBB3, Var, VLiveOutIdx, MOutLocs, Preds);
|
Result = pickVPHILoc(*MBB3, Var, VLiveOutIdx, MOutLocs, Preds);
|
||||||
EXPECT_FALSE(Result);
|
EXPECT_FALSE(Result);
|
||||||
|
|
||||||
DbgValueProperties PropsWithIndirect(EmptyExpr, true);
|
DbgValueProperties PropsWithIndirect(EmptyExpr, true, false);
|
||||||
VLiveOuts[1] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
|
VLiveOuts[1] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
|
||||||
VLiveOuts[2] = DbgValue(LiveInRsp, PropsWithIndirect, DbgValue::Def);
|
VLiveOuts[2] = DbgValue(LiveInRsp, PropsWithIndirect, DbgValue::Def);
|
||||||
Result = pickVPHILoc(*MBB3, Var, VLiveOutIdx, MOutLocs, Preds);
|
Result = pickVPHILoc(*MBB3, Var, VLiveOutIdx, MOutLocs, Preds);
|
||||||
|
@ -1929,7 +1929,7 @@ TEST_F(InstrRefLDVTest, pickVPHILocLoops) {
|
||||||
ValueIDNum RaxPHIInBlk1(LoopBlk, 0, RaxLoc);
|
ValueIDNum RaxPHIInBlk1(LoopBlk, 0, RaxLoc);
|
||||||
|
|
||||||
DebugVariable Var(FuncVariable, None, nullptr);
|
DebugVariable Var(FuncVariable, None, nullptr);
|
||||||
DbgValueProperties EmptyProps(EmptyExpr, false);
|
DbgValueProperties EmptyProps(EmptyExpr, false, false);
|
||||||
SmallVector<DbgValue, 32> VLiveOuts;
|
SmallVector<DbgValue, 32> VLiveOuts;
|
||||||
VLiveOuts.resize(3, DbgValue(EmptyProps, DbgValue::Undef));
|
VLiveOuts.resize(3, DbgValue(EmptyProps, DbgValue::Undef));
|
||||||
InstrRefBasedLDV::LiveIdxT VLiveOutIdx;
|
InstrRefBasedLDV::LiveIdxT VLiveOutIdx;
|
||||||
|
@ -2031,7 +2031,7 @@ TEST_F(InstrRefLDVTest, pickVPHILocBadlyNestedLoops) {
|
||||||
ValueIDNum RbxPHIInBlk1(Loop1Blk, 0, RbxLoc);
|
ValueIDNum RbxPHIInBlk1(Loop1Blk, 0, RbxLoc);
|
||||||
|
|
||||||
DebugVariable Var(FuncVariable, None, nullptr);
|
DebugVariable Var(FuncVariable, None, nullptr);
|
||||||
DbgValueProperties EmptyProps(EmptyExpr, false);
|
DbgValueProperties EmptyProps(EmptyExpr, false, false);
|
||||||
SmallVector<DbgValue, 32> VLiveOuts;
|
SmallVector<DbgValue, 32> VLiveOuts;
|
||||||
VLiveOuts.resize(5, DbgValue(EmptyProps, DbgValue::Undef));
|
VLiveOuts.resize(5, DbgValue(EmptyProps, DbgValue::Undef));
|
||||||
InstrRefBasedLDV::LiveIdxT VLiveOutIdx;
|
InstrRefBasedLDV::LiveIdxT VLiveOutIdx;
|
||||||
|
@ -2160,7 +2160,7 @@ TEST_F(InstrRefLDVTest, vlocJoinDiamond) {
|
||||||
ValueIDNum RspPHIInBlkRetBlk(RetBlk, 0, RspLoc);
|
ValueIDNum RspPHIInBlkRetBlk(RetBlk, 0, RspLoc);
|
||||||
|
|
||||||
DebugVariable Var(FuncVariable, None, nullptr);
|
DebugVariable Var(FuncVariable, None, nullptr);
|
||||||
DbgValueProperties EmptyProps(EmptyExpr, false);
|
DbgValueProperties EmptyProps(EmptyExpr, false, false);
|
||||||
SmallVector<DbgValue, 32> VLiveOuts;
|
SmallVector<DbgValue, 32> VLiveOuts;
|
||||||
VLiveOuts.resize(4, DbgValue(EmptyProps, DbgValue::Undef));
|
VLiveOuts.resize(4, DbgValue(EmptyProps, DbgValue::Undef));
|
||||||
InstrRefBasedLDV::LiveIdxT VLiveOutIdx;
|
InstrRefBasedLDV::LiveIdxT VLiveOutIdx;
|
||||||
|
@ -2272,7 +2272,7 @@ TEST_F(InstrRefLDVTest, vlocJoinDiamond) {
|
||||||
EXPECT_EQ(JoinedLoc.BlockNo, 0);
|
EXPECT_EQ(JoinedLoc.BlockNo, 0);
|
||||||
|
|
||||||
// We shouldn't eliminate PHIs when properties disagree.
|
// We shouldn't eliminate PHIs when properties disagree.
|
||||||
DbgValueProperties PropsWithIndirect(EmptyExpr, true);
|
DbgValueProperties PropsWithIndirect(EmptyExpr, true, false);
|
||||||
VLiveOuts[1] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
|
VLiveOuts[1] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
|
||||||
VLiveOuts[2] = DbgValue(LiveInRsp, PropsWithIndirect, DbgValue::Def);
|
VLiveOuts[2] = DbgValue(LiveInRsp, PropsWithIndirect, DbgValue::Def);
|
||||||
JoinedLoc = DbgValue(3, EmptyProps, DbgValue::VPHI);
|
JoinedLoc = DbgValue(3, EmptyProps, DbgValue::VPHI);
|
||||||
|
@ -2299,7 +2299,7 @@ TEST_F(InstrRefLDVTest, vlocJoinDiamond) {
|
||||||
// not be eliminated.
|
// not be eliminated.
|
||||||
DIExpression *NewExpr =
|
DIExpression *NewExpr =
|
||||||
DIExpression::prepend(EmptyExpr, DIExpression::ApplyOffset, 4);
|
DIExpression::prepend(EmptyExpr, DIExpression::ApplyOffset, 4);
|
||||||
DbgValueProperties PropsWithExpr(NewExpr, false);
|
DbgValueProperties PropsWithExpr(NewExpr, false, false);
|
||||||
VLiveOuts[1] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
|
VLiveOuts[1] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
|
||||||
VLiveOuts[2] = DbgValue(LiveInRsp, PropsWithExpr, DbgValue::Def);
|
VLiveOuts[2] = DbgValue(LiveInRsp, PropsWithExpr, DbgValue::Def);
|
||||||
JoinedLoc = DbgValue(3, EmptyProps, DbgValue::VPHI);
|
JoinedLoc = DbgValue(3, EmptyProps, DbgValue::VPHI);
|
||||||
|
@ -2328,7 +2328,7 @@ TEST_F(InstrRefLDVTest, vlocJoinLoops) {
|
||||||
ValueIDNum RspPHIInBlk1(LoopBlk, 0, RspLoc);
|
ValueIDNum RspPHIInBlk1(LoopBlk, 0, RspLoc);
|
||||||
|
|
||||||
DebugVariable Var(FuncVariable, None, nullptr);
|
DebugVariable Var(FuncVariable, None, nullptr);
|
||||||
DbgValueProperties EmptyProps(EmptyExpr, false);
|
DbgValueProperties EmptyProps(EmptyExpr, false, false);
|
||||||
SmallVector<DbgValue, 32> VLiveOuts;
|
SmallVector<DbgValue, 32> VLiveOuts;
|
||||||
VLiveOuts.resize(3, DbgValue(EmptyProps, DbgValue::Undef));
|
VLiveOuts.resize(3, DbgValue(EmptyProps, DbgValue::Undef));
|
||||||
InstrRefBasedLDV::LiveIdxT VLiveOutIdx;
|
InstrRefBasedLDV::LiveIdxT VLiveOutIdx;
|
||||||
|
@ -2384,7 +2384,7 @@ TEST_F(InstrRefLDVTest, vlocJoinLoops) {
|
||||||
// properties.
|
// properties.
|
||||||
DIExpression *NewExpr =
|
DIExpression *NewExpr =
|
||||||
DIExpression::prepend(EmptyExpr, DIExpression::ApplyOffset, 4);
|
DIExpression::prepend(EmptyExpr, DIExpression::ApplyOffset, 4);
|
||||||
DbgValueProperties PropsWithExpr(NewExpr, false);
|
DbgValueProperties PropsWithExpr(NewExpr, false, false);
|
||||||
VLiveOuts[0] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
|
VLiveOuts[0] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
|
||||||
VLiveOuts[1] = DbgValue(1, PropsWithExpr, DbgValue::VPHI);
|
VLiveOuts[1] = DbgValue(1, PropsWithExpr, DbgValue::VPHI);
|
||||||
JoinedLoc = DbgValue(1, EmptyProps, DbgValue::VPHI);
|
JoinedLoc = DbgValue(1, EmptyProps, DbgValue::VPHI);
|
||||||
|
@ -2431,7 +2431,7 @@ TEST_F(InstrRefLDVTest, vlocJoinBadlyNestedLoops) {
|
||||||
ValueIDNum LiveInRbx(EntryBlk, 0, RbxLoc);
|
ValueIDNum LiveInRbx(EntryBlk, 0, RbxLoc);
|
||||||
|
|
||||||
DebugVariable Var(FuncVariable, None, nullptr);
|
DebugVariable Var(FuncVariable, None, nullptr);
|
||||||
DbgValueProperties EmptyProps(EmptyExpr, false);
|
DbgValueProperties EmptyProps(EmptyExpr, false, false);
|
||||||
SmallVector<DbgValue, 32> VLiveOuts;
|
SmallVector<DbgValue, 32> VLiveOuts;
|
||||||
VLiveOuts.resize(5, DbgValue(EmptyProps, DbgValue::Undef));
|
VLiveOuts.resize(5, DbgValue(EmptyProps, DbgValue::Undef));
|
||||||
InstrRefBasedLDV::LiveIdxT VLiveOutIdx;
|
InstrRefBasedLDV::LiveIdxT VLiveOutIdx;
|
||||||
|
@ -2477,7 +2477,7 @@ TEST_F(InstrRefLDVTest, vlocJoinBadlyNestedLoops) {
|
||||||
EXPECT_EQ(JoinedLoc.ID, LiveInRsp);
|
EXPECT_EQ(JoinedLoc.ID, LiveInRsp);
|
||||||
|
|
||||||
// They shouldn't merge if one of their properties is different.
|
// They shouldn't merge if one of their properties is different.
|
||||||
DbgValueProperties PropsWithIndirect(EmptyExpr, true);
|
DbgValueProperties PropsWithIndirect(EmptyExpr, true, false);
|
||||||
VLiveOuts[0] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
|
VLiveOuts[0] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
|
||||||
VLiveOuts[1] = DbgValue(1, EmptyProps, DbgValue::VPHI);
|
VLiveOuts[1] = DbgValue(1, EmptyProps, DbgValue::VPHI);
|
||||||
VLiveOuts[2] = DbgValue(1, PropsWithIndirect, DbgValue::VPHI);
|
VLiveOuts[2] = DbgValue(1, PropsWithIndirect, DbgValue::VPHI);
|
||||||
|
@ -2516,7 +2516,7 @@ TEST_F(InstrRefLDVTest, VLocSingleBlock) {
|
||||||
MInLocs[0][0] = MOutLocs[0][0] = LiveInRsp;
|
MInLocs[0][0] = MOutLocs[0][0] = LiveInRsp;
|
||||||
|
|
||||||
DebugVariable Var(FuncVariable, None, nullptr);
|
DebugVariable Var(FuncVariable, None, nullptr);
|
||||||
DbgValueProperties EmptyProps(EmptyExpr, false);
|
DbgValueProperties EmptyProps(EmptyExpr, false, false);
|
||||||
|
|
||||||
SmallSet<DebugVariable, 4> AllVars;
|
SmallSet<DebugVariable, 4> AllVars;
|
||||||
AllVars.insert(Var);
|
AllVars.insert(Var);
|
||||||
|
@ -2576,7 +2576,7 @@ TEST_F(InstrRefLDVTest, VLocDiamondBlocks) {
|
||||||
initValueArray(MOutLocs, 4, 2);
|
initValueArray(MOutLocs, 4, 2);
|
||||||
|
|
||||||
DebugVariable Var(FuncVariable, None, nullptr);
|
DebugVariable Var(FuncVariable, None, nullptr);
|
||||||
DbgValueProperties EmptyProps(EmptyExpr, false);
|
DbgValueProperties EmptyProps(EmptyExpr, false, false);
|
||||||
|
|
||||||
SmallSet<DebugVariable, 4> AllVars;
|
SmallSet<DebugVariable, 4> AllVars;
|
||||||
AllVars.insert(Var);
|
AllVars.insert(Var);
|
||||||
|
@ -2793,7 +2793,7 @@ TEST_F(InstrRefLDVTest, VLocSimpleLoop) {
|
||||||
initValueArray(MOutLocs, 3, 2);
|
initValueArray(MOutLocs, 3, 2);
|
||||||
|
|
||||||
DebugVariable Var(FuncVariable, None, nullptr);
|
DebugVariable Var(FuncVariable, None, nullptr);
|
||||||
DbgValueProperties EmptyProps(EmptyExpr, false);
|
DbgValueProperties EmptyProps(EmptyExpr, false, false);
|
||||||
|
|
||||||
SmallSet<DebugVariable, 4> AllVars;
|
SmallSet<DebugVariable, 4> AllVars;
|
||||||
AllVars.insert(Var);
|
AllVars.insert(Var);
|
||||||
|
@ -3046,7 +3046,7 @@ TEST_F(InstrRefLDVTest, VLocNestedLoop) {
|
||||||
initValueArray(MOutLocs, 5, 2);
|
initValueArray(MOutLocs, 5, 2);
|
||||||
|
|
||||||
DebugVariable Var(FuncVariable, None, nullptr);
|
DebugVariable Var(FuncVariable, None, nullptr);
|
||||||
DbgValueProperties EmptyProps(EmptyExpr, false);
|
DbgValueProperties EmptyProps(EmptyExpr, false, false);
|
||||||
|
|
||||||
SmallSet<DebugVariable, 4> AllVars;
|
SmallSet<DebugVariable, 4> AllVars;
|
||||||
AllVars.insert(Var);
|
AllVars.insert(Var);
|
||||||
|
|
Loading…
Reference in New Issue