[PATCH] D114075: [IR] Split vscale_range interface
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 3 04:59:14 PST 2021
sdesmalen added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp:1611-1615
+ Optional<unsigned> MaxVScale =
+ CI.getFunction()
+ ->getFnAttribute(Attribute::VScaleRange)
+ .getVScaleRangeMax();
+ if (MaxVScale && Log2_32(MaxVScale.getValue()) < (SrcBitSize - 1)) {
----------------
nit: this is probably a stylistic thing, but I personally find the following a bit nicer to read:
Attribute Attr = CI.getFunction()->getFnAttribute(Attribute::VScaleRange);
if (Optional<unsigned> MaxVScale = Attr.getVScaleRangeMax())
if (Log2_32(MaxVScale.getValue()) < (SrcBitSize - 1)) {
..
}
(same suggestion for the similar cases)
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5654-5656
+ Optional<unsigned> VScaleMax =
+ TheFunction->getFnAttribute(Attribute::VScaleRange).getVScaleRangeMax();
+ if (VScaleMax)
----------------
nit: similar suggestion here:
Attribute Attr = CI.getFunction()->getFnAttribute(Attribute::VScaleRange);
if (Optional<unsigned> Max = Attr.getVScaleRangeMax())
MaxVScale = Max.getValue();
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114075/new/
https://reviews.llvm.org/D114075
More information about the llvm-commits
mailing list