diff --git a/polly/lib/Analysis/Dependences.cpp b/polly/lib/Analysis/Dependences.cpp index 61b1c1b29023..0950f3536e69 100644 --- a/polly/lib/Analysis/Dependences.cpp +++ b/polly/lib/Analysis/Dependences.cpp @@ -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 -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 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, diff --git a/polly/test/Dependences/do_pluto_matmult.ll b/polly/test/Dependences/do_pluto_matmult.ll index c0263056a074..fc9f518f9686 100644 --- a/polly/test/Dependences/do_pluto_matmult.ll +++ b/polly/test/Dependences/do_pluto_matmult.ll @@ -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"