[PATCH] D124730: [RISCV][NFC] Refactor RISC-V vector intrinsic utils.

Zakk Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 13 08:23:48 PDT 2022


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

Thanks Kito. This all LGTM except some warnings need to fix.



================
Comment at: clang/lib/Support/RISCVVIntrinsicUtils.cpp:384
+    return PD;
   // Handle primitive type transformer
+  auto PType = PrototypeDescriptorStr.back();
----------------
so we also need to update this comment as base type transformer?


================
Comment at: clang/lib/Support/RISCVVIntrinsicUtils.cpp:718
+  default:
+    llvm_unreachable("Illegal vector type modifier!");
+  }
----------------
Don’t use default labels in fully covered switches over enumerations
please remove default in `RISCVVIntrinsicUtils.cpp:624`, `RISCVVIntrinsicUtils.cpp:717` and `RISCVVIntrinsicUtils.cpp:793`.


================
Comment at: clang/lib/Support/RISCVVIntrinsicUtils.cpp:962
+  }
+  return std::move(PrototypeDescriptors);
+}
----------------
```
clang/lib/Support/RISCVVIntrinsicUtils.cpp:962:10: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
  return std::move(PrototypeDescriptors);
         ^
clang/lib/Support/RISCVVIntrinsicUtils.cpp:962:10: note: remove std::move call here
  return std::move(PrototypeDescriptors);
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124730



More information about the cfe-commits mailing list