[PATCH] D97480: [RISCV] Support inline asm for vector instructions.

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 07:37:30 PST 2021


frasercrmck added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:6218
+      // PartVT first.
+      if (ValueEltVT != PartEltVT) {
+        unsigned Count = ValueVTBitSize / PartEltVT.getSizeInBits();
----------------
HsiangKai wrote:
> frasercrmck wrote:
> > In what situations are the element types not equal? Does the PartVT come from the first type in the RC?
> Yes, the PartVT comes from the first type in the RC. Another way to handle it is to search the corresponding type in the RC in GetRegistersForValue(). The problem comes from we reuse VR register class for fractional LMUL types.
Thanks! (Un)Luckily I've seen the "first type" issue before: I wish there was a better way.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:6219
+      if (ValueEltVT != PartEltVT) {
+        unsigned Count = ValueVTBitSize / PartEltVT.getSizeInBits();
+        EVT SameEltTypeVT = EVT::getVectorVT(Context, PartEltVT, Count, true);
----------------
HsiangKai wrote:
> frasercrmck wrote:
> > Is this guaranteed not to become 0?
> Yes, I reordered the supported types in VR. The first type has the element type i8. In addition, I created VM register class for mask register types.
Cool. Then perhaps we can check/assert on this, just so the types aren't accidentally reordered in the future? This seems to me like quite a few implicit dependencies being used and handed to us via this method.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97480



More information about the llvm-commits mailing list