[PATCH] D17080: [LAA] Allow more run-time alias checks by coercing pointer expressions to AddRecExprs

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 07:02:32 PDT 2017


anna added a comment.

Hi Silviu, 
I came across the similar gap, but I aggressively tried converting the PtrSCEV to AddRec in `hasComputableBounds`, which worked on our internal benchmark. Could you please clarify why you have the `Assume` to be false in the first call, i.e. how do we know that it's not useful to try and convert PtrSCEV to AddRec?

This was my patch over the original code.

  diff --git a/lib/Analysis/LoopAccessAnalysis.cpp b/lib/Analysis/LoopAccessAnalysis.cpp
  index d2dbecd..a1c7584 100644
  --- a/lib/Analysis/LoopAccessAnalysis.cpp
  +++ b/lib/Analysis/LoopAccessAnalysis.cpp
  @@ -608,6 +608,11 @@ static bool hasComputableBounds(PredicatedScalarEvolution &PSE,
       return true;
   
     const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(PtrScev);
  +  // Sometimes the PtrSCEV can be converted into the AddRec, try to retrieve it
  +  // if possible.
  +  if (!AR)
  +    AR = PSE.getAsAddRec(Ptr);
  +    if (!AR)
           return false;


https://reviews.llvm.org/D17080





More information about the llvm-commits mailing list