Skip to content

Commit b42d496

Browse files
author
Vladimir Ivanov
committed
8266388: C2: Improve constant ShiftCntV on x86
Reviewed-by: kvn
1 parent 05cfac9 commit b42d496

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/hotspot/cpu/x86/x86.ad

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2119,6 +2119,10 @@ bool Matcher::pd_clone_node(Node* n, Node* m, Matcher::MStack& mstack) {
21192119
mstack.push(m, Visit);
21202120
return true;
21212121
}
2122+
if (is_vshift_con_pattern(n, m)) { // ShiftV src (ShiftCntV con)
2123+
mstack.push(m, Visit); // m = ShiftCntV
2124+
return true;
2125+
}
21222126
return false;
21232127
}
21242128

src/hotspot/share/opto/matcher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2025,7 +2025,7 @@ OptoReg::Name Matcher::find_receiver() {
20252025
return OptoReg::as_OptoReg(regs.first());
20262026
}
20272027

2028-
bool Matcher::is_vshift_con_pattern(Node *n, Node *m) {
2028+
bool Matcher::is_vshift_con_pattern(Node* n, Node* m) {
20292029
if (n != NULL && m != NULL) {
20302030
return VectorNode::is_vector_shift(n) &&
20312031
VectorNode::is_vector_shift_count(m) && m->in(1)->is_Con();

src/hotspot/share/opto/matcher.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class Matcher : public PhaseTransform {
121121
bool find_shared_visit(MStack& mstack, Node* n, uint opcode, bool& mem_op, int& mem_addr_idx);
122122
void find_shared_post_visit(Node* n, uint opcode);
123123

124-
bool is_vshift_con_pattern(Node *n, Node *m);
124+
bool is_vshift_con_pattern(Node* n, Node* m);
125125

126126
// Debug and profile information for nodes in old space:
127127
GrowableArray<Node_Notes*>* _old_node_note_array;

0 commit comments

Comments
 (0)