diff --git a/core/iwasm/compilation/aot_emit_numberic.c b/core/iwasm/compilation/aot_emit_numberic.c index d7c8ecf92..44e65a0cc 100644 --- a/core/iwasm/compilation/aot_emit_numberic.c +++ b/core/iwasm/compilation/aot_emit_numberic.c @@ -690,13 +690,12 @@ compile_int_rot(AOTCompContext *comp_ctx, LLVMValueRef left, LLVMValueRef right, LLVMValueRef bits_minus_shift_count, res, tmp_l, tmp_r; char *name = is_rotl ? "rotl" : "rotr"; - /* right is 0 */ - if (LLVMIsConstant(right) && (uint64)LLVMConstIntGetZExtValue(right) == 0) { - return left; - } - SHIFT_COUNT_MASK; + /* rotl/rotr with 0 */ + if (IS_CONST_ZERO(right)) + return left; + /* Calculate (bits - shif_count) */ LLVM_BUILD_OP(Sub, is_i32 ? I32_32 : I64_64, right, bits_minus_shift_count, "bits_minus_shift_count", NULL);