From b532360dd6bbdaf3b7fcd5f53647984600967a80 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Fri, 16 Sep 2016 12:33:34 +0000 Subject: [PATCH] [AArch64][GlobalISel] Use the generic DefaultMapping as the default. This lets generic logic handle the common case, instead of having to implement applyMappingImpl for each instruction. llvm-svn: 281720 --- llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp b/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp index d0da232bdce4..12fdb0d9cc68 100644 --- a/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp @@ -157,7 +157,6 @@ AArch64RegisterBankInfo::getInstrAlternativeMappings( void AArch64RegisterBankInfo::applyMappingImpl( const OperandsMapper &OpdMapper) const { switch (OpdMapper.getMI().getOpcode()) { - case TargetOpcode::G_ADD: case TargetOpcode::G_OR: { // Those ID must match getInstrAlternativeMappings. assert((OpdMapper.getInstrMapping().getID() == 1 || @@ -187,7 +186,7 @@ AArch64RegisterBankInfo::getInstrMapping(const MachineInstr &MI) const { else BankID = AArch64::GPRRegBankID; - Mapping = InstructionMapping{1, 1, MI.getNumOperands()}; + Mapping = InstructionMapping{DefaultMappingID, 1, MI.getNumOperands()}; int Size = Ty.isValid() ? Ty.getSizeInBits() : 0; for (unsigned Idx = 0; Idx < MI.getNumOperands(); ++Idx) Mapping.setOperandMapping(Idx, Size, getRegBank(BankID));