summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-03-04 00:06:37 +0000
committerSanjay Patel <spatel@rotateright.com>2017-03-04 00:06:37 +0000
commit71c1958fca2852cd418f89250547861b7c9bb016 (patch)
treecb040e3fc8fdc1b743b9397ece4c8aee597a4933 /llvm
parent9739a552c24a63c8a7070c04fdfde438472bb6e7 (diff)
downloadbcm5719-llvm-71c1958fca2852cd418f89250547861b7c9bb016.tar.gz
bcm5719-llvm-71c1958fca2852cd418f89250547861b7c9bb016.zip
[x86] add test to show failed recognition of commuted pattern; NFC
llvm-svn: 296931
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/CodeGen/X86/conditional-indecrement.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/conditional-indecrement.ll b/llvm/test/CodeGen/X86/conditional-indecrement.ll
index 8397c6bb1e4..1dc083290f2 100644
--- a/llvm/test/CodeGen/X86/conditional-indecrement.ll
+++ b/llvm/test/CodeGen/X86/conditional-indecrement.ll
@@ -14,6 +14,20 @@ define i32 @test1(i32 %a, i32 %b) nounwind readnone {
ret i32 %retval.0
}
+define i32 @test1_commute(i32 %a, i32 %b) nounwind readnone {
+; CHECK-LABEL: test1_commute:
+; CHECK: # BB#0:
+; CHECK-NEXT: xorl %eax, %eax
+; CHECK-NEXT: testl %edi, %edi
+; CHECK-NEXT: setne %al
+; CHECK-NEXT: addl %esi, %eax
+; CHECK-NEXT: retq
+ %cmp = icmp ne i32 %a, 0
+ %inc = zext i1 %cmp to i32
+ %ret = add i32 %b, %inc
+ ret i32 %ret
+}
+
define i32 @test2(i32 %a, i32 %b) nounwind readnone {
; CHECK-LABEL: test2:
; CHECK: # BB#0:
OpenPOWER on IntegriCloud