28 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 52; RUN: opt -passes=instcombine -S < %s | FileCheck %s3 4; This vscale udiv with a power-of-2 splat on the rhs should not crash opt5 6define <vscale x 2 x i32> @udiv_pow2_vscale(<vscale x 2 x i32> %lhs) {7; CHECK-LABEL: define <vscale x 2 x i32> @udiv_pow2_vscale(8; CHECK-SAME: <vscale x 2 x i32> [[LHS:%.*]]) {9; CHECK-NEXT: [[RES1:%.*]] = lshr <vscale x 2 x i32> [[LHS]], splat (i32 1)10; CHECK-NEXT: ret <vscale x 2 x i32> [[RES1]]11;12 %res = udiv <vscale x 2 x i32> %lhs, splat (i32 2)13 ret <vscale x 2 x i32> %res14}15 16; This fixed width udiv with a power-of-2 splat on the rhs should also not17; crash, and instcombine should eliminate the udiv18 19define <2 x i32> @udiv_pow2_fixed(<2 x i32> %lhs) {20; CHECK-LABEL: define <2 x i32> @udiv_pow2_fixed(21; CHECK-SAME: <2 x i32> [[LHS:%.*]]) {22; CHECK-NEXT: [[RES1:%.*]] = lshr <2 x i32> [[LHS]], splat (i32 1)23; CHECK-NEXT: ret <2 x i32> [[RES1]]24;25 %res = udiv <2 x i32> %lhs, splat (i32 2)26 ret <2 x i32> %res27}28