diff --git a/llvm/test/Transforms/LoopStrengthReduce/ARM/ivchain-ARM.ll b/llvm/test/Transforms/LoopStrengthReduce/ARM/ivchain-ARM.ll index 70d6cffdbd004..07debadf34f52 100644 --- a/llvm/test/Transforms/LoopStrengthReduce/ARM/ivchain-ARM.ll +++ b/llvm/test/Transforms/LoopStrengthReduce/ARM/ivchain-ARM.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3 -; RUN: llc -opaque-pointers=0 -O3 -mtriple=thumb-eabi -mcpu=cortex-a9 %s -o - | FileCheck %s -check-prefix=A9 +; RUN: llc -O3 -mtriple=thumb-eabi -mcpu=cortex-a9 %s -o - | FileCheck %s -check-prefix=A9 ; @simple is the most basic chain of address induction variables. Chaining ; saves at least one register and avoids complex addressing and setup @@ -7,7 +7,7 @@ ; ; no expensive address computation in the preheader ; no complex address modes -define i32 @simple(i32* %a, i32* %b, i32 %x) nounwind { +define i32 @simple(ptr %a, ptr %b, i32 %x) nounwind { ; A9-LABEL: simple: ; A9: @ %bb.0: @ %entry ; A9-NEXT: .save {r4, r5, r6, lr} @@ -36,21 +36,21 @@ define i32 @simple(i32* %a, i32* %b, i32 %x) nounwind { entry: br label %loop loop: - %iv = phi i32* [ %a, %entry ], [ %iv4, %loop ] + %iv = phi ptr [ %a, %entry ], [ %iv4, %loop ] %s = phi i32 [ 0, %entry ], [ %s4, %loop ] - %v = load i32, i32* %iv - %iv1 = getelementptr inbounds i32, i32* %iv, i32 %x - %v1 = load i32, i32* %iv1 - %iv2 = getelementptr inbounds i32, i32* %iv1, i32 %x - %v2 = load i32, i32* %iv2 - %iv3 = getelementptr inbounds i32, i32* %iv2, i32 %x - %v3 = load i32, i32* %iv3 + %v = load i32, ptr %iv + %iv1 = getelementptr inbounds i32, ptr %iv, i32 %x + %v1 = load i32, ptr %iv1 + %iv2 = getelementptr inbounds i32, ptr %iv1, i32 %x + %v2 = load i32, ptr %iv2 + %iv3 = getelementptr inbounds i32, ptr %iv2, i32 %x + %v3 = load i32, ptr %iv3 %s1 = add i32 %s, %v %s2 = add i32 %s1, %v1 %s3 = add i32 %s2, %v2 %s4 = add i32 %s3, %v3 - %iv4 = getelementptr inbounds i32, i32* %iv3, i32 %x - %cmp = icmp eq i32* %iv4, %b + %iv4 = getelementptr inbounds i32, ptr %iv3, i32 %x + %cmp = icmp eq ptr %iv4, %b br i1 %cmp, label %exit, label %loop exit: ret i32 %s4 @@ -60,7 +60,7 @@ exit: ; ; stride multiples computed in the preheader ; complex address modes -define i32 @user(i32* %a, i32* %b, i32 %x) nounwind { +define i32 @user(ptr %a, ptr %b, i32 %x) nounwind { ; A9-LABEL: user: ; A9: @ %bb.0: @ %entry ; A9-NEXT: .save {r4, r5, r6, r7, lr} @@ -89,22 +89,22 @@ define i32 @user(i32* %a, i32* %b, i32 %x) nounwind { entry: br label %loop loop: - %iv = phi i32* [ %a, %entry ], [ %iv4, %loop ] + %iv = phi ptr [ %a, %entry ], [ %iv4, %loop ] %s = phi i32 [ 0, %entry ], [ %s4, %loop ] - %v = load i32, i32* %iv - %iv1 = getelementptr inbounds i32, i32* %iv, i32 %x - %v1 = load i32, i32* %iv1 - %iv2 = getelementptr inbounds i32, i32* %iv1, i32 %x - %v2 = load i32, i32* %iv2 - %iv3 = getelementptr inbounds i32, i32* %iv2, i32 %x - %v3 = load i32, i32* %iv3 + %v = load i32, ptr %iv + %iv1 = getelementptr inbounds i32, ptr %iv, i32 %x + %v1 = load i32, ptr %iv1 + %iv2 = getelementptr inbounds i32, ptr %iv1, i32 %x + %v2 = load i32, ptr %iv2 + %iv3 = getelementptr inbounds i32, ptr %iv2, i32 %x + %v3 = load i32, ptr %iv3 %s1 = add i32 %s, %v %s2 = add i32 %s1, %v1 %s3 = add i32 %s2, %v2 %s4 = add i32 %s3, %v3 - %iv4 = getelementptr inbounds i32, i32* %iv3, i32 %x - store i32 %s4, i32* %iv - %cmp = icmp eq i32* %iv4, %b + %iv4 = getelementptr inbounds i32, ptr %iv3, i32 %x + store i32 %s4, ptr %iv + %cmp = icmp eq ptr %iv4, %b br i1 %cmp, label %exit, label %loop exit: ret i32 %s4 @@ -118,7 +118,7 @@ exit: ; no spills ; only one stride multiple in the preheader ; no complex address modes or reloads -define void @extrastride(i8* nocapture %main, i32 %main_stride, i32* nocapture %res, i32 %x, i32 %y, i32 %z) nounwind { +define void @extrastride(ptr nocapture %main, i32 %main_stride, ptr nocapture %res, i32 %x, i32 %y, i32 %z) nounwind { ; A9-LABEL: extrastride: ; A9: @ %bb.0: @ %entry ; A9-NEXT: .save {r4, r5, r6, r7, lr} @@ -165,30 +165,25 @@ for.body.lr.ph: ; preds = %entry br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body - %main.addr.011 = phi i8* [ %main, %for.body.lr.ph ], [ %add.ptr6, %for.body ] + %main.addr.011 = phi ptr [ %main, %for.body.lr.ph ], [ %add.ptr6, %for.body ] %i.010 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] - %res.addr.09 = phi i32* [ %res, %for.body.lr.ph ], [ %add.ptr7, %for.body ] - %0 = bitcast i8* %main.addr.011 to i32* - %1 = load i32, i32* %0, align 4 - %add.ptr = getelementptr inbounds i8, i8* %main.addr.011, i32 %main_stride - %2 = bitcast i8* %add.ptr to i32* - %3 = load i32, i32* %2, align 4 - %add.ptr1 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr.sum - %4 = bitcast i8* %add.ptr1 to i32* - %5 = load i32, i32* %4, align 4 - %add.ptr2 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr1.sum - %6 = bitcast i8* %add.ptr2 to i32* - %7 = load i32, i32* %6, align 4 - %add.ptr3 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr4.sum - %8 = bitcast i8* %add.ptr3 to i32* - %9 = load i32, i32* %8, align 4 - %add = add i32 %3, %1 - %add4 = add i32 %add, %5 - %add5 = add i32 %add4, %7 - %add6 = add i32 %add5, %9 - store i32 %add6, i32* %res.addr.09, align 4 - %add.ptr6 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr3.sum - %add.ptr7 = getelementptr inbounds i32, i32* %res.addr.09, i32 %y + %res.addr.09 = phi ptr [ %res, %for.body.lr.ph ], [ %add.ptr7, %for.body ] + %0 = load i32, ptr %main.addr.011, align 4 + %add.ptr = getelementptr inbounds i8, ptr %main.addr.011, i32 %main_stride + %1 = load i32, ptr %add.ptr, align 4 + %add.ptr1 = getelementptr inbounds i8, ptr %main.addr.011, i32 %add.ptr.sum + %2 = load i32, ptr %add.ptr1, align 4 + %add.ptr2 = getelementptr inbounds i8, ptr %main.addr.011, i32 %add.ptr1.sum + %3 = load i32, ptr %add.ptr2, align 4 + %add.ptr3 = getelementptr inbounds i8, ptr %main.addr.011, i32 %add.ptr4.sum + %4 = load i32, ptr %add.ptr3, align 4 + %add = add i32 %1, %0 + %add4 = add i32 %add, %2 + %add5 = add i32 %add4, %3 + %add6 = add i32 %add5, %4 + store i32 %add6, ptr %res.addr.09, align 4 + %add.ptr6 = getelementptr inbounds i8, ptr %main.addr.011, i32 %add.ptr3.sum + %add.ptr7 = getelementptr inbounds i32, ptr %res.addr.09, i32 %y %inc = add i32 %i.010, 1 %cmp = icmp eq i32 %inc, %z br i1 %cmp, label %for.end, label %for.body @@ -203,7 +198,7 @@ for.end: ; preds = %for.body, %entry ; } ; where 's' can be folded into the addressing mode. ; Consequently, we should *not* form any chains. -define void @foldedidx(i8* nocapture %a, i8* nocapture %b, i8* nocapture %c) nounwind ssp { +define void @foldedidx(ptr nocapture %a, ptr nocapture %b, ptr nocapture %c) nounwind ssp { ; A9-LABEL: foldedidx: ; A9: @ %bb.0: @ %entry ; A9-NEXT: .save {r4, r5, r6, lr} @@ -240,49 +235,49 @@ entry: for.body: ; preds = %for.body, %entry %i.07 = phi i32 [ 0, %entry ], [ %inc.3, %for.body ] - %arrayidx = getelementptr inbounds i8, i8* %a, i32 %i.07 - %0 = load i8, i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, ptr %a, i32 %i.07 + %0 = load i8, ptr %arrayidx, align 1 %conv5 = zext i8 %0 to i32 - %arrayidx1 = getelementptr inbounds i8, i8* %b, i32 %i.07 - %1 = load i8, i8* %arrayidx1, align 1 + %arrayidx1 = getelementptr inbounds i8, ptr %b, i32 %i.07 + %1 = load i8, ptr %arrayidx1, align 1 %conv26 = zext i8 %1 to i32 %add = add nsw i32 %conv26, %conv5 %conv3 = trunc i32 %add to i8 - %arrayidx4 = getelementptr inbounds i8, i8* %c, i32 %i.07 - store i8 %conv3, i8* %arrayidx4, align 1 + %arrayidx4 = getelementptr inbounds i8, ptr %c, i32 %i.07 + store i8 %conv3, ptr %arrayidx4, align 1 %inc1 = or i32 %i.07, 1 - %arrayidx.1 = getelementptr inbounds i8, i8* %a, i32 %inc1 - %2 = load i8, i8* %arrayidx.1, align 1 + %arrayidx.1 = getelementptr inbounds i8, ptr %a, i32 %inc1 + %2 = load i8, ptr %arrayidx.1, align 1 %conv5.1 = zext i8 %2 to i32 - %arrayidx1.1 = getelementptr inbounds i8, i8* %b, i32 %inc1 - %3 = load i8, i8* %arrayidx1.1, align 1 + %arrayidx1.1 = getelementptr inbounds i8, ptr %b, i32 %inc1 + %3 = load i8, ptr %arrayidx1.1, align 1 %conv26.1 = zext i8 %3 to i32 %add.1 = add nsw i32 %conv26.1, %conv5.1 %conv3.1 = trunc i32 %add.1 to i8 - %arrayidx4.1 = getelementptr inbounds i8, i8* %c, i32 %inc1 - store i8 %conv3.1, i8* %arrayidx4.1, align 1 + %arrayidx4.1 = getelementptr inbounds i8, ptr %c, i32 %inc1 + store i8 %conv3.1, ptr %arrayidx4.1, align 1 %inc.12 = or i32 %i.07, 2 - %arrayidx.2 = getelementptr inbounds i8, i8* %a, i32 %inc.12 - %4 = load i8, i8* %arrayidx.2, align 1 + %arrayidx.2 = getelementptr inbounds i8, ptr %a, i32 %inc.12 + %4 = load i8, ptr %arrayidx.2, align 1 %conv5.2 = zext i8 %4 to i32 - %arrayidx1.2 = getelementptr inbounds i8, i8* %b, i32 %inc.12 - %5 = load i8, i8* %arrayidx1.2, align 1 + %arrayidx1.2 = getelementptr inbounds i8, ptr %b, i32 %inc.12 + %5 = load i8, ptr %arrayidx1.2, align 1 %conv26.2 = zext i8 %5 to i32 %add.2 = add nsw i32 %conv26.2, %conv5.2 %conv3.2 = trunc i32 %add.2 to i8 - %arrayidx4.2 = getelementptr inbounds i8, i8* %c, i32 %inc.12 - store i8 %conv3.2, i8* %arrayidx4.2, align 1 + %arrayidx4.2 = getelementptr inbounds i8, ptr %c, i32 %inc.12 + store i8 %conv3.2, ptr %arrayidx4.2, align 1 %inc.23 = or i32 %i.07, 3 - %arrayidx.3 = getelementptr inbounds i8, i8* %a, i32 %inc.23 - %6 = load i8, i8* %arrayidx.3, align 1 + %arrayidx.3 = getelementptr inbounds i8, ptr %a, i32 %inc.23 + %6 = load i8, ptr %arrayidx.3, align 1 %conv5.3 = zext i8 %6 to i32 - %arrayidx1.3 = getelementptr inbounds i8, i8* %b, i32 %inc.23 - %7 = load i8, i8* %arrayidx1.3, align 1 + %arrayidx1.3 = getelementptr inbounds i8, ptr %b, i32 %inc.23 + %7 = load i8, ptr %arrayidx1.3, align 1 %conv26.3 = zext i8 %7 to i32 %add.3 = add nsw i32 %conv26.3, %conv5.3 %conv3.3 = trunc i32 %add.3 to i8 - %arrayidx4.3 = getelementptr inbounds i8, i8* %c, i32 %inc.23 - store i8 %conv3.3, i8* %arrayidx4.3, align 1 + %arrayidx4.3 = getelementptr inbounds i8, ptr %c, i32 %inc.23 + store i8 %conv3.3, ptr %arrayidx4.3, align 1 %inc.3 = add nsw i32 %i.07, 4 %exitcond.3 = icmp eq i32 %inc.3, 400 br i1 %exitcond.3, label %for.end, label %for.body @@ -295,7 +290,7 @@ for.end: ; preds = %for.body ; ; Loads and stores should use post-increment addressing, no add's or add.w's. ; Most importantly, there should be no spills or reloads! -define hidden void @testNeon(i8* %ref_data, i32 %ref_stride, i32 %limit, <16 x i8>* nocapture %data) nounwind optsize { +define hidden void @testNeon(ptr %ref_data, i32 %ref_stride, i32 %limit, ptr nocapture %data) nounwind optsize { ; A9-LABEL: testNeon: ; A9: @ %bb.0: ; A9-NEXT: .save {r4, r5, r7, lr} @@ -350,67 +345,67 @@ define hidden void @testNeon(i8* %ref_data, i32 %ref_stride, i32 %limit, <16 x i br label %11 ;