diff options
author | Eric Christopher <echristo@gmail.com> | 2019-04-17 02:12:23 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2019-04-17 02:12:23 +0000 |
commit | a86343512845c9c1fdbac865fea88aa5fce7142a (patch) | |
tree | 666fc6353de19ad8b00e56b67edd33f24104e4a7 /llvm/test/Transforms/Inline/ARM | |
parent | 7f8ca6e3679b3af951cb7a4b1377edfaa3244b93 (diff) | |
download | bcm5719-llvm-a86343512845c9c1fdbac865fea88aa5fce7142a.tar.gz bcm5719-llvm-a86343512845c9c1fdbac865fea88aa5fce7142a.zip |
Temporarily Revert "Add basic loop fusion pass."
As it's causing some bot failures (and per request from kbarton).
This reverts commit r358543/ab70da07286e618016e78247e4a24fcb84077fda.
llvm-svn: 358546
Diffstat (limited to 'llvm/test/Transforms/Inline/ARM')
-rw-r--r-- | llvm/test/Transforms/Inline/ARM/inline-fp.ll | 113 | ||||
-rw-r--r-- | llvm/test/Transforms/Inline/ARM/inline-target-attr.ll | 60 | ||||
-rw-r--r-- | llvm/test/Transforms/Inline/ARM/lit.local.cfg | 2 | ||||
-rw-r--r-- | llvm/test/Transforms/Inline/ARM/loop-add.ll | 95 | ||||
-rw-r--r-- | llvm/test/Transforms/Inline/ARM/loop-memcpy.ll | 87 | ||||
-rw-r--r-- | llvm/test/Transforms/Inline/ARM/loop-noinline.ll | 49 |
6 files changed, 0 insertions, 406 deletions
diff --git a/llvm/test/Transforms/Inline/ARM/inline-fp.ll b/llvm/test/Transforms/Inline/ARM/inline-fp.ll deleted file mode 100644 index be3dd2a93fd..00000000000 --- a/llvm/test/Transforms/Inline/ARM/inline-fp.ll +++ /dev/null @@ -1,113 +0,0 @@ -; RUN: opt -S -inline -mtriple=arm-eabi -pass-remarks=.* -pass-remarks-missed=.* < %s 2>&1 | FileCheck %s -check-prefix=NOFP -; RUN: opt -S -inline -mtriple=arm-eabi -mattr=+vfp2 -pass-remarks=.* -pass-remarks-missed=.* < %s 2>&1 | FileCheck %s -check-prefix=FULLFP -; RUN: opt -S -inline -mtriple=arm-eabi -mattr=+vfp2,+fp-only-sp -pass-remarks=.* -pass-remarks-missed=.* < %s 2>&1 | FileCheck %s -check-prefix=SINGLEFP -; Make sure that soft float implementations are calculated as being more expensive -; to the inliner. - -; NOFP-DAG: single not inlined into test_single because too costly to inline (cost=125, threshold=75) -; NOFP-DAG: single not inlined into test_single because too costly to inline (cost=125, threshold=75) -; NOFP-DAG: single_cheap inlined into test_single_cheap with (cost=-15, threshold=75) -; NOFP-DAG: single_cheap inlined into test_single_cheap with (cost=-15015, threshold=75) -; NOFP-DAG: double not inlined into test_double because too costly to inline (cost=125, threshold=75) -; NOFP-DAG: double not inlined into test_double because too costly to inline (cost=125, threshold=75) -; NOFP-DAG: single_force_soft not inlined into test_single_force_soft because too costly to inline (cost=125, threshold=75) -; NOFP-DAG: single_force_soft not inlined into test_single_force_soft because too costly to inline (cost=125, threshold=75) - -; FULLFP-DAG: single inlined into test_single with (cost=0, threshold=75) -; FULLFP-DAG: single inlined into test_single with (cost=-15000, threshold=75) -; FULLFP-DAG: single_cheap inlined into test_single_cheap with (cost=-15, threshold=75) -; FULLFP-DAG: single_cheap inlined into test_single_cheap with (cost=-15015, threshold=75) -; FULLFP-DAG: double inlined into test_double with (cost=0, threshold=75) -; FULLFP-DAG: double inlined into test_double with (cost=-15000, threshold=75) -; FULLFP-DAG: single_force_soft not inlined into test_single_force_soft because too costly to inline (cost=125, threshold=75) -; FULLFP-DAG: single_force_soft not inlined into test_single_force_soft because too costly to inline (cost=125, threshold=75) - -; SINGLEFP-DAG: single inlined into test_single with (cost=0, threshold=75) -; SINGLEFP-DAG: single inlined into test_single with (cost=-15000, threshold=75) -; SINGLEFP-DAG: single_cheap inlined into test_single_cheap with (cost=-15, threshold=75) -; SINGLEFP-DAG: single_cheap inlined into test_single_cheap with (cost=-15015, threshold=75) -; SINGLEFP-DAG: double not inlined into test_double because too costly to inline (cost=125, threshold=75) -; SINGLEFP-DAG: double not inlined into test_double because too costly to inline (cost=125, threshold=75) -; SINGLEFP-DAG: single_force_soft not inlined into test_single_force_soft because too costly to inline (cost=125, threshold=75) -; SINGLEFP-DAG: single_force_soft not inlined into test_single_force_soft because too costly to inline (cost=125, threshold=75) - -define i32 @test_single(i32 %a, i8 %b, i32 %c, i8 %d) #0 { - %call = call float @single(i32 %a, i8 zeroext %b) - %call2 = call float @single(i32 %c, i8 zeroext %d) - ret i32 0 -} - -define i32 @test_single_cheap(i32 %a, i8 %b, i32 %c, i8 %d) #0 { - %call = call float @single_cheap(i32 %a, i8 zeroext %b) - %call2 = call float @single_cheap(i32 %c, i8 zeroext %d) - ret i32 0 -} - -define i32 @test_double(i32 %a, i8 %b, i32 %c, i8 %d) #0 { - %call = call double @double(i32 %a, i8 zeroext %b) - %call2 = call double @double(i32 %c, i8 zeroext %d) - ret i32 0 -} - -define i32 @test_single_force_soft(i32 %a, i8 %b, i32 %c, i8 %d) #1 { - %call = call float @single_force_soft(i32 %a, i8 zeroext %b) #1 - %call2 = call float @single_force_soft(i32 %c, i8 zeroext %d) #1 - ret i32 0 -} - -define internal float @single(i32 %response, i8 zeroext %value1) #0 { -entry: - %conv = zext i8 %value1 to i32 - %sub = add nsw i32 %conv, -1 - %conv1 = sitofp i32 %sub to float - %0 = tail call float @llvm.pow.f32(float 0x3FF028F5C0000000, float %conv1) - %mul = fmul float %0, 2.620000e+03 - %conv2 = sitofp i32 %response to float - %sub3 = fsub float %conv2, %mul - %div = fdiv float %sub3, %mul - ret float %div -} - -define internal float @single_cheap(i32 %response, i8 zeroext %value1) #0 { -entry: - %conv = zext i8 %value1 to i32 - %sub = add nsw i32 %conv, -1 - %conv1 = bitcast i32 %sub to float - %conv2 = bitcast i32 %response to float - %0 = tail call float @llvm.pow.f32(float %conv2, float %conv1) - %1 = tail call float @llvm.pow.f32(float %0, float %0) - %2 = tail call float @llvm.pow.f32(float %1, float %1) - ret float %2 -} - -define internal double @double(i32 %response, i8 zeroext %value1) #0 { -entry: - %conv = zext i8 %value1 to i32 - %sub = add nsw i32 %conv, -1 - %conv1 = sitofp i32 %sub to double - %0 = tail call double @llvm.pow.f64(double 0x3FF028F5C0000000, double %conv1) - %mul = fmul double %0, 2.620000e+03 - %conv2 = sitofp i32 %response to double - %sub3 = fsub double %conv2, %mul - %div = fdiv double %sub3, %mul - ret double %div -} - -define internal float @single_force_soft(i32 %response, i8 zeroext %value1) #1 { -entry: - %conv = zext i8 %value1 to i32 - %sub = add nsw i32 %conv, -1 - %conv1 = sitofp i32 %sub to float - %0 = tail call float @llvm.pow.f32(float 0x3FF028F5C0000000, float %conv1) - %mul = fmul float %0, 2.620000e+03 - %conv2 = sitofp i32 %response to float - %sub3 = fsub float %conv2, %mul - %div = fdiv float %sub3, %mul - ret float %div -} - -declare float @llvm.pow.f32(float, float) optsize minsize -declare double @llvm.pow.f64(double, double) optsize minsize - -attributes #0 = { optsize } -attributes #1 = { optsize "use-soft-float"="true" "target-features"="+soft-float" } diff --git a/llvm/test/Transforms/Inline/ARM/inline-target-attr.ll b/llvm/test/Transforms/Inline/ARM/inline-target-attr.ll deleted file mode 100644 index 5bbecd20352..00000000000 --- a/llvm/test/Transforms/Inline/ARM/inline-target-attr.ll +++ /dev/null @@ -1,60 +0,0 @@ -; RUN: opt < %s -mtriple=arm-unknown-linux-gnu -S -inline | FileCheck %s -; RUN: opt < %s -mtriple=arm-unknown-linux-gnu -S -passes='cgscc(inline)' | FileCheck %s -; Check that we only inline when we have compatible target attributes. -; ARM has implemented a target attribute that will verify that the attribute -; sets are compatible. - -define i32 @foo() #0 { -entry: - %call = call i32 (...) @baz() - ret i32 %call -; CHECK-LABEL: foo -; CHECK: call i32 (...) @baz() -} -declare i32 @baz(...) #0 - -define i32 @bar() #1 { -entry: - %call = call i32 @foo() - ret i32 %call -; CHECK-LABEL: bar -; CHECK: call i32 (...) @baz() -} - -define i32 @qux() #0 { -entry: - %call = call i32 @bar() - ret i32 %call -; CHECK-LABEL: qux -; CHECK: call i32 @bar() -} - -define i32 @thumb_fn() #2 { -entry: - %call = call i32 @foo() - ret i32 %call -; CHECK-LABEL: thumb_fn -; CHECK: call i32 @foo -} - -define i32 @strict_align() #3 { -entry: - %call = call i32 @foo() - ret i32 %call -; CHECK-LABEL: strict_align -; CHECK: call i32 (...) @baz() -} - -define i32 @soft_float_fn() #4 { -entry: - %call = call i32 @foo() - ret i32 %call -; CHECK-LABEL: soft_float_fn -; CHECK: call i32 @foo -} - -attributes #0 = { "target-cpu"="generic" "target-features"="+dsp,+neon" } -attributes #1 = { "target-cpu"="generic" "target-features"="+dsp,+neon,+fp16" } -attributes #2 = { "target-cpu"="generic" "target-features"="+dsp,+neon,+fp16,+thumb-mode" } -attributes #3 = { "target-cpu"="generic" "target-features"="+dsp,+neon,+strict-align" } -attributes #4 = { "target-cpu"="generic" "target-features"="+dsp,+neon,+fp16,+soft-float" } diff --git a/llvm/test/Transforms/Inline/ARM/lit.local.cfg b/llvm/test/Transforms/Inline/ARM/lit.local.cfg deleted file mode 100644 index 236e1d34416..00000000000 --- a/llvm/test/Transforms/Inline/ARM/lit.local.cfg +++ /dev/null @@ -1,2 +0,0 @@ -if not 'ARM' in config.root.targets: - config.unsupported = True diff --git a/llvm/test/Transforms/Inline/ARM/loop-add.ll b/llvm/test/Transforms/Inline/ARM/loop-add.ll deleted file mode 100644 index a4717bc95b7..00000000000 --- a/llvm/test/Transforms/Inline/ARM/loop-add.ll +++ /dev/null @@ -1,95 +0,0 @@ -; RUN: opt -inline %s -S | FileCheck %s - -target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" -target triple = "thumbv7m-arm-none-eabi" - -; CHECK-LABEL: void @doCalls -define void @doCalls(i8* nocapture %p1, i8* nocapture %p2, i32 %n) #0 { -entry: - %div = lshr i32 %n, 1 -; CHECK: call void @LoopCall - tail call void @LoopCall(i8* %p1, i8* %p2, i32 %div) #0 - - %div2 = lshr i32 %n, 2 -; CHECK: call void @LoopCall - tail call void @LoopCall(i8* %p1, i8* %p2, i32 %div2) #0 - -; CHECK-NOT: call void @LoopCall - tail call void @LoopCall(i8* %p2, i8* %p1, i32 0) #0 - -; CHECK-NOT: call void @LoopCall_internal - tail call void @LoopCall_internal(i8* %p1, i8* %p2, i32 %div2) #0 - - %div3 = lshr i32 %n, 4 -; CHECK-NOT: call void @SimpleCall - tail call void @SimpleCall(i8* %p2, i8* %p1, i32 %div3) #0 - ret void -} - -; CHECK-LABEL: define void @LoopCall -define void @LoopCall(i8* nocapture %dest, i8* nocapture readonly %source, i32 %num) #0 { -entry: - %c = icmp ne i32 %num, 0 - br i1 %c, label %while.cond, label %while.end - -while.cond: ; preds = %while.body, %entry - %num.addr.0 = phi i32 [ %num, %entry ], [ %dec, %while.body ] - %p_dest.0 = phi i8* [ %dest, %entry ], [ %incdec.ptr2, %while.body ] - %p_source.0 = phi i8* [ %source, %entry ], [ %incdec.ptr, %while.body ] - %cmp = icmp eq i32 %num.addr.0, 0 - br i1 %cmp, label %while.end, label %while.body - -while.body: ; preds = %while.cond - %incdec.ptr = getelementptr inbounds i8, i8* %p_source.0, i32 1 - %0 = load i8, i8* %p_source.0, align 1 - %1 = trunc i32 %num.addr.0 to i8 - %conv1 = add i8 %0, %1 - %incdec.ptr2 = getelementptr inbounds i8, i8* %p_dest.0, i32 1 - store i8 %conv1, i8* %p_dest.0, align 1 - %dec = add i32 %num.addr.0, -1 - br label %while.cond - -while.end: ; preds = %while.cond - ret void -} - -; CHECK-LABEL-NOT: define void @LoopCall_internal -define internal void @LoopCall_internal(i8* nocapture %dest, i8* nocapture readonly %source, i32 %num) #0 { -entry: - %c = icmp ne i32 %num, 0 - br i1 %c, label %while.cond, label %while.end - -while.cond: ; preds = %while.body, %entry - %num.addr.0 = phi i32 [ %num, %entry ], [ %dec, %while.body ] - %p_dest.0 = phi i8* [ %dest, %entry ], [ %incdec.ptr2, %while.body ] - %p_source.0 = phi i8* [ %source, %entry ], [ %incdec.ptr, %while.body ] - %cmp = icmp eq i32 %num.addr.0, 0 - br i1 %cmp, label %while.end, label %while.body - -while.body: ; preds = %while.cond - %incdec.ptr = getelementptr inbounds i8, i8* %p_source.0, i32 1 - %0 = load i8, i8* %p_source.0, align 1 - %1 = trunc i32 %num.addr.0 to i8 - %conv1 = add i8 %0, %1 - %incdec.ptr2 = getelementptr inbounds i8, i8* %p_dest.0, i32 1 - store i8 %conv1, i8* %p_dest.0, align 1 - %dec = add i32 %num.addr.0, -1 - br label %while.cond - -while.end: ; preds = %while.cond - ret void -} - -; CHECK-LABEL: define void @SimpleCall -define void @SimpleCall(i8* nocapture %dest, i8* nocapture readonly %source, i32 %num) #0 { -entry: - %arrayidx = getelementptr inbounds i8, i8* %source, i32 %num - %0 = load i8, i8* %arrayidx, align 1 - %1 = xor i8 %0, 127 - %arrayidx2 = getelementptr inbounds i8, i8* %dest, i32 %num - store i8 %1, i8* %arrayidx2, align 1 - ret void -} - -attributes #0 = { minsize optsize } - diff --git a/llvm/test/Transforms/Inline/ARM/loop-memcpy.ll b/llvm/test/Transforms/Inline/ARM/loop-memcpy.ll deleted file mode 100644 index 3b3625c6027..00000000000 --- a/llvm/test/Transforms/Inline/ARM/loop-memcpy.ll +++ /dev/null @@ -1,87 +0,0 @@ -; RUN: opt -inline %s -S | FileCheck %s - -target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" -target triple = "thumbv7m-arm-none-eabi" - -; CHECK-LABEL: define void @matcpy -define void @matcpy(i8* %dest, i8* %source, i32 %num) #0 { -entry: - %0 = ptrtoint i8* %dest to i32 - %1 = ptrtoint i8* %source to i32 - %2 = xor i32 %0, %1 - %3 = and i32 %2, 3 - %cmp = icmp eq i32 %3, 0 - br i1 %cmp, label %if.then, label %if.else20 - -if.then: ; preds = %entry - %sub = sub i32 0, %0 - %and2 = and i32 %sub, 3 - %add = or i32 %and2, 4 - %cmp3 = icmp ugt i32 %add, %num - br i1 %cmp3, label %if.else, label %if.then4 - -if.then4: ; preds = %if.then - %sub5 = sub i32 %num, %and2 - %shr = and i32 %sub5, -4 - %sub7 = sub i32 %sub5, %shr - %tobool = icmp eq i32 %and2, 0 - br i1 %tobool, label %if.end, label %if.then8 - -if.then8: ; preds = %if.then4 -; CHECK: call fastcc void @memcpy - call fastcc void @memcpy(i8* %dest, i8* %source, i32 %and2) #0 - %add.ptr = getelementptr inbounds i8, i8* %dest, i32 %and2 - %add.ptr9 = getelementptr inbounds i8, i8* %source, i32 %and2 - br label %if.end - -if.end: ; preds = %if.then4, %if.then8 - %p_dest.0 = phi i8* [ %add.ptr, %if.then8 ], [ %dest, %if.then4 ] - %p_source.0 = phi i8* [ %add.ptr9, %if.then8 ], [ %source, %if.then4 ] - %tobool14 = icmp eq i32 %sub7, 0 - br i1 %tobool14, label %if.end22, label %if.then15 - -if.then15: ; preds = %if.end - %add.ptr13 = getelementptr inbounds i8, i8* %p_source.0, i32 %shr - %add.ptr11 = getelementptr inbounds i8, i8* %p_dest.0, i32 %shr -; CHECK: call fastcc void @memcpy - call fastcc void @memcpy(i8* %add.ptr11, i8* %add.ptr13, i32 %sub7) #0 - br label %if.end22 - -if.else: ; preds = %if.then - call fastcc void @memcpy(i8* %dest, i8* %source, i32 %num) #0 - br label %if.end22 - -if.else20: ; preds = %entry - call fastcc void @memcpy(i8* %dest, i8* %source, i32 %num) #0 - br label %if.end22 - -if.end22: ; preds = %if.then15, %if.end, %if.else, %if.else20 - ret void -} - -; CHECK-LABEL: define internal void @memcpy -define internal void @memcpy(i8* nocapture %dest, i8* nocapture readonly %source, i32 %num) #0 { -entry: - br label %while.cond - -while.cond: ; preds = %while.body, %entry - %num.addr.0 = phi i32 [ %num, %entry ], [ %dec, %while.body ] - %p_dest.0 = phi i8* [ %dest, %entry ], [ %incdec.ptr1, %while.body ] - %p_source.0 = phi i8* [ %source, %entry ], [ %incdec.ptr, %while.body ] - %cmp = icmp eq i32 %num.addr.0, 0 - br i1 %cmp, label %while.end, label %while.body - -while.body: ; preds = %while.cond - %incdec.ptr = getelementptr inbounds i8, i8* %p_source.0, i32 1 - %0 = load i8, i8* %p_source.0, align 1 - %incdec.ptr1 = getelementptr inbounds i8, i8* %p_dest.0, i32 1 - store i8 %0, i8* %p_dest.0, align 1 - %dec = add i32 %num.addr.0, -1 - br label %while.cond - -while.end: ; preds = %while.cond - ret void -} - -attributes #0 = { minsize optsize } - diff --git a/llvm/test/Transforms/Inline/ARM/loop-noinline.ll b/llvm/test/Transforms/Inline/ARM/loop-noinline.ll deleted file mode 100644 index 8438d16b03e..00000000000 --- a/llvm/test/Transforms/Inline/ARM/loop-noinline.ll +++ /dev/null @@ -1,49 +0,0 @@ -; RUN: opt -inline %s -S | FileCheck %s - -target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" -target triple = "thumbv7m-arm-none-eabi" - -; Check we don't inline loops at -Oz. They tend to be larger than we -; expect. - -; CHECK: define i8* @H -@digits = constant [16 x i8] c"0123456789ABCDEF", align 1 -define i8* @H(i8* %p, i32 %val, i32 %num) #0 { -entry: - br label %do.body - -do.body: ; preds = %do.body, %entry - %p.addr.0 = phi i8* [ %p, %entry ], [ %incdec.ptr, %do.body ] - %val.addr.0 = phi i32 [ %val, %entry ], [ %shl, %do.body ] - %num.addr.0 = phi i32 [ %num, %entry ], [ %dec, %do.body ] - %shr = lshr i32 %val.addr.0, 28 - %arrayidx = getelementptr inbounds [16 x i8], [16 x i8]* @digits, i32 0, i32 %shr - %0 = load i8, i8* %arrayidx, align 1 - %incdec.ptr = getelementptr inbounds i8, i8* %p.addr.0, i32 1 - store i8 %0, i8* %p.addr.0, align 1 - %shl = shl i32 %val.addr.0, 4 - %dec = add i32 %num.addr.0, -1 - %tobool = icmp eq i32 %dec, 0 - br i1 %tobool, label %do.end, label %do.body - -do.end: ; preds = %do.body - %scevgep = getelementptr i8, i8* %p, i32 %num - ret i8* %scevgep -} - -define nonnull i8* @call1(i8* %p, i32 %val, i32 %num) #0 { -entry: -; CHECK: tail call i8* @H - %call = tail call i8* @H(i8* %p, i32 %val, i32 %num) #0 - ret i8* %call -} - -define nonnull i8* @call2(i8* %p, i32 %val) #0 { -entry: -; CHECK: tail call i8* @H - %call = tail call i8* @H(i8* %p, i32 %val, i32 32) #0 - ret i8* %call -} - -attributes #0 = { minsize optsize } - |