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

[LLPC] Fully scalarize compares and selects #2831

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

nhaehnle
Copy link
Member

A while back, we switch to no longer always fully scalarizing in order to preserve packed 16-bit operations.

This had the effect that comparisons and selects were no longer scalarized due to limitations in LLVM's ScalarizerPass. And it seems that there is some correctness error, most likely somewhere else in the backend, which unfortunately hasn't been fully root caused.

In any case, there are no packed compares and (vector condition) selects, and fully scalarizing them tends to produce better code. So let's do that explicitly in the frontend as a quick fix.

Fixes: Red Dead Redemption with FSR 2.0
Fixes: c8f8da9 ("lgc: set scalarizer min-bits to 32")

A while back, we switch to no longer always fully scalarizing in order
to preserve packed 16-bit operations.

This had the effect that comparisons and selects were no longer
scalarized due to limitations in LLVM's ScalarizerPass. And it seems
that there is some correctness error, most likely somewhere else in the
backend, which unfortunately hasn't been fully root caused.

In any case, there are no packed compares and (vector condition)
selects, and fully scalarizing them tends to produce better code. So
let's do that explicitly in the frontend as a quick fix.

Fixes: Red Dead Redemption with FSR 2.0
Fixes: c8f8da9 ("lgc: set scalarizer min-bits to 32")
@nhaehnle nhaehnle requested a review from a team as a code owner November 21, 2023 05:59
@amdvlk-admin
Copy link

Test summary for commit 4292894

CTS tests (Failed: 0/138443)
  • Built with version 1.3.5.2
  • Ubuntu navi3x, Srdcvk
    • Passed: 35211/69228 (50.9%)
    • Failed: 0/69228 (0.0%)
    • Not Supported: 34017/69228 (49.1%)
    • Warnings: 0/69228 (0.0%)
    Ubuntu navi2x, Srdcvk
    • Passed: 35242/69215 (50.9%)
    • Failed: 0/69215 (0.0%)
    • Not Supported: 33973/69215 (49.1%)
    • Warnings: 0/69215 (0.0%)

@nhaehnle nhaehnle merged commit 6d724b7 into GPUOpen-Drivers:dev Nov 21, 2023
9 checks passed
@nhaehnle nhaehnle deleted the pub-scalarize branch November 21, 2023 13:47
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