From e3905dee0044c8b6c5f3a9cf46b9b6fe45039da6 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Thu, 17 Oct 2019 19:32:24 +0000 Subject: [PATCH] [x86] add test for setcc to shift transform; NFC llvm-svn: 375158 --- llvm/test/CodeGen/X86/setcc.ll | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/llvm/test/CodeGen/X86/setcc.ll b/llvm/test/CodeGen/X86/setcc.ll index 648935dd08af..f9ebeff7ed80 100644 --- a/llvm/test/CodeGen/X86/setcc.ll +++ b/llvm/test/CodeGen/X86/setcc.ll @@ -89,4 +89,18 @@ define zeroext i1 @t6(i32 %a) #0 { ret i1 %.not } +define i16 @shift_and(i16 %a) { +; CHECK-LABEL: shift_and: +; CHECK: ## %bb.0: +; CHECK-NEXT: movl %edi, %eax +; CHECK-NEXT: shrl $10, %eax +; CHECK-NEXT: andl $1, %eax +; CHECK-NEXT: ## kill: def $ax killed $ax killed $eax +; CHECK-NEXT: retq + %and = and i16 %a, 1024 + %cmp = icmp ne i16 %and, 0 + %conv = zext i1 %cmp to i16 + ret i16 %conv +} + attributes #0 = { "target-cpu"="skylake-avx512" }