[llvm] [AArch64] Protect against mismatching sizes in UMOV combine. (PR #202116)

David Green via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 06:45:12 PDT 2026


================
@@ -3141,6 +3141,10 @@ bool AArch64LoadStoreOpt::tryToReplaceUMOVStore(
   if (!UMOVMI)
     return false;
   MCPhysReg VecReg = UMOVMI->getOperand(1).getReg();
+  MCPhysReg FPRReg = TRI->getSubReg(VecReg, SubRegIdx);
+  if ((*StoreMI.memoperands_begin())->getSizeInBits() !=
+      TRI->getRegSizeInBits(*TRI->getMinimalPhysRegClass(FPRReg)))
+    return false;
----------------
davemgreen wrote:

A store without a MMO is considered volatile (or conservatively "don't know" through hasOrderedMemoryRef, as in 9f82a4e41f9a0101488cd81444adfa646063dbc5). We might prefer to be equally conservative in such cases and not convert the store kind.

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


More information about the llvm-commits mailing list