Skip to content

Commit 72c4b54

Browse files
[RISCV][GISEL] Regbankselect for G_ZEXT, G_SEXT, and G_ANYEXT with scalable vector type
1 parent 19733eb commit 72c4b54

File tree

4 files changed

+3351
-5
lines changed

4 files changed

+3351
-5
lines changed

llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,16 +289,20 @@ RISCVRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
289289

290290
switch (Opc) {
291291
case TargetOpcode::G_ADD:
292-
case TargetOpcode::G_SUB: {
292+
case TargetOpcode::G_SUB:
293+
case TargetOpcode::G_ANYEXT:
294+
case TargetOpcode::G_SEXT:
295+
case TargetOpcode::G_ZEXT: {
293296
if (MRI.getType(MI.getOperand(0).getReg()).isVector()) {
294297
LLT Ty = MRI.getType(MI.getOperand(0).getReg());
295298
return getInstructionMapping(
296299
DefaultMappingID, /*Cost=*/1,
297300
getVRBValueMapping(Ty.getSizeInBits().getKnownMinValue()),
298301
NumOperands);
299302
}
303+
return getInstructionMapping(DefaultMappingID, /*Cost=*/1, GPRValueMapping,
304+
NumOperands);
300305
}
301-
LLVM_FALLTHROUGH;
302306
case TargetOpcode::G_SHL:
303307
case TargetOpcode::G_ASHR:
304308
case TargetOpcode::G_LSHR:
@@ -320,9 +324,6 @@ RISCVRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
320324
case TargetOpcode::G_PTRTOINT:
321325
case TargetOpcode::G_INTTOPTR:
322326
case TargetOpcode::G_TRUNC:
323-
case TargetOpcode::G_ANYEXT:
324-
case TargetOpcode::G_SEXT:
325-
case TargetOpcode::G_ZEXT:
326327
case TargetOpcode::G_SEXTLOAD:
327328
case TargetOpcode::G_ZEXTLOAD:
328329
return getInstructionMapping(DefaultMappingID, /*Cost=*/1, GPRValueMapping,

0 commit comments

Comments
 (0)