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

A DXC optimization is producing i25 type, but shouldn't for DXIL #6564

Open
tex3d opened this issue Apr 23, 2024 · 0 comments
Open

A DXC optimization is producing i25 type, but shouldn't for DXIL #6564

tex3d opened this issue Apr 23, 2024 · 0 comments
Labels
bug Bug, regression, crash
Milestone

Comments

@tex3d
Copy link
Contributor

tex3d commented Apr 23, 2024

Description
An llvm optimization (like some switch optimization) is resulting in odd-sized int value types, such as i25. We should not produce integer values of odd sizes like this.

A separate but related issue for catching this class of problem in DxilValidation is #6563.

Steps to Reproduce

uint param;

bool fn()
{
    switch (param)
    {
    case 0:
    case 20:
    case 24:
        return false;
    }
    return true;
}

float4 main() : SV_Target
{
    float4 ret = float4(0, 0, 0, 0);
    if (fn())
    {
        ret = float4(1, 1, 1, 1);
    }
    return ret;
}

Actual Behavior
Results in IR containing i25:

  %6 = trunc i32 %3 to i25
  %7 = lshr i25 15728638, %6
  %8 = and i25 %7, 1
  %9 = icmp ne i25 %8, 0
  %10 = select i1 %9, float 1.000000e+00, float 0.000000e+00

This i25 type should never be produced during compilation or optimization.

Environment

  • DXC version: latest main, not a regression
  • Host Operating System: any
@tex3d tex3d added bug Bug, regression, crash needs-triage Awaiting triage labels Apr 23, 2024
@damyanp damyanp removed the needs-triage Awaiting triage label Apr 25, 2024
@damyanp damyanp added this to the Backlog milestone Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash
Projects
Status: Triaged
Development

No branches or pull requests

2 participants