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
10 changes: 5 additions & 5 deletions src/hotspot/cpu/riscv/riscv.ad
Original file line number Diff line number Diff line change
Expand Up @@ -2176,7 +2176,7 @@ bool Matcher::pd_clone_address_expressions(AddPNode* m, Matcher::MStack& mstack,
encode %{
// BEGIN Non-volatile memory access

enc_class riscv_enc_li_imm(iRegIorL dst, immIorL src) %{
enc_class riscv_enc_mov_imm(iRegIorL dst, immIorL src) %{
C2_MacroAssembler _masm(&cbuf);
int64_t con = (int64_t)$src$$constant;
Register dst_reg = as_Register($dst$$reg);
Expand Down Expand Up @@ -4965,9 +4965,9 @@ instruct loadConI(iRegINoSp dst, immI src)
match(Set dst src);

ins_cost(ALU_COST);
format %{ "li $dst, $src\t# int, #@loadConI" %}
format %{ "mv $dst, $src\t# int, #@loadConI" %}

ins_encode(riscv_enc_li_imm(dst, src));
ins_encode(riscv_enc_mov_imm(dst, src));

ins_pipe(ialu_imm);
%}
Expand All @@ -4978,9 +4978,9 @@ instruct loadConL(iRegLNoSp dst, immL src)
match(Set dst src);

ins_cost(ALU_COST);
format %{ "li $dst, $src\t# long, #@loadConL" %}
format %{ "mv $dst, $src\t# long, #@loadConL" %}

ins_encode(riscv_enc_li_imm(dst, src));
ins_encode(riscv_enc_mov_imm(dst, src));

ins_pipe(ialu_imm);
%}
Expand Down
12 changes: 6 additions & 6 deletions test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,25 +198,25 @@ public class IRNode {

public static final String ALLOC = PREFIX + "ALLOC" + POSTFIX;
static {
String optoRegex = "(.*precise .*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END;
String optoRegex = "(.*precise .*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END;
allocNodes(ALLOC, "Allocate", optoRegex);
}

public static final String ALLOC_OF = COMPOSITE_PREFIX + "ALLOC_OF" + POSTFIX;
static {
String regex = "(.*precise .*" + IS_REPLACED + ":.*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END;
String regex = "(.*precise .*" + IS_REPLACED + ":.*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END;
optoOnly(ALLOC_OF, regex);
}

Copy link
Member

@RealFYang RealFYang Jul 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: I think it will be safer and more consistent to update regex for ALLOC and ALLOC_OF adding matching for RISC-V mv at the same time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: I think it will be safer and more consistent to update regex for ALLOC and ALLOC_OF adding matching for RISC-V mv at the same time.

Thanks for your review, Fixed.

public static final String ALLOC_ARRAY = PREFIX + "ALLOC_ARRAY" + POSTFIX;
static {
String optoRegex = "(.*precise \\[.*\\R((.*(?i:mov|xor|nop|spill).*|\\s*|.*(LGHI|LI).*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END;
String optoRegex = "(.*precise \\[.*\\R((.*(?i:mov|mv|xor|nop|spill).*|\\s*|.*(LGHI|LI).*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END;
allocNodes(ALLOC_ARRAY, "AllocateArray", optoRegex);
}

public static final String ALLOC_ARRAY_OF = COMPOSITE_PREFIX + "ALLOC_ARRAY_OF" + POSTFIX;
static {
String regex = "(.*precise \\[.*" + IS_REPLACED + ":.*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*|.*(LGHI|LI).*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END;
String regex = "(.*precise \\[.*" + IS_REPLACED + ":.*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*|.*(LGHI|LI).*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END;
optoOnly(ALLOC_ARRAY_OF, regex);
}

Expand Down Expand Up @@ -277,13 +277,13 @@ public class IRNode {

public static final String CHECKCAST_ARRAY = PREFIX + "CHECKCAST_ARRAY" + POSTFIX;
static {
String regex = "(((?i:cmp|CLFI|CLR).*precise \\[.*:|.*(?i:mov|or).*precise \\[.*:.*\\R.*(cmp|CMP|CLR))" + END;
String regex = "(((?i:cmp|CLFI|CLR).*precise \\[.*:|.*(?i:mov|mv|or).*precise \\[.*:.*\\R.*(cmp|CMP|CLR))" + END;
optoOnly(CHECKCAST_ARRAY, regex);
}

public static final String CHECKCAST_ARRAY_OF = COMPOSITE_PREFIX + "CHECKCAST_ARRAY_OF" + POSTFIX;
static {
String regex = "(((?i:cmp|CLFI|CLR).*precise \\[.*" + IS_REPLACED + ":|.*(?i:mov|or).*precise \\[.*" + IS_REPLACED + ":.*\\R.*(cmp|CMP|CLR))" + END;
String regex = "(((?i:cmp|CLFI|CLR).*precise \\[.*" + IS_REPLACED + ":|.*(?i:mov|mv|or).*precise \\[.*" + IS_REPLACED + ":.*\\R.*(cmp|CMP|CLR))" + END;
optoOnly(CHECKCAST_ARRAY_OF, regex);
}

Expand Down