From 04418d5617f6ab7015c5cf7b905b4775a5219f4b Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Mon, 31 Jul 2017 14:11:33 -0700 Subject: use effective shifts in more places in optimize-instructions --- src/ast/bits.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ast/bits.h') diff --git a/src/ast/bits.h b/src/ast/bits.h index 11cf7b06d..0aee50ffe 100644 --- a/src/ast/bits.h +++ b/src/ast/bits.h @@ -51,7 +51,8 @@ struct Bits { WASM_UNREACHABLE(); } - static Index getEffectiveShifts(Const* amount) { + static Index getEffectiveShifts(Expression* expr) { + auto* amount = expr->cast(); if (amount->type == i32) { return getEffectiveShifts(amount->value.geti32(), i32); } else if (amount->type == i64) { -- cgit v1.2.3