Commit 39d5e711 by GregF

remapper: do not eliminate interface variables in dce by default

this is done by counting op_entrypoint as a use/def
parent 85b52f30
...@@ -926,8 +926,17 @@ namespace spv { ...@@ -926,8 +926,17 @@ namespace spv {
// Count function variable use // Count function variable use
process( process(
[&](spv::Op opCode, unsigned start) { [&](spv::Op opCode, unsigned start) {
if (opCode == spv::OpVariable) { ++varUseCount[asId(start+2)]; return true; } if (opCode == spv::OpVariable) {
return false; ++varUseCount[asId(start+2)];
return true;
} else if (opCode == spv::OpEntryPoint) {
const int wordCount = asWordCount(start);
for (int i = 4; i < wordCount; i++) {
++varUseCount[asId(start+i)];
}
return true;
} else
return false;
}, },
[&](spv::Id& id) { if (varUseCount[id]) ++varUseCount[id]; } [&](spv::Id& id) { if (varUseCount[id]) ++varUseCount[id]; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment