forked from OSchip/llvm-project
Dependences: Clarify difference between value and memory based dependences
We make the option a clear choice between the two analysis types and add descriptions about the difference between the two. llvm-svn: 186251
This commit is contained in:
parent
e7d26f9b49
commit
229d681675
|
@ -38,10 +38,20 @@ LegalityCheckDisabled("disable-polly-legality",
|
|||
cl::desc("Disable polly legality check"), cl::Hidden,
|
||||
cl::init(false), cl::cat(PollyCategory));
|
||||
|
||||
static cl::opt<bool>
|
||||
ValueDependences("polly-value-dependences",
|
||||
cl::desc("Use value instead of memory based dependences"),
|
||||
cl::Hidden, cl::init(true), cl::cat(PollyCategory));
|
||||
enum AnalysisType {
|
||||
VALUE_BASED_ANALYSIS,
|
||||
MEMORY_BASED_ANALYSIS
|
||||
};
|
||||
|
||||
static cl::opt<enum AnalysisType> OptAnalysisType(
|
||||
"polly-dependences-analysis-type",
|
||||
cl::desc("The kind of dependence analysis to use"),
|
||||
cl::values(clEnumValN(VALUE_BASED_ANALYSIS, "value-based",
|
||||
"Exact dependences without transitive dependences"),
|
||||
clEnumValN(MEMORY_BASED_ANALYSIS, "memory-based",
|
||||
"Overapproximation of dependences"),
|
||||
clEnumValEnd),
|
||||
cl::Hidden, cl::init(VALUE_BASED_ANALYSIS), cl::cat(PollyCategory));
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
Dependences::Dependences() : ScopPass(ID) { RAW = WAR = WAW = NULL; }
|
||||
|
@ -80,7 +90,7 @@ void Dependences::calculateDependences(Scop &S) {
|
|||
|
||||
collectInfo(S, &Read, &Write, &MayWrite, &Schedule);
|
||||
|
||||
if (ValueDependences) {
|
||||
if (OptAnalysisType == VALUE_BASED_ANALYSIS) {
|
||||
isl_union_map_compute_flow(
|
||||
isl_union_map_copy(Read), isl_union_map_copy(Write),
|
||||
isl_union_map_copy(MayWrite), isl_union_map_copy(Schedule), &RAW, NULL,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; RUN: opt %loadPolly -basicaa -polly-dependences -analyze -polly-value-dependences=true < %s | FileCheck %s -check-prefix=VALUE
|
||||
; RUN: opt %loadPolly -basicaa -polly-dependences -analyze -polly-value-dependences=false < %s | FileCheck %s -check-prefix=MEMORY
|
||||
; RUN: opt %loadPolly -basicaa -polly-dependences -analyze -polly-dependences-analysis-type=value-based < %s | FileCheck %s -check-prefix=VALUE
|
||||
; RUN: opt %loadPolly -basicaa -polly-dependences -analyze -polly-dependences-analysis-type=memory-based < %s | FileCheck %s -check-prefix=MEMORY
|
||||
|
||||
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"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
|
Loading…
Reference in New Issue