[PATCH] D69891: [VP,Integer,#1] Vector-predicated integer intrinsics

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 6 14:30:58 PST 2019


jdoerfert added inline comments.


================
Comment at: llvm/include/llvm/IR/IntrinsicInst.h:302
+      case Intrinsic::vp_srem:
+        return Instruction::SRem;
+      }
----------------
I (started to) like generating these constructs. It will make additions later easier and less (copy&paste) error prone.
If you put the mapping in a file with a macro
```
#ifndef OPCODE2VPINTRINSIC
#define OPCODE2VPINTRINSIC(Opcode, VPIntrinsic)
#endif

OPCODE2VPINTRINSIC(And, vp_and)
...

#undef OPCODE2VPINTRINSIC
```

you can replace all these long lists with codes like:

```
#define OPCODE2VPINTRINSIC(Opcode, VPIntrinsic) case Instruction::Opcode: return Intrinsic::VPIntrinsic;
#include ".../VPLanInstructions.def"
```



================
Comment at: llvm/include/llvm/IR/Intrinsics.td:1172
+
+}
+
----------------
I guess you can add readnone as an attribute, also nosync and nofree please.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69891





More information about the llvm-commits mailing list