[Polly] Migrate -polly-mse to the new pass manager.

This patch implements the `MaximalStaticExpansion` and its printer in NPM.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D125870
This commit is contained in:
Yang Keao 2022-06-01 13:09:58 -05:00 committed by Michael Kruse
parent a4425cc914
commit 02f640672e
16 changed files with 487 additions and 358 deletions

View File

@ -162,7 +162,7 @@ void initializeManagedMemoryRewritePassPass(llvm::PassRegistry &);
#endif #endif
void initializeIslScheduleOptimizerWrapperPassPass(llvm::PassRegistry &); void initializeIslScheduleOptimizerWrapperPassPass(llvm::PassRegistry &);
void initializeIslScheduleOptimizerPrinterLegacyPassPass(llvm::PassRegistry &); void initializeIslScheduleOptimizerPrinterLegacyPassPass(llvm::PassRegistry &);
void initializeMaximalStaticExpanderPass(llvm::PassRegistry &); void initializeMaximalStaticExpanderWrapperPassPass(llvm::PassRegistry &);
void initializePollyCanonicalizePass(llvm::PassRegistry &); void initializePollyCanonicalizePass(llvm::PassRegistry &);
void initializeFlattenSchedulePass(llvm::PassRegistry &); void initializeFlattenSchedulePass(llvm::PassRegistry &);
void initializeFlattenSchedulePrinterLegacyPassPass(llvm::PassRegistry &); void initializeFlattenSchedulePrinterLegacyPassPass(llvm::PassRegistry &);

View File

@ -0,0 +1,42 @@
//===- polly/MaximalStaticExpansion.h - expand memory access -*- C++ -*-======//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This pass fully expand the memory accesses of a Scop to get rid of
// dependencies.
//
//===----------------------------------------------------------------------===//
#ifndef POLLY_MAXIMALSTATICEXPANSION_H
#define POLLY_MAXIMALSTATICEXPANSION_H
#include "polly/ScopPass.h"
#include "llvm/IR/PassManager.h"
namespace polly {
class MaximalStaticExpansionPass
: public llvm::PassInfoMixin<MaximalStaticExpansionPass> {
public:
llvm::PreservedAnalyses run(Scop &, ScopAnalysisManager &,
ScopStandardAnalysisResults &, SPMUpdater &);
};
struct MaximalStaticExpansionPrinterPass
: llvm::PassInfoMixin<MaximalStaticExpansionPrinterPass> {
MaximalStaticExpansionPrinterPass(raw_ostream &OS) : OS(OS) {}
PreservedAnalyses run(Scop &S, ScopAnalysisManager &,
ScopStandardAnalysisResults &SAR, SPMUpdater &);
private:
llvm::raw_ostream &OS;
};
} // namespace polly
#endif /* POLLY_MAXIMALSTATICEXPANSION_H */

View File

@ -43,4 +43,6 @@ SCOP_PASS("polly-prune-unprofitable", PruneUnprofitablePass())
SCOP_PASS("polly-opt-isl", IslScheduleOptimizerPass()) SCOP_PASS("polly-opt-isl", IslScheduleOptimizerPass())
SCOP_PASS("print<polly-opt-isl>", IslScheduleOptimizerPrinterPass(llvm::outs())) SCOP_PASS("print<polly-opt-isl>", IslScheduleOptimizerPrinterPass(llvm::outs()))
SCOP_PASS("polly-dce", DeadCodeElimPass()) SCOP_PASS("polly-dce", DeadCodeElimPass())
SCOP_PASS("polly-mse", MaximalStaticExpansionPass())
SCOP_PASS("print<polly-mse>", MaximalStaticExpansionPrinterPass(llvm::outs()))
#undef SCOP_PASS #undef SCOP_PASS

View File

