From a8f1b85c5f8ee3d7287b1eacce6e16fbe3c71034 Mon Sep 17 00:00:00 2001 From: Philippe Tillet Date: Sat, 30 May 2020 15:03:25 -0400 Subject: [PATCH] [CODEGEN] Removed unnecessary coalescing rematerialization --- lib/codegen/transform/coalesce.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/codegen/transform/coalesce.cc b/lib/codegen/transform/coalesce.cc index 0f9675b5b..64af407e5 100644 --- a/lib/codegen/transform/coalesce.cc +++ b/lib/codegen/transform/coalesce.cc @@ -116,8 +116,11 @@ void coalesce::run(ir::module &mod) { // update list of values to rematerialize if(axes.empty()) continue; - for(auto it = ++axes.rbegin(); it != axes.rend(); it++) + for(auto it = ++axes.rbegin(); it != axes.rend(); it++){ + if(it->second.size() == 1) + continue; remat.insert(remat.begin(), it->second.begin(), it->second.end()); + } } // rematerialize values for(ir::io_inst *r: remat) {