diff options
| author | Craig Topper <craig.topper@intel.com> | 2019-03-30 18:59:17 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2019-03-30 18:59:17 +0000 |
| commit | e4a0fc7d75e896577364e839e19a73bfa028f3fb (patch) | |
| tree | 10aa875bdb40621529f2a73981df8c168c1b3e75 /llvm/test/CodeGen/X86/fold-rmw-ops.ll | |
| parent | 0b2803ee6578b50a536bfbacfba288cefa0172c6 (diff) | |
| download | bcm5719-llvm-e4a0fc7d75e896577364e839e19a73bfa028f3fb.tar.gz bcm5719-llvm-e4a0fc7d75e896577364e839e19a73bfa028f3fb.zip | |
[X86] Teach isel for RMW binops to handle negate
Negate updates flags like a subtract. We should be able to use the flags from the RMW form of negate when we have (store (X86ISD::SUB 0, load A), A)
Differential Revision: https://reviews.llvm.org/D60007
llvm-svn: 357353
Diffstat (limited to 'llvm/test/CodeGen/X86/fold-rmw-ops.ll')
| -rw-r--r-- | llvm/test/CodeGen/X86/fold-rmw-ops.ll | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/llvm/test/CodeGen/X86/fold-rmw-ops.ll b/llvm/test/CodeGen/X86/fold-rmw-ops.ll index ad8b4e4977a..87008b1f43a 100644 --- a/llvm/test/CodeGen/X86/fold-rmw-ops.ll +++ b/llvm/test/CodeGen/X86/fold-rmw-ops.ll @@ -2434,10 +2434,7 @@ b: define void @neg64_br() nounwind { ; CHECK-LABEL: neg64_br: ; CHECK: # %bb.0: # %entry -; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0] -; CHECK-NEXT: subq {{.*}}(%rip), %rax # encoding: [0x48,0x2b,0x05,A,A,A,A] -; CHECK-NEXT: # fixup A - offset: 3, value: g64-4, kind: reloc_riprel_4byte_relax_rex -; CHECK-NEXT: movq %rax, {{.*}}(%rip) # encoding: [0x48,0x89,0x05,A,A,A,A] +; CHECK-NEXT: negq {{.*}}(%rip) # encoding: [0x48,0xf7,0x1d,A,A,A,A] ; CHECK-NEXT: # fixup A - offset: 3, value: g64-4, kind: reloc_riprel_4byte ; CHECK-NEXT: js .LBB76_1 # encoding: [0x78,A] ; CHECK-NEXT: # fixup A - offset: 1, value: .LBB76_1-1, kind: FK_PCRel_1 @@ -2468,10 +2465,7 @@ b: define void @neg32_br() nounwind { ; CHECK-LABEL: neg32_br: ; CHECK: # %bb.0: # %entry -; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0] -; CHECK-NEXT: subl {{.*}}(%rip), %eax # encoding: [0x2b,0x05,A,A,A,A] -; CHECK-NEXT: # fixup A - offset: 2, value: g32-4, kind: reloc_riprel_4byte -; CHECK-NEXT: movl %eax, {{.*}}(%rip) # encoding: [0x89,0x05,A,A,A,A] +; CHECK-NEXT: negl {{.*}}(%rip) # encoding: [0xf7,0x1d,A,A,A,A] ; CHECK-NEXT: # fixup A - offset: 2, value: g32-4, kind: reloc_riprel_4byte ; CHECK-NEXT: js .LBB77_1 # encoding: [0x78,A] ; CHECK-NEXT: # fixup A - offset: 1, value: .LBB77_1-1, kind: FK_PCRel_1 @@ -2502,10 +2496,7 @@ b: define void @neg16_br() nounwind { ; CHECK-LABEL: neg16_br: ; CHECK: # %bb.0: # %entry -; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0] -; CHECK-NEXT: subw {{.*}}(%rip), %ax # encoding: [0x66,0x2b,0x05,A,A,A,A] -; CHECK-NEXT: # fixup A - offset: 3, value: g16-4, kind: reloc_riprel_4byte -; CHECK-NEXT: movw %ax, {{.*}}(%rip) # encoding: [0x66,0x89,0x05,A,A,A,A] +; CHECK-NEXT: negw {{.*}}(%rip) # encoding: [0x66,0xf7,0x1d,A,A,A,A] ; CHECK-NEXT: # fixup A - offset: 3, value: g16-4, kind: reloc_riprel_4byte ; CHECK-NEXT: js .LBB78_1 # encoding: [0x78,A] ; CHECK-NEXT: # fixup A - offset: 1, value: .LBB78_1-1, kind: FK_PCRel_1 @@ -2536,10 +2527,7 @@ b: define void @neg8_br() nounwind { ; CHECK-LABEL: neg8_br: ; CHECK: # %bb.0: # %entry -; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0] -; CHECK-NEXT: subb {{.*}}(%rip), %al # encoding: [0x2a,0x05,A,A,A,A] -; CHECK-NEXT: # fixup A - offset: 2, value: g8-4, kind: reloc_riprel_4byte -; CHECK-NEXT: movb %al, {{.*}}(%rip) # encoding: [0x88,0x05,A,A,A,A] +; CHECK-NEXT: negb {{.*}}(%rip) # encoding: [0xf6,0x1d,A,A,A,A] ; CHECK-NEXT: # fixup A - offset: 2, value: g8-4, kind: reloc_riprel_4byte ; CHECK-NEXT: js .LBB79_1 # encoding: [0x78,A] ; CHECK-NEXT: # fixup A - offset: 1, value: .LBB79_1-1, kind: FK_PCRel_1 |

