# HG changeset patch # User Thomas Wuerthinger # Date 1448218362 -3600 # Node ID 6c5f70cd3ed8e167738ab8db75c435d94d9dc756 # Parent 2b27fb937568c21585b6d566557ec3c6727a390c Improve memory compare match operation. diff -r 2b27fb937568 -r 6c5f70cd3ed8 graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeMatchRules.java --- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeMatchRules.java Sun Nov 22 14:53:59 2015 +0100 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeMatchRules.java Sun Nov 22 19:52:42 2015 +0100 @@ -126,7 +126,7 @@ if (value.isConstant()) { JavaConstant constant = value.asJavaConstant(); - if (constant != null && kind == AMD64Kind.QWORD && (constant.getJavaKind().isObject() || !NumUtil.isInt(constant.asLong()))) { + if (constant != null && kind == AMD64Kind.QWORD && !constant.getJavaKind().isObject() && !NumUtil.isInt(constant.asLong())) { // Only imm32 as long return null; } @@ -146,14 +146,7 @@ LabelRef falseLabel = getLIRBlock(ifNode.falseSuccessor()); boolean unorderedIsTrue = compare.unorderedIsTrue(); double trueLabelProbability = ifNode.probability(ifNode.trueSuccessor()); - Value other; - JavaConstant constant = value.asJavaConstant(); - if (constant != null) { - other = gen.emitJavaConstant(constant); - } else { - other = operand(value); - } - + Value other = operand(value); AMD64AddressValue address = (AMD64AddressValue) operand(access.getAddress()); getLIRGeneratorTool().emitCompareBranchMemory(kind, other, address, getState(access), finalCondition, unorderedIsTrue, trueLabel, falseLabel, trueLabelProbability); return null;