1*447c411fSSam Parker; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 2*447c411fSSam Parker; RUN: opt -mtriple=thumbv7-unknown-linux-gnueabihf < %s -arm-parallel-dsp -verify -S | FileCheck %s 3*447c411fSSam Parker 4*447c411fSSam Parkertarget datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64" 5*447c411fSSam Parker 6*447c411fSSam Parkerdefine i32 @test(ptr %b) { 7*447c411fSSam Parker; CHECK-LABEL: @test( 8*447c411fSSam Parker; CHECK-NEXT: entry: 9*447c411fSSam Parker; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[B:%.*]], align 2 10*447c411fSSam Parker; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[B]], align 2 11*447c411fSSam Parker; CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16 12*447c411fSSam Parker; CHECK-NEXT: [[TMP3:%.*]] = sext i16 [[TMP2]] to i32 13*447c411fSSam Parker; CHECK-NEXT: [[TMP4:%.*]] = lshr i32 [[TMP1]], 16 14*447c411fSSam Parker; CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16 15*447c411fSSam Parker; CHECK-NEXT: [[TMP6:%.*]] = sext i16 [[TMP5]] to i32 16*447c411fSSam Parker; CHECK-NEXT: [[CONV:%.*]] = sext i16 [[TMP0]] to i32 17*447c411fSSam Parker; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i16, ptr [[B]], i32 3 18*447c411fSSam Parker; CHECK-NEXT: [[TMP7:%.*]] = load i16, ptr [[ARRAYIDX1]], align 2 19*447c411fSSam Parker; CHECK-NEXT: [[TMP8:%.*]] = load i32, ptr [[ARRAYIDX1]], align 2 20*447c411fSSam Parker; CHECK-NEXT: [[TMP9:%.*]] = trunc i32 [[TMP8]] to i16 21*447c411fSSam Parker; CHECK-NEXT: [[TMP10:%.*]] = call i32 @llvm.arm.smlad(i32 [[TMP8]], i32 [[TMP1]], i32 0) 22*447c411fSSam Parker; CHECK-NEXT: [[TMP11:%.*]] = sext i16 [[TMP9]] to i32 23*447c411fSSam Parker; CHECK-NEXT: [[TMP12:%.*]] = lshr i32 [[TMP8]], 16 24*447c411fSSam Parker; CHECK-NEXT: [[TMP13:%.*]] = trunc i32 [[TMP12]] to i16 25*447c411fSSam Parker; CHECK-NEXT: [[TMP14:%.*]] = sext i16 [[TMP13]] to i32 26*447c411fSSam Parker; CHECK-NEXT: [[CONV2:%.*]] = sext i16 [[TMP7]] to i32 27*447c411fSSam Parker; CHECK-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP11]], [[TMP3]] 28*447c411fSSam Parker; CHECK-NEXT: [[INCDEC_PTR:%.*]] = getelementptr inbounds i16, ptr [[B]], i32 1 29*447c411fSSam Parker; CHECK-NEXT: [[TMP15:%.*]] = load i16, ptr [[INCDEC_PTR]], align 2 30*447c411fSSam Parker; CHECK-NEXT: [[CONV4:%.*]] = sext i16 [[TMP15]] to i32 31*447c411fSSam Parker; CHECK-NEXT: [[ARRAYIDX5:%.*]] = getelementptr inbounds i16, ptr [[B]], i32 4 32*447c411fSSam Parker; CHECK-NEXT: [[TMP16:%.*]] = load i16, ptr [[ARRAYIDX5]], align 2 33*447c411fSSam Parker; CHECK-NEXT: [[CONV6:%.*]] = sext i16 [[TMP16]] to i32 34*447c411fSSam Parker; CHECK-NEXT: [[MUL7:%.*]] = mul nsw i32 [[TMP14]], [[TMP6]] 35*447c411fSSam Parker; CHECK-NEXT: [[ADD9:%.*]] = add nsw i32 [[MUL7]], [[MUL]] 36*447c411fSSam Parker; CHECK-NEXT: [[MUL13:%.*]] = mul nsw i32 0, 0 37*447c411fSSam Parker; CHECK-NEXT: [[ADD15:%.*]] = add nsw i32 [[MUL13]], [[TMP10]] 38*447c411fSSam Parker; CHECK-NEXT: ret i32 [[ADD15]] 39*447c411fSSam Parker; 40*447c411fSSam Parkerentry: 41*447c411fSSam Parker %0 = load i16, ptr %b, align 2 42*447c411fSSam Parker %conv = sext i16 %0 to i32 43*447c411fSSam Parker %arrayidx1 = getelementptr inbounds i16, ptr %b, i32 3 44*447c411fSSam Parker %1 = load i16, ptr %arrayidx1, align 2 45*447c411fSSam Parker %conv2 = sext i16 %1 to i32 46*447c411fSSam Parker %mul = mul nsw i32 %conv2, %conv 47*447c411fSSam Parker %incdec.ptr = getelementptr inbounds i16, ptr %b, i32 1 48*447c411fSSam Parker %2 = load i16, ptr %incdec.ptr, align 2 49*447c411fSSam Parker %conv4 = sext i16 %2 to i32 50*447c411fSSam Parker %arrayidx5 = getelementptr inbounds i16, ptr %b, i32 4 51*447c411fSSam Parker %3 = load i16, ptr %arrayidx5, align 2 52*447c411fSSam Parker %conv6 = sext i16 %3 to i32 53*447c411fSSam Parker %mul7 = mul nsw i32 %conv6, %conv4 54*447c411fSSam Parker %add9 = add nsw i32 %mul7, %mul 55*447c411fSSam Parker %mul13 = mul nsw i32 0, 0 56*447c411fSSam Parker %add15 = add nsw i32 %mul13, %add9 57*447c411fSSam Parker ret i32 %add15 58*447c411fSSam Parker} 59