1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
4 ; The and with -9 has multiple users which prevents
5 ; SimplifyDemandedBits from touching it. The truncate only
6 ; demands the lower 8 bits. X86ISelDAGToDAG.cpp wants form
7 ; a test instruction from the icmp+trunc+and, but needs to
8 ; mask the -9 to 8 bits since SimplifyDemandedBits didn't.
10 define i32 @foo(i16 signext %0, i32 %1, ptr nocapture %2) {
13 ; CHECK-NEXT: incl %edi
14 ; CHECK-NEXT: andl $65527, %edi # imm = 0xFFF7
15 ; CHECK-NEXT: movl %edi, (%rdx)
16 ; CHECK-NEXT: xorl %eax, %eax
17 ; CHECK-NEXT: testb %dil, %dil
18 ; CHECK-NEXT: cmovel %esi, %eax
22 %6 = zext i16 %5 to i32
23 store i32 %6, ptr %2, align 4
24 %7 = trunc i16 %5 to i8
26 %9 = select i1 %8, i32 %1, i32 0