diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2015-08-11 15:56:31 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2015-08-11 15:56:31 +0000 |
| commit | fec7965b36b216434a0529255041bbc1eda6d0ce (patch) | |
| tree | 36ad39bae979bdaa50205e94e14d2dc04b92d849 /llvm/test | |
| parent | 7d9e1e125930404a7ebce2e8d584b34a9065d530 (diff) | |
| download | bcm5719-llvm-fec7965b36b216434a0529255041bbc1eda6d0ce.tar.gz bcm5719-llvm-fec7965b36b216434a0529255041bbc1eda6d0ce.zip | |
fix minsize detection: minsize attribute implies optimizing for size
llvm-svn: 244617
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/LoopVectorize/optsize.ll | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/llvm/test/Transforms/LoopVectorize/optsize.ll b/llvm/test/Transforms/LoopVectorize/optsize.ll index aa0ee0eadb2..513657cd372 100644 --- a/llvm/test/Transforms/LoopVectorize/optsize.ll +++ b/llvm/test/Transforms/LoopVectorize/optsize.ll @@ -1,17 +1,17 @@ ; This test verifies that the loop vectorizer will NOT produce a tail -; loop with Optimize for size attibute. +; loop with the optimize for size or the minimize size attributes. ; REQUIRES: asserts -; RUN: opt < %s -loop-vectorize -debug -debug-only=loop-vectorize -S 2>&1 | FileCheck %s - -; CHECK-NOT: <2 x i8> -; CHECK-NOT: <4 x i8> -; CHECK: Aborting. A tail loop is required in Os. +; RUN: opt < %s -loop-vectorize -S | FileCheck %s target datalayout = "E-m:e-p:32:32-i64:32-f64:32:64-a:0:32-n32-S128" @tab = common global [32 x i8] zeroinitializer, align 1 -define i32 @foo() #0 { +define i32 @foo_optsize() #0 { +; CHECK-LABEL: @foo_optsize( +; CHECK-NOT: <2 x i8> +; CHECK-NOT: <4 x i8> + entry: br label %for.body @@ -32,3 +32,28 @@ for.end: ; preds = %for.body attributes #0 = { optsize } +define i32 @foo_minsize() #1 { +; CHECK-LABEL: @foo_minsize( +; CHECK-NOT: <2 x i8> +; CHECK-NOT: <4 x i8> + +entry: + br label %for.body + +for.body: ; preds = %for.body, %entry + %i.08 = phi i32 [ 0, %entry ], [ %inc, %for.body ] + %arrayidx = getelementptr inbounds [32 x i8], [32 x i8]* @tab, i32 0, i32 %i.08 + %0 = load i8, i8* %arrayidx, align 1 + %cmp1 = icmp eq i8 %0, 0 + %. = select i1 %cmp1, i8 2, i8 1 + store i8 %., i8* %arrayidx, align 1 + %inc = add nsw i32 %i.08, 1 + %exitcond = icmp eq i32 %i.08, 202 + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body + ret i32 0 +} + +attributes #1 = { minsize } + |

