[PATCH] D156124: LoopVectorize/iv-select-cmp: add test for wide trip count (NFC)

Ramkumar Ramachandra via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 07:51:14 PDT 2023


artagnon added inline comments.


================
Comment at: llvm/test/Transforms/LoopVectorize/iv-select-cmp.ll:77
+  %cmp5 = icmp sgt i32 %n, 0
+  br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup
+
----------------
fhahn wrote:
> fhahn wrote:
> > Is this needed?
> I guess it's needed reading back the latest comments for D150851. Would be good to add a comment with an explanation and also add negative version of the test (i.e. where %n isn't guaranteed to be signed positive in i32).
Just to be clear: this test doesn't pass with Mel's patch. I can add another test with `icmp eq`, but we can theoretically vectorize it without a runtime check, because of the `nuw nsw` flags on the `add` instruction corresponding to `%inc`. I think the comment with the explanations should be added by the final version of Mel's patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156124



More information about the llvm-commits mailing list