[PATCH] D86269: [RFC][Target] Add a new backend target called CSKY

Zixuan Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 20:08:03 PDT 2020


zixuan-wu added a comment.

Thank you for your review, arsenm!



================
Comment at: llvm/lib/Target/CSKY/CSKYMachineFunctionInfo.h:35
+public:
+  CSKYMachineFunctionInfo(MachineFunction &MF) : MF(MF) {}
+
----------------
arsenm wrote:
> I'm trying to remove the dependency on machine function state in the constructor in D80249
D80249 has not been committed yet. I think I can rebase and catch up D80249 if it's committed before I commit this patch. If not, I would keep machine function state as original. 


================
Comment at: llvm/lib/Target/CSKY/CSKYTargetMachine.cpp:98-116
+  Attribute CPUAttr = F.getFnAttribute("target-cpu");
+  Attribute FSAttr = F.getFnAttribute("target-features");
+
+  std::string CPU = !CPUAttr.hasAttribute(Attribute::None)
+                        ? CPUAttr.getValueAsString().str()
+                        : TargetCPU;
+  std::string FS = !FSAttr.hasAttribute(Attribute::None)
----------------
arsenm wrote:
> We should move this logic into the base implementation with a template argument for the subtarget class; I think every target reproduces approximately the same thing
Yes, it's too much housekeeping work. But it's another orthogonal issue and should be handled together  with other targets in other patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86269/new/

https://reviews.llvm.org/D86269



More information about the llvm-commits mailing list