@@ -91,75 +91,12 @@ namespace gpu {
91
91
LogicalResult transformGpuModulesToBinaries (
92
92
Operation *op, OffloadingLLVMTranslationAttrInterface handler = nullptr ,
93
93
const gpu::TargetOptions &options = {});
94
-
95
- // / Base pass class to serialize kernel functions through LLVM into
96
- // / user-specified IR and add the resulting blob as module attribute.
97
- class SerializeToBlobPass : public OperationPass <gpu::GPUModuleOp> {
98
- public:
99
- SerializeToBlobPass (TypeID passID);
100
- SerializeToBlobPass (const SerializeToBlobPass &other);
101
-
102
- void runOnOperation () final ;
103
-
104
- protected:
105
- // / Hook allowing the application of optimizations before codegen
106
- // / By default, does nothing
107
- virtual LogicalResult optimizeLlvm (llvm::Module &llvmModule,
108
- llvm::TargetMachine &targetMachine);
109
-
110
- // / Translates the 'getOperation()' result to an LLVM module.
111
- virtual std::unique_ptr<llvm::Module>
112
- translateToLLVMIR (llvm::LLVMContext &llvmContext);
113
-
114
- private:
115
- // / Creates the LLVM target machine to generate the ISA.
116
- std::unique_ptr<llvm::TargetMachine> createTargetMachine ();
117
-
118
- // / Translates the module to ISA
119
- std::optional<std::string> translateToISA (llvm::Module &llvmModule,
120
- llvm::TargetMachine &targetMachine);
121
-
122
- // / Serializes the target ISA to binary form.
123
- virtual std::unique_ptr<std::vector<char >>
124
- serializeISA (const std::string &isa) = 0 ;
125
-
126
- protected:
127
- Option<std::string> triple{*this , " triple" ,
128
- ::llvm::cl::desc (" Target triple" )};
129
- Option<std::string> chip{*this , " chip" ,
130
- ::llvm::cl::desc (" Target architecture" )};
131
- Option<std::string> features{*this , " features" ,
132
- ::llvm::cl::desc (" Target features" )};
133
- Option<int > optLevel{*this , " opt-level" ,
134
- llvm::cl::desc (" Optimization level for compilation" ),
135
- llvm::cl::init (2 )};
136
- Option<std::string> gpuBinaryAnnotation{
137
- *this , " gpu-binary-annotation" ,
138
- llvm::cl::desc (" Annotation attribute string for GPU binary" ),
139
- llvm::cl::init (getDefaultGpuBinaryAnnotation ())};
140
- Option<bool > dumpPtx{*this , " dump-ptx" ,
141
- ::llvm::cl::desc (" Dump generated PTX" ),
142
- llvm::cl::init(false )};
143
- };
144
94
} // namespace gpu
145
95
146
96
// ===----------------------------------------------------------------------===//
147
97
// Registration
148
98
// ===----------------------------------------------------------------------===//
149
99
150
- // / Register pass to serialize GPU kernel functions to a HSAco binary
151
- // / annotation.
152
- LLVM_DEPRECATED (" use Target attributes instead" , " " )
153
- void registerGpuSerializeToHsacoPass ();
154
-
155
- // / Create an instance of the GPU kernel function to HSAco binary serialization
156
- // / pass.
157
- LLVM_DEPRECATED (" use Target attributes instead" , " " )
158
- std::unique_ptr<Pass> createGpuSerializeToHsacoPass (StringRef triple,
159
- StringRef arch,
160
- StringRef features,
161
- int optLevel);
162
-
163
100
// / Collect a set of patterns to decompose memrefs ops.
164
101
void populateGpuDecomposeMemrefsPatterns (RewritePatternSet &patterns);
165
102
0 commit comments