diff --git a/llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.cpp b/llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.cpp index a922991b7338cd..888bcc46ea1ef9 100644 --- a/llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.cpp +++ b/llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.cpp @@ -13,6 +13,7 @@ #include "RISCVRegisterBankInfo.h" #include "MCTargetDesc/RISCVMCTargetDesc.h" #include "RISCVSubtarget.h" +#include "llvm/CodeGen/GlobalISel/GenericMachineInstrs.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/RegisterBank.h" #include "llvm/CodeGen/RegisterBankInfo.h" @@ -407,6 +408,17 @@ RISCVRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const { case TargetOpcode::G_SELECT: { LLT Ty = MRI.getType(MI.getOperand(0).getReg()); + if (Ty.isVector()) { + auto &Sel = cast(MI); + LLT TestTy = MRI.getType(Sel.getCondReg()); + assert(TestTy.isVector() && "Unexpected condition argument type"); + OpdsMapping[0] = OpdsMapping[2] = OpdsMapping[3] = + getVRBValueMapping(Ty.getSizeInBits().getKnownMinValue()); + OpdsMapping[1] = + getVRBValueMapping(TestTy.getSizeInBits().getKnownMinValue()); + break; + } + // Try to minimize the number of copies. If we have more floating point // constrained values than not, then we'll put everything on FPR. Otherwise, // everything has to be on GPR. diff --git a/llvm/test/CodeGen/RISCV/GlobalISel/regbankselect/rvv/select.mir b/llvm/test/CodeGen/RISCV/GlobalISel/regbankselect/rvv/select.mir new file mode 100644 index 00000000000000..4dc077ae6bfebe --- /dev/null +++ b/llvm/test/CodeGen/RISCV/GlobalISel/regbankselect/rvv/select.mir @@ -0,0 +1,558 @@ +# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py +# RUN: llc -mtriple=riscv32 -mattr=+m,+v -run-pass=regbankselect \ +# RUN: -disable-gisel-legality-check -simplify-mir -verify-machineinstrs %s \ +# RUN: -o - | FileCheck -check-prefix=RV32I %s +# RUN: llc -mtriple=riscv64 -mattr=+m,+v -run-pass=regbankselect \ +# RUN: -disable-gisel-legality-check -simplify-mir -verify-machineinstrs %s \ +# RUN: -o - | FileCheck -check-prefix=RV64I %s + +--- +name: select_nxv1i8 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv1i8 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8 + ; + ; RV64I-LABEL: name: select_nxv1i8 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8 = COPY %0() + PseudoRET implicit $v8 +... +--- +name: select_nxv2i8 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv2i8 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8 + ; + ; RV64I-LABEL: name: select_nxv2i8 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8 = COPY %0() + PseudoRET implicit $v8 +... +--- +name: select_nxv4i8 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv4i8 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8 + ; + ; RV64I-LABEL: name: select_nxv4i8 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8 = COPY %0() + PseudoRET implicit $v8 +... +--- +name: select_nxv8i8 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv8i8 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8 + ; + ; RV64I-LABEL: name: select_nxv8i8 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8 = COPY %0() + PseudoRET implicit $v8 +... +--- +name: select_nxv16i8 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv16i8 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8m2 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8m2 + ; + ; RV64I-LABEL: name: select_nxv16i8 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8m2 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8m2 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8m2 = COPY %0() + PseudoRET implicit $v8m2 +... +--- +name: select_nxv32i8 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv32i8 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8m4 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8m4 + ; + ; RV64I-LABEL: name: select_nxv32i8 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8m4 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8m4 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8m4 = COPY %0() + PseudoRET implicit $v8m4 +... +--- +name: select_nxv64i8 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv64i8 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8m8 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8m8 + ; + ; RV64I-LABEL: name: select_nxv64i8 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8m8 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8m8 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8m8 = COPY %0() + PseudoRET implicit $v8m8 +... +--- +name: select_nxv1i16 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv1i16 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8 + ; + ; RV64I-LABEL: name: select_nxv1i16 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8 = COPY %0() + PseudoRET implicit $v8 +... +--- +name: select_nxv2i16 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv2i16 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8 + ; + ; RV64I-LABEL: name: select_nxv2i16 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8 = COPY %0() + PseudoRET implicit $v8 +... +--- +name: select_nxv4i16 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv4i16 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8 + ; + ; RV64I-LABEL: name: select_nxv4i16 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8 = COPY %0() + PseudoRET implicit $v8 +... +--- +name: select_nxv8i16 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv8i16 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8m2 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8m2 + ; + ; RV64I-LABEL: name: select_nxv8i16 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8m2 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8m2 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8m2 = COPY %0() + PseudoRET implicit $v8m2 +... +--- +name: select_nxv16i16 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv16i16 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8m4 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8m4 + ; + ; RV64I-LABEL: name: select_nxv16i16 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8m4 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8m4 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8m4 = COPY %0() + PseudoRET implicit $v8m4 +... +--- +name: select_nxv32i16 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv32i16 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8m8 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8m8 + ; + ; RV64I-LABEL: name: select_nxv32i16 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8m8 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8m8 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8m8 = COPY %0() + PseudoRET implicit $v8m8 +... +--- +name: select_nxv1i32 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv1i32 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8 + ; + ; RV64I-LABEL: name: select_nxv1i32 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8 = COPY %0() + PseudoRET implicit $v8 +... +--- +name: select_nxv2i32 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv2i32 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8 + ; + ; RV64I-LABEL: name: select_nxv2i32 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8 = COPY %0() + PseudoRET implicit $v8 +... +--- +name: select_nxv4i32 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv4i32 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8m2 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8m2 + ; + ; RV64I-LABEL: name: select_nxv4i32 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8m2 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8m2 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8m2 = COPY %0() + PseudoRET implicit $v8m2 +... +--- +name: select_nxv8i32 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv8i32 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8m4 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8m4 + ; + ; RV64I-LABEL: name: select_nxv8i32 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8m4 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8m4 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8m4 = COPY %0() + PseudoRET implicit $v8m4 +... +--- +name: select_nxv16i32 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv16i32 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8m8 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8m8 + ; + ; RV64I-LABEL: name: select_nxv16i32 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8m8 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8m8 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8m8 = COPY %0() + PseudoRET implicit $v8m8 +... +--- +name: select_nxv1i64 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv1i64 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8 + ; + ; RV64I-LABEL: name: select_nxv1i64 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8 = COPY %0() + PseudoRET implicit $v8 +... +--- +name: select_nxv2i64 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv2i64 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8m2 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8m2 + ; + ; RV64I-LABEL: name: select_nxv2i64 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8m2 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8m2 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8m2 = COPY %0() + PseudoRET implicit $v8m2 +... +--- +name: select_nxv4i64 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv4i64 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8m4 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8m4 + ; + ; RV64I-LABEL: name: select_nxv4i64 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8m4 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8m4 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8m4 = COPY %0() + PseudoRET implicit $v8m4 +... +--- +name: select_nxv8i64 +legalized: true +tracksRegLiveness: true +body: | + bb.0.entry: + ; RV32I-LABEL: name: select_nxv8i64 + ; RV32I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV32I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV32I-NEXT: $v8m8 = COPY [[SELECT]]() + ; RV32I-NEXT: PseudoRET implicit $v8m8 + ; + ; RV64I-LABEL: name: select_nxv8i64 + ; RV64I: [[DEF:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[DEF1:%[0-9]+]]:vrb() = G_IMPLICIT_DEF + ; RV64I-NEXT: [[SELECT:%[0-9]+]]:vrb() = G_SELECT [[DEF]](), [[DEF1]], [[DEF1]] + ; RV64I-NEXT: $v8m8 = COPY [[SELECT]]() + ; RV64I-NEXT: PseudoRET implicit $v8m8 + %1:_() = G_IMPLICIT_DEF + %2:_() = G_IMPLICIT_DEF + %0:_() = G_SELECT %1(), %2(), %2() + $v8m8 = COPY %0() + PseudoRET implicit $v8m8 +...