From 152e7c8b1222d2af61df72c08caaa740e553cb6c Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Sat, 9 Jul 2016 00:19:07 +0000 Subject: VirtRegMap: Replace some identity copies with KILL instructions. An identity COPY like this: %AL = COPY %AL, %EAX 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 --- llvm/test/CodeGen/X86/clz.ll | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/test/CodeGen/X86/clz.ll') diff --git a/llvm/test/CodeGen/X86/clz.ll b/llvm/test/CodeGen/X86/clz.ll index 8822515e0d5..9fcaa4c4fe5 100644 --- a/llvm/test/CodeGen/X86/clz.ll +++ b/llvm/test/CodeGen/X86/clz.ll @@ -14,6 +14,7 @@ define i8 @cttz_i8(i8 %x) { ; CHECK: # BB#0: ; CHECK-NEXT: movzbl %dil, %eax ; CHECK-NEXT: bsfl %eax, %eax +; CHECK-NEXT: # kill ; CHECK-NEXT: retq %tmp = call i8 @llvm.cttz.i8( i8 %x, i1 true ) ret i8 %tmp @@ -52,6 +53,7 @@ define i8 @ctlz_i8(i8 %x) { ; CHECK-NEXT: movzbl %dil, %eax ; CHECK-NEXT: bsrl %eax, %eax ; CHECK-NEXT: xorl $7, %eax +; CHECK-NEXT: # kill ; CHECK-NEXT: retq %tmp2 = call i8 @llvm.ctlz.i8( i8 %x, i1 true ) ret i8 %tmp2 @@ -62,6 +64,7 @@ define i16 @ctlz_i16(i16 %x) { ; CHECK: # BB#0: ; CHECK-NEXT: bsrw %di, %ax ; CHECK-NEXT: xorl $15, %eax +; CHECK-NEXT: # kill ; CHECK-NEXT: retq %tmp2 = call i16 @llvm.ctlz.i16( i16 %x, i1 true ) ret i16 %tmp2 @@ -100,6 +103,7 @@ define i8 @ctlz_i8_zero_test(i8 %n) { ; CHECK-NEXT: bsrl %eax, %eax ; CHECK-NEXT: xorl $7, %eax ; CHECK-NEXT: .LBB8_2: # %cond.end +; CHECK-NEXT: # kill ; CHECK-NEXT: retq %tmp1 = call i8 @llvm.ctlz.i8(i8 %n, i1 false) ret i8 %tmp1 @@ -117,6 +121,7 @@ define i16 @ctlz_i16_zero_test(i16 %n) { ; CHECK-NEXT: bsrw %di, %ax ; CHECK-NEXT: xorl $15, %eax ; CHECK-NEXT: .LBB9_2: # %cond.end +; CHECK-NEXT: # kill ; CHECK-NEXT: retq %tmp1 = call i16 @llvm.ctlz.i16(i16 %n, i1 false) ret i16 %tmp1 @@ -168,6 +173,7 @@ define i8 @cttz_i8_zero_test(i8 %n) { ; CHECK-NEXT: movzbl %dil, %eax ; CHECK-NEXT: bsfl %eax, %eax ; CHECK-NEXT: .LBB12_2: # %cond.end +; CHECK-NEXT: # kill ; CHECK-NEXT: retq %tmp1 = call i8 @llvm.cttz.i8(i8 %n, i1 false) ret i8 %tmp1 -- cgit v1.2.3