[CodeGen] Simplify reg bank/class union is+get into dyn_cast. NFC.

llvm-svn: 275443
This commit is contained in:
Ahmed Bougacha 2016-07-14 17:29:46 +00:00
parent 0233cc55de
commit 9e511525a0
1 changed files with 2 additions and 6 deletions

View File

@ -590,9 +590,7 @@ public:
/// the select pass, using getRegClass is safe.
const TargetRegisterClass *getRegClassOrNull(unsigned Reg) const {
const RegClassOrRegBank &Val = VRegInfo[Reg].first;
if (Val.is<const TargetRegisterClass *>())
return Val.get<const TargetRegisterClass *>();
return nullptr;
return Val.dyn_cast<const TargetRegisterClass *>();
}
/// Return the register bank of \p Reg, or null if Reg has not been assigned
@ -602,9 +600,7 @@ public:
///
const RegisterBank *getRegBankOrNull(unsigned Reg) const {
const RegClassOrRegBank &Val = VRegInfo[Reg].first;
if (Val.is<const RegisterBank *>())
return Val.get<const RegisterBank *>();
return nullptr;
return Val.dyn_cast<const RegisterBank *>();
}
/// Return the register bank or register class of \p Reg.