RFR: JDK-8213473: Prevent transformation of LoadB->AndI->CmpI pattern to facilitate testb instruction matching
rkennke at redhat.com
Wed Nov 7 11:46:48 UTC 2018
In JDK-8203628, Aleksey added matchers to generate testb instruction (on
x86) for LoadB->AndI->CmpI sequence. However, in AndINode::Ideal() we
transform any LoadB->AndI to LoadUB->AndI which fails to match this
pattern. Which means we never actually match for testb. The original
matchers for LoadUB->AndI->CmpI needed to be removed because of
The proposed enhancement would prevent the transformation if we have a
straight LoadB->AndI->CmpI sequence. While the matcher is x86-only, I
don't think it actually hurts to prevent this particular sequence. It
should generate better code (e.g. single testb instructions) for things
if ((field & 3) == 0) ..
if (field == x) .. because we always mask byte loads
or even (not sure) same for boolean fields.
Testing: passes hotspot/jtreg:tier1 here
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: OpenPGP digital signature
More information about the hotspot-compiler-dev