microsoft / microsoft/DirectXShaderCompiler

DXC should fail gracefully when unable to allocate signature elements in available space.

Open
#6,485 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Is your feature request related to a problem? Please describe.
There are some llvm_unreachable statements when a failure is detected in allocating signature elements in the available space. These are located in HLSLSignatureLower.cpp:AllocateDxilInputOutputs().

Describe the solution you'd like
Instead, the compiler should fail gracefully, without using llvm_unreachable. Perhaps emitting a diagnostic would be more desirable?

Describe alternatives you've considered
Emitting a diagnostic seems to be the most direct solution to the problem, however there doesn't seem to be any diagnostic engine in HLSignatureLower.cpp, and so it may not be an appropriate location to introduce diagnostics.

Additional context
Add any other context or screenshots about the feature request here.
https://github.com/microsoft/DirectXShaderCompiler/pull/6482#discussion_r1546706074

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with HLSLSignatureLower.cpp, specifically AllocateDxilInputOutputs(), and review the linked pull request discussion for the existing llvm_unreachable cases. Determine how allocation failure should be reported without introducing unsupported diagnostics there. Done means the compiler fails gracefully when signature elements cannot fit, rather than reaching llvm_unreachable.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.