[clang] [llvm] [WIP][TargetLowering] Prefer 'r' over 'm' for "rm" inline asm constraints (PR #214061)

Bill Wendling via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 4 21:13:21 PDT 2026


================
@@ -742,6 +754,15 @@ class MachineBasicBlock
     IsInlineAsmBrIndirectTarget = V;
   }
 
+  /// Returns true if this block directly contains an INLINEASM or
+  /// INLINEASM_BR instruction, as of the last time it was computed. See the
+  /// HasInlineAsm field comment for the staleness caveat.
+  bool hasInlineAsm() const { return HasInlineAsm; }
+
+  /// Indicates if this block directly contains an INLINEASM or INLINEASM_BR
+  /// instruction.
+  void setHasInlineAsm(bool V = true) { HasInlineAsm = V; }
----------------
isanbard wrote:

*From Claude, adding to my comment:*

The flag can only ever be stale in the "false when it should be true" direction (it starts false, only ever gets set true, never cleared), and it's consumed only as a performance short-circuit, not a correctness gate — RegAllocFast's normal per-instruction path still handles any `INLINEASM` it actually encounters regardless of the block flag. So the worst case from drift is a missed fold opportunity, never a miscompile.

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


More information about the llvm-commits mailing list