1; Test that DAGCombiner gets helped by computeKnownBitsForTargetNode(). 2; 3; RUN: llc -mtriple=s390x-linux-gnu -mcpu=z13 < %s | FileCheck %s 4 5; SystemZISD::REPLICATE 6define i32 @f0() { 7; CHECK-LABEL: f0: 8; CHECK-LABEL: # %bb.0: 9; CHECK: vlgvf 10; CHECK-NOT: lhi %r2, 0 11; CHECK-NOT: chi %r0, 0 12; CHECK-NOT: lochilh %r2, 1 13; CHECK: br %r14 14 %cmp0 = icmp ne <4 x i32> undef, zeroinitializer 15 %zxt0 = zext <4 x i1> %cmp0 to <4 x i32> 16 %ext0 = extractelement <4 x i32> %zxt0, i32 3 17 br label %exit 18 19exit: 20; The vector icmp+zext involves a REPLICATE of 1's. If KnownBits reflects 21; this, DAGCombiner can see that the i32 icmp and zext here are not needed. 22 %cmp1 = icmp ne i32 %ext0, 0 23 %zxt1 = zext i1 %cmp1 to i32 24 ret i32 %zxt1 25} 26 27; SystemZISD::JOIN_DWORDS (and REPLICATE) 28define void @f1() { 29; The DAG XOR has JOIN_DWORDS and REPLICATE operands. With KnownBits properly set 30; for both these nodes, ICMP is used instead of TM during lowering because 31; adjustForRedundantAnd() succeeds. 32; CHECK-LABEL: f1: 33; CHECK-LABEL: # %bb.0: 34; CHECK-NOT: tmll 35; CHECK-NOT: jne 36; CHECK: cijlh 37 %1 = load i16, i16* null, align 2 38 %2 = icmp eq i16 %1, 0 39 %3 = insertelement <2 x i1> undef, i1 %2, i32 0 40 %4 = insertelement <2 x i1> %3, i1 true, i32 1 41 %5 = xor <2 x i1> %4, <i1 true, i1 true> 42 %6 = extractelement <2 x i1> %5, i32 0 43 %7 = or i1 %6, undef 44 br i1 %7, label %9, label %8 45 46; <label>:8: ; preds = %0 47 unreachable 48 49; <label>:9: ; preds = %0 50 unreachable 51} 52