Skip to content

[DXIL] Always inline HLSL functions by default #89282

Closed
@pow2clk

Description

@pow2clk

Summary

At present, inlining in HLSL follows the existing heuristics which will inline if the function is short enough. To be correct in HLSL, we need to inline all non-entry functions. To do this we need to annotate either calls or function definitions (or some combination of both) as alwaysinline so that the inliner forces them to be inlined.

For HLSL shader and library targets, automatically apply the alwaysinline attribute to non-entry functions with tests regardless of qualifiers. The exception is the autogenerated unmangled main() function

Note that there are cases where not everything should be inlined (eg noinline attribute). This is out of scope for this issue.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions