[llvm] CSKY: Consume "float-abi" module flag (PR #212975)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 31 08:44:15 PDT 2026


================
@@ -134,7 +135,8 @@ class CSKYSubtarget : public CSKYGenSubtargetInfo {
   // Generated by inc file
   void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS);
 
-  bool useHardFloatABI() const;
+  bool useHardFloatABI() const { return UseHardFloatABI; }
----------------
s-barannikov wrote:

To help me understand what's going on

The old behavior was to:
1. use option value if it is set
2. otherwise, use subtarget feature (= function attribute), assuming the value is consistent across all subtargets, and which is **soft-fp** ABI by default.

My understanding is that the module flag is another source of truth that needs to be taken into account with some priority relative to other sources. The changes in CSKYTargetMachine.cpp suggest that the module flag has the highest priority, and the changes in CSKYSubtarget.cpp make the function attribute ignored. The new behavior is therefore:

1. use module flag if it is set
2. otherwise, use option value if it is set
3. oherwise, fall back to **hard-fp** ABI.

Does that sound right?


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


More information about the llvm-commits mailing list