[enco] Comment for bypass_shuffle (#2843)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Tue, 15 Jan 2019 02:07:39 +0000 (11:07 +0900)
committer박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 15 Jan 2019 02:07:39 +0000 (11:07 +0900)
* [enco] Comment for bypass_shuffle

This will add comment for generate_bypass_shuffle method

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
* apply comments

* apply comments

* apply comment

contrib/enco/core/src/Transforms/Optimizations.h

index c5f0f9c..d47e43b 100644 (file)
 namespace enco
 {
 
-// TODO Add a comment
+/**
+ * @brief Add a bypass Shuffle if two continued Shuffles map same from-into
+ *
+ * %bag_1 = Bag(size: N)
+ * %bag_2 = Bag(size: N)
+ * %bag_3 = Bag(size: N)
+ *
+ * >>> BEFORE <<<
+ * Shuffle(from: %bag_1, into: %bag_2, [0 -> 0])
+ * Shuffle(from: %bag_2, into: %bag_3, [0 -> 0])
+ *
+ * Let's refer to the former shuffle as Shuffle 1 and the latter one as Shuffle 2.
+ * We can replace Shuffle 2 with new Shuffle 3 as follows when Shuffle 1 and
+ * Shuffle 2 map to the same position.
+ *
+ * >>> AFTER <<<
+ * Shuffle(from: %bag_1, into: %bag_2, [0 -> 0]) <- Shuffle 1
+ * Shuffle(from: %bag_1, into: %bag_3, [0 -> 0]) <- Shuffle 3
+ *
+ * Note that Shuffle 1 can be eliminated when %bag_2 is not used
+ */
 void generate_bypass_shuffle(enco::Code *code);
 
 /**