[PATCH] D25557: [LAA] Collect pointers with unknown bounds

Evgeny Astigeevich via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 17 14:36:43 PDT 2016

eastig added inline comments.

Comment at: include/llvm/Analysis/LoopAccessAnalysis.h:478
+  void pointerWithUnknownBounds(Value *Ptr) {
+    assert(Ptr);
+    PtrsWithUnknownBounds.push_back(Ptr);
ashutosh.nema wrote:
> Its good to assert with some message (i.e. unexpected null pointer).
Not a problem.
I'll do.

Comment at: lib/Analysis/LoopAccessAnalysis.cpp:718
-  bool CanDoRTIfNeeded = !NeedRTCheck || CanDoRT;
-  if (!CanDoRTIfNeeded)
-    RtCheck.reset();
-  return CanDoRTIfNeeded;
+  return !NeedRTCheck || CanDoRT;
ashutosh.nema wrote:
> Earlier when “NeedRTCheck” is true & LAA can’t find the bounds of pointer it used to reset the “Need” field of RuntimePointerChecking, but with this change it can remains set. Is this expected change ?
The old behaviour is to reset RtCheck if we can not do RT checks when they are needed. Resetting means to make RtCheck Pointers and Checks empty. When they are empty it doesn't matter what a value Need has. We can do nothing with such RtCheck. But when Pointers is not empty the value of Need is important. According its documentation Need indicates if we need to add the runtime check. So when it's true RT checks might be created. They are not created if there are pointers with unknown bounds. In such case it's a user responsibility to create checks. The user can analyze Pointers and PtrsWithUnknownBounds and create needed checks.
I hope this explains why Need must be preserved.


More information about the llvm-commits mailing list