@@ -3223,6 +3223,8 @@ LValue CodeGenFunction::EmitDeclRefLValue(const
DeclRefExpr *E) {
// No other cases for now.
} else {
+ llvm::dbgs() << "THE DAMN DECLREFEXPR HASN'T BEEN ENTERED IN
LOCALDECLMAP\n";
+ VD->dumpColor();
eZWALT wrote:
Oo
@@ -5378,6 +5379,10 @@ class CodeGenFunction : public CodeGenTypeCache {
/// Set the address of a local variable.
void setAddrOfLocalVar(const VarDecl *VD, Address Addr) {
+if (LocalDeclMap.count(VD)) {
+ llvm::errs() << "Warning: VarDecl already exists in map: ";
@@ -5790,7 +5805,11 @@ class OMPReverseDirective final : public
OMPLoopTransformationDirective {
explicit OMPReverseDirective(SourceLocation StartLoc, SourceLocation EndLoc)
: OMPLoopTransformationDirective(OMPReverseDirectiveClass,
@@ -962,6 +962,9 @@ class OMPLoopTransformationDirective : public
OMPLoopBasedDirective {
/// Number of loops generated by this loop transformation.
unsigned NumGeneratedLoops = 0;
+ /// Number of top level canonical loop nests generated by this loop
+ /// transformatio
@@ -962,6 +962,9 @@ class OMPLoopTransformationDirective : public
OMPLoopBasedDirective {
/// Number of loops generated by this loop transformation.
unsigned NumGeneratedLoops = 0;
+ /// Number of top level canonical loop nests generated by this loop
+ /// transformatio
https://github.com/eZWALT edited
https://github.com/llvm/llvm-project/pull/139293
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/eZWALT edited
https://github.com/llvm/llvm-project/pull/139293
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
eZWALT wrote:
I want to notify that the following week I'll be unavailable, so expect this
patch to be updated on the 20th of May. Thanks for the feedback @alexey-bataev
https://github.com/llvm/llvm-project/pull/139293
___
cfe-commits mailing list
cf
eZWALT wrote:
It’s true that NumGeneratedLoops is used throughout the existing OpenMP loop
transformation infrastructure. While in some cases its usage could potentially
be replaced by NumGeneratedLoopNests (especially when only checking for values
like 0 or 1), the two variables convey distin
https://github.com/eZWALT edited
https://github.com/llvm/llvm-project/pull/140532
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
eZWALT wrote:
> @alexey-bataev It’s true that NumGeneratedLoops is used throughout the
> existing OpenMP loop transformation infrastructure. While in some cases its
> usage could potentially be replaced by NumGeneratedLoopNests (especially when
> only checking for values like 0 or 1), the two
@@ -14175,27 +14222,350 @@ bool SemaOpenMP::checkTransformableLoopNest(
return false;
},
[&OriginalInits](OMPLoopBasedDirective *Transform) {
-Stmt *DependentPreInits;
-if (auto *Dir = dyn_cast(Transform))
- DependentPreInits = Dir->
@@ -11516,6 +11516,21 @@ def note_omp_implicit_dsa : Note<
"implicitly determined as %0">;
def err_omp_loop_var_dsa : Error<
"loop iteration variable in the associated loop of 'omp %1' directive may
not be %0, predetermined as %2">;
+def warn_omp_different_loop_ind_var_typ
@@ -14175,27 +14222,350 @@ bool SemaOpenMP::checkTransformableLoopNest(
return false;
},
[&OriginalInits](OMPLoopBasedDirective *Transform) {
-Stmt *DependentPreInits;
-if (auto *Dir = dyn_cast(Transform))
- DependentPreInits = Dir->
@@ -1480,6 +1493,108 @@ class SemaOpenMP : public SemaBase {
SmallVectorImpl &LoopHelpers,
Stmt *&Body, SmallVectorImpl> &OriginalInits);
+ /// @brief Categories of loops encountered during semantic OpenMP loop
+ /// analysis
+ ///
+ /// This enumeration identi
@@ -1151,6 +1151,106 @@ class OMPFullClause final : public
OMPNoChildClause {
static OMPFullClause *CreateEmpty(const ASTContext &C);
};
+/// This class represents the 'looprange' clause in the
+/// '#pragma omp fuse' directive
+///
+/// \code {c}
+/// #pragma omp fuse loop
eZWALT wrote:
Gentle-ping, I'm not sure if GitHub has notified you of the comments :)
@alexey-bataev
https://github.com/llvm/llvm-project/pull/139293
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listi
@@ -962,6 +962,9 @@ class OMPLoopTransformationDirective : public
OMPLoopBasedDirective {
/// Number of loops generated by this loop transformation.
unsigned NumGeneratedLoops = 0;
+ /// Number of top level canonical loop nests generated by this loop
+ /// transformatio
@@ -11516,6 +11516,21 @@ def note_omp_implicit_dsa : Note<
"implicitly determined as %0">;
def err_omp_loop_var_dsa : Error<
"loop iteration variable in the associated loop of 'omp %1' directive may
not be %0, predetermined as %2">;
+def warn_omp_different_loop_ind_var_typ
https://github.com/eZWALT created
https://github.com/llvm/llvm-project/pull/140532
This patch is closely related to #139293 and addresses an existing issue in the
loop transformation codebase. Specifically, it corrects the handling of the
`NumGeneratedLoops` variable in `OMPLoopTransformationD
eZWALT wrote:
> > AnalyzeLoopSequence
>
> Could you point, where this is located?
Of course, [See line 14315 in
`SemaOpenMP.cpp`](https://github.com/eZWALT/llvm-project/blob/main/clang/lib/Sema/SemaOpenMP.cpp#L14315)
https://github.com/llvm/llvm-project/pull/140532
__
eZWALT wrote:
> > AnalyzeLoopSequence
>
> Could you point, where this is located?
Although now that i think about it, this function is not inside this PR but
rather on the PR #139293, but the dependency is clear.
https://github.com/llvm/llvm-project/pull/140532
__
eZWALT wrote:
gentle ping @alexey-bataev
https://github.com/llvm/llvm-project/pull/140532
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
eZWALT wrote:
gentle ping @alexey-bataev
https://github.com/llvm/llvm-project/pull/139293
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/eZWALT updated
https://github.com/llvm/llvm-project/pull/140532
>From affda91204c1aacdab8ebd0966a27e93feec6db3 Mon Sep 17 00:00:00 2001
From: eZWALT
Date: Mon, 19 May 2025 10:49:10 +
Subject: [PATCH] Correct the number of generated loops
---
clang/include/clang/AST/Stmt
eZWALT wrote:
After conducting an examination of the directive handling logic, I can
confidently state that the number of generated loops (`NumGeneratedLoops`) does
not affect the semantic checks for the majority of transformations. This is
because values are usually hardcoded in the `ActOnXXX
https://github.com/eZWALT edited
https://github.com/llvm/llvm-project/pull/139293
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/eZWALT edited
https://github.com/llvm/llvm-project/pull/139293
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1480,6 +1493,108 @@ class SemaOpenMP : public SemaBase {
SmallVectorImpl &LoopHelpers,
Stmt *&Body, SmallVectorImpl> &OriginalInits);
+ /// @brief Categories of loops encountered during semantic OpenMP loop
+ /// analysis
+ ///
+ /// This enumeration identi
@@ -0,0 +1,186 @@
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -std=c++20 -fopenmp
-fopenmp-version=60 -fsyntax-only -Wuninitialized -verify %s
+
+void func() {
+
+// expected-error@+2 {{statement after '#pragma omp fuse' must be a loop
sequence containing canonical loops
eZWALT wrote:
> It would be good to try to find the cases that may reveal this issues before
> committing the patch
Yes, i'll go through loop transformations tests and notify you tomorrow if this
is the case, but i'm pretty sure that these are not breaking changes for the
same reason that i t
eZWALT wrote:
Before leaving i can attest that the regression tests have been passed twice
:+1:
https://github.com/llvm/llvm-project/pull/140532
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/c
eZWALT wrote:
> Are there any tests that might be affected by this change?
Yesterday I ran all the tests (check-clang-openmp and check-clang) and no
change in the behaviour or incidence was found, although i'll re-execute them
just as a sanity check. Just a remainder but this merge request sho
eZWALT wrote:
> > @alexey-bataev After conducting an examination of the directive handling
> > logic, I can confidently state that the number of generated loops
> > (`NumGeneratedLoops`) does not affect the semantic checks for the majority
> > of transformations. This is because values are usu
eZWALT wrote:
> What I see in the source code that it is used as a boolean flag. Can we
> transform it to bool? There is no need to keep it integer
Please could you cite the exact line? I'm not sure if you are refering to the
logic inside checkTransformableLoopNest or not.
https://github.com/
eZWALT wrote:
> > > What I see in the source code that it is used as a boolean flag. Can we
> > > transform it to bool? There is no need to keep it integer
> >
> >
> > Please could you cite the exact line? I'm not sure if you are refering to
> > the logic inside checkTransformableLoopNest or
eZWALT wrote:
@alexey-bataev not sure what happened before with this build system, but now
everything works as expected. Thanks for the fast replies and have a nice
weekend!
https://github.com/llvm/llvm-project/pull/139293
___
cfe-commits mailing l
@@ -11516,6 +11516,21 @@ def note_omp_implicit_dsa : Note<
"implicitly determined as %0">;
def err_omp_loop_var_dsa : Error<
"loop iteration variable in the associated loop of 'omp %1' directive may
not be %0, predetermined as %2">;
+def warn_omp_different_loop_ind_var_typ
https://github.com/eZWALT edited
https://github.com/llvm/llvm-project/pull/139293
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
eZWALT wrote:
I originally kept the `NumGeneratedLoops` information consistent despite being
partially subsumed by NumGeneratedLoopNests (Note that its not actually the
same, it returns the number of generated loops in total adding nested loops,
but due to the current usage of this semantic i
eZWALT wrote:
> I originally kept the `NumGeneratedLoops` information consistent despite
> being partially subsumed by NumGeneratedLoopNests (Note that its not actually
> the same, it returns the number of generated loops in total adding nested
> loops, but due to the current usage of this sem
eZWALT wrote:
gentle ping @alexey-bataev @Meinersbur ;)
https://github.com/llvm/llvm-project/pull/140532
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
eZWALT wrote:
gentle ping :)
https://github.com/llvm/llvm-project/pull/140532
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
eZWALT wrote:
> > I originally kept the `NumGeneratedLoops` information consistent despite
> > being partially subsumed by NumGeneratedLoopNests (Note that its not
> > actually the same, it returns the number of generated loops in total adding
> > nested loops, but due to the current usage of
https://github.com/eZWALT updated
https://github.com/llvm/llvm-project/pull/140532
>From affda91204c1aacdab8ebd0966a27e93feec6db3 Mon Sep 17 00:00:00 2001
From: eZWALT
Date: Mon, 19 May 2025 10:49:10 +
Subject: [PATCH] Correct the number of generated loops
---
clang/include/clang/AST/Stmt
eZWALT wrote:
Thank you so much @Meinersbur !
https://github.com/llvm/llvm-project/pull/140532
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
eZWALT wrote:
> Thanks for the work and sorry I could not have a look into it earlier
Nono, thank you for your time and guidance! Between today and tomorrow i'll
upload the updated version, thanks for taking the time to improve it and the
nitpicks!
https://github.com/llvm/llvm-project/pull/13
@@ -1143,6 +1143,97 @@ class OMPFullClause final : public
OMPNoChildClause {
static OMPFullClause *CreateEmpty(const ASTContext &C);
};
+/// This class represents the 'looprange' clause in the
+/// '#pragma omp fuse' directive
+///
+/// \code {c}
+/// #pragma omp fuse loopr
@@ -508,6 +512,43 @@ OMPInterchangeDirective::CreateEmpty(const ASTContext &C,
unsigned NumClauses,
SourceLocation(), SourceLocation(), NumLoops);
}
+OMPFuseDirective *OMPFuseDirective::Create(
+const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
+
@@ -3256,9 +3256,8 @@ LValue CodeGenFunction::EmitDeclRefLValue(const
DeclRefExpr *E) {
var, ConvertTypeForMem(VD->getType()),
getContext().getDeclAlign(VD));
// No other cases for now.
-} else {
+} else
llvm_unreachable("DeclRefExpr for Decl not
@@ -3256,9 +3256,8 @@ LValue CodeGenFunction::EmitDeclRefLValue(const
DeclRefExpr *E) {
var, ConvertTypeForMem(VD->getType()),
getContext().getDeclAlign(VD));
// No other cases for now.
-} else {
+} else
llvm_unreachable("DeclRefExpr for Decl not
https://github.com/eZWALT deleted
https://github.com/llvm/llvm-project/pull/139293
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/eZWALT edited
https://github.com/llvm/llvm-project/pull/139293
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1479,7 +1492,109 @@ class SemaOpenMP : public SemaBase {
bool checkTransformableLoopNest(
OpenMPDirectiveKind Kind, Stmt *AStmt, int NumLoops,
SmallVectorImpl &LoopHelpers,
- Stmt *&Body, SmallVectorImpl> &OriginalInits);
+ Stmt *&Body, SmallVectorIm
@@ -14189,10 +14196,49 @@ StmtResult
SemaOpenMP::ActOnOpenMPTargetTeamsDistributeSimdDirective(
getASTContext(), StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
}
+/// Overloaded base case function
+template static bool tryHandleAs(T *t, F &&) {
+ return false;
@@ -15499,6 +15836,496 @@ StmtResult
SemaOpenMP::ActOnOpenMPInterchangeDirective(
buildPreInits(Context, PreInits));
}
+StmtResult SemaOpenMP::ActOnOpenMPFuseDirective(ArrayRef Clauses,
+
@@ -15499,6 +15836,496 @@ StmtResult
SemaOpenMP::ActOnOpenMPInterchangeDirective(
buildPreInits(Context, PreInits));
}
+StmtResult SemaOpenMP::ActOnOpenMPFuseDirective(ArrayRef Clauses,
+
57 matches
Mail list logo