The sexti32 ComplexRenderFn on RISCV calls computeNumSignBits which calls computeKnownBits. I encountered a case where we looked through a G_PHI and found a COPY that was created from an already selected G_TRUNC from s64 to s32. s32 and s64 integers on RISC-V end up in the same register class. s32 G_PHI is legal to allow f32 phis on RV64. The COPY inherited the types from the original G_TRUNC so the source and destination virtual registers have different widths. This patch uses KnownBits::anyextOrTrunc to adjust the width when they mismatch.
32 KiB
32 KiB