[PATCH] D73167: Don't separate imp/expl def handling for call site params
David Stenberg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 23 07:16:05 PST 2020
dstenb updated this revision to Diff 239895.
dstenb added a comment.
Add comment to variable.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73167/new/
https://reviews.llvm.org/D73167
Files:
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Index: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -581,35 +581,27 @@
// the describeLoadedValue()). For those remaining arguments in the working
// list, for which we do not describe a loaded value by
// the describeLoadedValue(), we try to generate an entry value expression
- // for their call site value desctipion, if the call is within the entry MBB.
+ // for their call site value description, if the call is within the entry MBB.
// The RegsForEntryValues maps a forwarding register into the register holding
// the entry value.
// TODO: Handle situations when call site parameter value can be described
- // as the entry value within basic blocks other then the first one.
+ // as the entry value within basic blocks other than the first one.
bool ShouldTryEmitEntryVals = MBB->getIterator() == MF->begin();
DenseMap<unsigned, unsigned> RegsForEntryValues;
// If the MI is an instruction defining one or more parameters' forwarding
- // registers, add those defines. We can currently only describe forwarded
- // registers that are explicitly defined, but keep track of implicit defines
- // also to remove those registers from the work list.
+ // registers, add those defines.
auto getForwardingRegsDefinedByMI = [&](const MachineInstr &MI,
- SmallVectorImpl<unsigned> &Explicit,
- SmallVectorImpl<unsigned> &Implicit) {
+ SmallSetVector<unsigned, 4> &Defs) {
if (MI.isDebugInstr())
return;
for (const MachineOperand &MO : MI.operands()) {
if (MO.isReg() && MO.isDef() &&
Register::isPhysicalRegister(MO.getReg())) {
- for (auto FwdReg : ForwardedRegWorklist) {
- if (TRI->regsOverlap(FwdReg, MO.getReg())) {
- if (MO.isImplicit())
- Implicit.push_back(FwdReg);
- else
- Explicit.push_back(FwdReg);
- }
- }
+ for (auto FwdReg : ForwardedRegWorklist)
+ if (TRI->regsOverlap(FwdReg, MO.getReg()))
+ Defs.insert(FwdReg);
}
}
};
@@ -641,18 +633,19 @@
if (ForwardedRegWorklist.empty())
return;
- SmallVector<unsigned, 4> ExplicitFwdRegDefs;
- SmallVector<unsigned, 4> ImplicitFwdRegDefs;
- getForwardingRegsDefinedByMI(*I, ExplicitFwdRegDefs, ImplicitFwdRegDefs);
- if (ExplicitFwdRegDefs.empty() && ImplicitFwdRegDefs.empty())
+ // Set of worklist registers that are defined by this instruction.
+ SmallSetVector<unsigned, 4> FwdRegDefs;
+
+ getForwardingRegsDefinedByMI(*I, FwdRegDefs);
+ if (FwdRegDefs.empty())
continue;
// If the MI clobbers more then one forwarding register we must remove
// all of them from the working list.
- for (auto Reg : concat<unsigned>(ExplicitFwdRegDefs, ImplicitFwdRegDefs))
+ for (auto Reg : FwdRegDefs)
ForwardedRegWorklist.erase(Reg);
- for (auto ParamFwdReg : ExplicitFwdRegDefs) {
+ for (auto ParamFwdReg : FwdRegDefs) {
if (auto ParamValue = TII->describeLoadedValue(*I, ParamFwdReg)) {
if (ParamValue->first.isImm()) {
int64_t Val = ParamValue->first.getImm();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73167.239895.patch
Type: text/x-patch
Size: 3399 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200123/99dd21c3/attachment.bin>
More information about the llvm-commits
mailing list