From 18b06f0e8d1b5ed3ebad704249de288a5d1cb402 Mon Sep 17 00:00:00 2001 From: Steven Johnson Date: Wed, 14 Sep 2022 13:49:20 -0700 Subject: [PATCH] Revert "[HVX] Simplify constant factor before distributing" (#7013) Revert "[HVX] Simplify constant factor before distributing (#7009)" This reverts commit 69b50af793d6eb850eea3dccb16426479edbff9d. --- src/HexagonOptimize.cpp | 4 +--- test/correctness/simd_op_check_hvx.cpp | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/HexagonOptimize.cpp b/src/HexagonOptimize.cpp index 22e51b8d3747..c4ecda2fe70d 100644 --- a/src/HexagonOptimize.cpp +++ b/src/HexagonOptimize.cpp @@ -2177,10 +2177,8 @@ class DistributeShiftsAsMuls : public IRMutator { } } else if (op->is_intrinsic(Call::widening_shift_left)) { if (const uint64_t *const_b = as_const_uint(op->args[1])) { - const uint64_t const_m = 1ull << *const_b; - Expr b = make_const(op->type, const_m); Expr a = Cast::make(op->type, op->args[0]); - return mutate(distribute(a, b)); + return mutate(distribute(a, make_one(a.type()) << *const_b)); } } return IRMutator::visit(op); diff --git a/test/correctness/simd_op_check_hvx.cpp b/test/correctness/simd_op_check_hvx.cpp index 640f11ec30f3..7685da369d18 100644 --- a/test/correctness/simd_op_check_hvx.cpp +++ b/test/correctness/simd_op_check_hvx.cpp @@ -514,7 +514,6 @@ class SimdOpCheckHVX : public SimdOpCheckTest { check("v*.h += vmpy(v*.ub,r*.b)", hvx_width / 1, i16_1 + 127 * i16(u8_1)); check("v*.uw += vmpy(v*.uh,r*.uh)", hvx_width / 2, u32_1 + 65535 * u32(u16_1)); - check("v*.h += vmpy(v*.b,v*.b)", hvx_width / 1, i16_1 + 2 * i16(i8_1)); check("v*.h += vmpy(v*.ub,r*.b)", hvx_width / 1, i16_1 - i16(u8_1) * -127); check("v*.h += vmpyi(v*.h,r*.b)", hvx_width / 2, i16_1 - i16_2 * -127);