RFR: 8308340: C2: Idealize Fma nodes [v4]
Fei Gao
fgao at openjdk.org
Tue Jul 18 01:44:05 UTC 2023
On Mon, 17 Jul 2023 14:37:52 GMT, Richard Reingruber <rrich at openjdk.org> wrote:
> I've added the patch to our nightly testing about 10 days ago and forgot about it (sorry). So it passed several iterations of tier1-4 of hotspot and jdk, all of langtools and jaxp, renaissance benchmarks as functional tests. All testing with fastdebug and release builds on the main platforms and also on Linux/PPC64le.
>
> PPC changes do look good to me. I'm not the greatest C2 expert though. So I'd suggest to get another review.
Thanks a lot for your review and test work @reinrich!
> src/hotspot/share/opto/vectornode.cpp line 1879:
>
>> 1877:
>> 1878: Node* FmaVNode::Ideal(PhaseGVN* phase, bool can_reshape) {
>> 1879: // We canonicalize the node by converting "(-a)*b+c" into "b*(-a)+c"
>
> Could you explain a little bit more please?
Thanks for your review!
For vectorapi masked operations, like `av.neg().lanewise(VectorOperators.FMA, bv, cv, mask)`, the inactive lanes of the output should save the first input of the node, so the inactive lanes of the output should be equal to lane values in `av.neg()`. If we exchange the inputs, the inactive lanes will be equal to `bv`, which is incorrect. So we shouldn't swap edges for masked nodes. The newly added testcases in ` jdk/test/hotspot/jtreg/compiler/vectorapi/VectorFusedMultiplyAddSubTest.java` can cover this. Fortunately, there is no such constraint for non-masked vector nodes.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14576#issuecomment-1639146994
PR Review Comment: https://git.openjdk.org/jdk/pull/14576#discussion_r1266078495
More information about the hotspot-compiler-dev
mailing list