MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / GetFirstNonLoopInvariantOperand

Method GetFirstNonLoopInvariantOperand

source/opt/loop_peeling.cpp:874–885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

872}
873
874uint32_t LoopPeelingPass::LoopPeelingInfo::GetFirstNonLoopInvariantOperand(
875 Instruction* condition) const {
876 for (uint32_t i = 0; i < condition->NumInOperands(); i++) {
877 BasicBlock* bb =
878 context_->get_instr_block(condition->GetSingleWordInOperand(i));
879 if (!bb || !loop_->IsInsideLoop(bb)) {
880 return condition->GetSingleWordInOperand(i);
881 }
882 }
883
884 return 0;
885}
886
887static bool IsHandledCondition(spv::Op opcode) {
888 switch (opcode) {

Callers

nothing calls this directly

Calls 4

NumInOperandsMethod · 0.80
get_instr_blockMethod · 0.80
IsInsideLoopMethod · 0.45

Tested by

no test coverage detected