[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:30 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:

>  why do we need to adjust Key?

That's why you need to adjust key. The subtarget map owned by TargetMachine is global state. Any program state that modifies the subtarget needs to be accounted for in the globally unique key 

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


More information about the llvm-commits mailing list