1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -O2 -mtriple=x86_64-unknown-unknown | FileCheck %s
3 ; Checks that a zeroing mov is inserted for the trunc/zext pair even when
4 ; the source of the zext is an AssertZext node
10 ; CHECK-NEXT: movq $-1, %rax
18 ; CHECK-NEXT: pushq %rax
19 ; CHECK-NEXT: .cfi_def_cfa_offset 16
20 ; CHECK-NEXT: callq foo
21 ; CHECK-NEXT: movabsq $-4294967041, %rcx # imm = 0xFFFFFFFF000000FF
22 ; CHECK-NEXT: andq %rax, %rcx
23 ; CHECK-NEXT: movl %ecx, %ecx
24 ; CHECK-NEXT: leaq (,%rcx,8), %rax
25 ; CHECK-NEXT: subq %rcx, %rax
26 ; CHECK-NEXT: shrq $32, %rax
27 ; CHECK-NEXT: popq %rcx
28 ; CHECK-NEXT: .cfi_def_cfa_offset 8
31 %or = and i64 %b, 18446744069414584575 ; this is 0xffffffff000000ff
32 %trunc = trunc i64 %or to i32
35 %ext = zext i32 %trunc to i64
36 %mul = mul i64 %ext, 7
38 m: ; keeps dag combine from seeing the multiply and the shift together
39 %shr = lshr i64 %mul, 32
40 trunc i64 %or to i32 ; keeps the and alive so it doesn't simplify