From adff176836a23adc0af5dc516baa093096ee9322 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=84=B8=ED=9D=AC/On-Device=20Lab=28SR=29/Princip?= =?utf8?q?al=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Tue, 15 Jan 2019 11:07:39 +0900 Subject: [PATCH] [enco] Comment for bypass_shuffle (#2843) * [enco] Comment for bypass_shuffle This will add comment for generate_bypass_shuffle method Signed-off-by: SaeHie Park * apply comments * apply comments * apply comment --- contrib/enco/core/src/Transforms/Optimizations.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/contrib/enco/core/src/Transforms/Optimizations.h b/contrib/enco/core/src/Transforms/Optimizations.h index c5f0f9c..d47e43b 100644 --- a/contrib/enco/core/src/Transforms/Optimizations.h +++ b/contrib/enco/core/src/Transforms/Optimizations.h @@ -22,7 +22,27 @@ 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); /** -- 2.7.4