[llvm] [TableGen] Complete the support for artificial registers (PR #183371)

Mikael Holmen via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 06:39:48 PDT 2026


================
@@ -2444,6 +2488,8 @@ void CodeGenRegBank::inferMatchingSuperRegClass(
     TopoSigs.reset();
     for (const CodeGenRegister *Super : RC->getMembers()) {
       const CodeGenRegister *Sub = Super->getSubRegs().find(SubIdx)->second;
----------------
mikaelholmen wrote:

Is it possible that find(SubIdx) returns end() here if Super is Artificial? Then ->second will dereference past end?

Perhaps the check on next line should be moved before the find above?

https://github.com/llvm/llvm-project/pull/183371


More information about the llvm-commits mailing list