diff --git a/lib/ir/type.cc b/lib/ir/type.cc index 43761f482..5667dcac5 100644 --- a/lib/ir/type.cc +++ b/lib/ir/type.cc @@ -27,7 +27,7 @@ unsigned type::get_primitive_size_in_bits() const { case BF16TyID: return 16; case FP32TyID: return 32; case FP64TyID: return 64; - case IntegerTyID: return ((integer_type*)(this))->get_bitwidth(); + case IntegerTyID: return std::max(8, ((integer_type*)(this))->get_bitwidth()); case BlockTyID: return ((block_type*)(this))->get_bitwidth(); default: return 0; }