[PATCH] D101541: BasicAA: Recognize inttoptr as isEscapeSource

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 29 19:39:30 PDT 2021


aqjune added a comment.

`isNonEscapingLocalObject` returns true if the pointer is a noalias argument, and it's worth clarifying why this is okay somewhere.

The noalias argument case is slightly different from other cases because its address could have been ptrtoint-ed already. For example:

  %i = ptrtoint i8* %ptr0 to i64
  call void @f(i8* %ptr0, i64 %i)
  
  define void @f(i8* noalias %ptr, i64 %i) {
    ; access %ptr <- isNonEscapingLocalObject(%ptr) is true, but
    ; access inttoptr(%i) <- this can exactly touch %ptr.
  }

It isn't clear whether the second access is successfully done according to the definition of based-on in LangRef.
Should we clarify that noalias ptr (`%ptr`) is not based on the original pointer (`%ptr0`)?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101541



More information about the llvm-commits mailing list