Lines Matching full:instruction
83 // Ensure `block` ends with a branch instruction.
85 AddError(StringPrintf("Block %d does not end with a branch instruction.",
115 AddError(StringPrintf("The recorded last instruction of block %d does not match "
116 "the actual last instruction %d.",
126 AddError(StringPrintf("Instruction %s:%d is a HBoundsCheck, "
132 // Perform the instruction base checks too.
136 void GraphChecker::VisitInstruction(HInstruction* instruction) {
137 if (seen_ids_.IsBitSet(instruction->GetId())) {
138 AddError(StringPrintf("Instruction id %d is duplicate in graph.",
139 instruction->GetId()));
141 seen_ids_.SetBit(instruction->GetId());
144 // Ensure `instruction` is associated with `current_block_`.
145 if (instruction->GetBlock() == nullptr) {
147 instruction->IsPhi() ? "Phi" : "Instruction",
148 instruction->GetId(),
150 } else if (instruction->GetBlock() != current_block_) {
152 instruction->IsPhi() ? "Phi" : "Instruction",
153 instruction->GetId(),
155 instruction->GetBlock()->GetBlockId()));
158 // Ensure the inputs of `instruction` are defined in a block of the graph.
159 for (HInputIterator input_it(instruction); !input_it.Done();
166 AddError(StringPrintf("Input %d of instruction %d is not defined "
169 instruction->GetId()));
173 // Ensure the uses of `instruction` are defined in a block of the graph,
175 for (HUseIterator<HInstruction*> use_it(instruction->GetUses());
182 AddError(StringPrintf("User %s:%d of instruction %d is not defined "
186 instruction->GetId()));
189 if ((use_index >= use->InputCount()) || (use->InputAt(use_index) != instruction)) {
190 AddError(StringPrintf("User %s:%d of instruction %d has a wrong "
194 instruction->GetId()));
199 for (HUseIterator<HEnvironment*> use_it(instruction->GetEnvUses());
203 if ((use_index >= use->Size()) || (use->GetInstructionAt(use_index) != instruction)) {
206 instruction->DebugName(),
207 instruction->GetId()));
211 // Ensure 'instruction' has pointers to its inputs' use entries.
212 for (size_t i = 0, e = instruction->InputCount(); i < e; ++i) {
213 HUserRecord<HInstruction*> input_record = instruction->InputRecordAt(i);
221 AddError(StringPrintf("Instruction %s:%d has an invalid pointer to use entry "
223 instruction->DebugName(),
224 instruction->GetId(),
246 "has a last instruction (%s:%d) which is neither a clinit check "
247 "nor a load class instruction.",
268 void GraphChecker::VisitInstanceOf(HInstanceOf* instruction) {
269 VisitInstruction(instruction);
270 HInstruction* input = instruction->InputAt(1);
273 instruction->DebugName(),
274 instruction->GetId(),
396 void SSAChecker::VisitInstruction(HInstruction* instruction) {
397 super_type::VisitInstruction(instruction);
399 // Ensure an instruction dominates all its uses.
400 for (HUseIterator<HInstruction*> use_it(instruction->GetUses());
403 if (!use->IsPhi() && !instruction->StrictlyDominates(use)) {
404 AddError(StringPrintf("Instruction %d in block %d does not dominate "
406 instruction->GetId(), current_block_->GetBlockId(),
411 // Ensure an instruction having an environment is dominated by the
413 for (HEnvironment* environment = instruction->GetEnvironment();
419 && !env_instruction->StrictlyDominates(instruction)) {
420 AddError(StringPrintf("Instruction %d in environment of instruction %d "
421 "from block %d does not dominate instruction %d.",
423 instruction->GetId(),
425 instruction->GetId()));
500 void SSAChecker::HandleBooleanInput(HInstruction* instruction, size_t input_index) {
501 HInstruction* input = instruction->InputAt(input_index);
506 "%s instruction %d has a non-Boolean constant input %d whose value is: %d.",
507 instruction->DebugName(),
508 instruction->GetId(),
518 "%s instruction %d has a non-Boolean input %d whose type is: %s.",
519 instruction->DebugName(),
520 instruction->GetId(),
526 void SSAChecker::VisitIf(HIf* instruction) {
527 VisitInstruction(instruction);
528 HandleBooleanInput(instruction, 0);
531 void SSAChecker::VisitBooleanNot(HBooleanNot* instruction) {
532 VisitInstruction(instruction);
533 HandleBooleanInput(instruction, 0);
608 void SSAChecker::VisitConstant(HConstant* instruction) {
609 HBasicBlock* block = instruction->GetBlock();
613 instruction->DebugName(),
614 instruction->GetId(),