Skip to content

DxilValidation should reject unsupported llvm integer sizes #6563

Closed

Description

@tex3d

Description
Some locations in Clang CodeGen or llvm optimizations will result in odd-sized int value types, such as i25. The DXIL Validator should catch and reject such unsupported sizes when found in the IR, and we should fix the sources of these to prevent them from appearing in the first place.

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 or accepted by DxilValidation. In this case, an optimization produces the value (which is usually the case).

This bug is about preventing this from passing validation. See #6564 for tracking the optimization producing the value in the first place.

Environment

  • DXC version: latest main, not a regression
  • Host Operating System: any

Activity

  1. added
    bug
    needs-triage
    on Apr 23, 2024
  2. added
    validation
    and removed
    needs-triage
    on Apr 25, 2024
  3. changed the title [-]DxilValidation should reject odd llvm integer sizes[/-] [+]DxilValidation should reject unsupported llvm integer sizes[/+] on May 20, 2024
  4. added a commit that references this issue on Feb 21, 2026
    a05bd44
  5. added a commit that references this issue on Mar 10, 2026
    90ae8d8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugvalidation

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions