Repository navigation
Direct DXIL: unused raw loads and f16 conversions are dropped - #2212
tibzejoker wants to merge 1 commit into
Conversation
Module::optimize kept unused dx.op.rawBufferLoad and dx.op.legacyF16ToF32 calls: neither is in the list of calls dead-code removal may take. A raw load sets the RawAndStructuredBuffers flag while the module is built, so when every raw load is unused the first one stays and the flags still match the code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
AMD with native wave64 (listed as untested), plus an RTX 3060, paired against Head
Per-test comparison: on both cards the only difference is the new Not tested: a title with |
|
@DarkPanda69 Thanks for running it on RDNA4 and the 3060 with |
|
Diff review on
|
|
AMD Windows driver timing for #2212: on the RX 9070 XT the DXIL shrinks by 1.9 %, but AMD's Setup
Method
Results (means of 2 rounds; all 104 builds succeeded, 0 refused)
Tests on this card (
Read / inference
Not tested
AI use: Claude Code (Claude Opus 5.5) ran the measurements and the test and drafted this. The account owner is away; counts and timings only, no game data. |
Module::optimizekept unuseddx.op.rawBufferLoadanddx.op.legacyF16ToF32calls: neither is in the list of calls dead-code removal may take. A raw load setsRawAndStructuredBufferswhile the module is built, so when every raw load of a program is unused the first one stays and the flags still match the code. Part of #1269 (claimed here).On 573 sampled programs (
xcl shaders shaders.rpf --direct --sample 600 --seed 3 --max-bytes 40000 --validate,XCL_HEAP_WINDOWS=1), all validator-clean before and after:main568e7dbdxc -dumpbin)A small gain: about 21 000 unused raw loads and 3 100 unused f16 conversions in that sample.
What is in it
crates/xcl/src/gpu/dxil/module/opt.rs:removabletakesdx.op.rawBufferLoad.*anddx.op.legacyF16ToF32; after liveness, one raw load is kept when none is live. Testunused_raw_loads_and_f16_conversions_go_but_one_raw_load_stays(fails without the change).Tested
cargo test --workspace -- --test-threads=4(throughscripts/test.ps1): 1155 passed, 0 failed, 46 ignored.no wave64, 13 wave64 variants of the instruction tests, 1no heap windows, 3 per-lane f16 refusals (V_CVT_F16_F32,V_PK_MUL_F16,V_MUL_F16).--validate: 573 / 573 translated, 0 validator errors, before and after.Regression run
main:This PR:
Not tested
AI use
🤖 Generated with Claude Code