[PATCH] D92471: [CSInfo][ISEL] Do not create CSInfo for undef arguments

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 2 08:12:41 PST 2020


djtodoro 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);
>   +  }
>   +

It makes sense to me.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92471/new/

https://reviews.llvm.org/D92471



More information about the llvm-commits mailing list