friend struct AnalysisInfoMixin<DependenceAnalysis>;
}; // class DependenceAnalysis
+ /// Printer pass to dump DA results.
+ struct DependenceAnalysisPrinterPass
+ : public PassInfoMixin<DependenceAnalysisPrinterPass> {
+ DependenceAnalysisPrinterPass(raw_ostream &OS) : OS(OS) {}
+
+ PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
+
+ private:
+ raw_ostream &OS;
+ }; // class DependenceAnalysisPrinterPass
+
/// Legacy pass manager pass to access dependence information
class DependenceAnalysisWrapperPass : public FunctionPass {
public:
dumpExampleDependence(OS, info.get());
}
+PreservedAnalyses
+DependenceAnalysisPrinterPass::run(Function &F, FunctionAnalysisManager &FAM) {
+ OS << "'Dependence Analysis' for function '" << F.getName() << "':\n";
+ dumpExampleDependence(OS, &FAM.getResult<DependenceAnalysis>(F));
+ return PreservedAnalyses::all();
+}
+
//===----------------------------------------------------------------------===//
// Dependence methods
FUNCTION_PASS("print<assumptions>", AssumptionPrinterPass(dbgs()))
FUNCTION_PASS("print<block-freq>", BlockFrequencyPrinterPass(dbgs()))
FUNCTION_PASS("print<branch-prob>", BranchProbabilityPrinterPass(dbgs()))
+FUNCTION_PASS("print<da>", DependenceAnalysisPrinterPass(dbgs()))
FUNCTION_PASS("print<domtree>", DominatorTreePrinterPass(dbgs()))
FUNCTION_PASS("print<postdomtree>", PostDominatorTreePrinterPass(dbgs()))
FUNCTION_PASS("print<demanded-bits>", DemandedBitsPrinterPass(dbgs()))
+; RUN: opt < %s -disable-output "-passes=print<da>" \
+; RUN: "-aa-pipeline=basic-aa,type-based-aa" 2>&1 | FileCheck %s
; RUN: opt < %s -analyze -basicaa -tbaa -da | FileCheck %s
; CHECK-LABEL: 'Dependence Analysis' for function 'test_no_noalias'
+; RUN: opt < %s -disable-output -da-delinearize=false "-passes=print<da>" \
+; RUN: -aa-pipeline=basic-aa 2>&1 | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da -da-delinearize=false | FileCheck %s
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s -check-prefix=DELIN
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s -check-prefix=DELIN
target 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-n8:16:32:64-S128"
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
; Test that the dependence analysis generates the correct results when using
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1
; RUN: opt < %s -analyze -basicaa -da
;; Check that this code doesn't abort. Test case is reduced version of lnt Polybench benchmark test case dynprog.
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
target 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-n8:16:32:64-S128"
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
; ModuleID = 'ExactRDIV.bc'
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
target 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-n8:16:32:64-S128"
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s -check-prefix=DELIN
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s -check-prefix=DELIN
target 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-n8:16:32:64-S128"
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
; Test for a bug, which caused an assert when an invalid
; RUN: opt < %s -analyze -basicaa -da
+; RUN: opt < %s -passes="print<da>"
; Test that the dependence analysis pass does seg-fault due to a null pointer
; dereference. The code in gcdMIVTest requires a null check for the result of
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1
; RUN: opt < %s -analyze -basicaa -da
;
; CHECK: da analyze - consistent input [S S]!
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s -check-prefix=DELIN
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s -check-prefix=DELIN
target 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-n8:16:32:64-S128"
+; RUN: opt < %s -disable-output "-passes=print<da>" \
+; RUN: "-aa-pipeline=basic-aa,globals-aa" 2>&1 | FileCheck %s
; RUN: opt < %s -analyze -basicaa -globals-aa -da | FileCheck %s
define void @i32_subscript(i32* %a) {
entry:
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
target 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-n8:16:32:64-S128"
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
target 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-n8:16:32:64-S128"
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
target 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-n8:16:32:64-S128"
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
target 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-n8:16:32:64-S128"
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
; ModuleID = 'SymbolicRDIV.bc'
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
target 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-n8:16:32:64-S128"
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1
; RUN: opt < %s -analyze -basicaa -da
;; Check this doesn't crash.
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
; ModuleID = 'WeakCrossingSIV.bc'
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
; ModuleID = 'WeakZeroDstSIV.bc'
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
; ModuleID = 'WeakZeroSrcSIV.bc'
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
; ModuleID = 'ZIV.bc'