forked from OSchip/llvm-project
[CodeGen] Simplify reg bank/class union is+get into dyn_cast. NFC.
llvm-svn: 275443
This commit is contained in:
parent
0233cc55de
commit
9e511525a0
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue