When replacing the dst reg with the src reg, we need to make sure that we propagate the dst reg's register class through to the src.
Otherwise, we aren't meeting the requirements for G_ASSERT_ZEXT, and so the verifier will fail.
Differential D95708
[GlobalISel] Make sure G_ASSERT_ZEXT's src ends up with the same rc as dst paquette on Jan 29 2021, 4:56 PM. Authored by
Details When replacing the dst reg with the src reg, we need to make sure that we propagate the dst reg's register class through to the src. Otherwise, we aren't meeting the requirements for G_ASSERT_ZEXT, and so the verifier will fail.
Diff Detail
Event Timeline
|
!MRI.getRegClassOrNull(SrcReg) should be redundant since this would have been invalid if it weren't the same class anyway