| 150 | |
| 151 | public: |
| 152 | static GlobalRegistry* get(ComputingGraph& graph) { |
| 153 | using namespace cg::event; |
| 154 | auto ptr = graph.options().user_data.get_user_data_or_create<GlobalRegistry>(); |
| 155 | if (!ptr->m_opr_insert_handler) { |
| 156 | ptr->m_opr_insert_handler = graph.event().register_receiver<OprInserted>( |
| 157 | [ptr](const OprInserted& ev) { |
| 158 | if (!ev.is_dedup && !ev.exc) { |
| 159 | ptr->on_new_opr(ev.opr); |
| 160 | } |
| 161 | }); |
| 162 | } |
| 163 | return ptr; |
| 164 | } |
| 165 | |
| 166 | //! get mask if var is conditional, or nullptr otherwise |
| 167 | ExecutionMask* get_mask_from_var(VarNode* var) const { |
no test coverage detected