[llvm] [AArch64] Fix tryMergeAdjacentSTG function in PrologEpilog pass (PR #68873)

Kristof Beyls via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 9 04:00:03 PST 2023


================
@@ -3761,7 +3761,26 @@ MachineBasicBlock::iterator tryMergeAdjacentSTG(MachineBasicBlock::iterator II,
 
   // New code will be inserted after the last tagging instruction we've found.
   MachineBasicBlock::iterator InsertI = Instrs.back().MI;
+
+  // All the gathered stack tag instructions are merged and placed after
+  // last tag store in the list. The check should be made if the nzcv
+  // flag is live at the point where we are trying to insert. Otherwise
+  // the nzcv flag might get clobbered if any stg loops are present.
+
+  // FIXME : This approach of bailing out from merge is also conservative
----------------
kbeyls wrote:

Could it be that the word "also" is best dropped in this sentence?

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


More information about the llvm-commits mailing list