summaryrefslogtreecommitdiff
path: root/src/ir/bits.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/bits.h')
-rw-r--r--src/ir/bits.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ir/bits.h b/src/ir/bits.h
index 21146b3d1..96b36a846 100644
--- a/src/ir/bits.h
+++ b/src/ir/bits.h
@@ -17,10 +17,11 @@
#ifndef wasm_ir_bits_h
#define wasm_ir_bits_h
+#include "ir/boolean.h"
#include "ir/literal-utils.h"
+#include "ir/load-utils.h"
#include "support/bits.h"
#include "wasm-builder.h"
-#include <ir/load-utils.h>
namespace wasm::Bits {
@@ -125,6 +126,9 @@ struct DummyLocalInfoProvider {
template<typename LocalInfoProvider = DummyLocalInfoProvider>
Index getMaxBits(Expression* curr,
LocalInfoProvider* localInfoProvider = nullptr) {
+ if (Properties::emitsBoolean(curr)) {
+ return 1;
+ }
if (auto* c = curr->dynCast<Const>()) {
switch (curr->type.getBasic()) {
case Type::i32:
@@ -363,7 +367,7 @@ Index getMaxBits(Expression* curr,
case LeFloat64:
case GtFloat64:
case GeFloat64:
- return 1;
+ WASM_UNREACHABLE("relationals handled before");
default: {
}
}
@@ -379,7 +383,7 @@ Index getMaxBits(Expression* curr,
return 7;
case EqZInt32:
case EqZInt64:
- return 1;
+ WASM_UNREACHABLE("relationals handled before");
case WrapInt64:
case ExtendUInt32:
return std::min(Index(32), getMaxBits(unary->value, localInfoProvider));