[llvm] [ADT] Make null PointerUnion with different active members compare equal (PR #121847)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 04:20:32 PST 2025


================
@@ -134,10 +134,10 @@ const TargetRegisterClass *RegisterBankInfo::constrainGenericRegister(
 
   // If the register already has a class, fallback to MRI::constrainRegClass.
   auto &RegClassOrBank = MRI.getRegClassOrRegBank(Reg);
-  if (isa<const TargetRegisterClass *>(RegClassOrBank))
+  if (isa_and_present<const TargetRegisterClass *>(RegClassOrBank))
----------------
arsenm wrote:

> GIR_MakeTempReg creates a register without class/bank for the result of the S_MOV_B32.

As I mentioned in the other PR this is broken. In no context should an incomplete virtual register be used by an instruction 

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


More information about the llvm-commits mailing list