summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h b/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h
index b640637cdee..8f7042655cb 100644
--- a/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h
+++ b/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h
@@ -272,9 +272,12 @@ protected:
/// \post if Force == true then getRegBankForType(SVT) == &RegBank
void recordRegBankForType(const RegisterBank &RegBank,
MVT::SimpleValueType SVT, bool Force = false) {
- if (!VTToRegBank)
+ if (!VTToRegBank) {
VTToRegBank.reset(
new const RegisterBank *[MVT::SimpleValueType::LAST_VALUETYPE]);
+ std::fill(&VTToRegBank[0],
+ &VTToRegBank[MVT::SimpleValueType::LAST_VALUETYPE], nullptr);
+ }
assert(SVT < MVT::SimpleValueType::LAST_VALUETYPE && "Out-of-bound access");
// If we want to override the mapping or the mapping does not exits yet,
// set the register bank for SVT.