[llvm] r296931 - [x86] add test to show failed recognition of commuted pattern; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 3 16:06:37 PST 2017
Author: spatel
Date: Fri Mar 3 18:06:37 2017
New Revision: 296931
URL: http://llvm.org/viewvc/llvm-project?rev=296931&view=rev
Log:
[x86] add test to show failed recognition of commuted pattern; NFC
Modified:
llvm/trunk/test/CodeGen/X86/conditional-indecrement.ll
Modified: llvm/trunk/test/CodeGen/X86/conditional-indecrement.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/conditional-indecrement.ll?rev=296931&r1=296930&r2=296931&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/conditional-indecrement.ll (original)
+++ llvm/trunk/test/CodeGen/X86/conditional-indecrement.ll Fri Mar 3 18:06:37 2017
@@ -14,6 +14,20 @@ define i32 @test1(i32 %a, i32 %b) nounwi
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:
More information about the llvm-commits
mailing list