< prev index next >

src/hotspot/share/opto/mulnode.cpp

Print this page
rev 52443 : 8213473: Prevent transformation of LoadB->AndI->CmpI pattern to facilitate testb instruction matching

*** 488,498 **** return new AndINode(ldus, phase->intcon(mask & 0xFFFF)); } // Masking sign bits off of a Byte? Do an unsigned byte load plus // an and. ! if (lop == Op_LoadB && (mask & 0xFFFFFF00) == 0) { Node* ldub = load->as_Load()->convert_to_unsigned_load(*phase); ldub = phase->transform(ldub); return new AndINode(ldub, phase->intcon(mask)); } } --- 488,503 ---- return new AndINode(ldus, phase->intcon(mask & 0xFFFF)); } // Masking sign bits off of a Byte? Do an unsigned byte load plus // an and. ! // Prevent transform if it feeds to CmpI. We have special matcher ! // for LoadB+AndI+CmpI that generates a single instruction. ! bool feeds_to_cmpi_zero = outcnt() == 1 && ! unique_out()->Opcode() == Op_CmpI && ! phase->type(unique_out()->in(2))->is_zero_type(); ! if (lop == Op_LoadB && (mask & 0xFFFFFF00) == 0 && !feeds_to_cmpi_zero) { Node* ldub = load->as_Load()->convert_to_unsigned_load(*phase); ldub = phase->transform(ldub); return new AndINode(ldub, phase->intcon(mask)); } }
< prev index next >