[PATCH] D66106: [LV] fold-tail predication should be respected even with assume_safety

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 14:02:01 PDT 2019


Ayal accepted this revision.
Ayal added a comment.
This revision is now accepted and ready to land.

LGTM, good catch!

The original overriding of SafePtrs by IsAnnotatedParallel deserves cleaning up, but preferably as a follow-up NFC patch to this wrong-code bug fix. I.e., when this "AllPtrsAreSafe" overriding takes place, there's no point in inserting any pointer to SafePtrs. (Put differently, this overriding could alternatively be implemented by inserting all accessed pointers to SafePtrs.) Finally, "continue"ing to next instruction for non-SafePtrs, while falling-thru to check I.mayWriteToMemory for SafePtrs, seems strange.



================
Comment at: test/Transforms/LoopVectorize/X86/tail_folding_and_assume_safety.ll:55
+; Case2: With pragma assume_safety only the store is masked.
+; void fold_tail(int * p, int * q1, int * q2, int guard) {
+;   #pragma clang loop vectorize(assume_safety)
----------------
fold_tail() >> assume_safety()


================
Comment at: test/Transforms/LoopVectorize/X86/tail_folding_and_assume_safety.ll:100
+; load are masked.
+; void fold_tail(int * p, int * q1, int * q2, int guard) {
+;   #pragma clang loop vectorize(assume_safety) vectorize_predicate(enable)
----------------
fold_tail() >> fold_tail_and_assume_safety()


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

https://reviews.llvm.org/D66106





More information about the llvm-commits mailing list