forked from OSchip/llvm-project
Dead code elimination: Schedule another approximative step before actual DCE
In 'obsequi' we have a scop in which the current dead code elimination works, but the generated code is way too complex. To avoid this trouble (and to not disable the DCE entirely) we add an additional approximative step before the actual dead code elimination. This should fix one of the two current nightly-test issues. Polly could be improved to handle 'obsequi' by teaching it to introduce only a single parameter for (%1 and zext %1) which halves the number of parameters and allows polly to derive a simpler representation for the set of live iterations. However, this needs some time to investigate. I will commit a test case as soon as we have a reduced one. llvm-svn: 202010
This commit is contained in:
parent
04f2bf0f07
commit
356faa8f09
|
@ -47,9 +47,10 @@ namespace {
|
|||
|
||||
cl::opt<int> DCEPreciseSteps(
|
||||
"polly-dce-precise-steps",
|
||||
cl::desc(
|
||||
"The number of precise steps between two approximating iterations"),
|
||||
cl::init(2));
|
||||
cl::desc("The number of precise steps between two approximating "
|
||||
"iterations. (A value of -1 schedules another approximation stage "
|
||||
"before the actual dead code elimination."),
|
||||
cl::init(-1));
|
||||
|
||||
class DeadCodeElim : public ScopPass {
|
||||
|
||||
|
@ -103,6 +104,9 @@ bool DeadCodeElim::eliminateDeadCode(Scop &S, int PreciseSteps) {
|
|||
isl_union_map *Dep = D->getDependences(Dependences::TYPE_RAW);
|
||||
Dep = isl_union_map_reverse(Dep);
|
||||
|
||||
if (PreciseSteps == -1)
|
||||
Live = isl_union_set_affine_hull(Live);
|
||||
|
||||
isl_union_set *OriginalDomain = S.getDomains();
|
||||
int Steps = 0;
|
||||
while (true) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt -S %loadPolly -basicaa -polly-dependences-analysis-type=value-based -polly-dce -polly-ast -analyze < %s | FileCheck %s -check-prefix=CHECK
|
||||
; RUN: opt -S %loadPolly -basicaa -polly-dependences-analysis-type=value-based -polly-dce -polly-dce-precise-steps=2 -polly-ast -analyze < %s | FileCheck %s -check-prefix=CHECK
|
||||
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-pc-linux-gnu"
|
||||
;
|
||||
|
|
Loading…
Reference in New Issue