-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AMDGPU] New ttracedata intrinsics #70235
+77
−2
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3 | ||
; RUN: llc -global-isel=0 -march=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX11,GFX11-SDAG %s | ||
; RUN: llc -global-isel=1 -march=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX11,GFX11-GISEL %s | ||
|
||
declare void @llvm.amdgcn.s.ttracedata(i32) | ||
declare void @llvm.amdgcn.s.ttracedata.imm(i16) | ||
|
||
define amdgpu_cs void @ttracedata_c() { | ||
; GFX11-LABEL: ttracedata_c: | ||
; GFX11: ; %bb.0: | ||
; GFX11-NEXT: s_mov_b32 m0, 0xf4240 | ||
; GFX11-NEXT: s_ttracedata | ||
; GFX11-NEXT: s_endpgm | ||
call void @llvm.amdgcn.s.ttracedata(i32 1000000) | ||
ret void | ||
} | ||
|
||
define amdgpu_cs void @ttracedata_s(i32 inreg %val) { | ||
; GFX11-LABEL: ttracedata_s: | ||
; GFX11: ; %bb.0: | ||
; GFX11-NEXT: s_mov_b32 m0, s0 | ||
; GFX11-NEXT: s_ttracedata | ||
; GFX11-NEXT: s_endpgm | ||
call void @llvm.amdgcn.s.ttracedata(i32 %val) | ||
ret void | ||
} | ||
|
||
define amdgpu_cs void @ttracedata_v(i32 %val) { | ||
; GFX11-SDAG-LABEL: ttracedata_v: | ||
; GFX11-SDAG: ; %bb.0: | ||
; GFX11-SDAG-NEXT: v_readfirstlane_b32 s0, v0 | ||
; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | ||
; GFX11-SDAG-NEXT: s_mov_b32 m0, s0 | ||
; GFX11-SDAG-NEXT: s_ttracedata | ||
; GFX11-SDAG-NEXT: s_endpgm | ||
; | ||
; GFX11-GISEL-LABEL: ttracedata_v: | ||
; GFX11-GISEL: ; %bb.0: | ||
; GFX11-GISEL-NEXT: v_readfirstlane_b32 m0, v0 | ||
; GFX11-GISEL-NEXT: s_ttracedata | ||
; GFX11-GISEL-NEXT: s_endpgm | ||
call void @llvm.amdgcn.s.ttracedata(i32 %val) | ||
ret void | ||
} | ||
|
||
define amdgpu_cs void @ttracedata_imm() { | ||
; GFX11-LABEL: ttracedata_imm: | ||
; GFX11: ; %bb.0: | ||
; GFX11-NEXT: s_ttracedata_imm 0x3e8 | ||
; GFX11-NEXT: s_endpgm | ||
call void @llvm.amdgcn.s.ttracedata.imm(i16 1000) | ||
ret void | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need the imm form, or can the backend just fold the register version with appropriate constant inputs to the imm instruction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really need it. They do different things. s_ttracedata emits a 32-bit "token" into ttracedata. s_ttracedata_imm emits an 8-bit "token" (the low 8 bits of the imm16 operand).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in no way obvious from the manual descriptions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think you would have to read the instruction descriptions in conjunction with the separate threadtrace documentation, and most or all of that is not public anyway.