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

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 04:24:25 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))
----------------
s-barannikov wrote:

It appears there is another context when class/bank may not be set: https://github.com/llvm/llvm-project/commit/7e1f66d6f5d679632b279b64bb1a0f338104730c


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


More information about the llvm-commits mailing list