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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 31 10:51:59 PDT 2026


================
@@ -59,10 +60,16 @@ CSKYTargetMachine::getSubtargetImpl(const Function &F) const {
   std::string FS =
       FSAttr.isValid() ? FSAttr.getValueAsString().str() : TargetFS;
 
+  FloatABI::ABIType FloatABI = F.getParent()->getFloatABI();
+  if (FloatABI == FloatABI::Default)
+    FloatABI = Options.FloatABIType;
+
   std::string Key = CPU + TuneCPU + FS;
+  Key += FloatABI == FloatABI::Soft ? "+soft-float-abi" : "+hard-float-abi";
----------------
arsenm wrote:

> Also, why pass FloatABI to subtarget? If the abi is going to be strictly module-level, it is the same for all subtargets, why copy it into each subtarget instance?

It changes legality rules and lowering actions. It's pretty impractical to thread it through every context that queries this information 

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


More information about the llvm-commits mailing list