diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-28 21:22:49 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-28 21:22:49 +0000 |
commit | b2b7c066a48f61ec67332fb797a20bb04901c83d (patch) | |
tree | b3de3914f41bb160a795f7dcd767566c62bdf3e8 /test/CodeGen/X86/setcc-combine.ll | |
parent | fd4675b5a029cce616a1b0ad339344c5df800ea6 (diff) | |
download | src-b2b7c066a48f61ec67332fb797a20bb04901c83d.tar.gz src-b2b7c066a48f61ec67332fb797a20bb04901c83d.zip |
Vendor import of llvm trunk r321530:vendor/llvm/llvm-trunk-r321530
Notes
Notes:
svn path=/vendor/llvm/dist/; revision=327300
svn path=/vendor/llvm/llvm-trunk-r321530/; revision=327301; tag=vendor/llvm/llvm-trunk-r321530
Diffstat (limited to 'test/CodeGen/X86/setcc-combine.ll')
-rw-r--r-- | test/CodeGen/X86/setcc-combine.ll | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeGen/X86/setcc-combine.ll b/test/CodeGen/X86/setcc-combine.ll index a4a8e67d742c..56cff4ab6f2f 100644 --- a/test/CodeGen/X86/setcc-combine.ll +++ b/test/CodeGen/X86/setcc-combine.ll @@ -183,3 +183,27 @@ define i32 @test_gt_2(<4 x i32> %A, <4 x i32> %B) { ret i32 %t1 } +; (and (setne X, 0), (setne X, -1)) --> (setuge (add X, 1), 2) +; Don't combine with i1 - out of range constant +define void @test_i1_uge(i1 *%A2) { +; CHECK-LABEL: test_i1_uge: +; CHECK: # %bb.0: +; CHECK-NEXT: movb (%rdi), %al +; CHECK-NEXT: movl %eax, %ecx +; CHECK-NEXT: xorb $1, %cl +; CHECK-NEXT: andb %cl, %al +; CHECK-NEXT: movzbl %al, %eax +; CHECK-NEXT: andl $1, %eax +; CHECK-NEXT: negq %rax +; CHECK-NEXT: andb $1, %cl +; CHECK-NEXT: movb %cl, (%rdi,%rax) +; CHECK-NEXT: retq + %L5 = load i1, i1* %A2 + %C3 = icmp ne i1 %L5, true + %C8 = icmp eq i1 %L5, false + %C9 = icmp ugt i1 %C3, %C8 + %G3 = getelementptr i1, i1* %A2, i1 %C9 + store i1 %C3, i1* %G3 + ret void +} + |