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

Piotr Padlewski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 18 15:52:52 PDT 2018


Prazek marked 4 inline comments as done.
Prazek added a comment.

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

And use it in the places that I modified. 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