[PATCH] D114112: [SCEVAA] Avoid forming malformed pointer diff expressions

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 17 12:43:19 PST 2021


reames added a comment.

In D114112#3138506 <https://reviews.llvm.org/D114112#3138506>, @efriedma wrote:

> In D114112#3138447 <https://reviews.llvm.org/D114112#3138447>, @reames wrote:
>
>> In D114112#3138430 <https://reviews.llvm.org/D114112#3138430>, @efriedma wrote:
>>
>>> Do we have some documentation that indicates what we expect alias() to return in the case where instructionCouldExistWitthOperands fails?
>>
>> Not quite sure what you're asking.  If we have two pointers, the conservative result should always be MayAlias.  Is that what you meant?
>
> I mean, if we do an alias query with a pair of Instruction* that don't have a common scope, are all AA implementations required to always return MayAlias?  Call llvm_unreachable?  Or can we perform some sort of approximation of the possible values produced by the Instruction? If we do approximate the value, what are the rules for that?

Ah, this is a question about the alias interface on AliasAnalysis.  It doesn't appear to address this question.  I'm honestly not sure if we could return anything other than MayAlias, and very deliberately tried not to open that can of worms.  :)



================
Comment at: llvm/test/Analysis/ScalarEvolution/scev-aa.ll:306
+; dominated by the first.  As a result of that, we can nest the
+; addrecs and cancel out the %data base pointer.
+define void @test_dom(double* %data) {
----------------
efriedma wrote:
> "%addr1" here represents the value of the address in the last iteration of the first subloop?  Should SCEVAA try to canonicalize the SCEV with getSCEVAtScope() or something like that to get more precise results?
We seem to already get all the alias precision we can on this example.  The getSCEVAtScope question is reasonable, but doesn't appear to be needed at least on this one.  


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114112



More information about the llvm-commits mailing list