[enco] Remove unused variable load (#2882)
author이상규/On-Device Lab(SR)/Principal Engineer/삼성전자 <sg5.lee@samsung.com>
Fri, 18 Jan 2019 06:50:13 +0000 (15:50 +0900)
committer박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Fri, 18 Jan 2019 06:50:13 +0000 (15:50 +0900)
To suppress unused variable warning, remove declaration of `load`.

Signed-off-by: Sanggyu Lee <sg5.lee@samsung.com>
contrib/enco/core/src/Transforms/AvgPoolLowering.cpp

index 792e278..68cf452 100644 (file)
@@ -49,7 +49,12 @@ std::set<coco::AvgPool2D *> candidates(coco::Module *m)
     {
       if (auto avgpool = eval->op()->asAvgPool2D())
       {
-        if (auto load = avgpool->arg()->asLoad())
+        /* Originally it was preferred to use `auto load = avgpool->arg()->asLoad()' for
+         * consitent style with other if statements.
+         * Someone may think compiler will be happy because `load` in `if` statement can
+         * be considered as a use, however, it turend out that it is not the case.
+         */
+        if (avgpool->arg()->asLoad())
         {
           if (avgpool->divisor() == coco::AvgPool2D::Divisor::Static)
           {