[PATCH] D47088: Fix aliasing of launder.invariant.group

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 18 16:27:43 PDT 2018


hfinkel added a comment.

In https://reviews.llvm.org/D47088#1105280, @Prazek wrote:

> In https://reviews.llvm.org/D47088#1105258, @hfinkel wrote:
>
> > Is there some general principle we can outline to describe where these updates are needed?
>
>
> I am not sure how to do it right since I am not that familiar with this codebase. Maybe we can make function like
>
>   // This function can be used only for aliasing properties. You CAN'T use it to replace
>   // one value with another!
>   bool getArgumentAliasingToReturnedPointer(Function *F) {
>     if (Value *RV = CS.getReturnedArgOperand())
>         return RV;
>     if (CS.getIntrinsicID() == Intrinsic::launder_invariant_group)
>         return CS.getArgOperand(0);
>   
>     return nullptr;    
>   }


I think this refactoring makes sense. However...

> And use it in the places that I modified.

What I want to know is: how did you decide what had to be modified? Did you just look for every place that handles returned arguments? If you had to describe to someone how to find the places that need modification, how would you do it? (because that's what we need in the comment).

> Unfortunately it will not change CaptureTracking, because it goes top-down instead of bottom-up.
> 
> How does it sound to you?




Repository:
  rL LLVM

https://reviews.llvm.org/D47088





More information about the llvm-commits mailing list