Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/loopopts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ Node *PhaseIdealLoop::conditional_move( Node *region ) {
break;
}
}
if (phi == nullptr || _igvn.type(phi) == Type::TOP) {
if (phi == nullptr || _igvn.type(phi) == Type::TOP || !CMoveNode::supported(_igvn.type(phi))) {
break;
}
// Move speculative ops
Expand Down
21 changes: 18 additions & 3 deletions src/hotspot/share/opto/movenode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const Type* CMoveNode::Value(PhaseGVN* phase) const {
// Make a correctly-flavored CMove. Since _type is directly determined
// from the inputs we do not need to specify it here.
CMoveNode* CMoveNode::make(Node* bol, Node* left, Node* right, const Type* t) {
switch( t->basic_type() ) {
switch (t->basic_type()) {
case T_INT: return new CMoveINode(bol, left, right, t->is_int());
case T_FLOAT: return new CMoveFNode(bol, left, right, t);
case T_DOUBLE: return new CMoveDNode(bol, left, right, t);
Expand All @@ -195,8 +195,23 @@ CMoveNode* CMoveNode::make(Node* bol, Node* left, Node* right, const Type* t) {
case T_ADDRESS: return new CMovePNode(bol, left, right, t->is_ptr());
case T_NARROWOOP: return new CMoveNNode(bol, left, right, t);
default:
ShouldNotReachHere();
return nullptr;
ShouldNotReachHere();
return nullptr;
}
}

bool CMoveNode::supported(const Type* t) {
switch (t->basic_type()) {
case T_INT: return Matcher::match_rule_supported(Op_CMoveI);
case T_FLOAT: return Matcher::match_rule_supported(Op_CMoveF);
case T_DOUBLE: return Matcher::match_rule_supported(Op_CMoveD);
case T_LONG: return Matcher::match_rule_supported(Op_CMoveL);
case T_OBJECT: return Matcher::match_rule_supported(Op_CMoveP);
case T_ADDRESS: return Matcher::match_rule_supported(Op_CMoveP);
case T_NARROWOOP: return Matcher::match_rule_supported(Op_CMoveN);
default:
ShouldNotReachHere();
return false;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/opto/movenode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class CMoveNode : public TypeNode {
virtual const Type* Value(PhaseGVN* phase) const;
virtual Node* Identity(PhaseGVN* phase);
static CMoveNode* make(Node* bol, Node* left, Node* right, const Type* t);
static bool supported(const Type* t);
// Helper function to spot cmove graph shapes
static Node* is_cmove_id(PhaseTransform* phase, Node* cmp, Node* t, Node* f, BoolNode* b);
static Node* Ideal_minmax(PhaseGVN* phase, CMoveNode* cmov);
Expand Down