[PATCH] D108705: [AArch64][SVE] Add API for conversion between SVE predicate pattern and element count. NFC
David Sherwood via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 26 01:08:38 PDT 2021
david-arm added inline comments.
================
Comment at: llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h:470-471
+ case AArch64SVEPredPattern::vl8:
+ MinNumElts = Pattern;
+ break;
+ case AArch64SVEPredPattern::vl16:
----------------
junparser wrote:
> paulwalker-arm wrote:
> > Is there an LLVM coding style policy here? For example is setting `MinNumElts` and breaking preferred over just using return.
> I checked https://llvm.org/docs/CodingStandards.html, There is no rules for switch cases.
OK, I guess that's fine, but returning without breaks maybe does look nicer and more compact (it kills off 8 lines of code)? It's also more consistent with the default case that does return early.
i.e.
switch (Pattern) {
default:
return 0;
case AArch64SVEPredPattern::vl1:
...
return Pattern;
...
}
I don't feel too strongly about it though. :)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108705/new/
https://reviews.llvm.org/D108705
More information about the llvm-commits
mailing list