[llvm] [AArch64][GlobalISel] Fix creation of incorrect COPY gpr32, grp32.sub_32 (PR #171100)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 8 06:31:50 PST 2025


================
@@ -3015,6 +3015,8 @@ bool AArch64InstructionSelector::select(MachineInstr &I) {
         return false;
 
       // Generate a subreg copy.
+      if (RB.getID() == AArch64::GPRRegBankID && ValTy.getSizeInBits() < 32)
----------------
arsenm wrote:

This logical flow seems off; it's correcting a wrong result above for a specific case. I'd expect getSubRegForClass to work in terms of reporting an accurate subregister, based on the register class of the value type not memory 

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


More information about the llvm-commits mailing list