Index: test/CodeGen/X86/lzcnt-zext-cmp.ll =================================================================== --- test/CodeGen/X86/lzcnt-zext-cmp.ll +++ test/CodeGen/X86/lzcnt-zext-cmp.ll @@ -1,10 +1,10 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; Test patterns which generates lzcnt instructions. ; Eg: zext(or(setcc(cmp), setcc(cmp))) -> shr(or(lzcnt, lzcnt)) -; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=btver2 | FileCheck %s -; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=btver2 -mattr=-fast-lzcnt | FileCheck --check-prefix=NOFASTLZCNT %s -; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=znver1 | FileCheck %s -; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=znver1 -mattr=-fast-lzcnt | FileCheck --check-prefix=NOFASTLZCNT %s +; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=btver2 | FileCheck --check-prefix=ALL %s +; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=btver2 -mattr=-fast-lzcnt | FileCheck --check-prefix=ALL --check-prefix=NOFASTLZCNT %s +; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=znver1 | FileCheck --check-prefix=ALL %s +; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=znver1 -mattr=-fast-lzcnt | FileCheck --check-prefix=ALL --check-prefix=NOFASTLZCNT %s ; Test one 32-bit input, output is 32-bit, no transformations expected. define i32 @test_zext_cmp0(i32 %a) { @@ -15,12 +15,12 @@ ; CHECK-NEXT: sete %al ; CHECK-NEXT: retq ; -; NOFASTLZCNT-LABEL: test_zext_cmp0: -; NOFASTLZCNT: # BB#0: # %entry -; NOFASTLZCNT-NEXT: xorl %eax, %eax -; NOFASTLZCNT-NEXT: testl %edi, %edi -; NOFASTLZCNT-NEXT: sete %al -; NOFASTLZCNT-NEXT: retq +; ALL-LABEL: test_zext_cmp0: +; ALL: # BB#0: # %entry +; ALL-NEXT: xorl %eax, %eax +; ALL-NEXT: testl %edi, %edi +; ALL-NEXT: sete %al +; ALL-NEXT: retq entry: %cmp = icmp eq i32 %a, 0 %conv = zext i1 %cmp to i32 @@ -94,16 +94,16 @@ ; CHECK-NEXT: # kill: %AX %AX %EAX ; CHECK-NEXT: retq ; -; NOFASTLZCNT-LABEL: test_zext_cmp3: -; NOFASTLZCNT: # BB#0: -; NOFASTLZCNT-NEXT: testw %di, %di -; NOFASTLZCNT-NEXT: sete %al -; NOFASTLZCNT-NEXT: testw %si, %si -; NOFASTLZCNT-NEXT: sete %cl -; NOFASTLZCNT-NEXT: orb %al, %cl -; NOFASTLZCNT-NEXT: movzbl %cl, %eax -; NOFASTLZCNT-NEXT: # kill: %AX %AX %EAX -; NOFASTLZCNT-NEXT: retq +; ALL-LABEL: test_zext_cmp3: +; ALL: # BB#0: +; ALL-NEXT: testw %di, %di +; ALL-NEXT: sete %al +; ALL-NEXT: testw %si, %si +; ALL-NEXT: sete %cl +; ALL-NEXT: orb %al, %cl +; ALL-NEXT: movzbl %cl, %eax +; ALL-NEXT: # kill: %AX %AX %EAX +; ALL-NEXT: retq %cmp = icmp eq i16 %a, 0 %cmp1 = icmp eq i16 %b, 0 %or = or i1 %cmp, %cmp1 @@ -317,15 +317,15 @@ ; CHECK-NEXT: movzbl %cl, %eax ; CHECK-NEXT: retq ; -; NOFASTLZCNT-LABEL: test_zext_cmp10: -; NOFASTLZCNT: # BB#0: # %entry -; NOFASTLZCNT-NEXT: orq %rsi, %rdi -; NOFASTLZCNT-NEXT: sete %al -; NOFASTLZCNT-NEXT: orq %rcx, %rdx -; NOFASTLZCNT-NEXT: sete %cl -; NOFASTLZCNT-NEXT: orb %al, %cl -; NOFASTLZCNT-NEXT: movzbl %cl, %eax -; NOFASTLZCNT-NEXT: retq +; ALL-LABEL: test_zext_cmp10: +; ALL: # BB#0: # %entry +; ALL-NEXT: orq %rsi, %rdi +; ALL-NEXT: sete %al +; ALL-NEXT: orq %rcx, %rdx +; ALL-NEXT: sete %cl +; ALL-NEXT: orb %al, %cl +; ALL-NEXT: movzbl %cl, %eax +; ALL-NEXT: retq entry: %a.sroa.2.0.insert.ext = zext i64 %a.coerce1 to i128 %a.sroa.2.0.insert.shift = shl nuw i128 %a.sroa.2.0.insert.ext, 64 @@ -355,16 +355,16 @@ ; CHECK-NEXT: movzbl %cl, %eax ; CHECK-NEXT: retq ; -; NOFASTLZCNT-LABEL: test_zext_cmp11: -; NOFASTLZCNT: # BB#0: # %entry -; NOFASTLZCNT-NEXT: vxorps %xmm2, %xmm2, %xmm2 -; NOFASTLZCNT-NEXT: vucomisd %xmm2, %xmm0 -; NOFASTLZCNT-NEXT: sete %al -; NOFASTLZCNT-NEXT: vucomisd %xmm2, %xmm1 -; NOFASTLZCNT-NEXT: sete %cl -; NOFASTLZCNT-NEXT: orb %al, %cl -; NOFASTLZCNT-NEXT: movzbl %cl, %eax -; NOFASTLZCNT-NEXT: retq +; ALL-LABEL: test_zext_cmp11: +; ALL: # BB#0: # %entry +; ALL-NEXT: vxorps %xmm2, %xmm2, %xmm2 +; ALL-NEXT: vucomisd %xmm2, %xmm0 +; ALL-NEXT: sete %al +; ALL-NEXT: vucomisd %xmm2, %xmm1 +; ALL-NEXT: sete %cl +; ALL-NEXT: orb %al, %cl +; ALL-NEXT: movzbl %cl, %eax +; ALL-NEXT: retq entry: %cmp = fcmp fast oeq double %a, 0.000000e+00 %cmp1 = fcmp fast oeq double %b, 0.000000e+00