Skip to content

Commit c486b9b

Browse files
zifeihanRealFYang
authored andcommitted
8311923: TestIRMatching.java fails on RISC-V
Reviewed-by: phh, fyang Backport-of: e7adbdb1f1506b82392907f7e4a5c8882d3198eb
1 parent b4c8cc8 commit c486b9b

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/hotspot/cpu/riscv/riscv.ad

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,7 +2056,7 @@ bool Matcher::pd_clone_address_expressions(AddPNode* m, Matcher::MStack& mstack,
20562056
encode %{
20572057
// BEGIN Non-volatile memory access
20582058

2059-
enc_class riscv_enc_li_imm(iRegIorL dst, immIorL src) %{
2059+
enc_class riscv_enc_mov_imm(iRegIorL dst, immIorL src) %{
20602060
C2_MacroAssembler _masm(&cbuf);
20612061
int64_t con = (int64_t)$src$$constant;
20622062
Register dst_reg = as_Register($dst$$reg);
@@ -4672,9 +4672,9 @@ instruct loadConI(iRegINoSp dst, immI src)
46724672
match(Set dst src);
46734673

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

4677-
ins_encode(riscv_enc_li_imm(dst, src));
4677+
ins_encode(riscv_enc_mov_imm(dst, src));
46784678

46794679
ins_pipe(ialu_imm);
46804680
%}
@@ -4685,9 +4685,9 @@ instruct loadConL(iRegLNoSp dst, immL src)
46854685
match(Set dst src);
46864686

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

4690-
ins_encode(riscv_enc_li_imm(dst, src));
4690+
ins_encode(riscv_enc_mov_imm(dst, src));
46914691

46924692
ins_pipe(ialu_imm);
46934693
%}

test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ public class IRNode {
5353
private static final String STORE_OF_CLASS_POSTFIX = "(:|\\+)\\S* \\*" + END;
5454
private static final String LOAD_OF_CLASS_POSTFIX = "(:|\\+)\\S* \\*" + END;
5555

56-
public static final String ALLOC = "(.*precise klass .*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END;
57-
public static final String ALLOC_OF = COMPOSITE_PREFIX + "(.*precise klass .*" + IS_REPLACED + ":.*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END;
58-
public static final String ALLOC_ARRAY = "(.*precise klass \\[L.*\\R((.*(?i:mov|xor|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END;
59-
public static final String ALLOC_ARRAY_OF = COMPOSITE_PREFIX + "(.*precise klass \\[L.*" + IS_REPLACED + ";:.*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END;
56+
public static final String ALLOC = "(.*precise klass .*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END;
57+
public static final String ALLOC_OF = COMPOSITE_PREFIX + "(.*precise klass .*" + IS_REPLACED + ":.*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END;
58+
public static final String ALLOC_ARRAY = "(.*precise klass \\[L.*\\R((.*(?i:mov|mv|xor|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END;
59+
public static final String ALLOC_ARRAY_OF = COMPOSITE_PREFIX + "(.*precise klass \\[L.*" + IS_REPLACED + ";:.*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END;
6060

61-
public static final String CHECKCAST_ARRAY = "(((?i:cmp|CLFI|CLR).*precise klass \\[.*;:|.*(?i:mov|or).*precise klass \\[.*;:.*\\R.*(cmp|CMP|CLR))" + END;
62-
public static final String CHECKCAST_ARRAY_OF = COMPOSITE_PREFIX + "(((?i:cmp|CLFI|CLR).*precise klass \\[.*" + IS_REPLACED + ";:|.*(?i:mov|or).*precise klass \\[.*" + IS_REPLACED + ";:.*\\R.*(cmp|CMP|CLR))" + END;
61+
public static final String CHECKCAST_ARRAY = "(((?i:cmp|CLFI|CLR).*precise klass \\[.*;:|.*(?i:mov|mv|or).*precise klass \\[.*;:.*\\R.*(cmp|CMP|CLR))" + END;
62+
public static final String CHECKCAST_ARRAY_OF = COMPOSITE_PREFIX + "(((?i:cmp|CLFI|CLR).*precise klass \\[.*" + IS_REPLACED + ";:|.*(?i:mov|mv|or).*precise klass \\[.*" + IS_REPLACED + ";:.*\\R.*(cmp|CMP|CLR))" + END;
6363
// Does not work on s390 (a rule containing this regex will be skipped on s390).
6464
public static final String CHECKCAST_ARRAYCOPY = "(.*((?i:call_leaf_nofp,runtime)|CALL,\\s?runtime leaf nofp|BCTRL.*.leaf call).*checkcast_arraycopy.*" + END;
6565

0 commit comments

Comments
 (0)