brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · cf933cc Raw
64 lines · plain
1; Test that memdep gets invalidated when the analyses it depends on are2; invalidated.3;4; Check AA. AA is stateless, but given an explicit invalidate (abandon) the5; AAManager is invalidated and we must invalidate memdep as well given6; the transitive dependency.7; RUN: opt -disable-output -debug-pass-manager -aa-pipeline='basic-aa' %s 2>&1 \8; RUN:     -passes='require<memdep>,invalidate<aa>,gvn' \9; RUN:     | FileCheck %s --check-prefix=CHECK-AA-INVALIDATE10; CHECK-AA-INVALIDATE: Running pass: RequireAnalysisPass11; CHECK-AA-INVALIDATE: Running analysis: MemoryDependenceAnalysis12; CHECK-AA-INVALIDATE: Running pass: InvalidateAnalysisPass13; CHECK-AA-INVALIDATE: Invalidating analysis: AAManager14; CHECK-AA-INVALIDATE: Invalidating analysis: MemoryDependenceAnalysis15; CHECK-AA-INVALIDATE: Running pass: GVNPass16; CHECK-AA-INVALIDATE: Running analysis: MemoryDependenceAnalysis17;18; Check domtree specifically.19; RUN: opt -disable-output -debug-pass-manager %s 2>&1 \20; RUN:     -passes='require<memdep>,invalidate<domtree>,gvn' \21; RUN:     | FileCheck %s --check-prefix=CHECK-DT-INVALIDATE22; CHECK-DT-INVALIDATE: Running pass: RequireAnalysisPass23; CHECK-DT-INVALIDATE: Running analysis: MemoryDependenceAnalysis24; CHECK-DT-INVALIDATE: Running pass: InvalidateAnalysisPass25; CHECK-DT-INVALIDATE: Invalidating analysis: DominatorTreeAnalysis26; CHECK-DT-INVALIDATE: Invalidating analysis: MemoryDependenceAnalysis27; CHECK-DT-INVALIDATE: Running pass: GVNPass28; CHECK-DT-INVALIDATE: Running analysis: MemoryDependenceAnalysis29;30 31define void @test_use_domtree(ptr nocapture %bufUInt, ptr nocapture %pattern) nounwind {32entry:33  br label %for.body34 35for.exit:                                         ; preds = %for.body36  ret void37 38for.body:                                         ; preds = %for.body, %entry39  %i.01 = phi i32 [ 0, %entry ], [ %tmp8.7, %for.body ]40  %arrayidx = getelementptr i32, ptr %bufUInt, i32 %i.0141  %arrayidx5 = getelementptr i32, ptr %pattern, i32 %i.0142  %tmp6 = load i32, ptr %arrayidx5, align 443  store i32 %tmp6, ptr %arrayidx, align 444  %tmp8.7 = add i32 %i.01, 845  %cmp.7 = icmp ult i32 %tmp8.7, 102446  br i1 %cmp.7, label %for.body, label %for.exit47}48 49%t = type { i32 }50declare void @foo(ptr)51 52define void @test_use_aa(ptr noalias %stuff ) {53entry:54  %before = load i32, ptr %stuff55 56  call void @foo(ptr null)57 58  %after = load i32, ptr %stuff59  %sum = add i32 %before, %after60 61  store i32 %sum, ptr %stuff62  ret void63}64