summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/anyext.ll
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-07-09 00:19:07 +0000
committerMatthias Braun <matze@braunis.de>2016-07-09 00:19:07 +0000
commit152e7c8b1222d2af61df72c08caaa740e553cb6c (patch)
tree7178c1d1db0b5bf2babca7793c71c079854e1156 /llvm/test/CodeGen/X86/anyext.ll
parent07985809abeb97c131d37ee389ee0fea2a646516 (diff)
downloadbcm5719-llvm-152e7c8b1222d2af61df72c08caaa740e553cb6c.tar.gz
bcm5719-llvm-152e7c8b1222d2af61df72c08caaa740e553cb6c.zip
VirtRegMap: Replace some identity copies with KILL instructions.
An identity COPY like this: %AL = COPY %AL, %EAX<imp-def> has no semantic effect, but encodes liveness information: Further users of %EAX only depend on this instruction even though it does not define the full register. Replace the COPY with a KILL instruction in those cases to maintain this liveness information. (This reverts a small part of r238588 but this time adds a comment explaining why a KILL instruction is useful). llvm-svn: 274952
Diffstat (limited to 'llvm/test/CodeGen/X86/anyext.ll')
-rw-r--r--llvm/test/CodeGen/X86/anyext.ll4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/anyext.ll b/llvm/test/CodeGen/X86/anyext.ll
index 3c53983fe4e..4f4218bdd63 100644
--- a/llvm/test/CodeGen/X86/anyext.ll
+++ b/llvm/test/CodeGen/X86/anyext.ll
@@ -8,6 +8,7 @@ define i32 @foo(i32 %p, i8 zeroext %x) nounwind {
; X32-LABEL: foo:
; X32: # BB#0:
; X32-NEXT: movzbl {{[0-9]+}}(%esp), %eax
+; X32-NEXT: # kill: %EAX<def> %EAX<kill> %AX<def>
; X32-NEXT: divb {{[0-9]+}}(%esp)
; X32-NEXT: movzbl %al, %eax
; X32-NEXT: andl $1, %eax
@@ -16,6 +17,7 @@ define i32 @foo(i32 %p, i8 zeroext %x) nounwind {
; X64-LABEL: foo:
; X64: # BB#0:
; X64-NEXT: movzbl %dil, %eax
+; X64-NEXT: # kill: %EAX<def> %EAX<kill> %AX<def>
; X64-NEXT: divb %sil
; X64-NEXT: movzbl %al, %eax
; X64-NEXT: andl $1, %eax
@@ -33,6 +35,7 @@ define i32 @bar(i32 %p, i16 zeroext %x) nounwind {
; X32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
; X32-NEXT: xorl %edx, %edx
; X32-NEXT: divw {{[0-9]+}}(%esp)
+; X32-NEXT: # kill: %AX<def> %AX<kill> %EAX<def>
; X32-NEXT: andl $1, %eax
; X32-NEXT: retl
;
@@ -41,6 +44,7 @@ define i32 @bar(i32 %p, i16 zeroext %x) nounwind {
; X64-NEXT: xorl %edx, %edx
; X64-NEXT: movl %edi, %eax
; X64-NEXT: divw %si
+; X64-NEXT: # kill: %AX<def> %AX<kill> %EAX<def>
; X64-NEXT: andl $1, %eax
; X64-NEXT: retq
%q = trunc i32 %p to i16
OpenPOWER on IntegriCloud