[PATCH] D147731: [3/11][POC][Clang][RISCV] Add typedef of the tuple type and define tuple type variant of vlseg2e32

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 18 10:39:07 PDT 2023


craig.topper added inline comments.


================
Comment at: clang/include/clang/Basic/riscv_vector.td:1528
+
+      unsigned Offset = IsMasked ? 1 : 0;
+      llvm::Value *MaskOperand = IsMasked ? Ops[0] : nullptr;
----------------
I don't think we need the `Value *` variables here. They're only benefit is naming, but I think we can do that with comments.

Something like this

```
unsigned Offset = IsMasked ? 1 : 0;
Operands.push_back(Ops[Offset]); // Pointer
if (IsMasked)
  Operands.push_back(Ops[0]); // Mask
Operands.push_back(Ops[Offset + 1]); // VL
```


================
Comment at: clang/lib/AST/ASTContext.cpp:4090
+                                                unsigned NumElts,
+                                                unsigned NumFields) const {
+  if (Target->hasRISCVVTypes()) {
----------------
Would it be possible to add NumFields to getScalableVectorType maybe with a default value of 1 instead of introducing a new function?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147731



More information about the cfe-commits mailing list