RegClassOrBank is an object of RegClassOrRegBank, which is defined as
using llvm::RegClassOrRegBank = typedef PointerUnion<const TargetRegisterClass *, const RegisterBank *> }
so control flow can not get here. Use ""llvm_unreachable" here to avoid "null pointer" confusion.
Sorry for the late reply but that doesn't seem right.
Yes, RegClassOrRegBank is of one of the two classes, but it can still be nullptr, e.g., before regbankselect. Therefore this case seems reachable to me.
What am I missing?