[PATCH] D20665: Claim NoAlias if two GEPs index different fields of the same struct

Taewook Oh via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 1 20:06:15 PDT 2016


twoh added a comment.

@eli.friedman Thank you for bring up this example :) Actually your example is very close with the code snippet that motivates me to work on this patch. The only difference is that in my code index variable i iterates up to 10, not 11.

One thing I'd like to make sure is that the unit of "allocated object" in http://llvm.org/docs/LangRef.html#getelementptr-instruction is the entire struct, not an each field of the struct. I realized that if the value of %indvars.iv is 10 then %arrayidx and %b have the same valid value, but I assumed that it is still fine to aggressively claim NoAlias for such case because accessing %arrayidx will result poison value. However, if the entire struct is the unit of allocated object, then this patch is invalid.


Repository:
  rL LLVM

http://reviews.llvm.org/D20665





More information about the llvm-commits mailing list