[PATCH] D115873: [LAA] Add remarks for unbounded array access

Malhar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 28 06:23:46 PST 2022


malharJ added inline comments.


================
Comment at: llvm/lib/Analysis/LoopAccessAnalysis.cpp:565
+                       bool ShouldCheckWrap = false,
+                       Value **UncomputablePtr = nullptr);
 
----------------
malharJ wrote:
> sdesmalen wrote:
> > Instead of passing in the pointer with a default value of `nullptr`, can you make it a reference, so that it always gets set, e.g.
> > 
> >   Value *&UncomputablePtr
> > 
> > That also removes the need for the conditional write.
> Can we please leave it as initialised as nullptr ?
> 
> The conditional write ensures that the first unsafe dependence gets reported by the remark.
> 
> 
> ```
>  if (UncomputablePtr)
>      *UncomputablePtr = Access.getPointer();
> ```
> 
> 
> 
> 
Ok please ignore the above. I've made the change as suggested,

But I didn't remove that bit in the code.
The conditional write ensures that the first unsafe dependence gets reported by the remark.

```
if (!UncomputablePtr)
    UncomputablePtr = Access.getPointer();
```



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115873



More information about the llvm-commits mailing list