[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


================
@@ -5455,6 +5514,21 @@ bool ARMBaseInstrInfo::hasNOP() const {
   return Subtarget.hasFeature(ARM::HasV6KOps);
 }
 
+void ARMBaseInstrInfo::insertNoop(MachineBasicBlock &MBB,
+                                  MachineBasicBlock::iterator MI) const {
+  DebugLoc DL;
+  if (hasNOP()) {
+    BuildMI(MBB, MI, DL, get(ARM::tHINT)).addImm(0).addImm(ARMCC::AL).addImm(0);
----------------
davemgreen wrote:

Is this OK for ARM vs Thumb? The only other use of hasNOP seems to be assuming Arm.

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


More information about the llvm-commits mailing list