1; RUN: opt -hexagon-loop-idiom -loop-deletion -gvn -S < %s 2; REQUIRES: asserts 3 4; This tests that the HexagonLoopIdiom pass does not mark LCSSA information 5; as preserved. The pass calls SimplifyInstruction is a couple of places, 6; which can invalidate LCSSA. Specifically, the uses of a LCSSA phi variable 7; are replaced by the incoming value. 8 9define hidden void @test() local_unnamed_addr #0 { 10entry: 11 br label %if.then63 12 13if.then63: 14 br i1 undef, label %do.body311, label %if.end375 15 16do.body311: 17 br i1 undef, label %do.end318, label %do.body311 18 19do.end318: 20 br i1 undef, label %if.end322, label %if.end375 21 22if.end322: 23 %sub325 = sub i32 undef, undef 24 br i1 undef, label %do.end329, label %do.body311 25 26do.end329: 27 %sub325.lcssa = phi i32 [ %sub325, %if.end322 ] 28 br label %do.body330 29 30do.body330: 31 %row_width.7 = phi i32 [ %sub325.lcssa, %do.end329 ], [ %dec334, %do.body330 ] 32 %sp.5 = phi i8* [ undef, %do.end329 ], [ %incdec.ptr331, %do.body330 ] 33 %dp.addr.5 = phi i8* [ undef, %do.end329 ], [ %incdec.ptr332, %do.body330 ] 34 %0 = load i8, i8* %sp.5, align 1 35 store i8 %0, i8* %dp.addr.5, align 1 36 %incdec.ptr332 = getelementptr inbounds i8, i8* %dp.addr.5, i32 1 37 %incdec.ptr331 = getelementptr inbounds i8, i8* %sp.5, i32 1 38 %dec334 = add i32 %row_width.7, -1 39 %cmp335 = icmp eq i32 %dec334, 0 40 br i1 %cmp335, label %if.end375, label %do.body330 41 42if.end375: 43 ret void 44} 45 46attributes #0 = { nounwind } 47