Skip to content

Commit ef52424

Browse files
committed
[RISCV] Remove IsRV64 from XVentanaCondOps patterns.
Ventana doesn't have RV32 cores so they really supported for RV32, but there's nothing specifically 64-bit about the instructions. My goal here is to fix cannot select errors if XVentanaCondOps is enabled on RV32. Alternatively, we could quality the lowering code to also check IsRV64 so that we don't create RISCVISD::CZERO* nodes. Fixing the isel patterns seemed simpler. Fixes llvm#100855.
1 parent c7231e4 commit ef52424

File tree

2 files changed

+701
-9
lines changed

2 files changed

+701
-9
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoXVentana.td

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// XVentanaCondOps
1515
//===----------------------------------------------------------------------===//
1616

17-
let Predicates = [IsRV64, HasVendorXVentanaCondOps], hasSideEffects = 0,
17+
let Predicates = [HasVendorXVentanaCondOps], hasSideEffects = 0,
1818
mayLoad = 0, mayStore = 0, isCodeGenOnly = 0, DecoderNamespace = "XVentana" in
1919
class VTMaskedMove<bits<3> funct3, string opcodestr>
2020
: RVInstR<0b0000000, funct3, OPC_CUSTOM_3, (outs GPR:$rd),
@@ -28,18 +28,18 @@ def VT_MASKC : VTMaskedMove<0b110, "vt.maskc">,
2828
def VT_MASKCN : VTMaskedMove<0b111, "vt.maskcn">,
2929
Sched<[WriteIALU, ReadIALU, ReadIALU]>;
3030

31-
let Predicates = [IsRV64, HasVendorXVentanaCondOps] in {
32-
def : Pat<(i64 (riscv_czero_eqz GPR:$rs1, GPR:$rc)),
31+
let Predicates = [HasVendorXVentanaCondOps] in {
32+
def : Pat<(XLenVT (riscv_czero_eqz GPR:$rs1, GPR:$rc)),
3333
(VT_MASKC GPR:$rs1, GPR:$rc)>;
34-
def : Pat<(i64 (riscv_czero_nez GPR:$rs1, GPR:$rc)),
34+
def : Pat<(XLenVT (riscv_czero_nez GPR:$rs1, GPR:$rc)),
3535
(VT_MASKCN GPR:$rs1, GPR:$rc)>;
3636

37-
def : Pat<(i64 (riscv_czero_eqz GPR:$rs1, (riscv_setne (i64 GPR:$rc)))),
37+
def : Pat<(XLenVT (riscv_czero_eqz GPR:$rs1, (riscv_setne (XLenVT GPR:$rc)))),
3838
(VT_MASKC GPR:$rs1, GPR:$rc)>;
39-
def : Pat<(i64 (riscv_czero_eqz GPR:$rs1, (riscv_seteq (i64 GPR:$rc)))),
39+
def : Pat<(XLenVT (riscv_czero_eqz GPR:$rs1, (riscv_seteq (XLenVT GPR:$rc)))),
4040
(VT_MASKCN GPR:$rs1, GPR:$rc)>;
41-
def : Pat<(i64 (riscv_czero_nez GPR:$rs1, (riscv_setne (i64 GPR:$rc)))),
41+
def : Pat<(XLenVT (riscv_czero_nez GPR:$rs1, (riscv_setne (XLenVT GPR:$rc)))),
4242
(VT_MASKCN GPR:$rs1, GPR:$rc)>;
43-
def : Pat<(i64 (riscv_czero_nez GPR:$rs1, (riscv_seteq (i64 GPR:$rc)))),
43+
def : Pat<(XLenVT (riscv_czero_nez GPR:$rs1, (riscv_seteq (XLenVT GPR:$rc)))),
4444
(VT_MASKC GPR:$rs1, GPR:$rc)>;
45-
} // Predicates = [IsRV64, HasVendorXVentanaCondOps]
45+
} // Predicates = [HasVendorXVentanaCondOps]

0 commit comments

Comments
 (0)