67 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 10 define void @f1(i1 %arg) {11 entry:12 %arrayidx = getelementptr inbounds [2 x i16], ptr undef, i16 0, i16 213 br label %for.cond14 15 for.cond.loopexit:16 br label %for.cond17 18 for.cond:19 %0 = phi ptr [ %arrayidx, %entry ], [ %10, %for.cond.loopexit ]20 %1 = phi ptr [ %arrayidx, %entry ], [ %12, %for.cond.loopexit ]21 br label %for.body22 23 for.body:24 %2 = phi ptr [ %1, %for.cond ], [ %12, %cleanup ]25 %3 = phi ptr [ %0, %for.cond ], [ %11, %cleanup ]26 %4 = phi ptr [ %0, %for.cond ], [ %10, %cleanup ]27 br i1 %arg, label %for.cond2.preheader, label %if.then28 29 for.cond2.preheader:30 br label %for.cond231 32 if.then:33 store i32 undef, ptr %2, align 134 br label %cleanup35 36 for.cond2:37 %5 = phi ptr [ %8, %for.inc ], [ %4, %for.cond2.preheader ]38 %6 = phi ptr [ %9, %for.inc ], [ %3, %for.cond2.preheader ]39 %7 = phi ptr [ %9, %for.inc ], [ %2, %for.cond2.preheader ]40 br i1 %arg, label %for.inc, label %if.then541 42 if.then5:43 br i1 true, label %cleanup.loopexit, label %if.end44 45 if.end:46 br label %for.inc47 48 for.inc:49 %8 = phi ptr [ %5, %if.end ], [ undef, %for.cond2 ]50 %9 = phi ptr [ %6, %if.end ], [ undef, %for.cond2 ]51 br label %for.cond252 53 cleanup.loopexit:54 br label %cleanup55 56 cleanup:57 %10 = phi ptr [ %4, %if.then ], [ %5, %cleanup.loopexit ]58 %11 = phi ptr [ %3, %if.then ], [ %6, %cleanup.loopexit ]59 %12 = phi ptr [ %2, %if.then ], [ %7, %cleanup.loopexit ]60 br i1 true, label %for.cond.loopexit, label %for.body61 }62 63...64 65# A check to verify that something got through.66# CHECK-LABEL: entry:67