1;RUN: opt %s -passes='adce,loop(rotate),adce' -S -debug-pass-manager -debug-only=loop-rotate 2>&1 | FileCheck %s 2;REQUIRES: asserts 3 4; This test is to make sure we invalidate the post dominator pass after loop rotate simplifies the loop latch. 5; The adce passes are here to make sure post dominator analysis is required. 6 7; CHECK: Starting llvm::Function pass manager run. 8; CHECK-NEXT: Running pass: ADCEPass on f 9; CHECK-NEXT: Running analysis: DominatorTreeAnalysis on f 10; CHECK-NEXT: Running analysis: PostDominatorTreeAnalysis on f 11; CHECK-NEXT: Running pass: FunctionToLoopPassAdaptor{{.*}} on f 12; CHECK-NEXT: Starting llvm::Function pass manager run. 13; CHECK-NEXT: Running pass: LoopSimplifyPass on f 14; CHECK-NEXT: Running analysis: LoopAnalysis on f 15; CHECK-NEXT: Running analysis: AssumptionAnalysis on f 16; CHECK-NEXT: Running pass: LCSSAPass on f 17; CHECK-NEXT: Finished llvm::Function pass manager run. 18; CHECK-NEXT: Running analysis: AAManager on f 19; CHECK-NEXT: Running analysis: TargetLibraryAnalysis on f 20; CHECK-NEXT: Running analysis: ScalarEvolutionAnalysis on f 21; CHECK-NEXT: Running analysis: TargetIRAnalysis on f 22; CHECK-NEXT: Running analysis: InnerAnalysisManagerProxy{{.*}} on f 23; CHECK-NEXT: Starting Loop pass manager run. 24; CHECK-NEXT: Running pass: LoopRotatePass on Loop at depth 1 containing: %bb<header><exiting>,%bb4<latch> 25; CHECK-NEXT: Folding loop latch bb4 into bb 26; CHECK-NEXT: Invalidating all non-preserved analyses for: bb 27; CHECK-NEXT: Finished Loop pass manager run. 28; CHECK-NEXT: Invalidating all non-preserved analyses for: f 29; CHECK-NEXT: Invalidating analysis: PostDominatorTreeAnalysis on f 30; CHECK-NEXT: Running pass: ADCEPass on f 31; CHECK-NEXT: Running analysis: PostDominatorTreeAnalysis on f 32; CHECK-NEXT: Finished llvm::Function pass manager run. 33 34; CHECK-LABEL: define i8 @f() { 35; CHECK-NEXT : entry: 36; CHECK-NEXT : br label %bb 37; CHECK-NEXT : 38; CHECK-NEXT : bb: ; preds = %bb, %entry 39; CHECK-NEXT : %mode.0 = phi i8 [ 0, %entry ], [ %indvar.next, %bb ] 40; CHECK-NEXT : %tmp5 = icmp eq i8 %mode.0, 1 41; CHECK-NEXT : %indvar.next = add i8 %mode.0, 1 42; CHECK-NEXT : br i1 %tmp5, label %bb5, label %bb 43; CHECK-NEXT : 44; CHECK-NEXT : bb5: ; preds = %bb 45; CHECK-NEXT : tail call void @raise_exception() #0 46; CHECK-NEXT : unreachable 47; CHECK-NEXT : } 48; CHECK-NEXT : 49; CHECK-NEXT : ; Function Attrs: noreturn 50; CHECK-NEXT : declare void @raise_exception() #0 51; CHECK-NEXT : 52; CHECK-NEXT : attributes #0 = { noreturn } 53 54define i8 @f() { 55entry: 56 br label %bb 57 58bb: ; preds = %bb4, %entry 59 %mode.0 = phi i8 [ 0, %entry ], [ %indvar.next, %bb4 ] 60 %tmp5 = icmp eq i8 %mode.0, 1 61 br i1 %tmp5, label %bb5, label %bb4 62 63bb4: ; preds = %bb2 64 %indvar.next = add i8 %mode.0, 1 65 br label %bb 66 67bb5: ; preds = %bb2 68 tail call void @raise_exception() #0 69 unreachable 70} 71 72; Function Attrs: noreturn 73declare void @raise_exception() #0 74 75attributes #0 = { noreturn } 76