[clang] [llvm] [X86] Support reserving EDI on x86-32 (PR #186123)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 15 12:11:15 PDT 2026


================
@@ -0,0 +1,35 @@
+;; Check if manually reserved EDI is always excluded from being saved by the
+;; function prolog/epilog, as per GCC behavior, and that REP MOVS/STOS are not
+;; selected when EDI is reserved on x86-32.
+
+; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -verify-machineinstrs | FileCheck %s
+
+declare void @llvm.memcpy.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg)
+declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg)
+
+define void @tedi() "target-features"="+reserve-edi" {
+; CHECK-LABEL: tedi:
+; CHECK: # %bb.0:
+; CHECK-NOT:        pushl   %edi
----------------
efriedma-quic wrote:

Not sure the CHECK-NOT is really helpful here; we know the instructions aren't emitted due to the CHECK-NEXT anyway.

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


More information about the cfe-commits mailing list