dsanders added a comment. Does the patch at https://reviews.llvm.org/D29178 fix your problem? It prevents visitRegisterBankClasses() visiting the same class more than once without changing the classes within each bank. https://reviews.llvm.org/D29049