From 8928cab7c1a00f38b9c9a575998093d1b4138805 Mon Sep 17 00:00:00 2001 From: Mingyao Yang Date: Tue, 3 Mar 2015 16:15:23 -0800 Subject: [PATCH] Add a change that should be part of "enhance gvn for commutative ops." Change-Id: Id1a30afb095b2c7e27a4ef8a1ef7293022c1aaed --- compiler/optimizing/code_generator_x86.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc index 116dd158d..3c8f62c78 100644 --- a/compiler/optimizing/code_generator_x86.cc +++ b/compiler/optimizing/code_generator_x86.cc @@ -922,7 +922,7 @@ void InstructionCodeGeneratorX86::VisitCondition(HCondition* comp) { if (rhs.IsRegister()) { __ cmpl(lhs.AsRegister(), rhs.AsRegister()); } else if (rhs.IsConstant()) { - int32_t constant = rhs.GetConstant()->AsIntConstant()->GetValue(); + int32_t constant = CodeGenerator::GetInt32ValueOf(rhs.GetConstant()); if (constant == 0) { __ testl(lhs.AsRegister(), lhs.AsRegister()); } else { -- 2.11.0