RFR: 8312213: Remove unnecessary TEST instructions on x86 when flags reg will already be set [v6]

Tobias Hartmann thartmann at openjdk.org
Thu Aug 10 07:05:58 UTC 2023


On Tue, 8 Aug 2023 14:18:51 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Tobias Hotz has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add a side effect to the IR tests to make sure we do not emit CMOVs there
>>   
>>   Without Tiered Compilation, no profile data is present, which means a CMOV would always be emitted. Keep the compiler from doing that, as the peephole currently does not work with CMOV instructions
>
> Ok, thanks. I've submitted another CI run.

@JornVernee's testing failed:

`-ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:-TieredCompilation`



Failed IR Rules (6) of Methods (6)
----------------------------------
1) Method "public boolean compiler.c2.irTests.TestTestRemovalPeephole.testIntAddtionEquals0(int,int)" - [Failed IR rules: 1]:
   * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIfCPUFeatureAnd={}, phase={FINAL_CODE}, applyIf={}, applyIfCPUFeatureOr={}, applyIfCPUFeature={}, counts={}, applyIfAnd={}, failOn={"_#X86_TESTI_REG#_", "_#X86_TESTL_REG#_"}, applyIfOr={}, applyIfNot={})"
     > Phase "Final Code":
       - failOn: Graph contains forbidden nodes:
         * Constraint 1: "(\\d+(\\s){2}(testI_reg.*)+(\\s){2}===.*)"
           - Matched forbidden node:
             * 10  testI_reg  === _ 11  [[ 9 ]] #0/0x00000000

2) Method "public boolean compiler.c2.irTests.TestTestRemovalPeephole.testIntAddtionNotEquals0(int,int)" - [Failed IR rules: 1]:
   * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIfCPUFeatureAnd={}, phase={FINAL_CODE}, applyIf={}, applyIfCPUFeatureOr={}, applyIfCPUFeature={}, counts={}, applyIfAnd={}, failOn={"_#X86_TESTI_REG#_", "_#X86_TESTL_REG#_"}, applyIfOr={}, applyIfNot={})"
     > Phase "Final Code":
       - failOn: Graph contains forbidden nodes:
         * Constraint 1: "(\\d+(\\s){2}(testI_reg.*)+(\\s){2}===.*)"
           - Matched forbidden node:
             * 10  testI_reg  === _ 11  [[ 9 ]] #0/0x00000000

3) Method "public boolean compiler.c2.irTests.TestTestRemovalPeephole.testIntOrEquals0(int,int)" - [Failed IR rules: 1]:
   * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIfCPUFeatureAnd={}, phase={FINAL_CODE}, applyIf={}, applyIfCPUFeatureOr={}, applyIfCPUFeature={}, counts={}, applyIfAnd={}, failOn={"_#X86_TESTI_REG#_", "_#X86_TESTL_REG#_"}, applyIfOr={}, applyIfNot={})"
     > Phase "Final Code":
       - failOn: Graph contains forbidden nodes:
         * Constraint 1: "(\\d+(\\s){2}(testI_reg.*)+(\\s){2}===.*)"
           - Matched forbidden node:
             * 10  testI_reg  === _ 11  [[ 9 ]] #0/0x00000000

4) Method "public boolean compiler.c2.irTests.TestTestRemovalPeephole.testIntOrGreater0(int,int)" - [Failed IR rules: 1]:
   * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIfCPUFeatureAnd={}, phase={FINAL_CODE}, applyIf={}, applyIfCPUFeatureOr={}, applyIfCPUFeature={}, counts={}, applyIfAnd={}, failOn={"_#X86_TESTI_REG#_", "_#X86_TESTL_REG#_"}, applyIfOr={}, applyIfNot={})"
     > Phase "Final Code":
       - failOn: Graph contains forbidden nodes:
         * Constraint 1: "(\\d+(\\s){2}(testI_reg.*)+(\\s){2}===.*)"
           - Matched forbidden node:
             * 10  testI_reg  === _ 11  [[ 9 ]] #0/0x00000000

5) Method "public boolean compiler.c2.irTests.TestTestRemovalPeephole.testIntOrNotEquals0(int,int)" - [Failed IR rules: 1]:
   * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIfCPUFeatureAnd={}, phase={FINAL_CODE}, applyIf={}, applyIfCPUFeatureOr={}, applyIfCPUFeature={}, counts={}, applyIfAnd={}, failOn={"_#X86_TESTI_REG#_", "_#X86_TESTL_REG#_"}, applyIfOr={}, applyIfNot={})"
     > Phase "Final Code":
       - failOn: Graph contains forbidden nodes:
         * Constraint 1: "(\\d+(\\s){2}(testI_reg.*)+(\\s){2}===.*)"
           - Matched forbidden node:
             * 10  testI_reg  === _ 11  [[ 9 ]] #0/0x00000000

6) Method "public boolean compiler.c2.irTests.TestTestRemovalPeephole.testLongOrGreater0(long,long)" - [Failed IR rules: 1]:
   * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIfCPUFeatureAnd={}, phase={FINAL_CODE}, applyIf={}, applyIfCPUFeatureOr={}, applyIfCPUFeature={}, counts={}, applyIfAnd={}, failOn={"_#X86_TESTI_REG#_", "_#X86_TESTL_REG#_"}, applyIfOr={}, applyIfNot={})"
     > Phase "Final Code":
       - failOn: Graph contains forbidden nodes:
         * Constraint 2: "(\\d+(\\s){2}(testL_reg.*)+(\\s){2}===.*)"
           - Matched forbidden node:
             * 10  testL_reg  === _ 11  [[ 9 ]] #0/0x0000000000000000

-------------

PR Comment: https://git.openjdk.org/jdk/pull/14172#issuecomment-1672652404


More information about the hotspot-compiler-dev mailing list