1; RUN: opt < %s -nary-reassociate -S -o - | FileCheck %s 2 3; The test check that compilation does not segv (see pr37539). 4 5define void @f1() { 6; CHECK-LABEL: @f1( 7; CHECK-NEXT: br label %[[BB1:.*]] 8; CHECK: [[BB1]] 9; CHECK-NEXT: [[P1:%.*]] = phi i16 [ 0, [[TMP0:%.*]] ], [ [[A1:%.*]], %[[BB1]] ] 10; CHECK-NEXT: [[SCEVGEP_OFFS:%.*]] = add i16 2, 0 11; CHECK-NEXT: [[A1]] = add i16 [[P1]], [[SCEVGEP_OFFS]] 12; CHECK-NEXT: br i1 false, label %[[BB1]], label %[[BB7:.*]] 13; CHECK: [[BB7]] 14; CHECK-NEXT: ret void 15; 16 br label %bb1 17 18bb1: 19 %p1 = phi i16 [ 0, %0 ], [ %a1, %bb1 ] 20 %p2 = phi i16 [ 0, %0 ], [ %a2, %bb1 ] 21 %scevgep.offs = add i16 2, 0 22 %a1 = add i16 %p1, %scevgep.offs 23 %scevgep.offs5 = add i16 2, 0 24 %a2 = add i16 %p2, %scevgep.offs5 25 br i1 false, label %bb1, label %bb7 26 27bb7: 28 ret void 29} 30