[PATCH] D15873: AMDGPU: Implement readcyclecounter

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 4 15:24:40 PST 2016


nhaehnle added a subscriber: nhaehnle.
nhaehnle added a comment.

Looks good to me.


================
Comment at: lib/Target/AMDGPU/SIInstructions.td:91-93
@@ -90,2 +90,5 @@
 
-//def S_MEMTIME : SMRD_ <0x0000001e, "s_memtime", []>;
+// TODO: The finalizer implements the HSAIL clock instruction with
+// s_memtime, except on VI where s_memrealtime is used. Should
+// readcyclecounter be treated the same way?
+defm S_MEMTIME : SMRD_Special <smrd<0x1e, 0x24>, "s_memtime",
----------------
FWIW, OpenGL (ARB_shader_clock) doesn't really care.

================
Comment at: test/CodeGen/AMDGPU/readcyclecounter.ll:7
@@ +6,3 @@
+; GCN-LABEL: {{^}}test_readcyclecounter:
+; GCN: s_memtime s{{\[[0-9]+:[0-9]+\]}}
+; GCN: buffer_store_dwordx2
----------------
s_memtime needs a s_waitcnt, right? Makes sense to check for that here, but not a big deal either way.


http://reviews.llvm.org/D15873





More information about the llvm-commits mailing list