[PATCH] D55798: [LAA] Avoid generating RT checks for known deps preventing vectorization.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 18 13:37:57 PST 2018


fhahn marked an inline comment as done.
fhahn added inline comments.


================
Comment at: include/llvm/Analysis/LoopAccessAnalysis.h:223
     return ShouldRetryWithRuntimeCheck &&
-           Status == VectorizationSafetyStatus::Unsafe;
+           Status == VectorizationSafetyStatus::SafeWithRtChecks;
   }
----------------
Ayal wrote:
> > When SafeWithRtChecks is added, in next patch, consider renaming the flag or method (slightly), as they will no longer mean exactly the same thing. 
> 
> Consider renaming `ShouldRetryWithRuntimeCheck` to something like `FoundDependenceForRuntimeCheck`; or keep the original name but fold SafeWithRtChecks into the flag, i.e., when turning the flag on check if Status is not Unsafe, and when setting Status to Unsafe turn the flag off.
> 
> On second thought, now that Status includes SafeWithRtChecks, this flag seems redundant, and suffice to have
> 
> ```
> bool shouldRetryWithRuntimeCheck() const {
>   return Status == VectorizationSafetyStatus::SafeWithRtChecks;
> }
> 
> ```
> ?
Currently, ShouldRetryWithRuntimeCheck is only set when we return Unknown for non-constant distances between dependences. There are other cases where we return Unknown, but do not set it.

By removing it, we would generate runtime checks in more cases. That might be beneficial, but I think should be done in a separate patch. 


Repository:
  rL LLVM

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

https://reviews.llvm.org/D55798





More information about the llvm-commits mailing list