[llvm] [PowerPC] Fix ppc-reduce-cr-ops mishandling of subregister uses (PR #144405)

Nemanja Ivanovic via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 17 21:07:20 PDT 2025


================
@@ -471,6 +474,8 @@ PPCReduceCRLogicals::createCRLogicalOpInfo(MachineInstr &MIParam) {
   } else {
     MachineInstr *Def1 = lookThroughCRCopy(MIParam.getOperand(1).getReg(),
                                            Ret.SubregDef1, Ret.CopyDefs.first);
+    if (Ret.SubregDef1 == 0)
----------------
nemanjai wrote:

If the handling for `Subreg` is removed from `lookThroughCRCopy()`, this condition and the one on line 489 can just go away and the assignments to `Ret.SubregDef1` and `Ret.SubregDef2` can be unconditional.

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


More information about the llvm-commits mailing list