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

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 2 07:23:23 PST 2020


dstenb added a comment.

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


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

https://reviews.llvm.org/D92471



More information about the llvm-commits mailing list