diff options
author | Quentin Colombet <qcolombet@apple.com> | 2016-09-27 22:55:04 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2016-09-27 22:55:04 +0000 |
commit | c0f11a9fb86cbfc8a489a27f907f5ee5fe9611d5 (patch) | |
tree | 8e244dccd7a5eac244e8c98f239c1bd7d5d03fbd /llvm/lib | |
parent | caae9cd246fe90a7aec5a40551b0015997f36a1f (diff) | |
download | bcm5719-llvm-c0f11a9fb86cbfc8a489a27f907f5ee5fe9611d5.tar.gz bcm5719-llvm-c0f11a9fb86cbfc8a489a27f907f5ee5fe9611d5.zip |
[AArch64][RegisterBankInfo] Switch to statically allocated ValueMapping.
Another step toward TableGen'ed like structure for the RegisterBankInfo
of AArch64. By doing this, we also save a bit of compile time for the
exact same output.
llvm-svn: 282550
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64GenRegisterBankInfo.def | 19 | ||||
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp | 15 |
2 files changed, 24 insertions, 10 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64GenRegisterBankInfo.def b/llvm/lib/Target/AArch64/AArch64GenRegisterBankInfo.def index 2183e4a3dc7..de85b383b63 100644 --- a/llvm/lib/Target/AArch64/AArch64GenRegisterBankInfo.def +++ b/llvm/lib/Target/AArch64/AArch64GenRegisterBankInfo.def @@ -65,5 +65,24 @@ RegisterBankInfo::PartialMapping PartMappings[] { {0, 512, FPRRegBank} }; +// ValueMappings. +RegisterBankInfo::ValueMapping ValMappings[] { + /* BreakDown, NumBreakDowns */ + // 0: GPR 32-bit value. + {&PartMappings[0], 1}, + // 1: GPR 64-bit value. + {&PartMappings[1], 1}, + // 2: FPR 32-bit value. + {&PartMappings[2], 1}, + // 3: FPR 64-bit value. + {&PartMappings[3], 1}, + // 4: FPR 128-bit value. + {&PartMappings[4], 1}, + // 5: FPR 256-bit value. + {&PartMappings[5], 1}, + // 6: FPR 512-bit value. + {&PartMappings[6], 1} +}; + } // End AArch64 namespace. } // End llvm namespace. diff --git a/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp b/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp index de66c817bc0..6315edd1743 100644 --- a/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp @@ -205,15 +205,11 @@ AArch64RegisterBankInfo::getInstrAlternativeMappings( InstructionMapping FPRMapping(/*ID*/ 2, /*Cost*/ 1, /*NumOperands*/ 3); for (unsigned Idx = 0; Idx != 3; ++Idx) { GPRMapping.setOperandMapping( - Idx, getValueMapping( - &AArch64::PartMappings[AArch64::getRegBankBaseIdx(Size) + - AArch64::FirstGPR], - 1)); + Idx, AArch64::ValMappings[AArch64::getRegBankBaseIdx(Size) + + AArch64::FirstGPR]); FPRMapping.setOperandMapping( - Idx, getValueMapping( - &AArch64::PartMappings[AArch64::getRegBankBaseIdx(Size) + - AArch64::FirstFPR], - 1)); + Idx, AArch64::ValMappings[AArch64::getRegBankBaseIdx(Size) + + AArch64::FirstFPR]); } AltMappings.emplace_back(std::move(GPRMapping)); AltMappings.emplace_back(std::move(FPRMapping)); @@ -324,8 +320,7 @@ AArch64RegisterBankInfo::getInstrMapping(const MachineInstr &MI) const { // Finally construct the computed mapping. for (unsigned Idx = 0; Idx < MI.getNumOperands(); ++Idx) if (MI.getOperand(Idx).isReg()) - Mapping.setOperandMapping( - Idx, getValueMapping(&AArch64::PartMappings[OpFinalIdx[Idx]], 1)); + Mapping.setOperandMapping(Idx, AArch64::ValMappings[OpFinalIdx[Idx]]); return Mapping; } |