; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
-; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s
+; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefix=X86
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefix=X64
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefix=X64
+
; PR3253
; The register+memory form of the BT instruction should be usable on
; - The and can be commuted.
define void @test2(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: test2:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jb .LBB0_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB0_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: test2:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jb .LBB0_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB0_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: test2:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jb .LBB0_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB0_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = lshr i32 %x, %n
%tmp3 = and i32 %tmp29, 1
}
define void @test2b(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: test2b:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB1_1
-; CHECK-NEXT: # BB#2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
-; CHECK-NEXT: .LBB1_1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; X86-LABEL: test2b:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB1_1
+; X86-NEXT: # BB#2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+; X86-NEXT: .LBB1_1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: retl
+;
+; X64-LABEL: test2b:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB1_1
+; X64-NEXT: # BB#2: # %UnifiedReturnBlock
+; X64-NEXT: retq
+; X64-NEXT: .LBB1_1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: retq
entry:
%tmp29 = lshr i32 %x, %n
%tmp3 = and i32 1, %tmp29
}
define void @atest2(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: atest2:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jb .LBB2_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB2_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: atest2:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jb .LBB2_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB2_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: atest2:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jb .LBB2_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB2_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = ashr i32 %x, %n
%tmp3 = and i32 %tmp29, 1
}
define void @atest2b(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: atest2b:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB3_1
-; CHECK-NEXT: # BB#2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
-; CHECK-NEXT: .LBB3_1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; X86-LABEL: atest2b:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB3_1
+; X86-NEXT: # BB#2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+; X86-NEXT: .LBB3_1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: retl
+;
+; X64-LABEL: atest2b:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB3_1
+; X64-NEXT: # BB#2: # %UnifiedReturnBlock
+; X64-NEXT: retq
+; X64-NEXT: .LBB3_1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: retq
entry:
%tmp29 = ashr i32 %x, %n
%tmp3 = and i32 1, %tmp29
}
define void @test3(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: test3:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB4_1
-; CHECK-NEXT: # BB#2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
-; CHECK-NEXT: .LBB4_1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; X86-LABEL: test3:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB4_1
+; X86-NEXT: # BB#2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+; X86-NEXT: .LBB4_1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: retl
+;
+; X64-LABEL: test3:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB4_1
+; X64-NEXT: # BB#2: # %UnifiedReturnBlock
+; X64-NEXT: retq
+; X64-NEXT: .LBB4_1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: retq
entry:
%tmp29 = shl i32 1, %n
%tmp3 = and i32 %tmp29, %x
}
define void @test3b(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: test3b:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB5_1
-; CHECK-NEXT: # BB#2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
-; CHECK-NEXT: .LBB5_1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; X86-LABEL: test3b:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB5_1
+; X86-NEXT: # BB#2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+; X86-NEXT: .LBB5_1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: retl
+;
+; X64-LABEL: test3b:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB5_1
+; X64-NEXT: # BB#2: # %UnifiedReturnBlock
+; X64-NEXT: retq
+; X64-NEXT: .LBB5_1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: retq
entry:
%tmp29 = shl i32 1, %n
%tmp3 = and i32 %x, %tmp29
}
define void @testne2(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: testne2:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB6_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB6_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: testne2:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB6_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB6_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: testne2:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB6_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB6_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = lshr i32 %x, %n
%tmp3 = and i32 %tmp29, 1
}
define void @testne2b(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: testne2b:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB7_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB7_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: testne2b:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB7_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB7_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: testne2b:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB7_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB7_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = lshr i32 %x, %n
%tmp3 = and i32 1, %tmp29
}
define void @atestne2(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: atestne2:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB8_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB8_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: atestne2:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB8_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB8_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: atestne2:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB8_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB8_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = ashr i32 %x, %n
%tmp3 = and i32 %tmp29, 1
}
define void @atestne2b(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: atestne2b:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB9_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB9_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: atestne2b:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB9_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB9_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: atestne2b:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB9_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB9_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = ashr i32 %x, %n
%tmp3 = and i32 1, %tmp29
}
define void @testne3(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: testne3:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB10_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB10_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: testne3:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB10_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB10_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: testne3:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB10_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB10_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = shl i32 1, %n
%tmp3 = and i32 %tmp29, %x
}
define void @testne3b(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: testne3b:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB11_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB11_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: testne3b:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB11_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB11_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: testne3b:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB11_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB11_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = shl i32 1, %n
%tmp3 = and i32 %x, %tmp29
}
define void @query2(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: query2:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB12_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB12_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: query2:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB12_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB12_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: query2:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB12_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB12_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = lshr i32 %x, %n
%tmp3 = and i32 %tmp29, 1
}
define void @query2b(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: query2b:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB13_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB13_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: query2b:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB13_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB13_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: query2b:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB13_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB13_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = lshr i32 %x, %n
%tmp3 = and i32 1, %tmp29
}
define void @aquery2(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: aquery2:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB14_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB14_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: aquery2:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB14_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB14_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: aquery2:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB14_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB14_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = ashr i32 %x, %n
%tmp3 = and i32 %tmp29, 1
}
define void @aquery2b(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: aquery2b:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB15_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB15_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: aquery2b:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB15_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB15_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: aquery2b:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB15_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB15_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = ashr i32 %x, %n
%tmp3 = and i32 1, %tmp29
}
define void @query3(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: query3:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB16_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB16_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: query3:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB16_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB16_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: query3:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB16_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB16_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = shl i32 1, %n
%tmp3 = and i32 %tmp29, %x
}
define void @query3b(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: query3b:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB17_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB17_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: query3b:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB17_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB17_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: query3b:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB17_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB17_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = shl i32 1, %n
%tmp3 = and i32 %x, %tmp29
}
define void @query3x(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: query3x:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB18_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB18_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: query3x:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB18_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB18_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: query3x:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB18_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB18_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = shl i32 1, %n
%tmp3 = and i32 %tmp29, %x
}
define void @query3bx(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: query3bx:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jae .LBB19_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB19_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: query3bx:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jae .LBB19_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB19_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: query3bx:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jae .LBB19_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB19_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = shl i32 1, %n
%tmp3 = and i32 %x, %tmp29
}
define void @queryne2(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: queryne2:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jb .LBB20_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB20_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: queryne2:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jb .LBB20_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB20_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: queryne2:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jb .LBB20_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB20_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = lshr i32 %x, %n
%tmp3 = and i32 %tmp29, 1
}
define void @queryne2b(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: queryne2b:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jb .LBB21_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB21_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: queryne2b:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jb .LBB21_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB21_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: queryne2b:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jb .LBB21_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB21_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = lshr i32 %x, %n
%tmp3 = and i32 1, %tmp29
}
define void @aqueryne2(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: aqueryne2:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jb .LBB22_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB22_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: aqueryne2:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jb .LBB22_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB22_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: aqueryne2:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jb .LBB22_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB22_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = ashr i32 %x, %n
%tmp3 = and i32 %tmp29, 1
}
define void @aqueryne2b(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: aqueryne2b:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jb .LBB23_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB23_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: aqueryne2b:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jb .LBB23_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB23_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: aqueryne2b:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jb .LBB23_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB23_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = ashr i32 %x, %n
%tmp3 = and i32 1, %tmp29
}
define void @queryne3(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: queryne3:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jb .LBB24_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB24_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: queryne3:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jb .LBB24_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB24_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: queryne3:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jb .LBB24_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB24_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = shl i32 1, %n
%tmp3 = and i32 %tmp29, %x
}
define void @queryne3b(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: queryne3b:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jb .LBB25_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB25_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: queryne3b:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jb .LBB25_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB25_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: queryne3b:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jb .LBB25_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB25_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = shl i32 1, %n
%tmp3 = and i32 %x, %tmp29
}
define void @queryne3x(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: queryne3x:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jb .LBB26_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB26_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: queryne3x:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jb .LBB26_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB26_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: queryne3x:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jb .LBB26_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB26_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = shl i32 1, %n
%tmp3 = and i32 %tmp29, %x
}
define void @queryne3bx(i32 %x, i32 %n) nounwind {
-; CHECK-LABEL: queryne3bx:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: jb .LBB27_2
-; CHECK-NEXT: # BB#1: # %bb
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq foo
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: .LBB27_2: # %UnifiedReturnBlock
-; CHECK-NEXT: retq
+; X86-LABEL: queryne3bx:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: jb .LBB27_2
+; X86-NEXT: # BB#1: # %bb
+; X86-NEXT: calll foo
+; X86-NEXT: .LBB27_2: # %UnifiedReturnBlock
+; X86-NEXT: retl
+;
+; X64-LABEL: queryne3bx:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: jb .LBB27_2
+; X64-NEXT: # BB#1: # %bb
+; X64-NEXT: pushq %rax
+; X64-NEXT: callq foo
+; X64-NEXT: popq %rax
+; X64-NEXT: .LBB27_2: # %UnifiedReturnBlock
+; X64-NEXT: retq
entry:
%tmp29 = shl i32 1, %n
%tmp3 = and i32 %x, %tmp29
declare void @foo()
define zeroext i1 @invert(i32 %flags, i32 %flag) nounwind {
-; CHECK-LABEL: invert:
-; CHECK: # BB#0:
-; CHECK-NEXT: notl %edi
-; CHECK-NEXT: btl %esi, %edi
-; CHECK-NEXT: setb %al
-; CHECK-NEXT: retq
+; X86-LABEL: invert:
+; X86: # BB#0:
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: notl %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %ecx, %eax
+; X86-NEXT: setb %al
+; X86-NEXT: retl
+;
+; X64-LABEL: invert:
+; X64: # BB#0:
+; X64-NEXT: notl %edi
+; X64-NEXT: btl %esi, %edi
+; X64-NEXT: setb %al
+; X64-NEXT: retq
%neg = xor i32 %flags, -1
%shl = shl i32 1, %flag
%and = and i32 %shl, %neg
}
define zeroext i1 @extend(i32 %bit, i64 %bits) {
-; CHECK-LABEL: extend:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: btl %edi, %esi
-; CHECK-NEXT: setb %al
-; CHECK-NEXT: retq
+; X86-LABEL: extend:
+; X86: # BB#0: # %entry
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: btl %eax, %ecx
+; X86-NEXT: setb %al
+; X86-NEXT: retl
+;
+; X64-LABEL: extend:
+; X64: # BB#0: # %entry
+; X64-NEXT: btl %edi, %esi
+; X64-NEXT: setb %al
+; X64-NEXT: retq
entry:
%and = and i32 %bit, 31
%sh_prom = zext i32 %and to i64