[PATCH] D87889: [SVE] Make EVT::getScalarSizeInBits and others consistent with Type::getScalarSizeInBits

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 09:44:13 PDT 2020


sdesmalen accepted this revision.
sdesmalen added a comment.
This revision is now accepted and ready to land.

LGTM. I think this is a sensible change. `TypeSize` is used to indicate that a value could be scalable, but if it is known the type is always fixed-size this change simplifies code that calls `getScalarSizeInBits` (i.e. no need to call 'getFixedSize`).
It also puts us on the path towards removing the implicit casts to uint64_t.



================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:7372
     EVT OrigEltTy = Entry.getOperand(0).getValueType().getVectorElementType();
-    int BitsDefined =
-        std::min(OrigEltTy.getSizeInBits(), VT.getScalarSizeInBits());
+    int BitsDefined = std::min(OrigEltTy.getSizeInBits().getFixedSize(),
+                               VT.getScalarSizeInBits());
----------------
`s/OrigEltTy.getSizeInBits().getFixedSize()/OrigEltTy.getScalarSizeInBits()/` ?


================
Comment at: llvm/lib/Target/ARM/ARMISelLowering.cpp:7835
     EVT OrigEltTy = Entry.getOperand(0).getValueType().getVectorElementType();
-    int BitsDefined = std::min(OrigEltTy.getSizeInBits(),
+    int BitsDefined = std::min(OrigEltTy.getSizeInBits().getFixedSize(),
                                VT.getScalarSizeInBits());
----------------
`s/OrigEltTy.getSizeInBits().getFixedSize()/OrigEltTy.getScalarSizeInBits()/` ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87889/new/

https://reviews.llvm.org/D87889



More information about the llvm-commits mailing list