diff options
author | GregF <greg@LunarG.com> | 2018-01-26 17:05:33 -0700 |
---|---|---|
committer | Steven Perron <stevenperron@google.com> | 2018-01-30 08:52:14 -0500 |
commit | f28b1061736a7034f66389f74408ce4955767a43 (patch) | |
tree | dd56edf130c0cd24edaf75d21c815f83ec72be83 /include | |
parent | 1b46f7ecad32f99e0b28702505a192d7bf680bd7 (diff) |
InsertExtractElim: Split out DeadInsertElim as separate pass
Diffstat (limited to 'include')
-rw-r--r-- | include/spirv-tools/optimizer.hpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp index b1e2cfe0..a8d8da0c 100644 --- a/include/spirv-tools/optimizer.hpp +++ b/include/spirv-tools/optimizer.hpp @@ -370,6 +370,21 @@ Optimizer::PassToken CreateLocalSingleStoreElimPass(); // converted to inserts and extracts and local loads and stores are eliminated. Optimizer::PassToken CreateInsertExtractElimPass(); +// Creates a dead insert elimination pass. +// This pass processes each entry point function in the module, searching for +// unreferenced inserts into composite types. These are most often unused +// stores to vector components. They are unused because they are never +// referenced, or because there is another insert to the same component between +// the insert and the reference. After removing the inserts, dead code +// elimination is attempted on the inserted values. +// +// This pass performs best after access chains are converted to inserts and +// extracts and local loads and stores are eliminated. While executing this +// pass can be advantageous on its own, it is also advantageous to execute +// this pass after CreateInsertExtractPass() as it will remove any unused +// inserts created by that pass. +Optimizer::PassToken CreateDeadInsertElimPass(); + // Creates a pass to consolidate uniform references. // For each entry point function in the module, first change all constant index // access chain loads into equivalent composite extracts. Then consolidate |