diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-05-16 15:41:30 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-05-16 15:41:30 -0700 |
commit | 568ea92489f883094c12b8be33c6b1ec05017bf0 (patch) | |
tree | 81ad92bc5af598db7f32fe5f6933319c8e797c94 | |
parent | 72b196f92b7c326349b0c6053af30dc29f4878f5 (diff) | |
download | binaryen-568ea92489f883094c12b8be33c6b1ec05017bf0.tar.gz binaryen-568ea92489f883094c12b8be33c6b1ec05017bf0.tar.bz2 binaryen-568ea92489f883094c12b8be33c6b1ec05017bf0.zip |
optimize adding new conflicts from merged starts
-rw-r--r-- | src/passes/CoalesceLocals.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/passes/CoalesceLocals.cpp b/src/passes/CoalesceLocals.cpp index edcc9d1db..3805d7280 100644 --- a/src/passes/CoalesceLocals.cpp +++ b/src/passes/CoalesceLocals.cpp @@ -314,9 +314,10 @@ bool CoalesceLocals::mergeStartsAndCheckChange(std::vector<BasicBlock*>& blocks, // this is not a new conflict. if (ret == old) return false; // add conflicts - for (auto i : ret) { - for (auto j : ret) { - interfere(i, j); + size_t size = ret.size(); + for (size_t i = 0; i < size; i++) { + for (size_t j = i + 1; j < size; j++) { + interfere(ret[i], ret[j]); } } return true; |