diff options
| author | Amaury Sechet <deadalnix@gmail.com> | 2017-02-05 14:22:20 +0000 |
|---|---|---|
| committer | Amaury Sechet <deadalnix@gmail.com> | 2017-02-05 14:22:20 +0000 |
| commit | 143902c29fbfd2036e603d5feec78ed39966ca3b (patch) | |
| tree | dfda48b46e0845622518448640f58ff3a01ce7c5 /llvm/test/CodeGen | |
| parent | c3ac566754eb4e46e98e7e444f2239872e2801ed (diff) | |
| download | bcm5719-llvm-143902c29fbfd2036e603d5feec78ed39966ca3b.tar.gz bcm5719-llvm-143902c29fbfd2036e603d5feec78ed39966ca3b.zip | |
[DAGCombiner] Leverage add's commutativity
Summary: This avoid the need to duplicate all pattern and actually end up exposing some opportunity to optimize existing pattern that did not exists in both directions on an existing test case.
Reviewers: mkuper, spatel, bkramer, RKSimon, zvi
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D29541
llvm-svn: 294125
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/X86/adde-carry.ll | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/llvm/test/CodeGen/X86/adde-carry.ll b/llvm/test/CodeGen/X86/adde-carry.ll index 0eae984525b..e111f683dd3 100644 --- a/llvm/test/CodeGen/X86/adde-carry.ll +++ b/llvm/test/CodeGen/X86/adde-carry.ll @@ -29,9 +29,8 @@ define void @b(i32* nocapture %r, i64 %a, i64 %b, i32 %c) nounwind { ; CHECK: # BB#0: # %entry ; CHECK-NEXT: addq %rdx, %rsi ; CHECK-NEXT: sbbq %rax, %rax -; CHECK-NEXT: andl $1, %eax -; CHECK-NEXT: addl %ecx, %eax -; CHECK-NEXT: movl %eax, (%rdi) +; CHECK-NEXT: subl %eax, %ecx +; CHECK-NEXT: movl %ecx, (%rdi) ; CHECK-NEXT: retq entry: %0 = zext i64 %a to i128 @@ -50,9 +49,8 @@ define void @c(i16* nocapture %r, i64 %a, i64 %b, i16 %c) nounwind { ; CHECK: # BB#0: # %entry ; CHECK-NEXT: addq %rdx, %rsi ; CHECK-NEXT: sbbq %rax, %rax -; CHECK-NEXT: andl $1, %eax -; CHECK-NEXT: addl %ecx, %eax -; CHECK-NEXT: movw %ax, (%rdi) +; CHECK-NEXT: subl %eax, %ecx +; CHECK-NEXT: movw %cx, (%rdi) ; CHECK-NEXT: retq entry: %0 = zext i64 %a to i128 @@ -71,9 +69,8 @@ define void @d(i8* nocapture %r, i64 %a, i64 %b, i8 %c) nounwind { ; CHECK: # BB#0: # %entry ; CHECK-NEXT: addq %rdx, %rsi ; CHECK-NEXT: sbbq %rax, %rax -; CHECK-NEXT: andl $1, %eax -; CHECK-NEXT: addl %ecx, %eax -; CHECK-NEXT: movb %al, (%rdi) +; CHECK-NEXT: subl %eax, %ecx +; CHECK-NEXT: movb %cl, (%rdi) ; CHECK-NEXT: retq entry: %0 = zext i64 %a to i128 @@ -169,9 +166,8 @@ define void @muladd(%accumulator* nocapture %this, i64 %arg.a, i64 %arg.b) { ; CHECK-NEXT: movq %rax, (%rdi) ; CHECK-NEXT: addq 8(%rdi), %rdx ; CHECK-NEXT: sbbq %rax, %rax -; CHECK-NEXT: andl $1, %eax ; CHECK-NEXT: movq %rdx, 8(%rdi) -; CHECK-NEXT: addl %eax, 16(%rdi) +; CHECK-NEXT: subl %eax, 16(%rdi) ; CHECK-NEXT: retq entry: %0 = zext i64 %arg.a to i128 |

