[PATCH] D99884: [LV] Logical and/or select costs

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 5 07:22:13 PDT 2021


dmgreen created this revision.
dmgreen added reviewers: aqjune, spatel, nikic, fhahn.
Herald added a subscriber: hiraditya.
dmgreen requested review of this revision.
Herald added a project: LLVM.

D99674 <https://reviews.llvm.org/D99674> stopped the folding of certain select operations into and/or, due to incorrect folding in the presence of poison. D97360 <https://reviews.llvm.org/D97360> added some costs to attempt to account for the change, but only worked at the getUserCost level, not the getCmpSelInstrCost that the vectorizer will use directly. This adds similar logic into the vectorizer to handle these logical and/or selects, treating them like and/or directly.

This fixes 60% performance regressions from code like the attached test case.


https://reviews.llvm.org/D99884

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/ARM/mve-selectandorcost.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99884.335249.patch
Type: text/x-patch
Size: 10276 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210405/73870f53/attachment.bin>


More information about the llvm-commits mailing list