[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 02:42:49 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();
----------------
In what situations are the element types not equal? Does the PartVT come from the first type in the RC?


================
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);
----------------
Is this guaranteed not to become 0?


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:6220
+        unsigned Count = ValueVTBitSize / PartEltVT.getSizeInBits();
+        EVT SameEltTypeVT = EVT::getVectorVT(Context, PartEltVT, Count, true);
+        Val = DAG.getNode(ISD::BITCAST, DL, SameEltTypeVT, Val);
----------------
Maybe put a `/*IsScalable*/` on the `true`?


================
Comment at: llvm/test/CodeGen/RISCV/rvv/inline-asm.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple=riscv64 -mattr=+experimental-v -o - < %s \
+; RUN:     --verify-machineinstrs | FileCheck %s
----------------
Nit, but `-o -` and `< %s` isn't too common a combination: `< %s` or `-o - %s`?


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