1; REQUIRES: asserts 2; RUN: opt < %s -indvars -disable-output -stats -info-output-file - | FileCheck %s 3; Check that IndVarSimplify is not creating unnecessary canonical IVs 4; that will never be used. 5; CHECK-NOT: indvars 6 7target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" 8 9@ue = external global i64 10 11define i32 @foo() nounwind { 12entry: 13 br label %bb38.i 14 15bb14.i27: 16 %t0 = load i64, i64* @ue, align 8 17 %t1 = sub i64 %t0, %i.0.i35 18 %t2 = add i64 %t1, 1 19 br i1 undef, label %bb15.i28, label %bb19.i31 20 21bb15.i28: 22 br label %bb19.i31 23 24bb19.i31: 25 %y.0.i = phi i64 [ %t2, %bb15.i28 ], [ %t2, %bb14.i27 ] 26 br label %bb35.i 27 28bb35.i: 29 br i1 undef, label %bb37.i, label %bb14.i27 30 31bb37.i: 32 %t3 = add i64 %i.0.i35, 1 33 br label %bb38.i 34 35bb38.i: 36 %i.0.i35 = phi i64 [ 1, %entry ], [ %t3, %bb37.i ] 37 br label %bb35.i 38} 39