[all-commits] [llvm/llvm-project] fb1035: [DirectX] Fix resource binding analysis incorrectl...

Helena Kotas via All-commits all-commits at lists.llvm.org
Mon Aug 11 10:53:21 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fb1035cfb4f0ceda143e01cc50100ce5b0d4e2e2
      https://github.com/llvm/llvm-project/commit/fb1035cfb4f0ceda143e01cc50100ce5b0d4e2e2
  Author: Helena Kotas <hekotas at microsoft.com>
  Date:   2025-08-11 (Mon, 11 Aug 2025)

  Changed paths:
    M llvm/lib/Frontend/HLSL/HLSLBinding.cpp
    M llvm/lib/Target/DirectX/DXILPostOptimizationValidation.cpp
    M llvm/test/CodeGen/DirectX/Metadata/srv_metadata.ll
    M llvm/test/CodeGen/DirectX/Metadata/uav_metadata.ll
    M llvm/unittests/Frontend/HLSLBindingTest.cpp

  Log Message:
  -----------
  [DirectX] Fix resource binding analysis incorrectly removing duplicates (#152253)

The resource binding analysis was incorrectly reducing the size of the
`Bindings` vector by one element after sorting and de-duplication. This
led to an inaccurate setting of the `HasOverlappingBinding` flag in the
`DXILResourceBindingInfo` analysis, as the truncated vector no longer
reflected the true binding state.

This update corrects the shrink logic and introduces an `assert` in the
`DXILPostOptimizationValidation` pass. The assertion will trigger if
`HasOverlappingBinding` is set but no corresponding error is detected,
helping catch future inconsistencies.

The bug surfaced when the `srv_metadata.hlsl` and `uav_metadata.hlsl`
tests were updated to include unbounded resource arrays as part of
https://github.com/llvm/llvm-project/issues/145422. These updated test
files are included in this PR, as they would cause the new assertion to
fire if the original issue remained unresolved.

Depends on #152250



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list