@@ -15980,7 +15985,44 @@ StmtResult SemaOpenMP::ActOnOpenMPInterchangeDirective(
"affected loops");
// Decode the permutation clause.
- constexpr uint64_t Permutation[] = {1, 0};
+ SmallVector Permutation;
+ if (!PermutationClause) {
+Permutation = {1, 0};
+
@@ -15972,6 +15971,12 @@ StmtResult SemaOpenMP::ActOnOpenMPInterchangeDirective(
return OMPInterchangeDirective::Create(Context, StartLoc, EndLoc, Clauses,
NumLoops, AStmt, nullptr, nullptr);
+ // An invalid expression in the
@@ -9861,13 +9842,19 @@ buildPreInits(ASTContext ,
/// Build pre-init statement for the given statements.
static Stmt *buildPreInits(ASTContext , ArrayRef PreInits) {
- if (PreInits.empty())
-return nullptr;
-
- SmallVector Stmts;
- for (Stmt *S : PreInits)
-
@@ -15209,7 +15206,7 @@ static void collectLoopStmts(Stmt *AStmt,
MutableArrayRef LoopStmts) {
LoopStmts[Cnt] = CurStmt;
return false;
});
- assert(!is_contained(LoopStmts, nullptr) &&
+ assert(llvm::all_of(LoopStmts, [](Stmt *LoopStmt) { return
@@ -1774,6 +1793,18 @@ void
OMPClausePrinter::VisitOMPSizesClause(OMPSizesClause *Node) {
OS << ")";
}
+void OMPClausePrinter::VisitOMPPermutationClause(OMPPermutationClause *Node) {
+ OS << "permutation(";
+ bool First = true;
+ for (Expr *Size : Node->getArgsRefs()) {
@@ -9970,9 +9957,12 @@ checkOpenMPLoop(OpenMPDirectiveKind DKind, Expr
*CollapseLoopCountExpr,
// Search for pre-init declared variables that need to be captured
// to be referenceable inside the directive.
SmallVector Constituents;
-
@@ -15149,8 +15139,15 @@ bool SemaOpenMP::checkTransformableLoopNest(
DependentPreInits = Dir->getPreInits();
else
llvm_unreachable("Unhandled loop transformation");
-
-appendFlattendedStmtList(OriginalInits.back(), DependentPreInits);
+
@@ -870,6 +870,106 @@ class OMPSizesClause final
}
};
+/// This class represents the 'permutation' clause in the
+/// '#pragma omp interchange' directive.
+///
+/// \code{c}
+/// #pragma omp interchange permutation(2,1)
+/// for (int i = 0; i < 64; ++i)
+/// for
@@ -870,6 +870,106 @@ class OMPSizesClause final
}
};
+/// This class represents the 'permutation' clause in the
+/// '#pragma omp interchange' directive.
+///
+/// \code{c}
+/// #pragma omp interchange permutation(2,1)
+/// for (int i = 0; i < 64; ++i)
+/// for
@@ -15937,6 +15945,160 @@ StmtResult
SemaOpenMP::ActOnOpenMPReverseDirective(Stmt *AStmt,
buildPreInits(Context, PreInits));
}
+StmtResult SemaOpenMP::ActOnOpenMPInterchangeDirective(
+ArrayRef Clauses, Stmt *AStmt, SourceLocation
https://github.com/alexey-bataev edited
https://github.com/llvm/llvm-project/pull/93022
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/alexey-bataev approved this pull request.
LG with a nit
https://github.com/llvm/llvm-project/pull/93022
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
@@ -5779,6 +5779,80 @@ class OMPReverseDirective final : public
OMPLoopTransformationDirective {
}
};
+/// Represents the '#pragma omp interchange' loop transformation directive.
+///
+/// \code{c}
+/// #pragma omp interchange
+/// for (int i = 0; i < m; ++i)
+///
@@ -5711,6 +5712,71 @@ class OMPUnrollDirective final : public
OMPLoopTransformationDirective {
}
};
+/// Represents the '#pragma omp reverse' loop transformation directive.
+///
+/// \code
+/// #pragma omp reverse
+/// for (int i = 0; i < n; ++i)
+/// ...
+/// \endcode
@@ -5711,6 +5712,73 @@ class OMPUnrollDirective final : public
OMPLoopTransformationDirective {
}
};
+/// Represents the '#pragma omp reverse' loop transformation directive.
+///
+/// \code
+/// #pragma omp reverse
+/// for (int i = 0; i < n; ++i)
+/// ...
+/// \endcode
@@ -6546,6 +6547,10 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective(
Res = ActOnOpenMPUnrollDirective(ClausesWithImplicit, AStmt, StartLoc,
EndLoc);
break;
+ case OMPD_reverse:
+Res =
https://github.com/alexey-bataev approved this pull request.
LG
https://github.com/llvm/llvm-project/pull/91682
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -15745,6 +15760,388 @@ StmtResult
SemaOpenMP::ActOnOpenMPUnrollDirective(ArrayRef Clauses,
buildPreInits(Context, PreInits));
}
+StmtResult
+SemaOpenMP::ActOnOpenMPReverseDirective(ArrayRef Clauses,
+
@@ -15745,6 +15760,388 @@ StmtResult
SemaOpenMP::ActOnOpenMPUnrollDirective(ArrayRef Clauses,
buildPreInits(Context, PreInits));
}
+StmtResult
+SemaOpenMP::ActOnOpenMPReverseDirective(ArrayRef Clauses,
+
@@ -870,6 +870,106 @@ class OMPSizesClause final
}
};
+/// This class represents the 'permutation' clause in the
+/// '#pragma omp interchange' directive.
+///
+/// \code{c}
+/// #pragma omp interchange permutation(2,1)
+/// for (int i = 0; i < 64; ++i)
+/// for
@@ -2146,6 +2146,14 @@ enum CXCursorKind {
*/
CXCursor_OMPScopeDirective = 306,
+ /** OpenMP reverse directive.
+ */
+ CXCursor_OMPReverseDirective = 307,
+
alexey-bataev wrote:
Split this into 2 patches, one for reverse, one for interchange
@@ -182,17 +182,34 @@ class OMPLoopScope : public
CodeGenFunction::RunCleanupsScope {
}
return false;
});
- PreInits = cast_or_null(LD->getPreInits());
+ PreInits = LD->getPreInits();
} else if (const auto *Tile = dyn_cast()) {
@@ -17432,16 +17457,54 @@ OMPClause
*SemaOpenMP::ActOnOpenMPSizesClause(ArrayRef SizeExprs,
SourceLocation StartLoc,
SourceLocation LParenLoc,
@@ -15197,6 +15202,36 @@ StmtResult
SemaOpenMP::ActOnOpenMPTileDirective(ArrayRef Clauses,
// Once the original iteration values are set, append the innermost body.
Stmt *Inner = Body;
+ auto MakeDimTileSize = [ = this->SemaRef, , ,
+
@@ -15197,6 +15202,36 @@ StmtResult
SemaOpenMP::ActOnOpenMPTileDirective(ArrayRef Clauses,
// Once the original iteration values are set, append the innermost body.
Stmt *Inner = Body;
+ auto MakeDimTileSize = [ = this->SemaRef, , ,
+
@@ -17432,16 +17457,54 @@ OMPClause
*SemaOpenMP::ActOnOpenMPSizesClause(ArrayRef SizeExprs,
SourceLocation StartLoc,
SourceLocation LParenLoc,
@@ -17432,16 +17457,54 @@ OMPClause
*SemaOpenMP::ActOnOpenMPSizesClause(ArrayRef SizeExprs,
SourceLocation StartLoc,
SourceLocation LParenLoc,
@@ -15111,13 +15111,11 @@ StmtResult
SemaOpenMP::ActOnOpenMPTileDirective(ArrayRef Clauses,
ASTContext = getASTContext();
Scope *CurScope = SemaRef.getCurScope();
- auto SizesClauses =
- OMPExecutableDirective::getClausesOfKind(Clauses);
- if
@@ -15197,6 +15202,36 @@ StmtResult
SemaOpenMP::ActOnOpenMPTileDirective(ArrayRef Clauses,
// Once the original iteration values are set, append the innermost body.
Stmt *Inner = Body;
+ auto MakeDimTileSize = [ = this->SemaRef, , ,
+
@@ -4991,3 +4971,38 @@ OMPClause
*Parser::ParseOpenMPVarListClause(OpenMPDirectiveKind DKind,
OMPVarListLocTy Locs(Loc, LOpen, Data.RLoc);
return Actions.OpenMP().ActOnOpenMPVarListClause(Kind, Vars, Locs, Data);
}
+
+bool
https://github.com/alexey-bataev approved this pull request.
LG
https://github.com/llvm/llvm-project/pull/86731
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/alexey-bataev approved this pull request.
LG
https://github.com/llvm/llvm-project/pull/86701
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/alexey-bataev closed
https://github.com/llvm/llvm-project/pull/83854
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/alexey-bataev created
https://github.com/llvm/llvm-project/pull/83854
None
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/alexey-bataev approved this pull request.
LG
https://github.com/llvm/llvm-project/pull/82793
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
alexey-bataev wrote:
> Changing `getArithmeticInstrCost` is just too dangerous. What if one opcode
> needs TLI for a different reason?
That should be fine, what's the dangerous in it?
https://github.com/llvm/llvm-project/pull/82488
___
alexey-bataev wrote:
> Personally I'm happy with keeping this nuance outside of TTI but if we really
> want this captured within TTI then I think it's time to break FREM into its
> own cost function (i.e. implement getFRemInstrCost. That way
> getArithmeticInstrCost can work as it does today
@@ -869,6 +870,18 @@ TargetTransformInfo::getOperandInfo(const Value *V) {
return {OpInfo, OpProps};
}
+InstructionCost TargetTransformInfo::getVecLibCallCost(
+const int OpCode, const TargetLibraryInfo *TLI, VectorType *VecTy,
+TTI::TargetCostKind CostKind) {
+
@@ -869,6 +870,18 @@ TargetTransformInfo::getOperandInfo(const Value *V) {
return {OpInfo, OpProps};
}
+InstructionCost TargetTransformInfo::getVecLibCallCost(
+const int OpCode, const TargetLibraryInfo *TLI, VectorType *VecTy,
+TTI::TargetCostKind CostKind) {
+
@@ -869,6 +870,18 @@ TargetTransformInfo::getOperandInfo(const Value *V) {
return {OpInfo, OpProps};
}
+InstructionCost TargetTransformInfo::getVecLibCallCost(
+const int OpCode, const TargetLibraryInfo *TLI, VectorType *VecTy,
+TTI::TargetCostKind CostKind) {
+
@@ -8362,9 +8362,20 @@ BoUpSLP::getEntryCost(const TreeEntry *E, ArrayRef VectorizedVals,
unsigned OpIdx = isa(VL0) ? 0 : 1;
TTI::OperandValueInfo Op1Info = getOperandInfo(E->getOperand(0));
TTI::OperandValueInfo Op2Info =
https://github.com/alexey-bataev approved this pull request.
LG
https://github.com/llvm/llvm-project/pull/81984
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -8231,13 +8231,24 @@ VPRecipeBase
*VPRecipeBuilder::tryToWidenMemory(Instruction *I,
bool Consecutive =
Reverse || Decision == LoopVectorizationCostModel::CM_Widen;
+ VPValue *Ptr = isa(I) ? Operands[0] : Operands[1];
+ if (Decision !=
@@ -404,6 +405,49 @@ Value *VPInstruction::generateInstruction(VPTransformState
,
Builder.GetInsertBlock()->getTerminator()->eraseFromParent();
return CondBr;
}
+ case VPInstruction::CreateVectorPtr: {
+// Calculate the pointer for the specific unroll-part.
+
@@ -8231,13 +8231,24 @@ VPRecipeBase
*VPRecipeBuilder::tryToWidenMemory(Instruction *I,
bool Consecutive =
Reverse || Decision == LoopVectorizationCostModel::CM_Widen;
+ VPValue *Ptr = isa(I) ? Operands[0] : Operands[1];
+ if (Decision !=
Author: Alexey Bataev
Date: 2021-01-19T12:41:15-08:00
New Revision: b272698de790d6603db7992c0c0ad6446b7a52b8
URL:
https://github.com/llvm/llvm-project/commit/b272698de790d6603db7992c0c0ad6446b7a52b8
DIFF:
https://github.com/llvm/llvm-project/commit/b272698de790d6603db7992c0c0ad6446b7a52b8.diff
Author: Alexey Bataev
Date: 2021-01-19T11:48:04-08:00
New Revision: e463bd53c03ff9183bd30030477dfe6f3b2fdd0c
URL:
https://github.com/llvm/llvm-project/commit/e463bd53c03ff9183bd30030477dfe6f3b2fdd0c
DIFF:
https://github.com/llvm/llvm-project/commit/e463bd53c03ff9183bd30030477dfe6f3b2fdd0c.diff
Author: Alexey Bataev
Date: 2021-01-08T06:23:23-08:00
New Revision: 0e57084d0efaab215d67c81a4664e1ee0622d3f1
URL:
https://github.com/llvm/llvm-project/commit/0e57084d0efaab215d67c81a4664e1ee0622d3f1
DIFF:
https://github.com/llvm/llvm-project/commit/0e57084d0efaab215d67c81a4664e1ee0622d3f1.diff
Author: Alexey Bataev
Date: 2021-01-07T04:50:48-08:00
New Revision: 4284afdf9432f7d756f56b0ab21d69191adefa8d
URL:
https://github.com/llvm/llvm-project/commit/4284afdf9432f7d756f56b0ab21d69191adefa8d
DIFF:
https://github.com/llvm/llvm-project/commit/4284afdf9432f7d756f56b0ab21d69191adefa8d.diff
Author: Alexey Bataev
Date: 2021-01-01T08:27:59-08:00
New Revision: bf2a78fd4ae90e6d427cb6abe64108a047c90c05
URL:
https://github.com/llvm/llvm-project/commit/bf2a78fd4ae90e6d427cb6abe64108a047c90c05
DIFF:
https://github.com/llvm/llvm-project/commit/bf2a78fd4ae90e6d427cb6abe64108a047c90c05.diff
Author: Alexey Bataev
Date: 2020-12-07T07:50:00-08:00
New Revision: 438682de6a38ac97f89fa38faf5c8dc9b09cd9ad
URL:
https://github.com/llvm/llvm-project/commit/438682de6a38ac97f89fa38faf5c8dc9b09cd9ad
DIFF:
https://github.com/llvm/llvm-project/commit/438682de6a38ac97f89fa38faf5c8dc9b09cd9ad.diff
Author: Alexey Bataev
Date: 2020-12-07T06:12:05-08:00
New Revision: 97c08db84e3a7eb4eba1eab2678f6f68c2afaca3
URL:
https://github.com/llvm/llvm-project/commit/97c08db84e3a7eb4eba1eab2678f6f68c2afaca3
DIFF:
https://github.com/llvm/llvm-project/commit/97c08db84e3a7eb4eba1eab2678f6f68c2afaca3.diff
Author: Alexey Bataev
Date: 2020-12-04T11:01:58-08:00
New Revision: e7fc561843ecf374c3b394a8ac76019f3d4bf1d6
URL:
https://github.com/llvm/llvm-project/commit/e7fc561843ecf374c3b394a8ac76019f3d4bf1d6
DIFF:
https://github.com/llvm/llvm-project/commit/e7fc561843ecf374c3b394a8ac76019f3d4bf1d6.diff
Author: Alexey Bataev
Date: 2020-12-04T07:44:36-08:00
New Revision: 2502f899543151cf3d35c0fa0eef4ba681ad4e77
URL:
https://github.com/llvm/llvm-project/commit/2502f899543151cf3d35c0fa0eef4ba681ad4e77
DIFF:
https://github.com/llvm/llvm-project/commit/2502f899543151cf3d35c0fa0eef4ba681ad4e77.diff
Author: abataev
Date: Mon Nov 28 11:55:42 2016
New Revision: 288048
URL: http://llvm.org/viewvc/llvm-project?rev=288048=rev
Log:
Merging r287227:
r287227 | abataev | 2016-11-17 15:12:05 + (Thu, 17 Nov 2016) | 4 lines
at 8:59 AM Alexey Bataev via llvm-branch-commits
<llvm-branch-commits@lists.llvm.org<mailto:llvm-branch-commits@lists.llvm.org>>
wrote:
Author: abataev
Date: Tue Nov 15 08:26:49 2016
New Revision: 286968
URL: http://llvm.org/viewvc/llvm-project?rev=286968=rev
Log:
Mer
Author: abataev
Date: Tue Nov 15 15:24:19 2016
New Revision: 287033
URL: http://llvm.org/viewvc/llvm-project?rev=287033=rev
Log:
Merging r287025:
r287025 | abataev | 2016-11-15 20:57:18 + (Tue, 15 Nov 2016) | 3 lines
Author: abataev
Date: Tue Nov 15 08:30:48 2016
New Revision: 286970
URL: http://llvm.org/viewvc/llvm-project?rev=286970=rev
Log:
Merging r284229:
r284229 | abataev | 2016-10-14 12:43:59 + (Fri, 14 Oct 2016) | 37 lines
Author: abataev
Date: Tue Nov 15 08:15:56 2016
New Revision: 286965
URL: http://llvm.org/viewvc/llvm-project?rev=286965=rev
Log:
Merging r286129:
r286129 | abataev | 2016-11-07 18:15:02 + (Mon, 07 Nov 2016) | 8 lines
Author: abataev
Date: Tue Nov 15 08:23:10 2016
New Revision: 286966
URL: http://llvm.org/viewvc/llvm-project?rev=286966=rev
Log:
Merging r286584:
r286584 | abataev | 2016-11-11 12:36:20 + (Fri, 11 Nov 2016) | 31 lines
Author: abataev
Date: Tue Nov 15 08:44:21 2016
New Revision: 286972
URL: http://llvm.org/viewvc/llvm-project?rev=286972=rev
Log:
Merging r283223:
r283223 | davidsh | 2016-10-04 10:41:36 -0400 (Tue, 04 Oct 2016) | 1 line
[OpenMP] fix segfault when a variable referenced in reduction clause is a
Author: abataev
Date: Tue Nov 15 08:26:49 2016
New Revision: 286968
URL: http://llvm.org/viewvc/llvm-project?rev=286968=rev
Log:
Merging r286944:
r286944 | abataev | 2016-11-15 09:11:50 + (Tue, 15 Nov 2016) | 6 lines
Author: abataev
Date: Thu Jan 28 23:14:10 2016
New Revision: 259160
URL: http://llvm.org/viewvc/llvm-project?rev=259160=rev
Log:
Merging r258307 and r258495:
r258307 | abataev | 2016-01-20 15:29:47 +0300 (Wed, 20 Jan 2016) |
Author: abataev
Date: Thu Jan 21 22:07:48 2016
New Revision: 258483
URL: http://llvm.org/viewvc/llvm-project?rev=258483=rev
Log:
Merging r258394:
r258394 | abataev | 2016-01-21 15:35:58 +0300 (Thu, 21 Jan 2016) | 3 lines
64 matches
Mail list logo