[llvm] [PPC] Constrain register in VSPLT of XXSLDWI transform (PR #208005)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 05:50:28 PDT 2026


================
@@ -889,6 +889,8 @@ bool PPCMIPeephole::simplifyCode() {
             LLVM_DEBUG(dbgs() << "Changing splat immediate from " << SplatImm
                               << " to " << NewElem << " in instruction: ");
             LLVM_DEBUG(MI.dump());
+            if (!MRI->constrainRegClass(ShiftOp1, &PPC::VRRCRegClass))
+              llvm_unreachable("vrrc is subset of vsrc");
----------------
nikic wrote:

I adjusted the message a bit to be clearer.

I'd also be fine with just bailing out. It seemed a bit cleaner to do it this way to me, because we don't expect this operation to fail.

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


More information about the llvm-commits mailing list