1; RUN: llc -mtriple=s390x-linux-gnu -mcpu=zEC12 < %s | FileCheck %s 2; 3; Check that DAGCombiner doesn't cause a crash by eventually producing a 4; PCREL_OFFSET node with a freeze operand. 5 6@a = dso_local global [6 x [6 x [3 x i8]]] zeroinitializer, align 2 7@b = dso_local local_unnamed_addr global i32 0, align 4 8 9define void @fun(i8 noundef zeroext %g) { 10; CHECK-LABEL: fun 11entry: 12 %agg.tmp.ensured.sroa.0 = alloca i8, align 2 13 %conv = zext i8 %g to i64 14 %0 = inttoptr i64 %conv to ptr 15 %.fr = freeze ptr getelementptr inbounds ([6 x [6 x [3 x i8]]], ptr @a, i64 0, i64 1, i64 2, i64 1) 16 %cmp = icmp eq ptr %.fr, %0 17 %1 = load i8, ptr getelementptr inbounds ([6 x [6 x [3 x i8]]], ptr @a, i64 0, i64 5, i64 4, i64 2), align 2 18 %conv2 = zext i8 %1 to i32 19 br i1 %cmp, label %for.cond.us, label %for.cond 20 21for.cond.us: ; preds = %entry, %for.cond.us 22 store i32 %conv2, ptr @b, align 4 23 ret void 24 25for.cond: ; preds = %entry, %for.cond 26 store i32 0, ptr @b, align 4 27 ret void 28} 29