Lines Matching refs:instruction
50 void VisitAbove(HAbove* instruction) OVERRIDE;
51 void VisitAboveOrEqual(HAboveOrEqual* instruction) OVERRIDE;
52 void VisitBelow(HBelow* instruction) OVERRIDE;
53 void VisitBelowOrEqual(HBelowOrEqual* instruction) OVERRIDE;
55 void VisitAnd(HAnd* instruction) OVERRIDE;
56 void VisitCompare(HCompare* instruction) OVERRIDE;
57 void VisitMul(HMul* instruction) OVERRIDE;
58 void VisitOr(HOr* instruction) OVERRIDE;
59 void VisitRem(HRem* instruction) OVERRIDE;
60 void VisitShl(HShl* instruction) OVERRIDE;
61 void VisitShr(HShr* instruction) OVERRIDE;
62 void VisitSub(HSub* instruction) OVERRIDE;
63 void VisitUShr(HUShr* instruction) OVERRIDE;
64 void VisitXor(HXor* instruction) OVERRIDE;
71 // so that an instruction turned into a constant, used as input of
72 // another instruction, may possibly be used to turn that second
73 // instruction into a constant as well.
130 void InstructionWithAbsorbingInputSimplifier::VisitShift(HBinaryOperation* instruction) {
131 DCHECK(instruction->IsShl() || instruction->IsShr() || instruction->IsUShr());
132 HInstruction* left = instruction->GetLeft();
138 instruction->ReplaceWith(left);
139 instruction->GetBlock()->RemoveInstruction(instruction);
143 void InstructionWithAbsorbingInputSimplifier::VisitAbove(HAbove* instruction) {
144 if (instruction->GetLeft()->IsConstant() &&
145 instruction->GetLeft()->AsConstant()->IsArithmeticZero()) {
150 instruction->ReplaceWith(GetGraph()->GetConstant(Primitive::kPrimBoolean, 0));
151 instruction->GetBlock()->RemoveInstruction(instruction);
155 void InstructionWithAbsorbingInputSimplifier::VisitAboveOrEqual(HAboveOrEqual* instruction) {
156 if (instruction->GetRight()->IsConstant() &&
157 instruction->GetRight()->AsConstant()->IsArithmeticZero()) {
162 instruction->ReplaceWith(GetGraph()->GetConstant(Primitive::kPrimBoolean, 1));
163 instruction->GetBlock()->RemoveInstruction(instruction);
167 void InstructionWithAbsorbingInputSimplifier::VisitBelow(HBelow* instruction) {
168 if (instruction->GetRight()->IsConstant() &&
169 instruction->GetRight()->AsConstant()->IsArithmeticZero()) {
174 instruction->ReplaceWith(GetGraph()->GetConstant(Primitive::kPrimBoolean, 0));
175 instruction->GetBlock()->RemoveInstruction(instruction);
179 void InstructionWithAbsorbingInputSimplifier::VisitBelowOrEqual(HBelowOrEqual* instruction) {
180 if (instruction->GetLeft()->IsConstant() &&
181 instruction->GetLeft()->AsConstant()->IsArithmeticZero()) {
186 instruction->ReplaceWith(GetGraph()->GetConstant(Primitive::kPrimBoolean, 1));
187 instruction->GetBlock()->RemoveInstruction(instruction);
191 void InstructionWithAbsorbingInputSimplifier::VisitAnd(HAnd* instruction) {
192 HConstant* input_cst = instruction->GetConstantRight();
198 instruction->ReplaceWith(input_cst);
199 instruction->GetBlock()->RemoveInstruction(instruction);
203 void InstructionWithAbsorbingInputSimplifier::VisitCompare(HCompare* instruction) {
204 HConstant* input_cst = instruction->GetConstantRight();
206 HInstruction* input_value = instruction->GetLeastConstantLeft();
216 instruction->ReplaceWith(GetGraph()->GetConstant(Primitive::kPrimInt,
217 (instruction->IsGtBias() ? 1 : -1)));
218 instruction->GetBlock()->RemoveInstruction(instruction);
223 void InstructionWithAbsorbingInputSimplifier::VisitMul(HMul* instruction) {
224 HConstant* input_cst = instruction->GetConstantRight();
225 Primitive::Type type = instruction->GetType();
235 instruction->ReplaceWith(input_cst);
236 instruction->GetBlock()->RemoveInstruction(instruction);
240 void InstructionWithAbsorbingInputSimplifier::VisitOr(HOr* instruction) {
241 HConstant* input_cst = instruction->GetConstantRight();
252 instruction->ReplaceWith(input_cst);
253 instruction->GetBlock()->RemoveInstruction(instruction);
257 void InstructionWithAbsorbingInputSimplifier::VisitRem(HRem* instruction) {
258 Primitive::Type type = instruction->GetType();
264 HBasicBlock* block = instruction->GetBlock();
266 if (instruction->GetLeft()->IsConstant() &&
267 instruction->GetLeft()->AsConstant()->IsArithmeticZero()) {
272 instruction->ReplaceWith(instruction->GetLeft());
273 block->RemoveInstruction(instruction);
276 HConstant* cst_right = instruction->GetRight()->AsConstant();
279 (instruction->GetLeft() == instruction->GetRight())) {
288 instruction->ReplaceWith(GetGraph()->GetConstant(type, 0));
289 block->RemoveInstruction(instruction);
293 void InstructionWithAbsorbingInputSimplifier::VisitShl(HShl* instruction) {
294 VisitShift(instruction);
297 void InstructionWithAbsorbingInputSimplifier::VisitShr(HShr* instruction) {
298 VisitShift(instruction);
301 void InstructionWithAbsorbingInputSimplifier::VisitSub(HSub* instruction) {
302 Primitive::Type type = instruction->GetType();
308 HBasicBlock* block = instruction->GetBlock();
314 if (instruction->GetLeft() == instruction->GetRight()) {
321 instruction->ReplaceWith(GetGraph()->GetConstant(type, 0));
322 block->RemoveInstruction(instruction);
326 void InstructionWithAbsorbingInputSimplifier::VisitUShr(HUShr* instruction) {
327 VisitShift(instruction);
330 void InstructionWithAbsorbingInputSimplifier::VisitXor(HXor* instruction) {
331 if (instruction->GetLeft() == instruction->GetRight()) {
336 Primitive::Type type = instruction->GetType();
337 HBasicBlock* block = instruction->GetBlock();
338 instruction->ReplaceWith(GetGraph()->GetConstant(type, 0));
339 block->RemoveInstruction(instruction);