================
@@ -8942,7 +8942,11 @@ void SIInstrInfo::moveToVALUImpl(
         return;
       } else if (RI.getMatchingSuperRegClass(SrcRegRC, NewDstRC,
                                              AMDGPU::lo16)) {
-        Inst.getOperand(1).setSubReg(AMDGPU::lo16);
+        // Read the low half, unless the copy already reads a 16-bit
+        // subregister such as hi16.
+        MachineOperand &SrcOp = Inst.getOperand(1);
+        if (!SrcOp.getSubReg() || RI.getSubRegIdxSize(SrcOp.getSubReg()) != 16)
----------------
krzysz00 wrote:

Inviting post-commit review on if this condition is spelled correctly, but it 
looks correct and like it's fixing a real bug.

https://github.com/llvm/llvm-project/pull/239247
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to