[PATCH] D154953: [InstCombine] Remove the reminder loop if we know the mask is always true

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 04:53:07 PDT 2023


paulwalker-arm added a comment.

In D154953#4492037 <https://reviews.llvm.org/D154953#4492037>, @Allen wrote:

> So now can I just delete the checking **TTI.isVScaleKnownToBeAPowerOfTwo()** with above **halfway house**, which is assume the m_VScale() is power-of-two values for all targets ? or  use a DataLayout here.

To implement my suggestion you'll need to update the LangRef to document that `vscale_range` implies `vscale` is a power-of-two.  This is best done as a separate patch because you'll also need to updating the parsing of the attribute to reject values that are not a power-of-two. This patch should include the RISC-V folk so we've go agreement between the current targets that support scalable vectors.

At that point you should be able to implement the combine (or update ValueTracking) using purely information within the IR without any uses of TTI.


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

https://reviews.llvm.org/D154953



More information about the llvm-commits mailing list