[llvm] [AArch64] Allocate two emergency spill slots for MTE to fix register … (PR #186505)

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 13 13:59:13 PDT 2026


================
@@ -3333,8 +3363,18 @@ void TagStoreEdit::emitCode(MachineBasicBlock::iterator &InsertI,
     TS.MI->eraseFromParent();
 }
 
+bool isMergeableSTG(MachineInstr &MI) {
+  auto Opcode = MI.getOpcode();
+  return (Opcode == AArch64::STZGloop || Opcode == AArch64::STZGi ||
+          Opcode == AArch64::STZ2Gi || Opcode == AArch64::STGloop ||
+          Opcode == AArch64::STGi || Opcode == AArch64::ST2Gi);
+}
+
 bool isMergeableStackTaggingInstruction(MachineInstr &MI, int64_t &Offset,
                                         int64_t &Size, bool &ZeroData) {
+  if (!isMergeableSTG(MI))
----------------
fmayer wrote:

This seems redundant. I would rather put an `assert(isMergeableSTG(MI))` on the true-return branches

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


More information about the llvm-commits mailing list