[llvm] [RISCV][GISel] Add initial support for rvv intrinsics (PR #156415)

Jon Roelofs via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 2 06:46:16 PDT 2025


================
@@ -707,6 +707,14 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
 bool RISCVLegalizerInfo::legalizeIntrinsic(LegalizerHelper &Helper,
                                            MachineInstr &MI) const {
   Intrinsic::ID IntrinsicID = cast<GIntrinsic>(MI).getIntrinsicID();
+
+  const RISCVVIntrinsicsTable::RISCVVIntrinsicInfo *II =
+      RISCVVIntrinsicsTable::getRISCVVIntrinsicInfo(IntrinsicID);
+
+  if (II) {
+    return true;
+  }
----------------
jroelofs wrote:

If `II` is otherwise unused, this should be:

```suggestion
  if (RISCVVIntrinsicsTable::getRISCVVIntrinsicInfo(IntrinsicID))
    return true;
```

https://github.com/llvm/llvm-project/pull/156415


More information about the llvm-commits mailing list