[all-commits] [llvm/llvm-project] f956e7: [AMDGPU] Prefer `s_memtime` for `readcyclecounter`...
Joseph Huber via All-commits
all-commits at lists.llvm.org
Thu Feb 1 05:20:10 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: f956e7fbf161447b9236f7c4448a9d02d3564261
https://github.com/llvm/llvm-project/commit/f956e7fbf161447b9236f7c4448a9d02d3564261
Author: Joseph Huber <huberjn at outlook.com>
Date: 2024-02-01 (Thu, 01 Feb 2024)
Changed paths:
M llvm/lib/Target/AMDGPU/SMInstructions.td
M llvm/test/CodeGen/AMDGPU/readcyclecounter.ll
Log Message:
-----------
[AMDGPU] Prefer `s_memtime` for `readcyclecounter` on GFX10 (#80211)
Summary:
The old `s_memtime` instruction was supported until the GFX10
architecture. Although this instruction has a higher latency than the
new shader counter, it's much more usable as a processor clock as it is
a full 64-bit counter. The new shader counter is only a 20-bit counter,
which makes it difficult to use as a standard cycle counter as it will
overflow in a few milliseconds. This patch suggests preferring
`s_memtime` for this instrinsic if it is still available.
More information about the All-commits
mailing list