[DA][NewPM] Add a printerpass and port the testsuite
The new-pm version of DA is untested. Testing requires a printer, so add that and use it in the existing DA tests. Differential Revision: https://reviews.llvm.org/D56386 llvm-svn: 350624
This commit is contained in:
parent
7a6d7672c1
commit
efb5ad1c58
|
@ -936,6 +936,17 @@ template <typename T> class ArrayRef;
|
||||||
friend struct AnalysisInfoMixin<DependenceAnalysis>;
|
friend struct AnalysisInfoMixin<DependenceAnalysis>;
|
||||||
}; // class 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
|
/// Legacy pass manager pass to access dependence information
|
||||||
class DependenceAnalysisWrapperPass : public FunctionPass {
|
class DependenceAnalysisWrapperPass : public FunctionPass {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -194,6 +194,13 @@ void DependenceAnalysisWrapperPass::print(raw_ostream &OS,
|
||||||
dumpExampleDependence(OS, info.get());
|
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
|
// Dependence methods
|
||||||
|
|
||||||
|
|
|
@ -201,6 +201,7 @@ FUNCTION_PASS("print", PrintFunctionPass(dbgs()))
|
||||||
FUNCTION_PASS("print<assumptions>", AssumptionPrinterPass(dbgs()))
|
FUNCTION_PASS("print<assumptions>", AssumptionPrinterPass(dbgs()))
|
||||||
FUNCTION_PASS("print<block-freq>", BlockFrequencyPrinterPass(dbgs()))
|
FUNCTION_PASS("print<block-freq>", BlockFrequencyPrinterPass(dbgs()))
|
||||||
FUNCTION_PASS("print<branch-prob>", BranchProbabilityPrinterPass(dbgs()))
|
FUNCTION_PASS("print<branch-prob>", BranchProbabilityPrinterPass(dbgs()))
|
||||||
|
FUNCTION_PASS("print<da>", DependenceAnalysisPrinterPass(dbgs()))
|
||||||
FUNCTION_PASS("print<domtree>", DominatorTreePrinterPass(dbgs()))
|
FUNCTION_PASS("print<domtree>", DominatorTreePrinterPass(dbgs()))
|
||||||
FUNCTION_PASS("print<postdomtree>", PostDominatorTreePrinterPass(dbgs()))
|
FUNCTION_PASS("print<postdomtree>", PostDominatorTreePrinterPass(dbgs()))
|
||||||
FUNCTION_PASS("print<demanded-bits>", DemandedBitsPrinterPass(dbgs()))
|
FUNCTION_PASS("print<demanded-bits>", DemandedBitsPrinterPass(dbgs()))
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; RUN: opt < %s -analyze -basicaa -tbaa -da | FileCheck %s
|
||||||
|
|
||||||
; CHECK-LABEL: 'Dependence Analysis' for function 'test_no_noalias'
|
; CHECK-LABEL: 'Dependence Analysis' for function 'test_no_noalias'
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
|
; 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 -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
|
; 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"
|
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"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
|
||||||
|
|
||||||
; Test that the dependence analysis generates the correct results when using
|
; Test that the dependence analysis generates the correct results when using
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1
|
||||||
; RUN: opt < %s -analyze -basicaa -da
|
; 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.
|
;; Check that this code doesn't abort. Test case is reduced version of lnt Polybench benchmark test case dynprog.
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; 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"
|
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"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; 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"
|
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
|
||||||
|
|
||||||
; ModuleID = 'ExactRDIV.bc'
|
; ModuleID = 'ExactRDIV.bc'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; 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"
|
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"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; 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"
|
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"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
|
||||||
|
|
||||||
; Test for a bug, which caused an assert when an invalid
|
; Test for a bug, which caused an assert when an invalid
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
; RUN: opt < %s -analyze -basicaa -da
|
; 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
|
; 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
|
; dereference. The code in gcdMIVTest requires a null check for the result of
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1
|
||||||
; RUN: opt < %s -analyze -basicaa -da
|
; RUN: opt < %s -analyze -basicaa -da
|
||||||
;
|
;
|
||||||
; CHECK: da analyze - consistent input [S S]!
|
; CHECK: da analyze - consistent input [S S]!
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; 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"
|
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"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; RUN: opt < %s -analyze -basicaa -globals-aa -da | FileCheck %s
|
||||||
define void @i32_subscript(i32* %a) {
|
define void @i32_subscript(i32* %a) {
|
||||||
entry:
|
entry:
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; 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"
|
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"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; 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"
|
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"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; 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"
|
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"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; 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"
|
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"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
|
||||||
|
|
||||||
; ModuleID = 'SymbolicRDIV.bc'
|
; ModuleID = 'SymbolicRDIV.bc'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; 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"
|
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"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1
|
||||||
; RUN: opt < %s -analyze -basicaa -da
|
; RUN: opt < %s -analyze -basicaa -da
|
||||||
;; Check this doesn't crash.
|
;; Check this doesn't crash.
|
||||||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
|
||||||
|
|
||||||
; ModuleID = 'WeakCrossingSIV.bc'
|
; ModuleID = 'WeakCrossingSIV.bc'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
|
||||||
|
|
||||||
; ModuleID = 'WeakZeroDstSIV.bc'
|
; ModuleID = 'WeakZeroDstSIV.bc'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
|
||||||
|
|
||||||
; ModuleID = 'WeakZeroSrcSIV.bc'
|
; ModuleID = 'WeakZeroSrcSIV.bc'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
; 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
|
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
|
||||||
|
|
||||||
; ModuleID = 'ZIV.bc'
|
; ModuleID = 'ZIV.bc'
|
||||||
|
|
Loading…
Reference in New Issue