Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This makes sense to me. The call site info represents info about param value transferring, so if the value was undef, we have "nothing to transfer".
I think it would be preferable if we could do this in a target independent place, so that downstream targets, and upstream targets that do not yet support call sites, do not have to care about this.
Can we do this in collectCallSiteParameters by looking at the call instruction's undef uses?
Something like this:
@@ -787,6 +787,15 @@ static void collectCallSiteParameters(const MachineInstr *CallMI, (void)InsertedReg; } + for (auto &MO : CallMI->uses()) { + if (!MO.isReg() || !MO.isUndef()) + continue; + auto It = ForwardedRegWorklist.find(MO.getReg()); + if (It == ForwardedRegWorklist.end()) + continue; + ForwardedRegWorklist.erase(It); + } +
LGTM.
As both the emission of the IMPLICIT_DEF instructions in SelectionDAG, and the resolving of those instructions in "Process Implicit Definitions", is target independent code, I think it would be sufficient with only keeping one of these test cases, but I would be fine with landed this with all five.