[llvm] [llvm][ARM] Add a cortex-m4f alignment hazard recognizer (PR #126991)

David Green via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 18 11:18:31 PST 2025


================
@@ -1445,6 +1446,9 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
     InConstantPool = false;
   }
 
+  if (MI->getAsmPrinterFlag(MachineInstr::CommentFlag(ARM::ALIGNMENT_HAZARD)))
+    OutStreamer->AddComment("alignment hazard");
----------------
davemgreen wrote:

Can you explain what this is useful for? We would not usually add such comments for other alignment changes like aligning loops or functions.

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


More information about the llvm-commits mailing list