File tree Expand file tree Collapse file tree 2 files changed +570
-0
lines changed
test/CodeGen/RISCV/GlobalISel/regbankselect/rvv Expand file tree Collapse file tree 2 files changed +570
-0
lines changed Original file line number Diff line number Diff line change 13
13
#include " RISCVRegisterBankInfo.h"
14
14
#include " MCTargetDesc/RISCVMCTargetDesc.h"
15
15
#include " RISCVSubtarget.h"
16
+ #include " llvm/CodeGen/GlobalISel/GenericMachineInstrs.h"
16
17
#include " llvm/CodeGen/MachineRegisterInfo.h"
17
18
#include " llvm/CodeGen/RegisterBank.h"
18
19
#include " llvm/CodeGen/RegisterBankInfo.h"
@@ -407,6 +408,17 @@ RISCVRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
407
408
case TargetOpcode::G_SELECT: {
408
409
LLT Ty = MRI.getType (MI.getOperand (0 ).getReg ());
409
410
411
+ if (Ty.isVector ()) {
412
+ auto &Sel = cast<GSelect>(MI);
413
+ LLT TestTy = MRI.getType (Sel.getCondReg ());
414
+ assert (TestTy.isVector () && " Unexpected condition argument type" );
415
+ OpdsMapping[0 ] = OpdsMapping[2 ] = OpdsMapping[3 ] =
416
+ getVRBValueMapping (Ty.getSizeInBits ().getKnownMinValue ());
417
+ OpdsMapping[1 ] =
418
+ getVRBValueMapping (TestTy.getSizeInBits ().getKnownMinValue ());
419
+ break ;
420
+ }
421
+
410
422
// Try to minimize the number of copies. If we have more floating point
411
423
// constrained values than not, then we'll put everything on FPR. Otherwise,
412
424
// everything has to be on GPR.
You can’t perform that action at this time.
0 commit comments