[llvm] r323663 - Add test case for truncated and promotion to test. NFC
Amaury Sechet via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 29 08:13:01 PST 2018
Author: deadalnix
Date: Mon Jan 29 08:13:01 2018
New Revision: 323663
URL: http://llvm.org/viewvc/llvm-project?rev=323663&view=rev
Log:
Add test case for truncated and promotion to test. NFC
Modified:
llvm/trunk/test/CodeGen/X86/test-shrink.ll
Modified: llvm/trunk/test/CodeGen/X86/test-shrink.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/test-shrink.ll?rev=323663&r1=323662&r2=323663&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/test-shrink.ll (original)
+++ llvm/trunk/test/CodeGen/X86/test-shrink.ll Mon Jan 29 08:13:01 2018
@@ -481,4 +481,53 @@ no:
ret void
}
+define void @truncand32(i16 inreg %x) nounwind {
+; CHECK-LINUX64-LABEL: truncand32:
+; CHECK-LINUX64: # %bb.0:
+; CHECK-LINUX64-NEXT: andl $2049, %edi # imm = 0x801
+; CHECK-LINUX64-NEXT: testw %di, %di
+; CHECK-LINUX64-NEXT: je .LBB11_1
+; CHECK-LINUX64-NEXT: # %bb.2: # %no
+; CHECK-LINUX64-NEXT: retq
+; CHECK-LINUX64-NEXT: .LBB11_1: # %yes
+; CHECK-LINUX64-NEXT: pushq %rax
+; CHECK-LINUX64-NEXT: callq bar
+; CHECK-LINUX64-NEXT: popq %rax
+; CHECK-LINUX64-NEXT: retq
+;
+; CHECK-WIN32-64-LABEL: truncand32:
+; CHECK-WIN32-64: # %bb.0:
+; CHECK-WIN32-64-NEXT: subq $40, %rsp
+; CHECK-WIN32-64-NEXT: andl $2049, %ecx # imm = 0x801
+; CHECK-WIN32-64-NEXT: testw %cx, %cx
+; CHECK-WIN32-64-NEXT: je .LBB11_1
+; CHECK-WIN32-64-NEXT: # %bb.2: # %no
+; CHECK-WIN32-64-NEXT: addq $40, %rsp
+; CHECK-WIN32-64-NEXT: retq
+; CHECK-WIN32-64-NEXT: .LBB11_1: # %yes
+; CHECK-WIN32-64-NEXT: callq bar
+; CHECK-WIN32-64-NEXT: addq $40, %rsp
+; CHECK-WIN32-64-NEXT: retq
+;
+; CHECK-X86-LABEL: truncand32:
+; CHECK-X86: # %bb.0:
+; CHECK-X86-NEXT: andl $2049, %eax # imm = 0x801
+; CHECK-X86-NEXT: testw %ax, %ax
+; CHECK-X86-NEXT: je .LBB11_1
+; CHECK-X86-NEXT: # %bb.2: # %no
+; CHECK-X86-NEXT: retl
+; CHECK-X86-NEXT: .LBB11_1: # %yes
+; CHECK-X86-NEXT: calll bar
+; CHECK-X86-NEXT: retl
+ %t = and i16 %x, 2049
+ %s = icmp eq i16 %t, 0
+ br i1 %s, label %yes, label %no
+
+yes:
+ call void @bar()
+ ret void
+no:
+ ret void
+}
+
declare void @bar()
More information about the llvm-commits
mailing list