RFR: 8323220: Reassociate loop invariants involved in Cmps and Add/Subs [v2]
Joshua Cao
duke at openjdk.org
Fri Jan 19 19:10:26 UTC 2024
On Thu, 18 Jan 2024 08:25:46 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Some sort of pattern matcher could work. It would be able nice to match something like `a ADD_I b CMP_LT c`. In java this could look something like
>>
>>
>> @IR(counts = {IRNode.CMP_LT[IRNode.ANY, IRNode.SUB_I, IRNode.ANY], "1"}
>>
>>
>> The arguments in the `[]` are the inputs. `IRNode.ANY` matches any node. (The zero'th node is ANY because its the region node).
>>
>> Anyway, I think a `lt` test is not super-required for the coverage for this PR. The current machinery does not provide a convenient way to test it. I'd prefer to avoid something hacky. I think this work can be done separately.
>
> I agree with you there, don't do anything hacky here.
> But yes, I've also been wondering what kind of improvements to the IR framework would help us to do these sorts of graph-matching verifications.
Created https://bugs.openjdk.org/browse/JDK-8324226
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17375#discussion_r1459579634
More information about the hotspot-compiler-dev
mailing list