[coco] Introduce insert method in Shuffle (#1363)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Thu, 6 Sep 2018 00:52:58 +0000 (09:52 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Thu, 6 Sep 2018 00:52:58 +0000 (09:52 +0900)
* [coco] Introduce insert method in Shuffle

This commit introduces insert method in Shuffle instruction as the first
step toward partial shuffling support.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
* Update _content properly inside insert

contrib/coco/core/include/coco/IR/Shuffle.h
contrib/coco/core/src/IR/Shuffle.cpp

index 43baf01..1973d27 100644 (file)
@@ -47,8 +47,12 @@ public:
 
 public:
   const ElemID &at(uint32_t n) const { return _content.at(n); }
+  // NOTE This method is deprecated. Pleaes do NOT use this anymore
   ElemID &at(uint32_t n) { return _content.at(n); }
 
+public:
+  void insert(const ElemID &from, const ElemID &into);
+
 private:
   const PtrLink<Instr, Block> *const _instr_link;
 
index 54d075b..08926cb 100644 (file)
@@ -15,6 +15,8 @@ std::set<coco::Bag *> &operator+=(std::set<coco::Bag *> &res, coco::Bag *b)
 namespace coco
 {
 
+void Shuffle::insert(const ElemID &from, const ElemID &into) { _content.at(into.value()) = from; }
+
 std::set<Bag *> Shuffle::reads(void) const
 {
   std::set<Bag *> res;