RFR: 8342393: Promote commutative vector IR node sharing [v8]
Xiaohong Gong
xgong at openjdk.org
Thu Jan 16 06:56:37 UTC 2025
On Thu, 16 Jan 2025 06:44:13 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:
>> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Extension covering masked vector operations
>
> test/hotspot/jtreg/compiler/vectorapi/VectorCommutativeOperSharingTest.java line 418:
>
>> 416: // predicated (vec1 + vec2) + (vec2 + vec1)
>> 417: vec1.lanewise(VectorOperators.ADD, vec2, vmask)
>> 418: .lanewise(VectorOperators.ADD, vec2.lanewise(VectorOperators.ADD, vec1, vmask))
>
> Thanks for your updating @jatin-bhateja!
>
> But I don't think it's right here. Do you mean `vec1.lanewise(VectorOperators.ADD, vec2, vmake)` equals to `vec2.lanewise(VectorOperators.ADD, vec1, vmask)` ? The inactive lane values are not equal, right? Should it keep the lane value of first input for inactive lanes? Thanks!
Seems the predicated IR can be commutative only if the mask is `alltrue()`. I noticed the mask in this test is `alltrue`, so it maybe correct for this case. Could you please also add other IR tests that the mask is not `alltrue`? Thanks!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22863#discussion_r1917839879
More information about the hotspot-compiler-dev
mailing list