According the discuss on D154953, we need to make the LangRef change
before the optimization relied on the new behaviour:
vscale_range implies vscale is a power-of-two value, parse of the attribute to reject values that are not a power-of-two.
Paths
| Differential D155193
[LangRef] vscale_range implies the vscale is power-of-two ClosedPublic Authored by Allen on Jul 13 2023, 6:05 AM.
Details Summary According the discuss on D154953, we need to make the LangRef change vscale_range implies vscale is a power-of-two value, parse of the attribute to reject values that are not a power-of-two.
Diff Detail Event TimelineComment Actions To provide a bit more context here. We would like to have power of two vscale exposed in a target-independent way, so we can make use of this in places like ValueTracking, just like we currently do the vscale range. Some options that have been discussed are:
Comment Actions The approach taken here seems fine. It gives the optimization opportunities we want now, but leaves open an escape hatch for non-power-of-two widths if some target does end up needing them. (SVE does require power-of-two lengths, but they made that decision very late; there seems to be some room for other architectures to make a different choice.) Allen added inline comments. Comment Actions I've offered some alternate phrasing to consider but am happy to accept the patch on principle. Please give others a chance to comment on your final choice of phrasing before landing the patch.
This revision is now accepted and ready to land.Jul 14 2023, 4:48 AM Allen marked 2 inline comments as done. Comment ActionsThanks, apply your comment , and I'll wait a couple days before landing this patch. This revision was landed with ongoing or failed builds.Jul 14 2023, 6:18 PM Closed by commit rG7203286329de: [LangRef] vscale_range implies the vscale is power-of-two (authored by Allen). · Explain Why This revision was automatically updated to reflect the committed changes. Allen added a child revision: D155350: [ValueTracking] Support vscale assumes for isKnownToBeAPowerOfTwo.Jul 14 2023, 7:13 PM
Revision Contents
Diff 539985 llvm/docs/BitCodeFormat.rst
llvm/docs/LangRef.rst
llvm/lib/IR/Verifier.cpp
llvm/test/Transforms/InstCombine/icmp-vscale.ll
llvm/test/Transforms/InstCombine/vscale_sext_and_zext.ll
llvm/test/Transforms/InstCombine/vscale_trunc.ll
llvm/test/Verifier/vscale_range.ll
|
This change does not affect the bitcode format, no need to modify this file.