diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2016-02-13 14:57:10 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2016-02-13 14:57:10 +0000 |
| commit | a322a4af1fe8b989fe5d1bbc15de8736a26c03ca (patch) | |
| tree | 0daaa3c98a8029d259c5918dfa1c13c9d4fe7971 /test/Transforms | |
| parent | aff3ef6f6ccad9bd4e082546f8161727c2019117 (diff) | |
Notes
Diffstat (limited to 'test/Transforms')
| -rw-r--r-- | test/Transforms/InstCombine/icmp.ll | 12 | ||||
| -rw-r--r-- | test/Transforms/InstCombine/insert-extract-shuffle.ll | 30 | ||||
| -rw-r--r-- | test/Transforms/InstCombine/unpack-fca.ll | 15 | ||||
| -rw-r--r-- | test/Transforms/LoopVectorize/AArch64/loop-vectorization-factors.ll | 34 | ||||
| -rw-r--r-- | test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll | 32 |
5 files changed, 89 insertions, 34 deletions
diff --git a/test/Transforms/InstCombine/icmp.ll b/test/Transforms/InstCombine/icmp.ll index 7d6ec96b5328..1e64cd7f5820 100644 --- a/test/Transforms/InstCombine/icmp.ll +++ b/test/Transforms/InstCombine/icmp.ll @@ -1672,3 +1672,15 @@ define i1 @cmp_slt_rhs_inc(float %x, i32 %i) { %cmp = icmp slt i32 %conv, %inc ret i1 %cmp } + +; CHECK-LABEL: @PR26407 +; CHECK-NEXT: %[[addx:.*]] = add i32 %x, 2147483647 +; CHECK-NEXT: %[[addy:.*]] = add i32 %y, 2147483647 +; CHECK-NEXT: %[[cmp:.*]] = icmp uge i32 %[[addx]], %[[addy]] +; CHECK-NEXT: ret i1 %[[cmp]] +define i1 @PR26407(i32 %x, i32 %y) { + %addx = add i32 %x, 2147483647 + %addy = add i32 %y, 2147483647 + %cmp = icmp uge i32 %addx, %addy + ret i1 %cmp +} diff --git a/test/Transforms/InstCombine/insert-extract-shuffle.ll b/test/Transforms/InstCombine/insert-extract-shuffle.ll index 47c2a139a479..8ed4db8bbbc3 100644 --- a/test/Transforms/InstCombine/insert-extract-shuffle.ll +++ b/test/Transforms/InstCombine/insert-extract-shuffle.ll @@ -175,3 +175,33 @@ bb3: ret <4 x double> %tmp4 } +; PR26354: https://llvm.org/bugs/show_bug.cgi?id=26354 +; Don't create a shufflevector if we know that we're not going to replace the insertelement. + +define double @pr26354(<2 x double>* %tmp, i1 %B) { +; CHECK-LABEL: @pr26354( +; CHECK: %ld = load <2 x double>, <2 x double>* %tmp +; CHECK-NEXT: %e1 = extractelement <2 x double> %ld, i32 0 +; CHECK-NEXT: br i1 %B, label %if, label %end +; CHECK: if: +; CHECK-NEXT: %e2 = extractelement <2 x double> %ld, i32 1 +; CHECK-NEXT: %i1 = insertelement <4 x double> +; CHECK-NEXT: br label %end + +entry: + %ld = load <2 x double>, <2 x double>* %tmp + %e1 = extractelement <2 x double> %ld, i32 0 + %e2 = extractelement <2 x double> %ld, i32 1 + br i1 %B, label %if, label %end + +if: + %i1 = insertelement <4 x double> zeroinitializer, double %e2, i32 3 + br label %end + +end: + %ph = phi <4 x double> [ undef, %entry ], [ %i1, %if ] + %e3 = extractelement <4 x double> %ph, i32 1 + %mu = fmul double %e1, %e3 + ret double %mu +} + diff --git a/test/Transforms/InstCombine/unpack-fca.ll b/test/Transforms/InstCombine/unpack-fca.ll index 9b8d10457491..435983924b77 100644 --- a/test/Transforms/InstCombine/unpack-fca.ll +++ b/test/Transforms/InstCombine/unpack-fca.ll @@ -136,3 +136,18 @@ define %B @structB(%B* %b.ptr) { %1 = load %B, %B* %b.ptr, align 8 ret %B %1 } + +%struct.S = type <{ i8, %struct.T }> +%struct.T = type { i32, i32 } + +; Make sure that we do not increase alignment of packed struct element +define i32 @packed_alignment(%struct.S* dereferenceable(9) %s) { +; CHECK-LABEL: packed_alignment +; CHECK-NEXT: %tv.elt1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 1, i32 1 +; CHECK-NEXT: %tv.unpack2 = load i32, i32* %tv.elt1, align 1 +; CHECK-NEXT: ret i32 %tv.unpack2 + %t = getelementptr inbounds %struct.S, %struct.S* %s, i32 0, i32 1 + %tv = load %struct.T, %struct.T* %t, align 1 + %v = extractvalue %struct.T %tv, 1 + ret i32 %v +} diff --git a/test/Transforms/LoopVectorize/AArch64/loop-vectorization-factors.ll b/test/Transforms/LoopVectorize/AArch64/loop-vectorization-factors.ll index eee310491805..51f899c2f645 100644 --- a/test/Transforms/LoopVectorize/AArch64/loop-vectorization-factors.ll +++ b/test/Transforms/LoopVectorize/AArch64/loop-vectorization-factors.ll @@ -205,39 +205,5 @@ for.body: ; preds = %for.body, %for.body br i1 %exitcond, label %for.cond.cleanup, label %for.body } -; CHECK-LABEL: @add_g -; CHECK: load <16 x i8> -; CHECK: xor <16 x i8> -; CHECK: icmp ult <16 x i8> -; CHECK: select <16 x i1> {{.*}}, <16 x i8> -; CHECK: store <16 x i8> -define void @add_g(i8* noalias nocapture readonly %p, i8* noalias nocapture readonly %q, i8* noalias nocapture %r, i8 %arg1, i32 %len) #0 { - %1 = icmp sgt i32 %len, 0 - br i1 %1, label %.lr.ph, label %._crit_edge - -.lr.ph: ; preds = %0 - %2 = sext i8 %arg1 to i64 - br label %3 - -._crit_edge: ; preds = %3, %0 - ret void - -; <label>:3 ; preds = %3, %.lr.ph - %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %3 ] - %x4 = getelementptr inbounds i8, i8* %p, i64 %indvars.iv - %x5 = load i8, i8* %x4 - %x7 = getelementptr inbounds i8, i8* %q, i64 %indvars.iv - %x8 = load i8, i8* %x7 - %x9 = zext i8 %x5 to i32 - %x10 = xor i32 %x9, 255 - %x11 = icmp ult i32 %x10, 24 - %x12 = select i1 %x11, i32 %x10, i32 24 - %x13 = trunc i32 %x12 to i8 - store i8 %x13, i8* %x4 - %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 - %lftr.wideiv = trunc i64 %indvars.iv.next to i32 - %exitcond = icmp eq i32 %lftr.wideiv, %len - br i1 %exitcond, label %._crit_edge, label %3 -} attributes #0 = { nounwind } diff --git a/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll b/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll index cae1a91bd43d..6953cf9c8b33 100644 --- a/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll +++ b/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll @@ -1302,3 +1302,35 @@ l6: ; CHECK: entry ; CHECK-NEXT: switch } + +; Speculation depth must be limited to avoid a zero-cost instruction cycle. + +; CHECK-LABEL: @PR26308( +; CHECK: cleanup4: +; CHECK-NEXT: br label %cleanup4 + +define i32 @PR26308(i1 %B, i64 %load) { +entry: + br label %while.body + +while.body: + br label %cleanup + +cleanup: + %cleanup.dest.slot.0 = phi i1 [ false, %while.body ] + br i1 %cleanup.dest.slot.0, label %for.cond, label %cleanup4 + +for.cond: + %e.0 = phi i64* [ undef, %cleanup ], [ %incdec.ptr, %for.cond2 ] + %pi = ptrtoint i64* %e.0 to i64 + %incdec.ptr = getelementptr inbounds i64, i64* %e.0, i64 1 + br label %for.cond2 + +for.cond2: + %storemerge = phi i64 [ %pi, %for.cond ], [ %load, %for.cond2 ] + br i1 %B, label %for.cond2, label %for.cond + +cleanup4: + br label %while.body +} + |
