#include "Split.h"
#include "Usage.h"
#include "Session.h"
+#include "coex/IR.h"
#include <coco/IR.h>
namespace
{
+std::unique_ptr<ANNOpAppender> make_appender(coco::Instr *ins)
+{
+ ANNOpBuilder op_builder;
+
+ if (auto eval = coco::safe_cast<coco::Eval>(ins))
+ {
+ return eval->accept(op_builder);
+ }
+
+ if (auto depth_concat = coco::safe_cast<ANNDepthConcatF>(ins))
+ {
+ auto app = make_unique<ANNConcatAppender>();
+
+ app->out(depth_concat->out()->asFeature());
+
+ app->left(depth_concat->fst()->asFeature());
+ app->right(depth_concat->snd()->asFeature());
+
+ return std::move(app);
+ }
+
+ return nullptr;
+}
+
enum Compatibility
{
COMPATIBLE,
auto m = code->module();
auto d = code->data();
- ANNOpBuilder op_builder;
-
// ANNGroupBuilder will construct a sequence of blocks from the original block sequence, and
// a destination block (that dst_blk points to) is the tail of the generated sequence.
coco::Block *dst_blk = nullptr;
ins = cur_ins->next();
cur_ins->detach();
- auto cur_append = cur_ins->accept(op_builder);
+ auto cur_append = make_appender(cur_ins);
// Create a new compatible block and use it as a destination block if the current
// destination block is absent or incompatible with the instruction of intereset.