22 #include <unordered_set>
34 const std::string& ppfile,
36 const std::string& ppfunc)
73 for (
auto bb_it = func_it->begin(); bb_it != func_it->end(); ++bb_it) {
74 for (
auto instr_it = bb_it->begin(); instr_it != bb_it->end(); ++instr_it) {
89 for (
auto bb_it = func_it->begin(); bb_it != func_it->end(); ++bb_it) {
90 for (
auto instr_it = bb_it->begin(); instr_it != bb_it->end(); ++instr_it) {
93 llvm::Instruction* i = &*instr_it;
96 std::string footnote =
103 it->second.detailed_footnote_ =
104 footnote +
", " + it->second.detailed_footnote_;
117 for (
auto bb_it = func_it->begin(); bb_it != func_it->end(); ++bb_it) {
118 for (
auto instr_it = bb_it->begin(); instr_it != bb_it->end(); ++instr_it) {
125 auto value = llvm::MDNode::get(
130 our_it->first->setMetadata(kind_id, value);
139 if (!fnames.empty()) {
140 return fnames.back();
149 for (
auto n : fnames) {
150 if (copying && !
n.empty()) {
156 if (
n ==
"QueryEngine") {
160 if (f.empty() && fnames.size() > 0) {
162 }
else if (f.empty()) {
169 static const std::unordered_set<std::string::value_type> allowed_punct{
'_',
'.'};
170 for (
auto& ch : text) {
171 if (std::ispunct(ch) && !allowed_punct.count(ch)) {
198 inline static std::unordered_map<CgenState*, OurInstructions>
instructions_;
205 #define AUTOMATIC_IR_METADATA(CGENSTATE) \
206 AutomaticIRMetadataGuard automatic_ir_metadata_guard( \
207 CGENSTATE, __FILE__, __LINE__, __func__)
209 #define AUTOMATIC_IR_METADATA_DONE() automatic_ir_metadata_guard.done()
213 #define AUTOMATIC_IR_METADATA(CGENSTATE)
214 #define AUTOMATIC_IR_METADATA_DONE()
llvm::LLVMContext & context_
torch::Tensor f(torch::Tensor x, torch::Tensor W_target, torch::Tensor b_target)
bool g_enable_watchdog false