RFR: 8353276: C2: simplify PhaseMacroExpand::opt_bits_test

Christian Hagedorn chagedorn at openjdk.org
Mon Jul 14 07:48:39 UTC 2025


On Fri, 11 Jul 2025 21:53:35 GMT, Saranya Natarajan <snatarajan at openjdk.org> wrote:

> **Issue** 
> The last three parameters of `PhaseMacroExpand::opt_bits_test(Node* ctrl, Node* region, int edge, Node* word, int mask, int bits, bool return_fast_path)` are unnecessary after the fix introduced in [JDK-8256425](https://bugs.openjdk.org/browse/JDK-8256425)
> 
> **Fix** 
> The proposed fix removes the last three parameters and makes the necessary modification to the methods. 
> 
> **Testing**
> GitHub Actions
> tier1 to tier5 on windows-x64, linux-x64, linux-aarch64, macosx-x64, and macosx-aarch64.

Otherwise, it looks good, thanks for cleaning it up!

src/hotspot/share/opto/macro.cpp line 98:

> 96: Node* PhaseMacroExpand::opt_bits_test(Node* ctrl, Node* region, int edge, Node* word) {
> 97:   Node* cmp;
> 98:   cmp = word;

Could now be merged (I cannot make a direct suggestion due to deleted lines):

Node* cmp = word;

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

Marked as reviewed by chagedorn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/26276#pullrequestreview-3015116536
PR Review Comment: https://git.openjdk.org/jdk/pull/26276#discussion_r2204080988


More information about the hotspot-compiler-dev mailing list