1cee313d2SEric Christopher; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 2cee313d2SEric Christopher; This is currently failing because of bug in LoopSimplifyCFG. It does not update 3cee313d2SEric Christopher; duplicating Phi inputs properly. 4cee313d2SEric Christopher; REQUIRES: asserts 55249e6f2SArthur Eubanks; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -passes='require<domtree>,loop(loop-simplifycfg)' -debug-only=loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s 6a3712e87SRoman Lebedev; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -passes=loop-simplifycfg -verify-memoryssa -debug-only=loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s 7cee313d2SEric Christopher 8cee313d2SEric Christophertarget datalayout = "P40" 9cee313d2SEric Christopher 10cee313d2SEric Christopher@a = external global i16, align 1 11cee313d2SEric Christopher 12cee313d2SEric Christopherdefine void @f1(i1 %cond) { 13cee313d2SEric Christopher; CHECK-LABEL: @f1( 14cee313d2SEric Christopher; CHECK-NEXT: entry: 15cee313d2SEric Christopher; CHECK-NEXT: br label [[FOR_COND:%.*]] 16cee313d2SEric Christopher; CHECK: for.cond: 17cee313d2SEric Christopher; CHECK-NEXT: br i1 [[COND:%.*]], label [[IF_THEN:%.*]], label [[FOR_INC:%.*]] 18cee313d2SEric Christopher; CHECK: if.then: 19*055fb779SNikita Popov; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr @a, align 1 20cee313d2SEric Christopher; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i16 [[TMP0]], 0 21cee313d2SEric Christopher; CHECK-NEXT: br label [[FOR_INC]] 22cee313d2SEric Christopher; CHECK: for.inc: 23cee313d2SEric Christopher; CHECK-NEXT: [[C_1:%.*]] = phi i16 [ 2, [[IF_THEN]] ], [ 1, [[FOR_COND]] ] 24cee313d2SEric Christopher; CHECK-NEXT: br label [[FOR_COND]] 25cee313d2SEric Christopher; 26cee313d2SEric Christopherentry: 27cee313d2SEric Christopher br label %for.cond 28cee313d2SEric Christopher 29cee313d2SEric Christopherfor.cond: 30cee313d2SEric Christopher br i1 %cond, label %if.then, label %for.inc 31cee313d2SEric Christopher 32cee313d2SEric Christopherif.then: 33*055fb779SNikita Popov %0 = load i16, ptr @a, align 1 34cee313d2SEric Christopher %tobool = icmp ne i16 %0, 0 35cee313d2SEric Christopher br i1 %tobool, label %for.inc, label %for.inc 36cee313d2SEric Christopher 37cee313d2SEric Christopherfor.inc: 38cee313d2SEric Christopher %c.1 = phi i16 [ 2, %if.then ], [ 2, %if.then ], [ 1, %for.cond ] 39cee313d2SEric Christopher br label %for.cond 40cee313d2SEric Christopher} 41