Skip to content
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

Lower OpFNegate directly to fneg #2739

Merged
merged 1 commit into from
Oct 3, 2023
Merged

Conversation

dstutt
Copy link
Member

@dstutt dstutt commented Oct 2, 2023

Update SPIRVReader to lower OpFNegate directly to fneg. By doing this the code in SpirvLowerMath can be updated to remove the change to add a canonicalize for any fneg.

The motivation for this is that InstCombine can introduce fneg instructions (after some recent upstream llvm changes) and in this case we don't want to blindly add a canonicalize as this invalidates e.g. xor 0x8000000 val -> fneg val.

It makes more sense to handle the requirement to treat OpFNegate as a floating point instruction at the point it is lowered (llvm fneg is not, hence the reason we may need the canonicalize intrinsic).

Update SPIRVReader to lower OpFNegate directly to fneg.
By doing this the code in SpirvLowerMath can be updated to remove the change to
add a canonicalize for any fneg.

The motivation for this is that InstCombine can introduce fneg
instructions (after some recent upstream llvm changes) and in this case we don't
want to blindly add a canonicalize as this invalidates e.g. xor 0x8000000 val ->
fneg val.

It makes more sense to handle the requirement to treat OpFNegate as a floating
point instruction at the point it is lowered (llvm fneg is not, hence the reason
we may need the canonicalize intrinsic).
@dstutt dstutt requested a review from a team as a code owner October 2, 2023 14:30
@amdvlk-admin
Copy link

Test summary for commit 8aaf5a4

CTS tests (Failed: 0/139021)
  • Built with version 1.3.5.2
  • Ubuntu 22.04, Navi3x
    • Passed: 41144/69517 (59.2%)
    • Failed: 0/69517 (0.0%)
    • Not Supported: 28373/69517 (40.8%)
    • Warnings: 0/69517 (0.0%)
    Ubuntu 20.04, Navi2x
    • Passed: 41178/69504 (59.2%)
    • Failed: 0/69504 (0.0%)
    • Not Supported: 28326/69504 (40.8%)
    • Warnings: 0/69504 (0.0%)

Copy link
Member

@nhaehnle nhaehnle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dstutt dstutt merged commit 1aebd12 into GPUOpen-Drivers:dev Oct 3, 2023
9 checks passed
@dstutt dstutt deleted the direct-fneg branch October 3, 2023 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants