[llvm] r265629 - [AArch64] Teach RegisterBankInfo about the CC register bank.
Quentin Colombet via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 6 17:39:30 PDT 2016
Author: qcolombet
Date: Wed Apr 6 19:39:29 2016
New Revision: 265629
URL: http://llvm.org/viewvc/llvm-project?rev=265629&view=rev
Log:
[AArch64] Teach RegisterBankInfo about the CC register bank.
We need to cover each register class with a register bank.
Modified:
llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp
llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.h
Modified: llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp?rev=265629&r1=265628&r2=265629&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp Wed Apr 6 19:39:29 2016
@@ -51,6 +51,15 @@ AArch64RegisterBankInfo::AArch64Register
assert(RBFPR.getSize() == 512 &&
"FPRs should hold up to 512-bit via QQQQ sequence");
+ // Initialize the CCR bank.
+ createRegisterBank(AArch64::CCRRegBankID, "CCR");
+ addRegBankCoverage(AArch64::CCRRegBankID, AArch64::CCRRegClassID, TRI);
+ const RegisterBank &RBCCR = getRegBank(AArch64::CCRRegBankID);
+ (void)RBCCR;
+ assert(RBCCR.contains(*TRI.getRegClass(AArch64::CCRRegClassID)) &&
+ "Class not added?");
+ assert(RBCCR.getSize() == 32 && "CCR should hold up to 32-bit");
+
verify(TRI);
}
@@ -94,6 +103,8 @@ const RegisterBank &AArch64RegisterBankI
case AArch64::WSeqPairsClassRegClassID:
case AArch64::XSeqPairsClassRegClassID:
return getRegBank(AArch64::FPRRegBankID);
+ case AArch64::CCRRegClassID:
+ return getRegBank(AArch64::CCRRegBankID);
default:
llvm_unreachable("Register class not supported");
}
Modified: llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.h?rev=265629&r1=265628&r2=265629&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.h (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.h Wed Apr 6 19:39:29 2016
@@ -24,6 +24,7 @@ namespace AArch64 {
enum {
GPRRegBankID = 0, /// General Purpose Registers: W, X.
FPRRegBankID = 1, /// Floating Point/Vector Registers: B, H, S, D, Q.
+ CCRRegBankID = 2, /// Conditional register: NZCV.
NumRegisterBanks
};
} // End AArch64 namespace.
More information about the llvm-commits
mailing list