[PATCH] D97609: [RISCV] Add support for VECTOR_REVERSE for scalable vector types.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 26 23:44:45 PST 2021
craig.topper added inline comments.
================
Comment at: llvm/utils/TableGen/CodeGenDAGPatterns.cpp:731
- auto NoSize = [](const SmallSet<TypeSize, 2> &Sizes, MVT T) -> bool {
- return !Sizes.count(T.getSizeInBits());
+ auto NoSize =
+ [](const SmallSet<std::pair<bool, TypeSize::ScalarTy>, 2> &Sizes,
----------------
This hack is to prevent tablegen from throwing a bunch of warnings about assuming a vector type is not scalable. This occurs because of my use of SDTCisSameSizeAs in the type profile for vrgather_vv_vl in tablegen.
SmallSet defaults to std::less as its comparison function. But TypeSize doesn't implement operator< natively. But it appears to match to the operator< for uint64_t since there's a conversion operator to uint64_t in TypeSize. But that only works for fixed vectors.
To workaround this, I explicitly split up the TypeSize into a std::pair. Adding an operator< to TypeSize didn't seem like a good idea. Another option might be to switch to SmallDenseSet and add a DenseMapInfo for TypeSize.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97609/new/
https://reviews.llvm.org/D97609
More information about the llvm-commits
mailing list