Skip to content

Commit 8253173

Browse files
committed
modification per code review suggestions
1 parent 6630a8e commit 8253173

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/hotspot/share/opto/subnode.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1813,16 +1813,16 @@ Node *BoolNode::Ideal(PhaseGVN *phase, bool can_reshape) {
18131813
// Simplify a Bool (convert condition codes to boolean (1 or 0)) node,
18141814
// based on local information. If the input is constant, do it.
18151815
const Type* BoolNode::Value(PhaseGVN* phase) const {
1816-
Node *cmp = in(1);
1817-
if (cmp && cmp->is_Sub()) {
1816+
Node* cmp = in(1);
1817+
if (cmp != nullptr && cmp->is_Sub()) {
18181818
int cop = cmp->Opcode();
1819-
Node *cmp1 = cmp->in(1);
1820-
Node *cmp2 = cmp->in(2);
1819+
Node* cmp1 = cmp->in(1);
1820+
Node* cmp2 = cmp->in(2);
18211821

18221822
// Change ((x & m) u<= m) or ((m & x) u<= m) to always true
18231823
// Same with ((x & m) u< m+1) and ((m & x) u< m+1)
18241824
if (cop == Op_CmpU && cmp1->Opcode() == Op_AndI) {
1825-
Node *bound = nullptr;
1825+
Node* bound = nullptr;
18261826
if (_test._test == BoolTest::le) {
18271827
bound = cmp2;
18281828
} else if (_test._test == BoolTest::lt && cmp2->Opcode() == Op_AddI && cmp2->in(2)->find_int_con(0) == 1) {

test/hotspot/jtreg/compiler/c2/TestBoolNodeGvn.java renamed to test/hotspot/jtreg/compiler/c2/irTests/TestBoolNodeGvn.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333

3434
/**
3535
* @test
36-
* @summary
36+
* @bug 8327381
37+
* @summary Refactor boolean node tautology transformations
3738
* @library /test/lib /
3839
* @run driver compiler.c2.TestBoolNodeGvn
3940
*/

0 commit comments

Comments
 (0)