RFR: 8310886: C2 SuperWord: Two nodes should be isomorphic if they are loop invariant but pinned at different nodes outside the loop [v4]

Christian Hagedorn chagedorn at openjdk.org
Wed Sep 27 17:16:17 UTC 2023


On Fri, 22 Sep 2023 07:37:57 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Christian Hagedorn has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Restrict test to aarch64 and x86_64 since match rule for Op_MulAddVS2VI is only defined on these platforms
>
> test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java line 917:
> 
>> 915:     public static final String MUL_ADD_VS2VI = PREFIX + "MUL_ADD_VS2VI" + POSTFIX;
>> 916:     static {
>> 917:         superWordNodes(MUL_ADD_VS2VI, "MulAddVS2VI");
> 
> Is there a reason this is not a `vectorNode`?

First I've noticed that `MulAddVS2VI` is only created in Superword as far as I see. But now that [JDK-8310308](https://bugs.openjdk.org/browse/JDK-8310308) is in, I think I can switch to `vectorNode()`. Additionally, I think I need to revisit the rule for aarch64 to see if I can do better with the features from JDK-8310308. In the .ad file it says that it's only possible to use these nodes if the length is 16:
https://github.com/openjdk/jdk/blob/5350fd617390aaaedf8dd8821418c796cb1c38b3/src/hotspot/cpu/aarch64/aarch64_vector.ad#L182-L185

> test/hotspot/jtreg/compiler/loopopts/superword/TestMulAddS2I.java line 50:
> 
>> 48:         for (int i = 0; i < RANGE; i++) {
>> 49:             sArr1[i] = (short)(i + (1000 * AbstractInfo.getRandom().nextDouble()));
>> 50:             sArr2[i] = (short)(RANGE - i + (2000 * AbstractInfo.getRandom().nextDouble()));
> 
> Did you want to change this to `(short)AbstractInfo.getRandom().nextInt();`

Good idea, I will update this.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15842#discussion_r1338945591
PR Review Comment: https://git.openjdk.org/jdk/pull/15842#discussion_r1338945084


More information about the hotspot-compiler-dev mailing list