Adjust formatting to commit r292110 [NFC]

llvm-svn: 292123
This commit is contained in:
Tobias Grosser 2017-01-16 14:08:10 +00:00
parent 92fd612c84
commit 21a059af09
10 changed files with 61 additions and 43 deletions

View File

@ -151,8 +151,9 @@ static void collectInfo(Scop &S, isl_union_map **Read, isl_union_map **Write,
// to match the new access domains, thus we need // to match the new access domains, thus we need
// [Stmt[i0, i1] -> MemAcc_A[i0 + i1]] -> [0, i0, 2, i1, 0] // [Stmt[i0, i1] -> MemAcc_A[i0 + i1]] -> [0, i0, 2, i1, 0]
isl_map *Schedule = Stmt.getSchedule(); isl_map *Schedule = Stmt.getSchedule();
assert(Schedule && "Schedules that contain extension nodes require " assert(Schedule &&
"special handling."); "Schedules that contain extension nodes require special "
"handling.");
Schedule = isl_map_apply_domain( Schedule = isl_map_apply_domain(
Schedule, Schedule,
isl_map_reverse(isl_map_domain_map(isl_map_copy(accdom)))); isl_map_reverse(isl_map_domain_map(isl_map_copy(accdom))));
@ -163,8 +164,9 @@ static void collectInfo(Scop &S, isl_union_map **Read, isl_union_map **Write,
accdom = tag(accdom, MA, Level); accdom = tag(accdom, MA, Level);
if (Level > Dependences::AL_Statement) { if (Level > Dependences::AL_Statement) {
auto *StmtScheduleMap = Stmt.getSchedule(); auto *StmtScheduleMap = Stmt.getSchedule();
assert(StmtScheduleMap && "Schedules that contain extension nodes " assert(StmtScheduleMap &&
"require special handling."); "Schedules that contain extension nodes require special "
"handling.");
isl_map *Schedule = tag(StmtScheduleMap, MA, Level); isl_map *Schedule = tag(StmtScheduleMap, MA, Level);
*StmtSchedule = isl_union_map_add_map(*StmtSchedule, Schedule); *StmtSchedule = isl_union_map_add_map(*StmtSchedule, Schedule);
} }
@ -274,8 +276,9 @@ void Dependences::addPrivatizationDependences() {
*PrivMap = isl_union_map_apply_range(isl_union_map_copy(*Map), *PrivMap = isl_union_map_apply_range(isl_union_map_copy(*Map),
isl_union_map_copy(TC_RED)); isl_union_map_copy(TC_RED));
*PrivMap = isl_union_map_union( *PrivMap = isl_union_map_union(
*PrivMap, isl_union_map_apply_range(isl_union_map_copy(TC_RED), *PrivMap,
isl_union_map_copy(*Map))); isl_union_map_apply_range(isl_union_map_copy(TC_RED),
isl_union_map_copy(*Map)));
*Map = isl_union_map_union(*Map, *PrivMap); *Map = isl_union_map_union(*Map, *PrivMap);
} }

View File

@ -218,8 +218,9 @@ STATISTIC(NumProfScopsDepthFour,
"Number of scops with maximal loop depth 4 (profitable scops only)"); "Number of scops with maximal loop depth 4 (profitable scops only)");
STATISTIC(NumProfScopsDepthFive, STATISTIC(NumProfScopsDepthFive,
"Number of scops with maximal loop depth 5 (profitable scops only)"); "Number of scops with maximal loop depth 5 (profitable scops only)");
STATISTIC(NumProfScopsDepthLarger, "Number of scops with maximal loop depth 6 " STATISTIC(NumProfScopsDepthLarger,
"and larger (profitable scops only)"); "Number of scops with maximal loop depth 6 and larger "
"(profitable scops only)");
class DiagnosticScopFound : public DiagnosticInfo { class DiagnosticScopFound : public DiagnosticInfo {
private: private:

View File

@ -60,8 +60,8 @@ llvm::Statistic RejectStatistics[] = {
SCOP_STAT(LoopBound, "Uncomputable loop bounds"), SCOP_STAT(LoopBound, "Uncomputable loop bounds"),
SCOP_STAT(LoopHasNoExit, "Loop without exit"), SCOP_STAT(LoopHasNoExit, "Loop without exit"),
SCOP_STAT(FuncCall, "Function call with side effects"), SCOP_STAT(FuncCall, "Function call with side effects"),
SCOP_STAT(NonSimpleMemoryAccess, "Compilated access semantics (volatile or " SCOP_STAT(NonSimpleMemoryAccess,
"atomic)"), "Compilated access semantics (volatile or atomic)"),
SCOP_STAT(Alias, "Base address aliasing"), SCOP_STAT(Alias, "Base address aliasing"),
SCOP_STAT(Other, ""), SCOP_STAT(Other, ""),
SCOP_STAT(IntToPtr, "Integer to pointer conversions"), SCOP_STAT(IntToPtr, "Integer to pointer conversions"),
@ -309,8 +309,9 @@ bool ReportDifferentArrayElementSize::classof(const RejectReason *RR) {
std::string ReportDifferentArrayElementSize::getEndUserMessage() const { std::string ReportDifferentArrayElementSize::getEndUserMessage() const {
llvm::StringRef BaseName = BaseValue->getName(); llvm::StringRef BaseName = BaseValue->getName();
std::string Name = (BaseName.size() > 0) ? BaseName : "UNKNOWN"; std::string Name = (BaseName.size() > 0) ? BaseName : "UNKNOWN";
return "The array \"" + Name + "\" is accessed through elements that differ " return "The array \"" + Name +
"in size"; "\" is accessed through elements that differ "
"in size";
} }
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//

View File

@ -2168,8 +2168,9 @@ static bool calculateMinMaxAccess(__isl_take isl_union_map *Accesses,
isl_union_set *Locations = isl_union_map_range(Accesses); isl_union_set *Locations = isl_union_map_range(Accesses);
Locations = isl_union_set_coalesce(Locations); Locations = isl_union_set_coalesce(Locations);
Locations = isl_union_set_detect_equalities(Locations); Locations = isl_union_set_detect_equalities(Locations);
bool Valid = (0 == isl_union_set_foreach_set(Locations, buildMinMaxAccess, bool Valid = (0 ==
&MinMaxAccesses)); isl_union_set_foreach_set(Locations, buildMinMaxAccess,
&MinMaxAccesses));
isl_union_set_free(Locations); isl_union_set_free(Locations);
return Valid; return Valid;
} }
@ -3055,8 +3056,9 @@ bool Scop::buildAliasGroups(AliasAnalysis &AA) {
// Bail out if the number of values we need to compare is too large. // Bail out if the number of values we need to compare is too large.
// This is important as the number of comparisons grows quadratically with // This is important as the number of comparisons grows quadratically with
// the number of values we need to compare. // the number of values we need to compare.
if (!Valid || (MinMaxAccessesNonReadOnly.size() + ReadOnlyPairs.size() > if (!Valid ||
RunTimeChecksMaxArraysPerGroup)) (MinMaxAccessesNonReadOnly.size() + ReadOnlyPairs.size() >
RunTimeChecksMaxArraysPerGroup))
return false; return false;
// Calculate minimal and maximal accesses for read only accesses. // Calculate minimal and maximal accesses for read only accesses.

View File

@ -476,9 +476,9 @@ void BlockGenerator::generateScalarStores(
__isl_keep isl_id_to_ast_expr *NewAccesses) { __isl_keep isl_id_to_ast_expr *NewAccesses) {
Loop *L = LI.getLoopFor(Stmt.getBasicBlock()); Loop *L = LI.getLoopFor(Stmt.getBasicBlock());
assert(Stmt.isBlockStmt() && "Region statements need to use the " assert(Stmt.isBlockStmt() &&
"generateScalarStores() function in the " "Region statements need to use the generateScalarStores() function in "
"RegionGenerator"); "the RegionGenerator");
for (MemoryAccess *MA : Stmt) { for (MemoryAccess *MA : Stmt) {
if (MA->isOriginalArrayKind() || MA->isRead()) if (MA->isOriginalArrayKind() || MA->isRead())
@ -1060,8 +1060,9 @@ void VectorBlockGenerator::verifyNoScalarStores(ScopStmt &Stmt) {
void VectorBlockGenerator::copyStmt( void VectorBlockGenerator::copyStmt(
ScopStmt &Stmt, __isl_keep isl_id_to_ast_expr *NewAccesses) { ScopStmt &Stmt, __isl_keep isl_id_to_ast_expr *NewAccesses) {
assert(Stmt.isBlockStmt() && "TODO: Only block statements can be copied by " assert(Stmt.isBlockStmt() &&
"the vector block generator"); "TODO: Only block statements can be copied by the vector block "
"generator");
BasicBlock *BB = Stmt.getBasicBlock(); BasicBlock *BB = Stmt.getBasicBlock();
BasicBlock *CopyBB = SplitBlock(Builder.GetInsertBlock(), BasicBlock *CopyBB = SplitBlock(Builder.GetInsertBlock(),
@ -1237,8 +1238,9 @@ void RegionGenerator::copyStmt(ScopStmt &Stmt, LoopToScevMapT &LTS,
BlockMap[R->getExit()] = ExitBBCopy; BlockMap[R->getExit()] = ExitBBCopy;
BasicBlock *ExitDomBBCopy = BlockMap.lookup(findExitDominator(DT, R)); BasicBlock *ExitDomBBCopy = BlockMap.lookup(findExitDominator(DT, R));
assert(ExitDomBBCopy && "Common exit dominator must be within region; at " assert(ExitDomBBCopy &&
"least the entry node must match"); "Common exit dominator must be within region; at least the entry node "
"must match");
DT.changeImmediateDominator(ExitBBCopy, ExitDomBBCopy); DT.changeImmediateDominator(ExitBBCopy, ExitDomBBCopy);
// As the block generator doesn't handle control flow we need to add the // As the block generator doesn't handle control flow we need to add the

View File

@ -458,8 +458,9 @@ void IslNodeBuilder::createForSequential(__isl_take isl_ast_node *For,
CmpInst::Predicate Predicate; CmpInst::Predicate Predicate;
bool Parallel; bool Parallel;
Parallel = KnownParallel || (IslAstInfo::isParallel(For) && Parallel =
!IslAstInfo::isReductionParallel(For)); KnownParallel ||
(IslAstInfo::isParallel(For) && !IslAstInfo::isReductionParallel(For));
Body = isl_ast_node_for_get_body(For); Body = isl_ast_node_for_get_body(For);

View File

@ -487,8 +487,9 @@ public:
Values.insert(Unknown->getValue()); Values.insert(Unknown->getValue());
Instruction *Inst = dyn_cast<Instruction>(Unknown->getValue()); Instruction *Inst = dyn_cast<Instruction>(Unknown->getValue());
if (!Inst || (Inst->getOpcode() != Instruction::SRem && if (!Inst ||
Inst->getOpcode() != Instruction::SDiv)) (Inst->getOpcode() != Instruction::SRem &&
Inst->getOpcode() != Instruction::SDiv))
return false; return false;
auto *Dividend = SE.getSCEV(Inst->getOperand(1)); auto *Dividend = SE.getSCEV(Inst->getOperand(1));

View File

@ -296,8 +296,9 @@ private:
else else
IP = RTCBB->getParent()->getEntryBlock().getTerminator(); IP = RTCBB->getParent()->getEntryBlock().getTerminator();
if (!Inst || (Inst->getOpcode() != Instruction::SRem && if (!Inst ||
Inst->getOpcode() != Instruction::SDiv)) (Inst->getOpcode() != Instruction::SRem &&
Inst->getOpcode() != Instruction::SDiv))
return visitGenericInst(E, Inst, IP); return visitGenericInst(E, Inst, IP);
const SCEV *LHSScev = SE.getSCEV(Inst->getOperand(0)); const SCEV *LHSScev = SE.getSCEV(Inst->getOperand(0));

View File

@ -174,10 +174,12 @@ static cl::opt<int> FirstLevelDefaultTileSize(
" --polly-tile-sizes)"), " --polly-tile-sizes)"),
cl::Hidden, cl::init(32), cl::ZeroOrMore, cl::cat(PollyCategory)); cl::Hidden, cl::init(32), cl::ZeroOrMore, cl::cat(PollyCategory));
static cl::list<int> FirstLevelTileSizes( static cl::list<int>
"polly-tile-sizes", cl::desc("A tile size for each loop dimension, filled " FirstLevelTileSizes("polly-tile-sizes",
cl::desc("A tile size for each loop dimension, filled "
"with --polly-default-tile-size"), "with --polly-default-tile-size"),
cl::Hidden, cl::ZeroOrMore, cl::CommaSeparated, cl::cat(PollyCategory)); cl::Hidden, cl::ZeroOrMore, cl::CommaSeparated,
cl::cat(PollyCategory));
static cl::opt<bool> static cl::opt<bool>
SecondLevelTiling("polly-2nd-level-tiling", SecondLevelTiling("polly-2nd-level-tiling",
@ -1064,8 +1066,9 @@ bool ScheduleTreeOptimizer::isProfitableSchedule(
return true; return true;
auto *NewScheduleMap = isl_schedule_get_map(NewSchedule); auto *NewScheduleMap = isl_schedule_get_map(NewSchedule);
isl_union_map *OldSchedule = S.getSchedule(); isl_union_map *OldSchedule = S.getSchedule();
assert(OldSchedule && "Only IslScheduleOptimizer can insert extension nodes " assert(OldSchedule &&
"that make Scop::getSchedule() return nullptr."); "Only IslScheduleOptimizer can insert extension nodes "
"that make Scop::getSchedule() return nullptr.");
bool changed = !isl_union_map_is_equal(OldSchedule, NewScheduleMap); bool changed = !isl_union_map_is_equal(OldSchedule, NewScheduleMap);
isl_union_map_free(OldSchedule); isl_union_map_free(OldSchedule);
isl_union_map_free(NewScheduleMap); isl_union_map_free(NewScheduleMap);

View File

@ -303,8 +303,9 @@ TEST(Isl, Foreach) {
EXPECT_EQ(isl_stat_error, EXPECT_EQ(isl_stat_error,
foreachEltWithBreak( foreachEltWithBreak(
TestMap, [&](IslPtr<isl_basic_map> BMap) -> isl_stat { TestMap, [&](IslPtr<isl_basic_map> BMap) -> isl_stat {
EXPECT_EQ(isl_bool_true, isl_basic_map_is_equal( EXPECT_EQ(
BMap.keep(), TestBMap.keep())); isl_bool_true,
isl_basic_map_is_equal(BMap.keep(), TestBMap.keep()));
NumBMaps++; NumBMaps++;
return isl_stat_error; return isl_stat_error;
})); }));
@ -328,13 +329,15 @@ TEST(Isl, Foreach) {
auto TestPwAff = auto TestPwAff =
give(isl_pw_aff_val_on_domain(TestSet.copy(), isl_val_zero(Ctx.get()))); give(isl_pw_aff_val_on_domain(TestSet.copy(), isl_val_zero(Ctx.get())));
auto NumPieces = 0; auto NumPieces = 0;
foreachPieceWithBreak(TestPwAff, [&](IslPtr<isl_set> Domain, foreachPieceWithBreak(
IslPtr<isl_aff> Aff) -> isl_stat { TestPwAff,
EXPECT_EQ(isl_bool_true, isl_set_is_equal(Domain.keep(), TestSet.keep())); [&](IslPtr<isl_set> Domain, IslPtr<isl_aff> Aff) -> isl_stat {
EXPECT_EQ(isl_bool_true, isl_aff_is_cst(Aff.keep())); EXPECT_EQ(isl_bool_true,
NumPieces++; isl_set_is_equal(Domain.keep(), TestSet.keep()));
return isl_stat_error; EXPECT_EQ(isl_bool_true, isl_aff_is_cst(Aff.keep()));
}); NumPieces++;
return isl_stat_error;
});
EXPECT_EQ(1, NumPieces); EXPECT_EQ(1, NumPieces);
} }
} }