Recommit r310809 with a fix for the spill problem
[llvm-core.git] / test / CodeGen / MSP430 / select-use-sr.ll
blob3f67fb85f793fc36526fd986827d7e7d3889c783
1 ; RUN: llc < %s -march=msp430 | FileCheck %s
2 ; PR32769
4 target triple = "msp430"
6 ; Test that CMP instruction is not removed by MachineCSE.
8 ; CHECK-LABEL: @f
9 ; CHECK: cmp.w r15, r13
10 ; CHECK: cmp.w r15, r13
11 ; CHECK-NEXT: jeq .LBB0_2
12 define i16 @f(i16, i16, i16, i16) {
13 entry:
14   %4 = icmp ult i16 %1, %3
15   %5 = zext i1 %4 to i16
16   %6 = icmp ult i16 %0, %2
17   %7 = zext i1 %6 to i16
18   %8 = icmp eq i16 %1, %3
19   %out = select i1 %8, i16 %5, i16 %7
20   ret i16 %out