[PATCH] D32017: [MVT][SVE] Scalable vector MVTs (1/3)

Graham Hunter via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 18 05:48:18 PDT 2017


huntergr added inline comments.


================
Comment at: include/llvm/CodeGen/ValueTypes.h:311
+      EVT EltVT = getVectorElementType();
+      EltVT = EVT::getIntegerVT(Context, EltVT.getSizeInBits() / 2);
+      return EVT::getVectorVT(Context, EltVT, getVectorNumElements());
----------------
RKSimon wrote:
> assert that the size is even? Also, we don't seem to have a use for this function yet?
As with the other function below, it would be used later, but I'll delay it until that patch.


================
Comment at: include/llvm/CodeGen/ValueTypes.h:318
+    // extended type.
+    EVT getDoubleNumVectorElementsVT(LLVMContext &Context) const {
+      EVT EltVT = getVectorElementType();
----------------
rengolin wrote:
> I know it's for completeness, but you don't need this function, better not create it at this time.
It'll be used later (in the AArch64 backend), but ok, will remove until that later patch.


================
Comment at: include/llvm/CodeGen/ValueTypes.h:329
+      EVT EltVT = getVectorElementType();
+      auto EltCnt = getVectorNumElements();
+      return EVT::getVectorVT(Context, EltVT, EltCnt / 2);
----------------
RKSimon wrote:
> Use unsigned for clarity and assert that its even? The asserts in LegalizeVectorTypes.cpp and SelectionDAG.cpp can then be dropped
So the reason for the 'auto' is that this will be converted to use MVT::ElementCount in patch 3, so that it works with scalable vectors; you're right that I can move the assert about even numbers of elements here, though.


https://reviews.llvm.org/D32017





More information about the llvm-commits mailing list