[llvm] [DXIL] Add GroupMemoryBarrierWithGroupSync intrinsic (PR #114349)
Justin Bogner via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 11 15:45:17 PST 2024
================
@@ -294,6 +294,37 @@ class Attributes<Version ver = DXIL1_0, list<DXILAttribute> attrs> {
list<DXILAttribute> op_attrs = attrs;
}
+defvar BarrierMode_DeviceMemoryBarrier = 2;
+defvar BarrierMode_DeviceMemoryBarrierWithGroupSync = 3;
+defvar BarrierMode_GroupMemoryBarrier = 8;
+defvar BarrierMode_GroupMemoryBarrierWithGroupSync = 9;
+defvar BarrierMode_AllMemoryBarrier = 10;
+defvar BarrierMode_AllMemoryBarrierWithGroupSync = 11;
+
+// Intrinsic arg selection
+class Arg {
+ int index = -1;
+ int value = 0;
+ bit is_i8 = 0;
+ bit is_i32 = 0;
+}
+class ArgSelect<int index_> : Arg {
+ let index = index_;
+}
+class ArgI32<int value_> : Arg {
+ let value = value_;
+ let is_i32 = 1;
+}
+class ArgI8<int value_> : Arg {
+ let value = value_;
+ let is_i8 = 1;
+}
+
+class IntrinsicSelect<Intrinsic intrinsic_, list<Arg> args_> {
+ Intrinsic intrinsic = intrinsic_;
+ list<Arg> args = args_;
+}
----------------
bogner wrote:
Could you add a comment by this definition explaining how to use it? It isn't clear to me how we define where the arguments end up or what the difference between "ArgSelect" and "ArgI32" are from the definitions alone.
https://github.com/llvm/llvm-project/pull/114349
More information about the llvm-commits
mailing list