From 26b2f331a210bf6de22816e2564516a9f59178d0 Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Tue, 11 Jul 2017 18:55:13 -0700 Subject: handle an unreachable condition properly in vacuum if simplification --- src/passes/Vacuum.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/passes/Vacuum.cpp b/src/passes/Vacuum.cpp index 40f4a6e59..0178a794d 100644 --- a/src/passes/Vacuum.cpp +++ b/src/passes/Vacuum.cpp @@ -232,6 +232,12 @@ struct Vacuum : public WalkerPass> { replaceCurrent(child); return; } + // if the condition is unreachable, just return it + if (curr->condition->type == unreachable) { + replaceCurrent(curr->condition); + return; + } + // from here on, we can assume the condition executed if (curr->ifFalse) { if (curr->ifFalse->is()) { curr->ifFalse = nullptr; -- cgit v1.2.3