Lines Matching refs:opCode
64 const spv::Op opCode = asOpCode(word); in asOpCodeHash() local
68 switch (opCode) { in asOpCodeHash()
75 return opCode * 19 + offset; // 19 = small prime in asOpCodeHash()
78 spirvbin_t::range_t spirvbin_t::literalRange(spv::Op opCode) const in literalRange()
82 switch (opCode) { in literalRange()
97 spirvbin_t::range_t spirvbin_t::typeRange(spv::Op opCode) const in typeRange()
101 if (isConstOp(opCode)) in typeRange()
104 switch (opCode) { in typeRange()
118 spirvbin_t::range_t spirvbin_t::constRange(spv::Op opCode) const in constRange()
122 switch (opCode) { in constRange()
136 const spv::Op opCode = asOpCode(typeStart); in typeSizeInWords() local
141 switch (opCode) { in typeSizeInWords()
163 bool spirvbin_t::isStripOp(spv::Op opCode, unsigned start) const in isStripOp() argument
165 switch (opCode) { in isStripOp()
190 bool spirvbin_t::isFlowCtrl(spv::Op opCode) const in isFlowCtrl()
192 switch (opCode) { in isFlowCtrl()
206 bool spirvbin_t::isTypeOp(spv::Op opCode) const in isTypeOp()
208 switch (opCode) { in isTypeOp()
234 bool spirvbin_t::isConstOp(spv::Op opCode) const in isConstOp()
236 switch (opCode) { in isConstOp()
387 [&](spv::Op opCode, unsigned start) { in stripDebug() argument
389 if (isStripOp(opCode, start)) in stripDebug()
400 [&](spv::Op opCode, unsigned start) { in stripDeadRefs() argument
402 switch (opCode) { in stripDeadRefs()
443 [&](spv::Op opCode, unsigned start) { in buildLocalMaps() argument
447 if (spv::InstructionDesc[opCode].hasType()) in buildLocalMaps()
451 if (spv::InstructionDesc[opCode].hasResult()) { in buildLocalMaps()
466 if (opCode == spv::Op::OpName) { in buildLocalMaps()
471 } else if (opCode == spv::Op::OpFunctionCall) { in buildLocalMaps()
473 } else if (opCode == spv::Op::OpEntryPoint) { in buildLocalMaps()
475 } else if (opCode == spv::Op::OpFunction) { in buildLocalMaps()
483 } else if (opCode == spv::Op::OpFunctionEnd) { in buildLocalMaps()
492 } else if (isConstOp(opCode)) { in buildLocalMaps()
498 } else if (isTypeOp(opCode)) { in buildLocalMaps()
540 spv::Op opCode = asOpCode(instructionStart); in processInstruction() local
550 if (instFn(opCode, instructionStart)) in processInstruction()
554 if (spv::InstructionDesc[opCode].hasType()) { in processInstruction()
559 if (spv::InstructionDesc[opCode].hasResult()) { in processInstruction()
566 if (opCode == spv::OpExtInst) { in processInstruction()
591 if (opCode == spv::OpSpecConstantOp) { in processInstruction()
593 … opCode = asOpCode(word++); // this is the opcode embedded in the SpecConstantOp. in processInstruction()
598 switch (spv::InstructionDesc[opCode].operands.getClass(op)) { in processInstruction()
622 if (opCode == OpSwitch) { in processInstruction()
771 const spv::Op opCode = asOpCode(start); in mapFnBodies() local
773 if (opCode == spv::OpFunction) in mapFnBodies()
776 if (opCode == spv::OpFunctionEnd) in mapFnBodies()
780 if (spv::InstructionDesc[opCode].hasResult()) { in mapFnBodies()
781 … const unsigned word = start + (spv::InstructionDesc[opCode].hasType() ? 2 : 1); in mapFnBodies()
813 [&](spv::Op opCode, unsigned start) { in mapFnBodies() argument
814 switch (opCode) { in mapFnBodies()
842 ++opCounter[opCode]; in mapFnBodies()
844 thisOpCode = opCode; in mapFnBodies()
881 [&](spv::Op opCode, unsigned start) { in forwardLoadStores() argument
883 if ((opCode == spv::OpVariable && asWordCount(start) == 4) && in forwardLoadStores()
889 if (opCode == spv::OpAccessChain && fnLocalVars.count(asId(start+3)) > 0) in forwardLoadStores()
892 if (opCode == spv::OpLoad && fnLocalVars.count(asId(start+3)) > 0) { in forwardLoadStores()
911 [&](spv::Op opCode, unsigned start) { in forwardLoadStores() argument
913 if ((opCode == spv::OpVariable && asWordCount(start) == 4) && in forwardLoadStores()
917 if (opCode == spv::OpStore && fnLocalVars.count(asId(start+1)) > 0) { in forwardLoadStores()
950 [&](spv::Op opCode, unsigned start) { in optLoadStore() argument
954 if (isFlowCtrl(opCode)) in optLoadStore()
958 …if ((opCode == spv::OpVariable && spv[start+3] == spv::StorageClassFunction && asWordCount(start) … in optLoadStore()
964 …if ((opCode == spv::OpAccessChain || opCode == spv::OpInBoundsAccessChain) && fnLocalVars.count(as… in optLoadStore()
970 if (opCode == spv::OpLoad && fnLocalVars.count(asId(start+3)) > 0) { in optLoadStore()
996 if (opCode == spv::OpStore && fnLocalVars.count(asId(start+1)) > 0) { in optLoadStore()
1040 [&](spv::Op opCode, unsigned start) { in optLoadStore() argument
1041 if (opCode == spv::OpLoad && fnLocalVars.count(asId(start+3)) > 0) in optLoadStore()
1066 [&](spv::Op opCode, unsigned start) { in optLoadStore() argument
1067 if ((opCode == spv::OpLoad && fnLocalVars.count(asId(start+3)) > 0) || in optLoadStore()
1068 (opCode == spv::OpStore && fnLocalVars.count(asId(start+1)) > 0) || in optLoadStore()
1069 (opCode == spv::OpVariable && fnLocalVars.count(asId(start+2)) > 0)) { in optLoadStore()
1114 [&](spv::Op opCode, unsigned start) { in dceFuncs() argument
1115 if (opCode == spv::Op::OpFunctionCall) { in dceFuncs()
1147 [&](spv::Op opCode, unsigned start) { in dceVars() argument
1148 if (opCode == spv::OpVariable) { in dceVars()
1151 } else if (opCode == spv::OpEntryPoint) { in dceVars()
1169 [&](spv::Op opCode, unsigned start) { in dceVars() argument
1171 if (opCode == spv::OpVariable) in dceVars()
1173 if (opCode == spv::OpDecorate || opCode == spv::OpName) in dceVars()
1245 const spv::Op opCode = asOpCode(typeStart); in matchType() local
1248 if (opCode != opOpCode(gdata[0]) || wordCount != opWordCount(gdata[0])) in matchType()
1260 const auto cmpConst = [&]() { return cmpIdRange(constRange(opCode)); }; in matchType()
1261 const auto cmpSubType = [&]() { return cmpIdRange(typeRange(opCode)); }; in matchType()
1265 const auto range = literalRange(opCode); in matchType()
1271 assert(isTypeOp(opCode) || isConstOp(opCode)); in matchType()
1273 switch (opCode) { in matchType()
1314 const spv::Op opCode = asOpCode(typeStart); in hashType() local
1316 switch (opCode) { in hashType()