[PATCH] D92471: [CSInfo][ISEL] Do not create CSInfo for undef arguments
Nikola Tesic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 3 04:29:32 PST 2020
ntesic added a comment.
In D92471#2428505 <https://reviews.llvm.org/D92471#2428505>, @dstenb wrote:
> 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);
> + }
> +
Thanks, I agree with your proposal.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92471/new/
https://reviews.llvm.org/D92471
More information about the llvm-commits
mailing list