@ -30,6 +30,7 @@
#include "polly/ForwardOpTree.h" #include "polly/ForwardOpTree.h"
#include "polly/JSONExporter.h" #include "polly/JSONExporter.h"
#include "polly/LinkAllPasses.h" #include "polly/LinkAllPasses.h"
#include "polly/MaximalStaticExpansion.h"
#include "polly/PolyhedralInfo.h" #include "polly/PolyhedralInfo.h"
#include "polly/PruneUnprofitable.h" #include "polly/PruneUnprofitable.h"
#include "polly/ScheduleOptimizer.h" #include "polly/ScheduleOptimizer.h"
@ -263,7 +264,7 @@ void initializePollyPasses(llvm::PassRegistry &Registry) {
initializeJSONExporterPass(Registry); initializeJSONExporterPass(Registry);
initializeJSONImporterPass(Registry); initializeJSONImporterPass(Registry);
initializeJSONImporterPrinterLegacyPassPass(Registry); initializeJSONImporterPrinterLegacyPassPass(Registry);
initializeMaximalStaticExpanderPass(Registry); initializeMaximalStaticExpanderWrapperPassPass(Registry);
initializeIslAstInfoWrapperPassPass(Registry); initializeIslAstInfoWrapperPassPass(Registry);
initializeIslAstInfoPrinterLegacyPassPass(Registry); initializeIslAstInfoPrinterLegacyPassPass(Registry);
initializeIslScheduleOptimizerWrapperPassPass(Registry); initializeIslScheduleOptimizerWrapperPassPass(Registry);

View File

@ -11,6 +11,7 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "polly/MaximalStaticExpansion.h"
#include "polly/DependenceInfo.h" #include "polly/DependenceInfo.h"
#include "polly/LinkAllPasses.h" #include "polly/LinkAllPasses.h"
#include "polly/ScopInfo.h" #include "polly/ScopInfo.h"
@ -34,13 +35,13 @@ using namespace polly;
namespace { namespace {
class MaximalStaticExpander final : public ScopPass { class MaximalStaticExpanderWrapperPass final : public ScopPass {
public: public:
static char ID; static char ID;
explicit MaximalStaticExpander() : ScopPass(ID) {} explicit MaximalStaticExpanderWrapperPass() : ScopPass(ID) {}
~MaximalStaticExpander() override = default; ~MaximalStaticExpanderWrapperPass() override = default;
/// Expand the accesses of the SCoP. /// Expand the accesses of the SCoP.
/// ///
@ -55,63 +56,7 @@ public:
/// Register all analyses and transformations required. /// Register all analyses and transformations required.
void getAnalysisUsage(AnalysisUsage &AU) const override; void getAnalysisUsage(AnalysisUsage &AU) const override;
private:
/// OptimizationRemarkEmitter object for displaying diagnostic remarks.
OptimizationRemarkEmitter *ORE;
/// Emit remark
void emitRemark(StringRef Msg, Instruction *Inst);
/// Return true if the SAI in parameter is expandable.
///
/// @param SAI the SAI that need to be checked.
/// @param Writes A set that will contains all the write accesses.
/// @param Reads A set that will contains all the read accesses.
/// @param S The SCop in which the SAI is in.
/// @param Dependences The RAW dependences of the SCop.
bool isExpandable(const ScopArrayInfo *SAI,
SmallPtrSetImpl<MemoryAccess *> &Writes,
SmallPtrSetImpl<MemoryAccess *> &Reads, Scop &S,
const isl::union_map &Dependences);
/// Expand the MemoryAccess according to its domain.
///
/// @param S The SCop in which the memory access appears in.
/// @param MA The memory access that need to be expanded.
ScopArrayInfo *expandAccess(Scop &S, MemoryAccess *MA);
/// Filter the dependences to have only one related to current memory access.
///
/// @param S The SCop in which the memory access appears in.
/// @param MapDependences The dependences to filter.
/// @param MA The memory access that need to be expanded.
isl::union_map filterDependences(Scop &S,
const isl::union_map &MapDependences,
MemoryAccess *MA);
/// Expand the MemoryAccess according to Dependences and already expanded
/// MemoryAccesses.
///
/// @param The SCop in which the memory access appears in.
/// @param The memory access that need to be expanded.
/// @param Dependences The RAW dependences of the SCop.
/// @param ExpandedSAI The expanded SAI created during write expansion.
/// @param Reverse if true, the Dependences union_map is reversed before
/// intersection.
void mapAccess(Scop &S, SmallPtrSetImpl<MemoryAccess *> &Accesses,
const isl::union_map &Dependences, ScopArrayInfo *ExpandedSAI,
bool Reverse);
/// Expand PHI memory accesses.
///
/// @param The SCop in which the memory access appears in.
/// @param The ScopArrayInfo representing the PHI accesses to expand.
/// @param Dependences The RAW dependences of the SCop.
void expandPhi(Scop &S, const ScopArrayInfo *SAI,
const isl::union_map &Dependences);
}; };
} // namespace
#ifndef NDEBUG #ifndef NDEBUG
/// Whether a dimension of a set is bounded (lower and upper) by a constant, /// Whether a dimension of a set is bounded (lower and upper) by a constant,
@ -128,10 +73,24 @@ static bool isDimBoundedByConstant(isl::set Set, unsigned dim) {
} }
#endif #endif
char MaximalStaticExpander::ID = 0; class MaximalStaticExpansionImpl {
OptimizationRemarkEmitter &ORE;
Scop &S;
isl::union_map &Dependences;
isl::union_map MaximalStaticExpander::filterDependences( /// Emit remark
Scop &S, const isl::union_map &Dependences, MemoryAccess *MA) { void emitRemark(StringRef Msg, Instruction *Inst) {
ORE.emit(OptimizationRemarkAnalysis(DEBUG_TYPE, "ExpansionRejection", Inst)
<< Msg);
}
/// Filter the dependences to have only one related to current memory access.
///
/// @param S The SCop in which the memory access appears in.
/// @param MapDependences The dependences to filter.
/// @param MA The memory access that need to be expanded.
isl::union_map filterDependences(const isl::union_map &Dependences,
MemoryAccess *MA) {
auto SAI = MA->getLatestScopArrayInfo(); auto SAI = MA->getLatestScopArrayInfo();
auto AccessDomainSet = MA->getAccessRelation().domain(); auto AccessDomainSet = MA->getAccessRelation().domain();
@ -168,10 +127,16 @@ isl::union_map MaximalStaticExpander::filterDependences(
return MapDependences; return MapDependences;
} }
bool MaximalStaticExpander::isExpandable( /// Return true if the SAI in parameter is expandable.
const ScopArrayInfo *SAI, SmallPtrSetImpl<MemoryAccess *> &Writes, ///
SmallPtrSetImpl<MemoryAccess *> &Reads, Scop &S, /// @param SAI the SAI that need to be checked.
const isl::union_map &Dependences) { /// @param Writes A set that will contains all the write accesses.
/// @param Reads A set that will contains all the read accesses.
/// @param S The SCop in which the SAI is in.
/// @param Dependences The RAW dependences of the SCop.
bool isExpandable(const ScopArrayInfo *SAI,
SmallPtrSetImpl<MemoryAccess *> &Writes,
SmallPtrSetImpl<MemoryAccess *> &Reads, Scop &S) {
if (SAI->isValueKind()) { if (SAI->isValueKind()) {
Writes.insert(S.getValueDef(SAI)); Writes.insert(S.getValueDef(SAI));
for (auto MA : S.getValueUses(SAI)) for (auto MA : S.getValueUses(SAI))
@ -188,7 +153,7 @@ bool MaximalStaticExpander::isExpandable(
auto WriteDomain = isl::union_set::empty(S.getIslCtx()); auto WriteDomain = isl::union_set::empty(S.getIslCtx());
for (auto Write : Writes) { for (auto Write : Writes) {
auto MapDeps = filterDependences(S, Dependences, Write); auto MapDeps = filterDependences(Dependences, Write);
for (isl::map Map : MapDeps.get_map_list()) for (isl::map Map : MapDeps.get_map_list())
WriteDomain = WriteDomain.unite(Map.range()); WriteDomain = WriteDomain.unite(Map.range());
} }
@ -266,7 +231,7 @@ bool MaximalStaticExpander::isExpandable(
auto ReadDomain = isl::union_set(ReadDomainSet); auto ReadDomain = isl::union_set(ReadDomainSet);
// Get the dependences relevant for this MA // Get the dependences relevant for this MA
auto MapDependences = filterDependences(S, Dependences.reverse(), MA); auto MapDependences = filterDependences(Dependences.reverse(), MA);
unsigned NumberElementMap = isl_union_map_n_map(MapDependences.get()); unsigned NumberElementMap = isl_union_map_n_map(MapDependences.get());
if (NumberElementMap == 0) { if (NumberElementMap == 0) {
@ -312,10 +277,17 @@ bool MaximalStaticExpander::isExpandable(
return true; return true;
} }
void MaximalStaticExpander::mapAccess(Scop &S, /// Expand the MemoryAccess according to Dependences and already expanded
SmallPtrSetImpl<MemoryAccess *> &Accesses, /// MemoryAccesses.
const isl::union_map &Dependences, ///
ScopArrayInfo *ExpandedSAI, /// @param The SCop in which the memory access appears in.
/// @param The memory access that need to be expanded.
/// @param Dependences The RAW dependences of the SCop.
/// @param ExpandedSAI The expanded SAI created during write expansion.
/// @param Reverse if true, the Dependences union_map is reversed before
/// intersection.
void mapAccess(SmallPtrSetImpl<MemoryAccess *> &Accesses,
const isl::union_map &Dependences, ScopArrayInfo *ExpandedSAI,
bool Reverse) { bool Reverse) {
for (auto MA : Accesses) { for (auto MA : Accesses) {
// Get the current AM. // Get the current AM.
@ -327,7 +299,7 @@ void MaximalStaticExpander::mapAccess(Scop &S,
// Get the dependences relevant for this MA. // Get the dependences relevant for this MA.
isl::union_map MapDependences = isl::union_map MapDependences =
filterDependences(S, Reverse ? Dependences.reverse() : Dependences, MA); filterDependences(Reverse ? Dependences.reverse() : Dependences, MA);
// If no dependences, no need to modify anything. // If no dependences, no need to modify anything.
if (MapDependences.is_empty()) if (MapDependences.is_empty())
@ -347,7 +319,11 @@ void MaximalStaticExpander::mapAccess(Scop &S,
} }
} }
ScopArrayInfo *MaximalStaticExpander::expandAccess(Scop &S, MemoryAccess *MA) { /// Expand the MemoryAccess according to its domain.
///
/// @param S The SCop in which the memory access appears in.
/// @param MA The memory access that need to be expanded.
ScopArrayInfo *expandAccess(MemoryAccess *MA) {
// Get the current AM. // Get the current AM.
auto CurrentAccessMap = MA->getAccessRelation(); auto CurrentAccessMap = MA->getAccessRelation();
@ -364,8 +340,8 @@ ScopArrayInfo *MaximalStaticExpander::expandAccess(Scop &S, MemoryAccess *MA) {
NewAccessMap = NewAccessMap.add_dims(isl::dim::out, in_dimensions); NewAccessMap = NewAccessMap.add_dims(isl::dim::out, in_dimensions);
// Create the string representing the name of the new SAI. // Create the string representing the name of the new SAI.
// One new SAI for each statement so that each write go to a different memory // One new SAI for each statement so that each write go to a different
// cell. // memory cell.
auto CurrentStmtDomain = MA->getStatement()->getDomain(); auto CurrentStmtDomain = MA->getStatement()->getDomain();
auto CurrentStmtName = CurrentStmtDomain.get_tuple_name(); auto CurrentStmtName = CurrentStmtDomain.get_tuple_name();
auto CurrentOutId = CurrentAccessMap.get_tuple_id(isl::dim::out); auto CurrentOutId = CurrentAccessMap.get_tuple_id(isl::dim::out);
@ -416,72 +392,163 @@ ScopArrayInfo *MaximalStaticExpander::expandAccess(Scop &S, MemoryAccess *MA) {
return ExpandedSAI; return ExpandedSAI;
} }
void MaximalStaticExpander::expandPhi(Scop &S, const ScopArrayInfo *SAI, /// Expand PHI memory accesses.
///
/// @param The SCop in which the memory access appears in.
/// @param The ScopArrayInfo representing the PHI accesses to expand.
/// @param Dependences The RAW dependences of the SCop.
void expandPhi(Scop &S, const ScopArrayInfo *SAI,
const isl::union_map &Dependences) { const isl::union_map &Dependences) {
SmallPtrSet<MemoryAccess *, 4> Writes; SmallPtrSet<MemoryAccess *, 4> Writes;
for (auto MA : S.getPHIIncomings(SAI)) for (auto MA : S.getPHIIncomings(SAI))
Writes.insert(MA); Writes.insert(MA);
auto Read = S.getPHIRead(SAI); auto Read = S.getPHIRead(SAI);
auto ExpandedSAI = expandAccess(S, Read); auto ExpandedSAI = expandAccess(Read);
mapAccess(S, Writes, Dependences, ExpandedSAI, false); mapAccess(Writes, Dependences, ExpandedSAI, false);
} }
void MaximalStaticExpander::emitRemark(StringRef Msg, Instruction *Inst) { public:
ORE->emit(OptimizationRemarkAnalysis(DEBUG_TYPE, "ExpansionRejection", Inst) MaximalStaticExpansionImpl(Scop &S, isl::union_map &Dependences,
<< Msg); OptimizationRemarkEmitter &ORE)
} : S(S), ORE(ORE), Dependences(Dependences) {}
bool MaximalStaticExpander::runOnScop(Scop &S) {
// Get the ORE from OptimizationRemarkEmitterWrapperPass.
ORE = &(getAnalysis<OptimizationRemarkEmitterWrapperPass>().getORE());
// Get the RAW Dependences.
auto &DI = getAnalysis<DependenceInfo>();
auto &D = DI.getDependences(Dependences::AL_Reference);
isl::union_map Dependences = D.getDependences(Dependences::TYPE_RAW);
/// Expand the accesses of the SCoP
///
/// @param S The SCoP that must be expanded
/// @param D The dependencies information of SCoP
void expand() {
SmallVector<ScopArrayInfo *, 4> CurrentSAI(S.arrays().begin(), SmallVector<ScopArrayInfo *, 4> CurrentSAI(S.arrays().begin(),
S.arrays().end()); S.arrays().end());
for (auto SAI : CurrentSAI) { for (auto SAI : CurrentSAI) {
SmallPtrSet<MemoryAccess *, 4> AllWrites; SmallPtrSet<MemoryAccess *, 4> AllWrites;
SmallPtrSet<MemoryAccess *, 4> AllReads; SmallPtrSet<MemoryAccess *, 4> AllReads;
if (!isExpandable(SAI, AllWrites, AllReads, S, Dependences)) if (!isExpandable(SAI, AllWrites, AllReads, S))
continue; continue;
if (SAI->isValueKind() || SAI->isArrayKind()) { if (SAI->isValueKind() || SAI->isArrayKind()) {
assert(AllWrites.size() == 1 || SAI->isValueKind()); assert(AllWrites.size() == 1 || SAI->isValueKind());
auto TheWrite = *(AllWrites.begin()); auto TheWrite = *(AllWrites.begin());
ScopArrayInfo *ExpandedArray = expandAccess(S, TheWrite); ScopArrayInfo *ExpandedArray = expandAccess(TheWrite);
mapAccess(S, AllReads, Dependences, ExpandedArray, true); mapAccess(AllReads, Dependences, ExpandedArray, true);
} else if (SAI->isPHIKind()) { } else if (SAI->isPHIKind()) {
expandPhi(S, SAI, Dependences); expandPhi(S, SAI, Dependences);
} }
} }
}
/// Dump the internal information about a performed MSE to @p OS.
void print(llvm::raw_ostream &OS) {
OS << "After arrays {\n";
for (auto &Array : S.arrays())
Array->print(OS);
OS << "}\n";
OS << "After accesses {\n";
for (auto &Stmt : S) {
OS.indent(4) << Stmt.getBaseName() << "{\n";
for (auto *MA : Stmt)
MA->print(OS);
OS.indent(4) << "}\n";
}
OS << "}\n";
}
};
static std::unique_ptr<MaximalStaticExpansionImpl>
runMaximalStaticExpansion(Scop &S, OptimizationRemarkEmitter &ORE,
const Dependences &D) {
auto Dependences = D.getDependences(Dependences::TYPE_RAW);
std::unique_ptr<MaximalStaticExpansionImpl> Impl =
std::make_unique<MaximalStaticExpansionImpl>(S, Dependences, ORE);
Impl->expand();
return Impl;
}
static PreservedAnalyses runMSEUsingNPM(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &SAR,
raw_ostream *OS) {
OptimizationRemarkEmitter ORE(&S.getFunction());
auto &DI = SAM.getResult<DependenceAnalysis>(S, SAR);
auto &D = DI.getDependences(Dependences::AL_Reference);
std::unique_ptr<MaximalStaticExpansionImpl> Impl =
runMaximalStaticExpansion(S, ORE, D);
if (OS) {
*OS << "Printing analysis 'Polly - Maximal static expansion of SCoP' for "
"region: '"
<< S.getName() << "' in function '" << S.getFunction().getName()
<< "':\n";
if (Impl) {
*OS << "MSE result:\n";
Impl->print(*OS);
}
}
return PreservedAnalyses::all();
}
} // namespace
PreservedAnalyses
MaximalStaticExpansionPass::run(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &SAR,
SPMUpdater &) {
return runMSEUsingNPM(S, SAM, SAR, nullptr);
}
PreservedAnalyses
MaximalStaticExpansionPrinterPass::run(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &SAR,
SPMUpdater &) {
return runMSEUsingNPM(S, SAM, SAR, &OS);
}
char MaximalStaticExpanderWrapperPass::ID = 0;
bool MaximalStaticExpanderWrapperPass::runOnScop(Scop &S) {
// Get the ORE from OptimizationRemarkEmitterWrapperPass.
OptimizationRemarkEmitter *ORE =
&getAnalysis<OptimizationRemarkEmitterWrapperPass>().getORE();
// Get the RAW Dependences.
auto &DI = getAnalysis<DependenceInfo>();
auto &D = DI.getDependences(Dependences::AL_Reference);
std::unique_ptr<MaximalStaticExpansionImpl> Impl =
runMaximalStaticExpansion(S, *ORE, D);
return false; return false;
} }
void MaximalStaticExpander::printScop(raw_ostream &OS, Scop &S) const { void MaximalStaticExpanderWrapperPass::printScop(raw_ostream &OS,
Scop &S) const {
S.print(OS, false); S.print(OS, false);
} }
void MaximalStaticExpander::getAnalysisUsage(AnalysisUsage &AU) const { void MaximalStaticExpanderWrapperPass::getAnalysisUsage(
AnalysisUsage &AU) const {
ScopPass::getAnalysisUsage(AU); ScopPass::getAnalysisUsage(AU);
AU.addRequired<DependenceInfo>(); AU.addRequired<DependenceInfo>();
AU.addRequired<OptimizationRemarkEmitterWrapperPass>(); AU.addRequired<OptimizationRemarkEmitterWrapperPass>();
} }
Pass *polly::createMaximalStaticExpansionPass() { Pass *polly::createMaximalStaticExpansionPass() {
return new MaximalStaticExpander(); return new MaximalStaticExpanderWrapperPass();
} }
INITIALIZE_PASS_BEGIN(MaximalStaticExpander, "polly-mse", INITIALIZE_PASS_BEGIN(MaximalStaticExpanderWrapperPass, "polly-mse",
"Polly - Maximal static expansion of SCoP", false, false); "Polly - Maximal static expansion of SCoP", false, false);
INITIALIZE_PASS_DEPENDENCY(DependenceInfo); INITIALIZE_PASS_DEPENDENCY(DependenceInfo);
INITIALIZE_PASS_DEPENDENCY(OptimizationRemarkEmitterWrapperPass); INITIALIZE_PASS_DEPENDENCY(OptimizationRemarkEmitterWrapperPass);
INITIALIZE_PASS_END(MaximalStaticExpander, "polly-mse", INITIALIZE_PASS_END(MaximalStaticExpanderWrapperPass, "polly-mse",
"Polly - Maximal static expansion of SCoP", false, false) "Polly - Maximal static expansion of SCoP", false, false)

View File

@ -1,5 +1,7 @@
; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s
; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print<polly-mse>)" -disable-output < %s | FileCheck %s
; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-mse -polly-print-scops -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1| FileCheck %s --check-prefix=MSE ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-mse -polly-print-scops -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1| FileCheck %s --check-prefix=MSE
; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print<polly-mse>)" -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1 | FileCheck %s --check-prefix=MSE
; ;
; Verify that the expansion of an array with load after store in a same statement is not done. ; Verify that the expansion of an array with load after store in a same statement is not done.
; ;

View File

@ -1,5 +1,7 @@
; RUN: opt %loadPolly -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s ; RUN: opt %loadPolly -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s
; RUN: opt %loadNPMPolly "-passes=scop(print<polly-mse>)" -disable-output < %s | FileCheck %s
; RUN: opt %loadPolly -polly-mse -polly-print-scops -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1| FileCheck %s --check-prefix=MSE ; RUN: opt %loadPolly -polly-mse -polly-print-scops -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1| FileCheck %s --check-prefix=MSE
; RUN: opt %loadNPMPolly "-passes=scop(print<polly-mse>)" -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1 | FileCheck %s --check-prefix=MSE
; ;
; Verify that Polly detects problems and does not expand the array ; Verify that Polly detects problems and does not expand the array
; ;

View File

@ -1,5 +1,7 @@
; RUN: opt %loadPolly -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s ; RUN: opt %loadPolly -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s
; RUN: opt %loadNPMPolly "-passes=scop(print<polly-mse>)" -disable-output < %s | FileCheck %s
; RUN: opt %loadPolly -polly-mse -polly-print-scops -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1 | FileCheck %s --check-prefix=MSE ; RUN: opt %loadPolly -polly-mse -polly-print-scops -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1 | FileCheck %s --check-prefix=MSE
; RUN: opt %loadNPMPolly "-passes=scop(print<polly-mse>)" -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1 | FileCheck %s --check-prefix=MSE
; ;
; Verify that Polly detects problems and does not expand the array ; Verify that Polly detects problems and does not expand the array
; ;

View File

@ -1,4 +1,5 @@
; RUN: opt %loadPolly -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s ; RUN: opt %loadPolly -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s
; RUN: opt %loadNPMPolly "-passes=scop(print<polly-mse>)" -disable-output < %s | FileCheck %s
; ;
; Verify that the accesses are correctly expanded for MemoryKind::Array ; Verify that the accesses are correctly expanded for MemoryKind::Array
; ;

View File

@ -1,5 +1,7 @@
; RUN: opt %loadPolly -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s ; RUN: opt %loadPolly -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s
; RUN: opt %loadNPMPolly "-passes=scop(print<polly-mse>)" -disable-output < %s | FileCheck %s
; RUN: opt %loadPolly -polly-mse -polly-print-scops -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1 | FileCheck %s --check-prefix=MSE ; RUN: opt %loadPolly -polly-mse -polly-print-scops -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1 | FileCheck %s --check-prefix=MSE
; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print<polly-mse>)" -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1 | FileCheck %s --check-prefix=MSE
; ;
; Verify that the accesses are correctly expanded for MemoryKind::Array and MemoryKind::PHI. ; Verify that the accesses are correctly expanded for MemoryKind::Array and MemoryKind::PHI.
; tmp_06_phi is not expanded because it need copy in. ; tmp_06_phi is not expanded because it need copy in.

View File

@ -1,4 +1,5 @@
; RUN: opt %loadPolly -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s ; RUN: opt %loadPolly -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s
; RUN: opt %loadNPMPolly "-passes=scop(print<polly-mse>)" -disable-output < %s | FileCheck %s
; ;
; Verify that the accesses are correctly expanded for MemoryKind::Array ; Verify that the accesses are correctly expanded for MemoryKind::Array
; ;

View File

@ -1,4 +1,5 @@
; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s
; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print<polly-mse>)" -disable-output < %s | FileCheck %s
; ;
; Verify that the accesses are correctly expanded ; Verify that the accesses are correctly expanded
; ;

View File

@ -1,4 +1,5 @@
; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s
; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print<polly-mse>)" -disable-output < %s | FileCheck %s
; ;
; Verify that the accesses are correctly expanded ; Verify that the accesses are correctly expanded
; ;

View File

@ -1,5 +1,7 @@
; RUN: opt %loadPolly -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s ; RUN: opt %loadPolly -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s
; RUN: opt %loadNPMPolly "-passes=scop(print<polly-mse>)" -disable-output < %s | FileCheck %s
; RUN: opt %loadPolly -polly-mse -polly-print-scops -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1 | FileCheck %s --check-prefix=MSE ; RUN: opt %loadPolly -polly-mse -polly-print-scops -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1 | FileCheck %s --check-prefix=MSE
; RUN: opt %loadNPMPolly "-passes=scop(print<polly-mse>)" -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1 | FileCheck %s --check-prefix=MSE
; ;
; Verify that the accesses are correctly expanded for MemoryKind::PHI ; Verify that the accesses are correctly expanded for MemoryKind::PHI
; tmp_04 is not expanded because it need copy-in. ; tmp_04 is not expanded because it need copy-in.

View File

@ -1,5 +1,7 @@
; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s
; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print<polly-mse>)" -disable-output < %s | FileCheck %s
; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-mse -polly-print-scops -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1 | FileCheck %s --check-prefix=MSE ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-mse -polly-print-scops -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1 | FileCheck %s --check-prefix=MSE
; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print<polly-mse>)" -pass-remarks-analysis="polly-mse" -disable-output < %s 2>&1 | FileCheck %s --check-prefix=MSE
; ;
; Verify that the accesses are correctly expanded for MemoryKind::PHI ; Verify that the accesses are correctly expanded for MemoryKind::PHI
; tmp_05 and tmp2_06 are not expanded because they need copy-in. ; tmp_05 and tmp2_06 are not expanded because they need copy-in.

View File

@ -1,4 +1,5 @@
; RUN: opt %loadPolly -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s ; RUN: opt %loadPolly -polly-mse -polly-print-scops -disable-output < %s | FileCheck %s
; RUN: opt %loadNPMPolly "-passes=scop(print<polly-mse>)" -disable-output < %s | FileCheck %s
; ;
; Verify that the accesses are correctly expanded for MemoryKind::Value ; Verify that the accesses are correctly expanded for MemoryKind::Value
; ;