[clang] [llvm] [X86] Reduce -ffixed-r compile-time overhead (PR #184606)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 07:12:43 PST 2026


================
@@ -366,9 +357,23 @@ void x86::getX86TargetFeatures(const Driver &D, const llvm::Triple &Triple,
   RESERVE_REG(r13)
   RESERVE_REG(r14)
   RESERVE_REG(r15)
+#undef RESERVE_REG
+
+  bool NeedDetectEGPR = Args.hasArg(
+      options::OPT_ffixed_r16, options::OPT_ffixed_r17, options::OPT_ffixed_r18,
+      options::OPT_ffixed_r19, options::OPT_ffixed_r20, options::OPT_ffixed_r21,
+      options::OPT_ffixed_r22, options::OPT_ffixed_r23, options::OPT_ffixed_r24,
+      options::OPT_ffixed_r25, options::OPT_ffixed_r26, options::OPT_ffixed_r27,
+      options::OPT_ffixed_r28, options::OPT_ffixed_r29, options::OPT_ffixed_r30,
+      options::OPT_ffixed_r31);
----------------
aengelke wrote:

(Side remark: Is adding 24 new options the best approach? Wouldn't a more general `-ffixed-reg=r8,r12` or similar be more general and better?)

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


More information about the llvm-commits mailing list