[llvm] Fix [PowerPC] llc crashed at -O1/O2/O3: Assertion `isImm() && "Wrong MachineOperand mutator"' failed. (PR #170548)

Lei Huang via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 5 13:08:15 PST 2025


================
@@ -835,30 +837,58 @@ bool PPCMIPeephole::simplifyCode() {
           ToErase = &MI;
           Simplified = true;
         }
+
         // Splat fed by a shift. Usually when we align value to splat into
         // vector element zero.
         if (DefOpcode == PPC::XXSLDWI) {
-          Register ShiftRes = DefMI->getOperand(0).getReg();
           Register ShiftOp1 = DefMI->getOperand(1).getReg();
           Register ShiftOp2 = DefMI->getOperand(2).getReg();
----------------
lei137 wrote:

can just inline to the call since only have 1 use.

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


More information about the llvm-commits mailing list