This is an archive of the discontinued LLVM Phabricator instance.

[TableGen][GlobalISel] Rework RegisterBankEmitter for easier const correctness

Authored by lewis-revill on Mar 11 2020, 10:12 AM.



This patch rewrites the RegisterBankEmitter class to derive RegisterClassHierarchy from CodeGenTarget::getRegBank() rather than constructing our own copy. All are now accessed through a const reference.

This appeared to fix a case of invalidating vectors within RegisterClassHierarchy.getHwModes() - found when testing implementations for another RegisterBankEmitter patch.

Diff Detail

Event Timeline

lewis-revill created this revision.Mar 11 2020, 10:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2020, 10:13 AM
arsenm accepted this revision.Mar 11 2020, 10:34 AM
This revision is now accepted and ready to land.Mar 11 2020, 10:34 AM
This revision was automatically updated to reflect the committed changes.