[llvm] [DirectX][ShaderFlags] Add analysis for `WaveOps` flag (PR #118140)

Finn Plummer via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 09:01:21 PST 2025


================
@@ -30,6 +31,28 @@
 using namespace llvm;
 using namespace llvm::dxil;
 
+static dxil::Properties getOpCodeProperties(dxil::OpCode OpCode) {
+  dxil::Properties Props;
+  switch (OpCode) {
+#define DXIL_OP_PROPERTIES(OpCode, ...)                                        \
+  case OpCode:                                                                 \
+    Props = dxil::Properties{__VA_ARGS__};                                     \
+    break;
+#include "DXILOperation.inc"
+  }
+  return Props;
+}
+
+static bool checkWaveOps(Intrinsic::ID IID) {
+  switch (IID) {
+#define DXIL_OP_INTRINSIC(OpCode, IntrinsicID, ...)                            \
+  case IntrinsicID:                                                            \
+    return getOpCodeProperties(OpCode).IsWave;
+#include "DXILOperation.inc"
+  }
+  return false;
+}
----------------
inbelic wrote:

I think in either case, it is more a question if we want to continuing using the `IsWave` property (and `DXILProperty`s in general) in `DXIL.td` to model sub-groups of ops for shader flag analysis.

The removal of `DXILProperty` is outlined [here](https://github.com/llvm/llvm-project/issues/126298).

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


More information about the llvm-commits mailing list