llvm-project
5dc8ac22 - [DirectX] Add DXILRemoveUnusedResources pass (#200965)

Commit
13 days ago
[DirectX] Add DXILRemoveUnusedResources pass (#200965) Adds `DXILRemoveUnusedResources` pass that scans the module and removes any resource that is not used. It means that it removes calls to `dx_resource_handlefrom{implicit}binding` whose return value is either not used at all, or it is saved to a global variable that does not have external linkage and is not used anywhere else in the module. This pass needs to run before implicit resource binding assignment pass. The test `unused-resources-impl-binding.ll` makes sure the implicit binding assignments are not affected by the unused resources. Since we have many tests that are initializing resources without actually using them, an internal option `-disable-dxil-remove-unused-resource` has been added to `llc` so we can keep these tests simple without adding extra code to artificially use each resource. Depends on #200312 Fixes #192524
Author
Parents
Loading