-
Notifications
You must be signed in to change notification settings - Fork 14.3k
AMDGPU: Pre-commit test to verify mode change in fp constrained operations #88858
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e5545e8
Pre-commit lit test
abhigargrepo 9da1bcb
Merge branch 'main' into bug-siMode
abhigargrepo 8deec78
Pre-commit test to verify mode change in fp constrained operations
abhigargrepo 7630cf2
Merge branch 'main' into bug-siMode
abhigargrepo 905389d
Pre-commit test to verify mode change in fp constrained operations
abhigargrepo 74b9e9f
Pre-commit test to verify mode change in fp constrained operations
abhigargrepo 6dc15e7
Merge branch 'main' into bug-siMode
arsenm 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 hidden or 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,43 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4 | ||
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 %s -o - | FileCheck -check-prefix=GCN %s | ||
|
||
; The si-mode-register pass is changing the default mode for FP constrained operations. | ||
; It must ignore for strictfp functions. | ||
|
||
define double @ignoreStrictfp(double noundef %a, double noundef %b) #0 { | ||
; GCN-LABEL: ignoreStrictfp: | ||
; GCN: ; %bb.0: | ||
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||
; GCN-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 2), 1 | ||
; GCN-NEXT: s_nop 1 | ||
; GCN-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 1), 0 | ||
; GCN-NEXT: v_add_f64 v[0:1], v[0:1], v[2:3] | ||
; GCN-NEXT: s_setpc_b64 s[30:31] | ||
tail call void @llvm.amdgcn.s.setreg(i32 2177, i32 1) | ||
%val = tail call double @llvm.experimental.constrained.fadd.f64(double %a, double %b, metadata !"round.dynamic", metadata !"fpexcept.strict") #0 | ||
ret double %val | ||
} | ||
|
||
define double @set_fpenv(double noundef %a, double noundef %b) #0 { | ||
; GCN-LABEL: set_fpenv: | ||
; GCN: ; %bb.0: ; %entry | ||
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||
; GCN-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 23), 4 | ||
; GCN-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_TRAPSTS, 0, 5), 0 | ||
; GCN-NEXT: s_nop 0 | ||
; GCN-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 1), 0 | ||
; GCN-NEXT: v_add_f64 v[0:1], v[0:1], v[2:3] | ||
; GCN-NEXT: s_setpc_b64 s[30:31] | ||
entry: | ||
call void @llvm.set.fpenv.i64(i64 4) | ||
%val = tail call double @llvm.experimental.constrained.fadd.f64(double %a, double %b, metadata !"round.dynamic", metadata !"fpexcept.strict") #0 | ||
ret double %val | ||
} | ||
|
||
arsenm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
declare void @llvm.amdgcn.s.setreg(i32 immarg, i32) | ||
|
||
declare double @llvm.experimental.constrained.fadd.f64(double, double, metadata, metadata) | ||
|
||
declare void @llvm.set.fpenv.i64(i64) | ||
|
||
attributes #0 = { strictfp } |
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.
Not the most realistic source value but ok