Skip to content

CodeGen: Move ABI option enums to support #142912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2025

Conversation

arsenm
Copy link
Contributor

@arsenm arsenm commented Jun 5, 2025

Move these out of TargetOptions and into Support to avoid
the dependency on Target. There are similar ABI options
already in Support/CodeGen.h.

Copy link
Contributor Author

arsenm commented Jun 5, 2025

@llvmbot
Copy link
Member

llvmbot commented Jun 5, 2025

@llvm/pr-subscribers-llvm-support

Author: Matt Arsenault (arsenm)

Changes

Move these out of TargetOptions and into Support to avoid
the dependency on Target. There are similar ABI options
already in Support/CodeGen.h.


Full diff: https://github.com/llvm/llvm-project/pull/142912.diff

2 Files Affected:

  • (modified) llvm/include/llvm/Support/CodeGen.h (+16)
  • (modified) llvm/include/llvm/Target/TargetOptions.h (+1-16)
diff --git a/llvm/include/llvm/Support/CodeGen.h b/llvm/include/llvm/Support/CodeGen.h
index 0e42789ba932e..b7896ae5d0f83 100644
--- a/llvm/include/llvm/Support/CodeGen.h
+++ b/llvm/include/llvm/Support/CodeGen.h
@@ -50,6 +50,22 @@ namespace llvm {
     };
   }
 
+  namespace FloatABI {
+  enum ABIType {
+    Default, // Target-specific (either soft or hard depending on triple, etc).
+    Soft,    // Soft float.
+    Hard     // Hard float.
+  };
+  }
+
+  enum class EABI {
+    Unknown,
+    Default, // Default means not specified
+    EABI4,   // Target-specific (either 4, 5 or gnu depending on triple).
+    EABI5,
+    GNU
+  };
+
   /// Code generation optimization level.
   enum class CodeGenOptLevel {
     None = 0,      ///< -O0
diff --git a/llvm/include/llvm/Target/TargetOptions.h b/llvm/include/llvm/Target/TargetOptions.h
index fd8dad4f6f791..08d6aa36e19d8 100644
--- a/llvm/include/llvm/Target/TargetOptions.h
+++ b/llvm/include/llvm/Target/TargetOptions.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/FloatingPointMode.h"
 #include "llvm/MC/MCTargetOptions.h"
+#include "llvm/Support/CodeGen.h"
 
 #include <memory>
 
@@ -24,14 +25,6 @@ namespace llvm {
   class MachineFunction;
   class MemoryBuffer;
 
-  namespace FloatABI {
-    enum ABIType {
-      Default, // Target-specific (either soft or hard depending on triple, etc).
-      Soft,    // Soft float.
-      Hard     // Hard float.
-    };
-  }
-
   namespace FPOpFusion {
     enum FPOpFusionMode {
       Fast,     // Enable fusion of FP ops wherever it's profitable.
@@ -70,14 +63,6 @@ namespace llvm {
     None    // Do not use Basic Block Sections.
   };
 
-  enum class EABI {
-    Unknown,
-    Default, // Default means not specified
-    EABI4,   // Target-specific (either 4, 5 or gnu depending on triple).
-    EABI5,
-    GNU
-  };
-
   /// Identify a debugger for "tuning" the debug info.
   ///
   /// The "debugger tuning" concept allows us to present a more intuitive

@arsenm arsenm force-pushed the users/arsenm/dag/move-runtime-libcalls-predicate-setting branch from 0b14727 to a3cb3a4 Compare June 6, 2025 00:53
@arsenm arsenm force-pushed the users/arsenm/codegen/move-float-abi-eabi-to-support branch 2 times, most recently from f8721bd to d8f0999 Compare June 6, 2025 06:44
@arsenm arsenm force-pushed the users/arsenm/dag/move-runtime-libcalls-predicate-setting branch from a3cb3a4 to 25d7dd2 Compare June 6, 2025 06:44
@arsenm arsenm force-pushed the users/arsenm/dag/move-runtime-libcalls-predicate-setting branch from 25d7dd2 to b7f272a Compare June 6, 2025 07:18
@arsenm arsenm force-pushed the users/arsenm/codegen/move-float-abi-eabi-to-support branch from d8f0999 to 652f127 Compare June 6, 2025 07:18
@arsenm arsenm force-pushed the users/arsenm/dag/move-runtime-libcalls-predicate-setting branch from b7f272a to e245a54 Compare June 6, 2025 14:09
@arsenm arsenm force-pushed the users/arsenm/codegen/move-float-abi-eabi-to-support branch from 652f127 to 2168b66 Compare June 6, 2025 14:09
@arsenm arsenm force-pushed the users/arsenm/dag/move-runtime-libcalls-predicate-setting branch from e245a54 to dff6aca Compare June 9, 2025 02:35
@arsenm arsenm force-pushed the users/arsenm/codegen/move-float-abi-eabi-to-support branch 2 times, most recently from 8450d9c to dd08605 Compare June 11, 2025 00:33
@arsenm arsenm force-pushed the users/arsenm/dag/move-runtime-libcalls-predicate-setting branch from dff6aca to 581f775 Compare June 11, 2025 00:33
@arsenm arsenm force-pushed the users/arsenm/codegen/move-float-abi-eabi-to-support branch from dd08605 to 558dfa9 Compare June 12, 2025 03:11
@arsenm arsenm force-pushed the users/arsenm/dag/move-runtime-libcalls-predicate-setting branch 2 times, most recently from 219358e to 15a5c10 Compare June 17, 2025 00:39
Base automatically changed from users/arsenm/dag/move-runtime-libcalls-predicate-setting to main June 17, 2025 00:42
@arsenm
Copy link
Contributor Author

arsenm commented Jun 18, 2025

Alternatively we could introduce a new ABI header/library in IR or top-level

@arsenm arsenm force-pushed the users/arsenm/codegen/move-float-abi-eabi-to-support branch from 558dfa9 to f41c698 Compare June 18, 2025 05:24
Move these out of TargetOptions and into Support to avoid
the dependency on Target. There are similar ABI options
already in Support/CodeGen.h.
@arsenm arsenm force-pushed the users/arsenm/codegen/move-float-abi-eabi-to-support branch from f41c698 to ecef4b5 Compare June 18, 2025 06:03
Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arsenm arsenm merged commit b596726 into main Jun 18, 2025
7 checks passed
@arsenm arsenm deleted the users/arsenm/codegen/move-float-abi-eabi-to-support branch June 18, 2025 10:56
fschlimb pushed a commit to fschlimb/llvm-project that referenced this pull request Jun 18, 2025
Move these out of TargetOptions and into Support to avoid
the dependency on Target. There are similar ABI options
already in Support/CodeGen.h.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy