46 lines · plain
1# RUN: llc -run-pass=codegenprepare -o - %s | FileCheck %s2 3# REQUIRES: default_triple4 5# This testcase without the accompanying fix triggers the assert6# "Replacement PHI node is already replaced."7 8--- |9 define void @f1(i1 %arg) {10 entry:11 %arrayidx = getelementptr inbounds [2 x i16], ptr undef, i16 0, i16 212 br label %for.cond13 14 for.cond:15 %0 = phi ptr [ %arrayidx, %entry ], [ %5, %cleanup ]16 %1 = phi ptr [ %arrayidx, %entry ], [ %7, %cleanup ]17 br label %for.body18 19 for.body:20 %2 = phi ptr [ %1, %for.cond ], [ %7, %cleanup ]21 %3 = phi ptr [ %0, %for.cond ], [ %7, %cleanup ]22 %4 = phi ptr [ %0, %for.cond ], [ %7, %cleanup ]23 br i1 false, label %for.cond2, label %if.then24 25 if.then:26 store i32 undef, ptr %2, align 127 unreachable28 29 for.cond2:30 %5 = phi ptr [ %4, %for.body ], [ %5, %if.then5 ], [ undef, %for.cond2 ]31 %6 = phi ptr [ %3, %for.body ], [ %6, %if.then5 ], [ undef, %for.cond2 ]32 %7 = phi ptr [ %2, %for.body ], [ %6, %if.then5 ], [ undef, %for.cond2 ]33 br i1 %arg, label %for.cond2, label %if.then534 35 if.then5:36 br i1 %arg, label %cleanup, label %for.cond237 38 cleanup:39 br i1 true, label %for.cond, label %for.body40 }41 42...43 44# A check to verify that something got through.45# CHECK-LABEL: entry:46