1 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s
2 target datalayout = "e-p:64:64-i64:64-n32:64"
3 target triple = "powerpc64le-linux"
5 %struct.BSS1.0.9.28.39.43.46.47.54.56.57.64.65.69.71.144 = type <{ [220 x i8] }>
7 @.BSS1 = external unnamed_addr global %struct.BSS1.0.9.28.39.43.46.47.54.56.57.64.65.69.71.144, align 32
9 ; Function Attrs: noinline nounwind
10 define void @ety2_() #0 {
12 ; This test case used to crash because the preinc prep pass would assume that
13 ; if X-Y could be simplified to a constant, than so could Y-X. While not
14 ; desirable, we cannot actually make this guarantee.
18 %0 = load i32, i32* undef, align 4
19 %1 = sext i32 %0 to i64
20 %2 = shl nsw i64 %1, 3
21 %3 = add nsw i64 %2, 8
24 L.LB1_425: ; preds = %L.LB1_427, %L.entry
25 %4 = phi i64 [ %21, %L.LB1_427 ], [ undef, %L.entry ]
26 br i1 undef, label %L.LB1_427, label %L.LB1_816
28 L.LB1_816: ; preds = %L.LB1_425
29 switch i32 undef, label %L.LB1_432 [
30 i32 30, label %L.LB1_805
31 i32 10, label %L.LB1_451
32 i32 20, label %L.LB1_451
35 L.LB1_451: ; preds = %L.LB1_816, %L.LB1_816
38 L.LB1_432: ; preds = %L.LB1_816
39 %.in.31 = lshr i64 %4, 32
40 %5 = trunc i64 %.in.31 to i32
41 br i1 undef, label %L.LB1_769, label %L.LB1_455
43 L.LB1_455: ; preds = %L.LB1_432
46 L.LB1_769: ; preds = %L.LB1_432
47 %6 = sext i32 %5 to i64
48 %7 = add nsw i64 %6, 2
49 %8 = add nsw i64 %6, -1
53 %12 = getelementptr i8, i8* undef, i64 %11
54 %13 = mul nsw i64 %6, %1
57 %16 = getelementptr i8, i8* undef, i64 %15
58 br i1 undef, label %L.LB1_662, label %L.LB1_662.prol
60 L.LB1_662.prol: ; preds = %L.LB1_662.prol, %L.LB1_769
61 %indvars.iv.next20.prol = add nuw nsw i64 undef, 1
62 br i1 undef, label %L.LB1_662, label %L.LB1_662.prol
64 L.LB1_662: ; preds = %L.LB1_437.2, %L.LB1_662.prol, %L.LB1_769
65 %indvars.iv19 = phi i64 [ %indvars.iv.next20.3, %L.LB1_437.2 ], [ 0, %L.LB1_769 ], [ %indvars.iv.next20.prol, %L.LB1_662.prol ]
66 %indvars.iv.next20 = add nuw nsw i64 %indvars.iv19, 1
67 %17 = mul i64 %indvars.iv.next20, %3
68 %18 = getelementptr i8, i8* %16, i64 %17
69 %19 = bitcast i8* %18 to double*
70 store double 0.000000e+00, double* %19, align 8
71 %indvars.iv.next20.1 = add nsw i64 %indvars.iv19, 2
72 %20 = mul i64 %indvars.iv.next20.1, %3
73 br i1 undef, label %L.LB1_437.2, label %L.LB1_824.2
75 L.LB1_427: ; preds = %L.LB1_425
76 %21 = load i64, i64* bitcast (i8* getelementptr inbounds (%struct.BSS1.0.9.28.39.43.46.47.54.56.57.64.65.69.71.144, %struct.BSS1.0.9.28.39.43.46.47.54.56.57.64.65.69.71.144* @.BSS1, i64 0, i32 0, i64 8) to i64*), align 8
79 L.LB1_805: ; preds = %L.LB1_816
82 L.LB1_824.2: ; preds = %L.LB1_662
83 %22 = getelementptr i8, i8* %12, i64 %20
84 %23 = bitcast i8* %22 to double*
85 store double 0.000000e+00, double* %23, align 8
88 L.LB1_437.2: ; preds = %L.LB1_824.2, %L.LB1_662
89 %indvars.iv.next20.3 = add nsw i64 %indvars.iv19, 4
93 attributes #0 = { noinline nounwind }