[PATCH] D80640: [CodeGen][SVE] Calculate correct type legalization for scalable vectors.
David Sherwood via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 28 01:35:11 PDT 2020
david-arm added inline comments.
================
Comment at: llvm/include/llvm/Support/TypeSize.h:54
+
+ bool isOne() const { return Min == 1 && !Scalable; }
+
----------------
Alternatively here we could have a more powerful isEqual() where we pass an unsigned integer of the same type in ElementCount, then you can simply do:
if (EC.isEqual(1)) { ... }
The function would look like
bool isEqual(const unsigned RHS) const {
return Min == RHS && !Scalable;
}
If you don't want to do that in this patch that's fine, but it might be more generic?
================
Comment at: llvm/lib/CodeGen/TargetLoweringBase.cpp:828
EVT::getVectorVT(Context, SVT.getVectorElementType(),
- SVT.getVectorNumElements() / 2));
+ SVT.getVectorElementCount() / 2));
if (LA == TypeScalarizeVector)
----------------
Instead of calling EVT::getVectorVT, could we just call SVT.getHalfNumVectorElementsVT() instead? It does the same thing.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80640/new/
https://reviews.llvm.org/D80640
More information about the llvm-commits
mailing list