50 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=gvn -S < %s | FileCheck %s --check-prefixes=CHECK,MDEP3; RUN: opt -passes='gvn<memoryssa>' -S < %s | FileCheck %s --check-prefixes=CHECK,MSSA4 5; Check that PRE-LOAD across backedge does not6; result in invalid dominator tree.7declare void @use(i32)8 9define void @test1(i1 %c, i32 %arg) {10; CHECK-LABEL: @test1(11; CHECK-NEXT: br i1 [[C:%.*]], label [[BB1:%.*]], label [[DOTBB2_CRIT_EDGE:%.*]]12; CHECK: .bb2_crit_edge:13; CHECK-NEXT: [[DOTPRE:%.*]] = shl i32 [[ARG:%.*]], 214; CHECK-NEXT: br label [[BB2:%.*]]15; CHECK: bb1:16; CHECK-NEXT: [[SHL1:%.*]] = shl i32 [[ARG]], 217; CHECK-NEXT: br label [[BB3:%.*]]18; CHECK: bb2:19; CHECK-NEXT: [[SHL2_PRE_PHI:%.*]] = phi i32 [ [[DOTPRE]], [[DOTBB2_CRIT_EDGE]] ], [ [[SHL3:%.*]], [[BB3]] ]20; CHECK-NEXT: call void @use(i32 [[SHL2_PRE_PHI]])21; CHECK-NEXT: br label [[BB3]]22; CHECK: bb3:23; CHECK-NEXT: [[SHL3]] = shl i32 [[ARG]], 224; CHECK-NEXT: [[GEP:%.*]] = getelementptr i32, ptr null, i32 [[SHL3]]25; CHECK-NEXT: [[V:%.*]] = load i32, ptr [[GEP]], align 426; CHECK-NEXT: call void @use(i32 [[V]])27; CHECK-NEXT: br label [[BB2]]28;29 br i1 %c, label %bb1, label %bb230 31bb1:32 %shl1 = shl i32 %arg, 233 br label %bb334 35bb2:36 %shl2 = shl i32 %arg, 237 call void @use(i32 %shl2)38 br label %bb339 40bb3:41 %shl3 = shl i32 %arg, 242 %gep = getelementptr i32, ptr null, i32 %shl343 %v = load i32, ptr %gep, align 444 call void @use(i32 %v)45 br label %bb246}47;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:48; MDEP: {{.*}}49; MSSA: {{.*}}50