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

Renato Golin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 13 10:49:05 PDT 2017


rengolin added inline comments.


================
Comment at: include/llvm/CodeGen/MachineValueType.h:607
 
+    MVT::ElementCount getVectorElementCount() const {
+      return { getVectorNumElements(), isScalableVector() };
----------------
Can't you just return EC here?


================
Comment at: include/llvm/CodeGen/ValueTypes.h:77
+      // We don't support extended scalable types yet.
+      assert(!IsScalable);
       return getExtendedVectorVT(Context, VT, NumElements);
----------------
Add the comment inside the assert, like:

    assert(!IsScalable && "we don't support extended scalable types yet");


================
Comment at: include/llvm/CodeGen/ValueTypes.h:97
+      // We don't support extended scalable types yet.
+      assert (!isScalableVector());
       if (!isSimple())
----------------
ditto


================
Comment at: include/llvm/CodeGen/ValueTypes.h:157
+      // We don't support extended scalable types yet.
+      if (!isSimple())
+        return false;
----------------
I don't think this check is necessary, and may bite you later if you forget.

Either make it an assert, like the others, or just let the comparison get inlined.


================
Comment at: include/llvm/CodeGen/ValueTypes.h:284
+      // We don't support extended scalable types yet.
+      assert(!isScalableVector());
+      return {getExtendedVectorNumElements(), false};
----------------
ditto


https://reviews.llvm.org/D32019





More information about the llvm-commits mailing list