From e8df5bd92b95b86427b167b8e0b5753a87e42530 Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Wed, 17 Apr 2013 07:20:36 +0000 Subject: [PATCH] IndependentBlocks: We can only reconstruct PHI nodes that are within the ScoP In the classical (non -polly-codegen-scev) mode, we assume that we can always recreate PHI nodes during code generation. This is not true. We can only reconstruct them from the polyhedral information, in case the entire loop of the PHI node is part of the SCoP and consequently the PHI node was translated in the polyhedral description. llvm-svn: 179674 --- polly/lib/CodeGen/BlockGenerators.cpp | 2 +- polly/test/Isl/CodeGen/20110226-PHI-Node-removed.ll | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index 6eb2e583c38e..1baefaf0ee29 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -58,7 +58,7 @@ bool polly::canSynthesize(const Instruction *I, const llvm::LoopInfo *LI, } Loop *L = LI->getLoopFor(I->getParent()); - return L && I == L->getCanonicalInductionVariable(); + return L && I == L->getCanonicalInductionVariable() && R->contains(L); } // Helper class to generate memory location. diff --git a/polly/test/Isl/CodeGen/20110226-PHI-Node-removed.ll b/polly/test/Isl/CodeGen/20110226-PHI-Node-removed.ll index a519e46dc6c8..75676be3b470 100644 --- a/polly/test/Isl/CodeGen/20110226-PHI-Node-removed.ll +++ b/polly/test/Isl/CodeGen/20110226-PHI-Node-removed.ll @@ -1,6 +1,4 @@ ; RUN: opt %loadPolly %defaultOpts -polly-codegen-isl %s -; -polly-indenpendent causes: Cannot generate independent blocks -; XFAIL:* 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"