[DAGCombiner] Eliminate dead stores to stack.
[llvm-complete.git] / test / CodeGen / SystemZ / dag-combine-03.ll
blobc197c9a73a36dd445c9cfbb83e5b1e0fa9bbfe41
1 ; Test that DAGCombiner gets helped by getKnownBitsForTargetNode() when
2 ; BITCAST nodes are involved on a big-endian target.
4 ; RUN: llc -mtriple=s390x-linux-gnu -mcpu=z13 < %s  | FileCheck %s
6 define void @fun() {
7 entry:
8   br label %lab0
10 lab0:
11   %phi = phi i64 [ %sel, %lab0 ], [ 0, %entry ]
12   %add = add nuw nsw i64 %phi, 1
13   %add2 = add nuw nsw i64 %phi, 2
14   %cmp = icmp eq i64 %add, undef
15   %cmp2 = icmp eq i64 %add2, undef
16   %ins = insertelement <2 x i1> undef, i1 %cmp, i32 0
17   %ins2 = insertelement <2 x i1> undef, i1 %cmp2, i32 0
18   %xor = xor <2 x i1> %ins, %ins2
19   %extr = extractelement <2 x i1> %xor, i32 0
20 ; The EXTRACT_VECTOR_ELT is done first into an i32, and then AND:ed with
21 ; 1. The AND is not actually necessary since the element contains a CC (i1)
22 ; value. Test that the BITCAST nodes in the DAG when computing KnownBits is
23 ; handled so that the AND is removed. If this succeeds, this results in a CHI
24 ; instead of TMLL.
26 ; CHECK-LABEL: # %bb.0:
27 ; CHECK:       chi
28 ; CHECK-NOT:   tmll
29 ; CHECK:       j
30   %sel = select i1 %extr, i64 %add, i64 0
31   br label %lab0