-; RUN: opt -reassociate -disable-output %s
+; RUN: opt -reassociate -disable-output < %s
; rdar://7507855
; PR5981
define i32 @test2() nounwind ssp {
entry:
- %0 = load i32* undef, align 4
+ %0 = load i32, i32* undef, align 4
%1 = mul nsw i32 undef, %0
%2 = mul nsw i32 undef, %0
%3 = add nsw i32 undef, %1
br label %_33
_33: ; preds = %_33, %_
- %tmp348 = load i8* %arg, align 1
+ %tmp348 = load i8, i8* %arg, align 1
%tmp349 = lshr i8 %tmp348, 7
%tmp350 = or i8 %tmp349, 42
%tmp351 = add i8 %tmp350, -42
%mul = mul i128 0, 0
ret i128 %mul
}
+
+define void @infinite_loop() {
+entry:
+ br label %loop
+loop:
+ %x = phi i32 [undef, %entry], [%x, %loop]
+ %dead = add i32 %x, 0
+ br label %loop
+unreachable1:
+ %y1 = add i32 %y1, 0
+ %z1 = add i32 %y1, 0
+ ret void
+unreachable2:
+ %y2 = add i32 %y2, 0
+ %z2 = add i32 %y2, %y2
+ ret void
+unreachable3:
+ %y3 = add i32 %y3, %y3
+ %z3 = add i32 %y3, 0
+ ret void
+unreachable4:
+ %y4 = add i32 %y4, %y4
+ %z4 = add i32 %y4, %y4
+ ret void
+}
+
+; PR13185
+define void @pr13185(i16 %p) {
+entry:
+ br label %for.cond
+
+for.cond: ; preds = %for.cond, %entry
+ %x.0 = phi i32 [ undef, %entry ], [ %conv, %for.cond ]
+ %conv = zext i16 %p to i32
+ br label %for.cond
+}
+
+; PR12963
+@a = external global i8
+define i8 @f0(i8 %x) {
+ %t0 = load i8, i8* @a
+ %t1 = mul i8 %x, %x
+ %t2 = mul i8 %t1, %t1
+ %t3 = mul i8 %t2, %t2
+ %t4 = mul i8 %t3, %x
+ %t5 = mul i8 %t4, %t4
+ %t6 = mul i8 %t5, %x
+ %t7 = mul i8 %t6, %t0
+ ret i8 %t7
+}
+
+define i32 @sozefx_(i32 %x, i32 %y) {
+ %t0 = sub i32 %x, %x
+ %t1 = mul i32 %t0, %t0
+ %t2 = mul i32 %x, %t0
+ %t3 = mul i32 %t1, %t1
+ %t4 = add i32 %t2, %t3
+ %t5 = mul i32 %x, %y
+ %t6 = add i32 %t4, %t5
+ ret i32 %t6
+}
+
+define i32 @bar(i32 %arg, i32 %arg1, i32 %arg2) {
+ %tmp1 = mul i32 %arg1, 2
+ %tmp2 = mul i32 %tmp1, 3
+ %tmp3 = mul i32 %arg2, 2
+ %tmp4 = add i32 %tmp1, 1 ; dead code
+ %ret = add i32 %tmp2, %tmp3
+ ret i32 %ret
+}
+
+; PR14060
+define i8 @hang(i8 %p, i8 %p0, i8 %p1, i8 %p2, i8 %p3, i8 %p4, i8 %p5, i8 %p6, i8 %p7, i8 %p8, i8 %p9) {
+ %tmp = zext i1 false to i8
+ %tmp16 = or i8 %tmp, 1
+ %tmp22 = or i8 %p7, %p0
+ %tmp23 = or i8 %tmp16, %tmp22
+ %tmp28 = or i8 %p9, %p1
+ %tmp31 = or i8 %tmp23, %p2
+ %tmp32 = or i8 %tmp31, %tmp28
+ %tmp38 = or i8 %p8, %p3
+ %tmp39 = or i8 %tmp16, %tmp38
+ %tmp43 = or i8 %tmp39, %p4
+ %tmp44 = or i8 %tmp43, 1
+ %tmp47 = or i8 %tmp32, %p5
+ %tmp50 = or i8 %tmp47, %p6
+ %tmp51 = or i8 %tmp44, %tmp50
+ ret i8 %tmp51
+}