It was noticed in https://bugs.openjdk.org/browse/JDK-8311597 that in the following instruction sequence:
or ebp, 0xa
test ebp, ebp
jl 0x1b5ee511261
The `test ebp, ebp` is redundant, because the same flags are already set by the 'or' instruction.
We could coalesce these instructions together into just:
or ebp, 0xa
jl 0x1b5ee511261
The 'jl' instruction needs the SF and OF flags, which are set by the 'or' instruction. The `test ebp, ebp` does not modify the result register, just sets the flags, so it is not needed.
or ebp, 0xa
test ebp, ebp
jl 0x1b5ee511261
The `test ebp, ebp` is redundant, because the same flags are already set by the 'or' instruction.
We could coalesce these instructions together into just:
or ebp, 0xa
jl 0x1b5ee511261
The 'jl' instruction needs the SF and OF flags, which are set by the 'or' instruction. The `test ebp, ebp` does not modify the result register, just sets the flags, so it is not needed.
- duplicates
-
JDK-8312213 Remove unnecessary TEST instructions on x86 when flags reg will already be set
-
- Resolved
-
- relates to
-
JDK-8311597 OrINode/OrLNode::add_ring should track positives
-
- Closed
-