Skip to content

Commit

Permalink
[ARM] Convert some tests to opaque pointers (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Apr 4, 2023
1 parent 24906aa commit f45b22e
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 152 deletions.
51 changes: 25 additions & 26 deletions llvm/test/CodeGen/ARM/combine-movc-sub.ll
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -opaque-pointers=0 %s -o - -verify-machineinstrs | FileCheck %s
; RUN: llc %s -o - -verify-machineinstrs | FileCheck %s

target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
target triple = "thumbv7s-apple-unknown"
Expand All @@ -8,21 +8,21 @@ target triple = "thumbv7s-apple-unknown"
; inside the loop. In this case, the kill flag on the subtract should be removed or else
; it will fail verification.

%struct.PROOFSEARCH_HELP = type { %struct.LIST_HELP*, %struct.LIST_HELP*, %struct.LIST_HELP*, %struct.LIST_HELP*, %struct.SHARED_INDEX_NODE*, %struct.LIST_HELP*, %struct.SHARED_INDEX_NODE*, %struct.LIST_HELP*, %struct.SORTTHEORY_HELP*, %struct.SORTTHEORY_HELP*, %struct.SORTTHEORY_HELP*, %struct.SHARED_INDEX_NODE*, %struct.LIST_HELP*, i32*, i32*, %struct.LIST_HELP*, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.SORTTHEORY_HELP = type { %struct.st*, [4000 x %struct.NODE_HELP*], %struct.LIST_HELP*, %struct.LIST_HELP*, i32 }
%struct.st = type { %struct.subst*, %struct.LIST_HELP*, %struct.LIST_HELP*, i16, i16 }
%struct.subst = type { %struct.subst*, i32, %struct.term* }
%struct.term = type { i32, %union.anon, %struct.LIST_HELP*, i32, i32 }
%union.anon = type { %struct.LIST_HELP* }
%struct.NODE_HELP = type { %struct.LIST_HELP*, i32, i32, i32, %struct.LIST_HELP*, i32 }
%struct.SHARED_INDEX_NODE = type { %struct.st*, [3001 x %struct.term*], [4000 x %struct.term*], i32 }
%struct.LIST_HELP = type { %struct.LIST_HELP*, i8* }
%struct.CLAUSE_HELP = type { i32, i32, i32, i32, i32*, i32, %struct.LIST_HELP*, %struct.LIST_HELP*, i32, i32, %struct.LITERAL_HELP**, i32, i32, i32, i32 }
%struct.LITERAL_HELP = type { i32, i32, i32, %struct.CLAUSE_HELP*, %struct.term* }
%struct.PROOFSEARCH_HELP = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.SORTTHEORY_HELP = type { ptr, [4000 x ptr], ptr, ptr, i32 }
%struct.st = type { ptr, ptr, ptr, i16, i16 }
%struct.subst = type { ptr, i32, ptr }
%struct.term = type { i32, %union.anon, ptr, i32, i32 }
%union.anon = type { ptr }
%struct.NODE_HELP = type { ptr, i32, i32, i32, ptr, i32 }
%struct.SHARED_INDEX_NODE = type { ptr, [3001 x ptr], [4000 x ptr], i32 }
%struct.LIST_HELP = type { ptr, ptr }
%struct.CLAUSE_HELP = type { i32, i32, i32, i32, ptr, i32, ptr, ptr, i32, i32, ptr, i32, i32, i32, i32 }
%struct.LITERAL_HELP = type { i32, i32, i32, ptr, ptr }

declare void @foo(%struct.PROOFSEARCH_HELP*, %struct.CLAUSE_HELP*)
declare void @foo(ptr, ptr)

define hidden fastcc %struct.LIST_HELP* @test(%struct.PROOFSEARCH_HELP* %Search, %struct.LIST_HELP* %ClauseList, i32 %Level, %struct.LIST_HELP** nocapture %New) {
define hidden fastcc ptr @test(ptr %Search, ptr %ClauseList, i32 %Level, ptr nocapture %New) {
; CHECK-LABEL: test:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: push.w {r4, r5, r6, r7, r8, r9, lr}
Expand Down Expand Up @@ -67,28 +67,27 @@ entry:
br label %for.body

for.body: ; preds = %for.inc, %entry
%Scan.038 = phi %struct.LIST_HELP* [ %ClauseList, %entry ], [ %i9, %for.inc ]
%car.i33 = getelementptr inbounds %struct.LIST_HELP, %struct.LIST_HELP* %Scan.038, i32 0, i32 1
%i5 = bitcast i8** %car.i33 to %struct.CLAUSE_HELP**
%i6 = load %struct.CLAUSE_HELP*, %struct.CLAUSE_HELP** %i5, align 4
%Scan.038 = phi ptr [ %ClauseList, %entry ], [ %i9, %for.inc ]
%car.i33 = getelementptr inbounds %struct.LIST_HELP, ptr %Scan.038, i32 0, i32 1
%i6 = load ptr, ptr %car.i33, align 4
%. = add i32 %i4, 10
%.Level = select i1 %cmp4.i.i, i32 %i3, i32 %Level
%splitfield.i = getelementptr inbounds %struct.CLAUSE_HELP, %struct.CLAUSE_HELP* %i6, i32 0, i32 4
%i7 = load i32*, i32** %splitfield.i, align 4
%arrayidx.i = getelementptr inbounds i32, i32* %i7, i32 %.
%i8 = load i32, i32* %arrayidx.i, align 4
%splitfield.i = getelementptr inbounds %struct.CLAUSE_HELP, ptr %i6, i32 0, i32 4
%i7 = load ptr, ptr %splitfield.i, align 4
%arrayidx.i = getelementptr inbounds i32, ptr %i7, i32 %.
%i8 = load i32, ptr %arrayidx.i, align 4
%shl.i = shl i32 1, %.Level
%and.i = and i32 %i8, %shl.i
%cmp4.i = icmp eq i32 %and.i, 0
br i1 %cmp4.i, label %for.inc, label %if.then

if.then: ; preds = %for.body
tail call void @foo(%struct.PROOFSEARCH_HELP* %Search, %struct.CLAUSE_HELP* %i6)
store i8* null, i8** %car.i33, align 4
tail call void @foo(ptr %Search, ptr %i6)
store ptr null, ptr %car.i33, align 4
br label %for.inc

for.inc: ; preds = %if.then, %for.body
%cdr.i = getelementptr inbounds %struct.LIST_HELP, %struct.LIST_HELP* %Scan.038, i32 0, i32 0
%i9 = load %struct.LIST_HELP*, %struct.LIST_HELP** %cdr.i, align 4
%cdr.i = getelementptr inbounds %struct.LIST_HELP, ptr %Scan.038, i32 0, i32 0
%i9 = load ptr, ptr %cdr.i, align 4
br label %for.body
}
44 changes: 19 additions & 25 deletions llvm/test/CodeGen/ARM/inlineasm-X-constraint.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: llc -opaque-pointers=0 -mtriple=armv7-none-eabi -mattr=+neon < %s -o - | FileCheck %s
; RUN: llc -mtriple=armv7-none-eabi -mattr=+neon < %s -o - | FileCheck %s

; The following functions test the use case where an X constraint is used to
; add a dependency between an assembly instruction (vmsr in this case) and
Expand All @@ -18,9 +18,9 @@
define arm_aapcs_vfpcc double @f1(double %f, i32 %pscr_value) {
entry:
%f.addr = alloca double, align 8
store double %f, double* %f.addr, align 8
call void asm sideeffect "vmsr fpscr,$1", "=*X,r"(double* elementtype(double) nonnull %f.addr, i32 %pscr_value) nounwind
%0 = load double, double* %f.addr, align 8
store double %f, ptr %f.addr, align 8
call void asm sideeffect "vmsr fpscr,$1", "=*X,r"(ptr elementtype(double) nonnull %f.addr, i32 %pscr_value) nounwind
%0 = load double, ptr %f.addr, align 8
%add = fadd double %0, %0
ret double %add
}
Expand All @@ -36,9 +36,9 @@ entry:
define arm_aapcs_vfpcc i32 @f2(i32 %f, i32 %pscr_value) {
entry:
%f.addr = alloca i32, align 4
store i32 %f, i32* %f.addr, align 4
call void asm sideeffect "vmsr fpscr,$1", "=*X,r"(i32* elementtype(i32) nonnull %f.addr, i32 %pscr_value) nounwind
%0 = load i32, i32* %f.addr, align 4
store i32 %f, ptr %f.addr, align 4
call void asm sideeffect "vmsr fpscr,$1", "=*X,r"(ptr elementtype(i32) nonnull %f.addr, i32 %pscr_value) nounwind
%0 = load i32, ptr %f.addr, align 4
%mul = mul i32 %0, %0
ret i32 %mul
}
Expand All @@ -65,9 +65,9 @@ entry:
define arm_aapcs_vfpcc <8 x i8> @f3() {
entry:
%vector_res_int8x8 = alloca <8 x i8>, align 8
%0 = getelementptr inbounds <8 x i8>, <8 x i8>* %vector_res_int8x8, i32 0, i32 0
call void asm sideeffect "vmsr fpscr,$1", "=*X,r"(<8 x i8>* elementtype(<8 x i8>) nonnull %vector_res_int8x8, i32 undef) nounwind
%1 = load <8 x i8>, <8 x i8>* %vector_res_int8x8, align 8
%0 = getelementptr inbounds <8 x i8>, ptr %vector_res_int8x8, i32 0, i32 0
call void asm sideeffect "vmsr fpscr,$1", "=*X,r"(ptr elementtype(<8 x i8>) nonnull %vector_res_int8x8, i32 undef) nounwind
%1 = load <8 x i8>, ptr %vector_res_int8x8, align 8
%mul = mul <8 x i8> %1, %1
ret <8 x i8> %mul
}
Expand Down Expand Up @@ -96,31 +96,25 @@ entry:
; CHECK: bl f4
define void @f5() {
entry:
tail call void asm sideeffect "bl $0", "X"(void ()* nonnull @f4)
tail call void asm sideeffect "bl $0", "X"(ptr nonnull @f4)
ret void
}

declare void @foo(...)

; This tests the behavior of the X constraint when used on functions pointers,
; or functions with a cast. In the first asm call we figure out that this
; is a function pointer and emit the label. However, in the second asm call
; we can't see through the bitcast and we end up having to lower this constraint
; to something else. This is not ideal, but it is a correct behaviour according
; to the definition of the X constraint.
;
; In this case (and other cases where we could have emitted something else),
; what we're doing with the X constraint is not particularly useful either,
; since the user could have used "r" in this situation for the same effect.
; is a function pointer and emit the label. With opaque pointers, we also do
; so in the second case.

; CHECK-LABEL: f6
; CHECK: bl foo
; CHECK: bl r
; CHECK: bl f4

define void @f6() nounwind {
entry:
tail call void asm sideeffect "bl $0", "X"(void (...)* @foo) nounwind
tail call void asm sideeffect "bl $0", "X"(void (...)* bitcast (void ()* @f4 to void (...)*)) nounwind
tail call void asm sideeffect "bl $0", "X"(ptr @foo) nounwind
tail call void asm sideeffect "bl $0", "X"(ptr @f4) nounwind
ret void
}

Expand All @@ -141,7 +135,7 @@ entry:
; CHECK-LABEL: f7
; CHECK: bl
define void @f7() {
call void asm sideeffect "bl $0", "X"( i8* blockaddress(@f7, %bb) )
call void asm sideeffect "bl $0", "X"( ptr blockaddress(@f7, %bb) )
br label %bb
bb:
ret void
Expand All @@ -150,8 +144,8 @@ bb:
; If we use a constraint "=*X", we should get a store back to *%x (in r0).
; CHECK-LABEL: f8
; CHECK: str r{{.*}}, [r0]
define void @f8(i32 *%x) {
define void @f8(ptr %x) {
entry:
tail call void asm sideeffect "add $0, r0, r0", "=*X"(i32* elementtype(i32) %x)
tail call void asm sideeffect "add $0, r0, r0", "=*X"(ptr elementtype(i32) %x)
ret void
}
82 changes: 41 additions & 41 deletions llvm/test/CodeGen/ARM/lsr-setupcost.ll
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -opaque-pointers=0 -mtriple=thumbv6m-none-eabi -loop-reduce %s -S -o - | FileCheck %s
; RUN: opt -mtriple=thumbv6m-none-eabi -loop-reduce %s -S -o - | FileCheck %s

target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"

%struct.arm_matrix_instance_q15 = type { i16, i16, i16* }
%struct.arm_matrix_instance_q15 = type { i16, i16, ptr }

define i32 @arm_mat_add_q15(%struct.arm_matrix_instance_q15* nocapture readonly %pSrcA, %struct.arm_matrix_instance_q15* nocapture readonly %pSrcB, %struct.arm_matrix_instance_q15* nocapture readonly %pDst) {
define i32 @arm_mat_add_q15(ptr nocapture readonly %pSrcA, ptr nocapture readonly %pSrcB, ptr nocapture readonly %pDst) {
; CHECK-LABEL: @arm_mat_add_q15(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[NUMROWS:%.*]] = getelementptr inbounds [[STRUCT_ARM_MATRIX_INSTANCE_Q15:%.*]], %struct.arm_matrix_instance_q15* [[PSRCA:%.*]], i32 0, i32 0
; CHECK-NEXT: [[I0:%.*]] = load i16, i16* [[NUMROWS]], align 4
; CHECK-NEXT: [[NUMCOLS:%.*]] = getelementptr inbounds [[STRUCT_ARM_MATRIX_INSTANCE_Q15]], %struct.arm_matrix_instance_q15* [[PSRCA]], i32 0, i32 1
; CHECK-NEXT: [[I1:%.*]] = load i16, i16* [[NUMCOLS]], align 2
; CHECK-NEXT: [[NUMROWS:%.*]] = getelementptr inbounds [[STRUCT_ARM_MATRIX_INSTANCE_Q15:%.*]], ptr [[PSRCA:%.*]], i32 0, i32 0
; CHECK-NEXT: [[I0:%.*]] = load i16, ptr [[NUMROWS]], align 4
; CHECK-NEXT: [[NUMCOLS:%.*]] = getelementptr inbounds [[STRUCT_ARM_MATRIX_INSTANCE_Q15]], ptr [[PSRCA]], i32 0, i32 1
; CHECK-NEXT: [[I1:%.*]] = load i16, ptr [[NUMCOLS]], align 2
; CHECK-NEXT: [[MUL:%.*]] = mul i16 [[I1]], [[I0]]
; CHECK-NEXT: [[CMP22:%.*]] = icmp eq i16 [[MUL]], 0
; CHECK-NEXT: br i1 [[CMP22]], label [[WHILE_END:%.*]], label [[WHILE_BODY_PREHEADER:%.*]]
; CHECK: while.body.preheader:
; CHECK-NEXT: [[CONV5:%.*]] = zext i16 [[MUL]] to i32
; CHECK-NEXT: [[PDATA2:%.*]] = getelementptr inbounds [[STRUCT_ARM_MATRIX_INSTANCE_Q15]], %struct.arm_matrix_instance_q15* [[PDST:%.*]], i32 0, i32 2
; CHECK-NEXT: [[I2:%.*]] = load i16*, i16** [[PDATA2]], align 4
; CHECK-NEXT: [[PDATA1:%.*]] = getelementptr inbounds [[STRUCT_ARM_MATRIX_INSTANCE_Q15]], %struct.arm_matrix_instance_q15* [[PSRCB:%.*]], i32 0, i32 2
; CHECK-NEXT: [[I3:%.*]] = load i16*, i16** [[PDATA1]], align 4
; CHECK-NEXT: [[PDATA:%.*]] = getelementptr inbounds [[STRUCT_ARM_MATRIX_INSTANCE_Q15]], %struct.arm_matrix_instance_q15* [[PSRCA]], i32 0, i32 2
; CHECK-NEXT: [[I4:%.*]] = load i16*, i16** [[PDATA]], align 4
; CHECK-NEXT: [[PDATA2:%.*]] = getelementptr inbounds [[STRUCT_ARM_MATRIX_INSTANCE_Q15]], ptr [[PDST:%.*]], i32 0, i32 2
; CHECK-NEXT: [[I2:%.*]] = load ptr, ptr [[PDATA2]], align 4
; CHECK-NEXT: [[PDATA1:%.*]] = getelementptr inbounds [[STRUCT_ARM_MATRIX_INSTANCE_Q15]], ptr [[PSRCB:%.*]], i32 0, i32 2
; CHECK-NEXT: [[I3:%.*]] = load ptr, ptr [[PDATA1]], align 4
; CHECK-NEXT: [[PDATA:%.*]] = getelementptr inbounds [[STRUCT_ARM_MATRIX_INSTANCE_Q15]], ptr [[PSRCA]], i32 0, i32 2
; CHECK-NEXT: [[I4:%.*]] = load ptr, ptr [[PDATA]], align 4
; CHECK-NEXT: br label [[WHILE_BODY:%.*]]
; CHECK: while.body:
; CHECK-NEXT: [[PINA_026:%.*]] = phi i16* [ [[INCDEC_PTR:%.*]], [[WHILE_BODY]] ], [ [[I4]], [[WHILE_BODY_PREHEADER]] ]
; CHECK-NEXT: [[PINA_026:%.*]] = phi ptr [ [[INCDEC_PTR:%.*]], [[WHILE_BODY]] ], [ [[I4]], [[WHILE_BODY_PREHEADER]] ]
; CHECK-NEXT: [[BLKCNT_025:%.*]] = phi i32 [ [[DEC:%.*]], [[WHILE_BODY]] ], [ [[CONV5]], [[WHILE_BODY_PREHEADER]] ]
; CHECK-NEXT: [[PINB_024:%.*]] = phi i16* [ [[INCDEC_PTR8:%.*]], [[WHILE_BODY]] ], [ [[I3]], [[WHILE_BODY_PREHEADER]] ]
; CHECK-NEXT: [[POUT_023:%.*]] = phi i16* [ [[INCDEC_PTR11:%.*]], [[WHILE_BODY]] ], [ [[I2]], [[WHILE_BODY_PREHEADER]] ]
; CHECK-NEXT: [[INCDEC_PTR]] = getelementptr inbounds i16, i16* [[PINA_026]], i32 1
; CHECK-NEXT: [[I5:%.*]] = load i16, i16* [[PINA_026]], align 2
; CHECK-NEXT: [[PINB_024:%.*]] = phi ptr [ [[INCDEC_PTR8:%.*]], [[WHILE_BODY]] ], [ [[I3]], [[WHILE_BODY_PREHEADER]] ]
; CHECK-NEXT: [[POUT_023:%.*]] = phi ptr [ [[INCDEC_PTR11:%.*]], [[WHILE_BODY]] ], [ [[I2]], [[WHILE_BODY_PREHEADER]] ]
; CHECK-NEXT: [[INCDEC_PTR]] = getelementptr inbounds i16, ptr [[PINA_026]], i32 1
; CHECK-NEXT: [[I5:%.*]] = load i16, ptr [[PINA_026]], align 2
; CHECK-NEXT: [[CONV7:%.*]] = sext i16 [[I5]] to i32
; CHECK-NEXT: [[INCDEC_PTR8]] = getelementptr inbounds i16, i16* [[PINB_024]], i32 1
; CHECK-NEXT: [[I6:%.*]] = load i16, i16* [[PINB_024]], align 2
; CHECK-NEXT: [[INCDEC_PTR8]] = getelementptr inbounds i16, ptr [[PINB_024]], i32 1
; CHECK-NEXT: [[I6:%.*]] = load i16, ptr [[PINB_024]], align 2
; CHECK-NEXT: [[CONV9:%.*]] = sext i16 [[I6]] to i32
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[CONV9]], [[CONV7]]
; CHECK-NEXT: [[I7:%.*]] = icmp sgt i32 [[ADD]], -32768
; CHECK-NEXT: [[SPEC_SELECT_I:%.*]] = select i1 [[I7]], i32 [[ADD]], i32 -32768
; CHECK-NEXT: [[I8:%.*]] = icmp slt i32 [[SPEC_SELECT_I]], 32767
; CHECK-NEXT: [[CALL21:%.*]] = select i1 [[I8]], i32 [[SPEC_SELECT_I]], i32 32767
; CHECK-NEXT: [[CONV10:%.*]] = trunc i32 [[CALL21]] to i16
; CHECK-NEXT: [[INCDEC_PTR11]] = getelementptr inbounds i16, i16* [[POUT_023]], i32 1
; CHECK-NEXT: store i16 [[CONV10]], i16* [[POUT_023]], align 2
; CHECK-NEXT: [[INCDEC_PTR11]] = getelementptr inbounds i16, ptr [[POUT_023]], i32 1
; CHECK-NEXT: store i16 [[CONV10]], ptr [[POUT_023]], align 2
; CHECK-NEXT: [[DEC]] = add nsw i32 [[BLKCNT_025]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[DEC]], 0
; CHECK-NEXT: br i1 [[CMP]], label [[WHILE_END_LOOPEXIT:%.*]], label [[WHILE_BODY]]
Expand All @@ -52,43 +52,43 @@ define i32 @arm_mat_add_q15(%struct.arm_matrix_instance_q15* nocapture readonly
; CHECK-NEXT: ret i32 0
;
entry:
%numRows = getelementptr inbounds %struct.arm_matrix_instance_q15, %struct.arm_matrix_instance_q15* %pSrcA, i32 0, i32 0
%i0 = load i16, i16* %numRows, align 4
%numCols = getelementptr inbounds %struct.arm_matrix_instance_q15, %struct.arm_matrix_instance_q15* %pSrcA, i32 0, i32 1
%i1 = load i16, i16* %numCols, align 2
%numRows = getelementptr inbounds %struct.arm_matrix_instance_q15, ptr %pSrcA, i32 0, i32 0
%i0 = load i16, ptr %numRows, align 4
%numCols = getelementptr inbounds %struct.arm_matrix_instance_q15, ptr %pSrcA, i32 0, i32 1
%i1 = load i16, ptr %numCols, align 2
%mul = mul i16 %i1, %i0
%cmp22 = icmp eq i16 %mul, 0
br i1 %cmp22, label %while.end, label %while.body.preheader

while.body.preheader: ; preds = %entry
%conv5 = zext i16 %mul to i32
%pData2 = getelementptr inbounds %struct.arm_matrix_instance_q15, %struct.arm_matrix_instance_q15* %pDst, i32 0, i32 2
%i2 = load i16*, i16** %pData2, align 4
%pData1 = getelementptr inbounds %struct.arm_matrix_instance_q15, %struct.arm_matrix_instance_q15* %pSrcB, i32 0, i32 2
%i3 = load i16*, i16** %pData1, align 4
%pData = getelementptr inbounds %struct.arm_matrix_instance_q15, %struct.arm_matrix_instance_q15* %pSrcA, i32 0, i32 2
%i4 = load i16*, i16** %pData, align 4
%pData2 = getelementptr inbounds %struct.arm_matrix_instance_q15, ptr %pDst, i32 0, i32 2
%i2 = load ptr, ptr %pData2, align 4
%pData1 = getelementptr inbounds %struct.arm_matrix_instance_q15, ptr %pSrcB, i32 0, i32 2
%i3 = load ptr, ptr %pData1, align 4
%pData = getelementptr inbounds %struct.arm_matrix_instance_q15, ptr %pSrcA, i32 0, i32 2
%i4 = load ptr, ptr %pData, align 4
br label %while.body

while.body: ; preds = %while.body.preheader, %while.body
%pInA.026 = phi i16* [ %incdec.ptr, %while.body ], [ %i4, %while.body.preheader ]
%pInA.026 = phi ptr [ %incdec.ptr, %while.body ], [ %i4, %while.body.preheader ]
%blkCnt.025 = phi i32 [ %dec, %while.body ], [ %conv5, %while.body.preheader ]
%pInB.024 = phi i16* [ %incdec.ptr8, %while.body ], [ %i3, %while.body.preheader ]
%pOut.023 = phi i16* [ %incdec.ptr11, %while.body ], [ %i2, %while.body.preheader ]
%incdec.ptr = getelementptr inbounds i16, i16* %pInA.026, i32 1
%i5 = load i16, i16* %pInA.026, align 2
%pInB.024 = phi ptr [ %incdec.ptr8, %while.body ], [ %i3, %while.body.preheader ]
%pOut.023 = phi ptr [ %incdec.ptr11, %while.body ], [ %i2, %while.body.preheader ]
%incdec.ptr = getelementptr inbounds i16, ptr %pInA.026, i32 1
%i5 = load i16, ptr %pInA.026, align 2
%conv7 = sext i16 %i5 to i32
%incdec.ptr8 = getelementptr inbounds i16, i16* %pInB.024, i32 1
%i6 = load i16, i16* %pInB.024, align 2
%incdec.ptr8 = getelementptr inbounds i16, ptr %pInB.024, i32 1
%i6 = load i16, ptr %pInB.024, align 2
%conv9 = sext i16 %i6 to i32
%add = add nsw i32 %conv9, %conv7
%i7 = icmp sgt i32 %add, -32768
%spec.select.i = select i1 %i7, i32 %add, i32 -32768
%i8 = icmp slt i32 %spec.select.i, 32767
%call21 = select i1 %i8, i32 %spec.select.i, i32 32767
%conv10 = trunc i32 %call21 to i16
%incdec.ptr11 = getelementptr inbounds i16, i16* %pOut.023, i32 1
store i16 %conv10, i16* %pOut.023, align 2
%incdec.ptr11 = getelementptr inbounds i16, ptr %pOut.023, i32 1
store i16 %conv10, ptr %pOut.023, align 2
%dec = add nsw i32 %blkCnt.025, -1
%cmp = icmp eq i32 %dec, 0
br i1 %cmp, label %while.end, label %while.body
Expand Down

0 comments on commit f45b22e

Please sign in to comment.