@@ -76,14 +76,29 @@ class CodeGenSpecifics {
7676 llvm::StringRef targetCPU, mlir::LLVM::TargetFeaturesAttr targetFeatures,
7777 const mlir::DataLayout &dl);
7878
79+ static std::unique_ptr<CodeGenSpecifics>
80+ get (mlir::MLIRContext *ctx, llvm::Triple &&trp, KindMapping &&kindMap,
81+ llvm::StringRef targetCPU, mlir::LLVM::TargetFeaturesAttr targetFeatures,
82+ const mlir::DataLayout &dl, llvm::StringRef tuneCPU);
83+
7984 static TypeAndAttr getTypeAndAttr (mlir::Type t) { return TypeAndAttr{t, {}}; }
8085
8186 CodeGenSpecifics (mlir::MLIRContext *ctx, llvm::Triple &&trp,
8287 KindMapping &&kindMap, llvm::StringRef targetCPU,
8388 mlir::LLVM::TargetFeaturesAttr targetFeatures,
8489 const mlir::DataLayout &dl)
8590 : context{*ctx}, triple{std::move (trp)}, kindMap{std::move (kindMap)},
86- targetCPU{targetCPU}, targetFeatures{targetFeatures}, dataLayout{&dl} {}
91+ targetCPU{targetCPU}, targetFeatures{targetFeatures}, dataLayout{&dl},
92+ tuneCPU{" " } {}
93+
94+ CodeGenSpecifics (mlir::MLIRContext *ctx, llvm::Triple &&trp,
95+ KindMapping &&kindMap, llvm::StringRef targetCPU,
96+ mlir::LLVM::TargetFeaturesAttr targetFeatures,
97+ const mlir::DataLayout &dl, llvm::StringRef tuneCPU)
98+ : context{*ctx}, triple{std::move (trp)}, kindMap{std::move (kindMap)},
99+ targetCPU{targetCPU}, targetFeatures{targetFeatures}, dataLayout{&dl},
100+ tuneCPU{tuneCPU} {}
101+
87102 CodeGenSpecifics () = delete ;
88103 virtual ~CodeGenSpecifics () {}
89104
@@ -165,6 +180,7 @@ class CodeGenSpecifics {
165180 virtual unsigned char getCIntTypeWidth () const = 0;
166181
167182 llvm::StringRef getTargetCPU () const { return targetCPU; }
183+ llvm::StringRef getTuneCPU () const { return tuneCPU; }
168184
169185 mlir::LLVM::TargetFeaturesAttr getTargetFeatures () const {
170186 return targetFeatures;
@@ -182,6 +198,7 @@ class CodeGenSpecifics {
182198 llvm::StringRef targetCPU;
183199 mlir::LLVM::TargetFeaturesAttr targetFeatures;
184200 const mlir::DataLayout *dataLayout = nullptr ;
201+ llvm::StringRef tuneCPU;
185202};
186203
187204} // namespace fir
0 commit comments