RFR: 8322589: Add Ideal transformation: (~a) & (~b) => ~(a | b) [v5]

Tobias Hartmann thartmann at openjdk.org
Tue Jan 9 09:08:26 UTC 2024


On Tue, 9 Jan 2024 05:59:26 GMT, Zhiqiang Zang <duke at openjdk.org> wrote:

>> src/hotspot/share/opto/addnode.hpp line 84:
>> 
>>> 82:   // Utility function to check if the given node is a NOT operation,
>>> 83:   // i.e., n == m ^ (-1).
>>> 84:   static bool is_not(PhaseGVN* phase, Node* n, BasicType bt);
>> 
>> Could these be made non-static?
>
> @TobiHartmann @eme64 
> I moved `is_not` but I was not able to move `make_not` to `node` class, because otherwise it would not compile for arm, s390x, ppc64le.
> 
> /home/runner/work/jdk/jdk/src/hotspot/share/opto/node.cpp:1605:18: error: expected type-specifier before 'XorINode'
>  1605 |       return new XorINode(this, phase->intcon(-1));
> 
> I do not see any similar use cases to `new XorINode` in `nocde.cpp`, so I was hesitant to include new header files for the file.
> Please let me know if we still want to move `make_not`. Thanks.

I would say it's better to leave both methods as static methods then, for consistency. Thanks for giving it a try!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16333#discussion_r1445810287


More information about the hotspot-compiler-dev mailing list