From 85d2c4ffdaf3934f7e529cc43842a03c3304107b Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Sat, 11 Feb 2017 22:04:22 -0800 Subject: handle tee_local in getMaxBits --- src/passes/OptimizeInstructions.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp index cf5ad982e..d28bf21a5 100644 --- a/src/passes/OptimizeInstructions.cpp +++ b/src/passes/OptimizeInstructions.cpp @@ -228,6 +228,9 @@ static Index getMaxBits(Expression* curr) { case WrapInt64: return std::min(Index(32), getMaxBits(unary->value)); default: {} } + } else if (auto* set = curr->dynCast()) { + // a tee passes through the value + return getMaxBits(set->value); } switch (curr->type) { case i32: return 32; -- cgit v1.2.3