mirror of
https://github.com/openjdk/jdk.git
synced 2026-08-03 06:35:31 +00:00
More fold C1 substitutability check for identical operands
This commit is contained in:
parent
9cab9a5936
commit
8e063f4519
@ -1594,14 +1594,14 @@ void LIR_Assembler::emit_opSubstitutabilityCheck(LIR_OpSubstitutabilityCheck* op
|
||||
|
||||
Register left = op->left()->as_register();
|
||||
Register right = op->right()->as_register();
|
||||
|
||||
if (left == right) {
|
||||
__ jmp(L_oops_equal);
|
||||
} else {
|
||||
__ cmpptr(left, right);
|
||||
__ jcc(Assembler::equal, L_oops_equal);
|
||||
move(op->equal_result(), op->result_opr());
|
||||
return;
|
||||
}
|
||||
|
||||
__ cmpptr(left, right);
|
||||
__ jcc(Assembler::equal, L_oops_equal);
|
||||
|
||||
// (1) Null check -- if one of the operands is null, the other must not be null (because
|
||||
// the two references are not equal), so they are not substitutable,
|
||||
__ testptr(left, left);
|
||||
|
||||
@ -3363,6 +3363,11 @@ void LIRGenerator::substitutability_check(If* x, LIRItem& left, LIRItem& right)
|
||||
void LIRGenerator::substitutability_check_common(Value left_val, Value right_val, LIRItem& left, LIRItem& right,
|
||||
LIR_Opr equal_result, LIR_Opr not_equal_result, LIR_Opr result,
|
||||
CodeEmitInfo* info) {
|
||||
if (left.result() == right.result()) {
|
||||
__ move(equal_result, result);
|
||||
return;
|
||||
}
|
||||
|
||||
LIR_Opr tmp1 = LIR_OprFact::illegalOpr;
|
||||
LIR_Opr tmp2 = LIR_OprFact::illegalOpr;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user