47 lines · plain
1; RUN: opt -mtriple hexagon-- -S -passes='loop(hexagon-loop-idiom,loop-deletion),gvn'2; REQUIRES: asserts3 4; This tests that the HexagonLoopIdiom pass does not mark LCSSA information5; as preserved. The pass calls SimplifyInstruction is a couple of places,6; which can invalidate LCSSA. Specifically, the uses of a LCSSA phi variable7; are replaced by the incoming value.8 9define hidden void @test() local_unnamed_addr #0 {10entry:11 br label %if.then6312 13if.then63:14 br i1 undef, label %do.body311, label %if.end37515 16do.body311:17 br i1 undef, label %do.end318, label %do.body31118 19do.end318:20 br i1 undef, label %if.end322, label %if.end37521 22if.end322:23 %sub325 = sub i32 undef, undef24 br i1 undef, label %do.end329, label %do.body31125 26do.end329:27 %sub325.lcssa = phi i32 [ %sub325, %if.end322 ]28 br label %do.body33029 30do.body330:31 %row_width.7 = phi i32 [ %sub325.lcssa, %do.end329 ], [ %dec334, %do.body330 ]32 %sp.5 = phi ptr [ undef, %do.end329 ], [ %incdec.ptr331, %do.body330 ]33 %dp.addr.5 = phi ptr [ undef, %do.end329 ], [ %incdec.ptr332, %do.body330 ]34 %0 = load i8, ptr %sp.5, align 135 store i8 %0, ptr %dp.addr.5, align 136 %incdec.ptr332 = getelementptr inbounds i8, ptr %dp.addr.5, i32 137 %incdec.ptr331 = getelementptr inbounds i8, ptr %sp.5, i32 138 %dec334 = add i32 %row_width.7, -139 %cmp335 = icmp eq i32 %dec334, 040 br i1 %cmp335, label %if.end375, label %do.body33041 42if.end375:43 ret void44}45 46attributes #0 = { nounwind }47