amyk added inline comments.
================ Comment at: llvm/lib/Target/PowerPC/PPCMIPeephole.cpp:1018 + unsigned Opcode2 = LiMI2->getOpcode(); + bool isOperand2Immeidate = MI.getOperand(2).isImm(); + // We can only do the optimization for the "reg + reg" form. ---------------- ================ Comment at: llvm/lib/Target/PowerPC/PPCMIPeephole.cpp:1020 + // We can only do the optimization for the "reg + reg" form. + if (!(LiMI1 && (Opcode1 == PPC::LI || Opcode1 == PPC::LI8))) + break; ---------------- Do we still need to take into account of the lis+ori that Nemanja mentioned? ================ Comment at: llvm/lib/Target/PowerPC/PPCMIPeephole.cpp:1022 + break; + if (!isOperand2Immeidate && + !(LiMI2 && (Opcode2 == PPC::LI || Opcode2 == PPC::LI8))) ---------------- ================ Comment at: llvm/lib/Target/PowerPC/PPCMIPeephole.cpp:1028 + auto ImmOperand1 = LiMI1->getOperand(1).getImm(); + auto ImmOperand2 = isOperand2Immeidate ? MI.getOperand(2).getImm() + : LiMI2->getOperand(1).getImm(); ---------------- Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111434/new/ https://reviews.llvm.org/D111434 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits