summaryrefslogtreecommitdiff
path: root/src/passes/CoalesceLocals.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/CoalesceLocals.cpp')
-rw-r--r--src/passes/CoalesceLocals.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/passes/CoalesceLocals.cpp b/src/passes/CoalesceLocals.cpp
index 63912db19..1bcc74f79 100644
--- a/src/passes/CoalesceLocals.cpp
+++ b/src/passes/CoalesceLocals.cpp
@@ -315,25 +315,6 @@ void CoalesceLocals::pickIndices(std::vector<Index>& indices) {
}
}
-// Remove a copy from a set of an if, where one if arm is a get of the same set
-static void removeIfCopy(Expression** origin, SetLocal* set, If* iff, Expression*& copy, Expression*& other, Module* module) {
- // replace the origin with the if, and sink the set into the other non-copying arm
- bool tee = set->isTee();
- *origin = iff;
- set->value = other;
- set->finalize();
- other = set;
- // if this is not a tee, then we can get rid of the copy in that arm
- if (!tee) {
- // we don't need the copy at all
- copy = nullptr;
- if (!iff->ifTrue) {
- Builder(*module).flip(iff);
- }
- iff->finalize();
- }
-}
-
void CoalesceLocals::applyIndices(std::vector<Index>& indices, Expression* root) {
assert(indices.size() == numLocals);
for (auto& curr : basicBlocks) {
@@ -362,20 +343,6 @@ void CoalesceLocals::applyIndices(std::vector<Index>& indices, Expression* root)
}
continue;
}
- if (auto* iff = set->value->dynCast<If>()) {
- if (auto* get = iff->ifTrue->dynCast<GetLocal>()) {
- if (get->index == set->index) {
- removeIfCopy(action.origin, set, iff, iff->ifTrue, iff->ifFalse, getModule());
- continue;
- }
- }
- if (auto* get = iff->ifFalse->dynCast<GetLocal>()) {
- if (get->index == set->index) {
- removeIfCopy(action.origin, set, iff, iff->ifFalse, iff->ifTrue, getModule());
- continue;
- }
- }
- }
}
}
}