diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.td b/llvm/lib/Target/RISCV/RISCVInstrInfo.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfo.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfo.td @@ -901,6 +901,9 @@ def : InstAlias<"hfence.gvma", (HFENCE_GVMA X0, X0)>; def : InstAlias<"hfence.gvma $rs", (HFENCE_GVMA GPR:$rs, X0)>; +def : InstAlias<"hfence.vvma", (HFENCE_VVMA X0, X0)>; +def : InstAlias<"hfence.vvma $rs", (HFENCE_VVMA GPR:$rs, X0)>; + let EmitPriority = 0 in { def : InstAlias<"lb $rd, (${rs1})", (LB GPR:$rd, GPR:$rs1, 0)>; diff --git a/llvm/test/MC/RISCV/rvi-aliases-valid.s b/llvm/test/MC/RISCV/rvi-aliases-valid.s --- a/llvm/test/MC/RISCV/rvi-aliases-valid.s +++ b/llvm/test/MC/RISCV/rvi-aliases-valid.s @@ -262,6 +262,12 @@ # CHECK-S-OBJ-NOALIAS: hfence.gvma a0, zero # CHECK-S-OBJ: hfence.gvma a0 hfence.gvma a0 +# CHECK-S-OBJ-NOALIAS: hfence.vvma zero, zero +# CHECK-S-OBJ: hfence.vvma +hfence.vvma +# CHECK-S-OBJ-NOALIAS: hfence.vvma a0, zero +# CHECK-S-OBJ: hfence.vvma a0 +hfence.vvma a0 # The following aliases are accepted as input but the canonical form # of the instruction will always be printed.