[clang] [flang] [llvm] Introduce -fexperimental-loop-fuse to clang and flang (PR #142686)

2025-08-29 Thread Ryotaro Kasuga via cfe-commits
@@ -204,6 +205,10 @@ static cl::opt EnableLoopInterchange("enable-loopinterchange", cl::init(false), cl::Hidden, cl::desc("Enable the LoopInterchange Pass")); +static cl::opt EnableLoopFusion("enable-loopfusion", cl::init(false),

[clang] [flang] [flang] add -floop-interchange and enable it with opt levels (PR #140182)

2025-08-22 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: I’ll leave the revert up to the author. https://github.com/llvm/llvm-project/pull/140182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] add -floop-interchange and enable it with opt levels (PR #140182)

2025-08-22 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: > To be honest, I am very surprised that this PR was submitted, let alone > landed. We have **explicitly not approved** enabling LoopInterchange by > default in LLVM due to outstanding issues. So instead you go ahead and enable > it directly in Flang instead, without even noti

[clang] [flang] [flang] add -floop-interchange and enable it with opt levels (PR #140182)

2025-08-21 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: > This is wrong, we fixed all outstanding bugs reported against DA at the time > when we enabled interchange in flang. I’m referring to the bugs that existed at that time but were not reported. The issues that were raised do not represent all the defects. > If we don't enable

[clang] [flang] [flang] add -floop-interchange and enable it with opt levels (PR #140182)

2025-08-21 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: I'm not trying to emphasize the number of issues raised on GitHub, the real concern is their substance. What I pointed out in the issues represents only a small portion of the overall problem. There are fundamental flaws in DA's implementation, particularly in how it handles w

[clang] [flang] [flang] add -floop-interchange and enable it with opt levels (PR #140182)

2025-08-20 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: It is only enabled in flang, and not in clang at the moment. https://github.com/llvm/llvm-project/pull/140182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] add -floop-interchange and enable it with opt levels (PR #140182)

2025-08-20 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: > Flang's policy is not really different from Clang's, but I can raise it in > the next community call Thanks. I think this should be removed from LLVM 21. https://github.com/llvm/llvm-project/pull/140182 ___ cfe-commits mailing list

[clang] [flang] [llvm] Introduce -fexperimental-loop-fuse to clang and flang (PR #142686)

2025-08-07 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: Just in case: it's not "just after LoopInterchange", it's "before LoopDeletion". If you want to run it just after LoopInterchange, please add LoopFuse after adding `LPM` to `OptimizePM`. It might be better adding some test to check the position. Also, you may want to avoid re

[clang] [flang] [llvm] Introduce -fexperimental-loop-fuse to clang and flang (PR #142686)

2025-08-07 Thread Ryotaro Kasuga via cfe-commits
@@ -204,6 +205,10 @@ static cl::opt EnableLoopInterchange("enable-loopinterchange", cl::init(false), cl::Hidden, cl::desc("Enable the LoopInterchange Pass")); +static cl::opt EnableLoopFusion("enable-loopfusion", cl::init(false),

[clang] [flang] [llvm] Introduce -fexperimental-loop-fuse to clang and flang (PR #142686)

2025-08-07 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: > In that case. it may be better to move it to > `buildModuleOptimizationPipeline`. This is undoubtedly an optimization, and a > non-trivial one at that. There are still open questions about the exact > placement of the pass within the optimization pipeline, but moving it into

[clang] [flang] [llvm] add -floop-fuse to clang and flang (PR #142686)

2025-07-31 Thread Ryotaro Kasuga via cfe-commits
@@ -204,6 +205,10 @@ static cl::opt EnableLoopInterchange("enable-loopinterchange", cl::init(false), cl::Hidden, cl::desc("Enable the LoopInterchange Pass")); +static cl::opt EnableLoopFusion("enable-loopfusion", cl::init(false), +

[clang] [flang] [llvm] add -floop-fuse to clang and flang (PR #142686)

2025-07-31 Thread Ryotaro Kasuga via cfe-commits
@@ -204,6 +205,10 @@ static cl::opt EnableLoopInterchange("enable-loopinterchange", cl::init(false), cl::Hidden, cl::desc("Enable the LoopInterchange Pass")); +static cl::opt EnableLoopFusion("enable-loopfusion", cl::init(false),

[clang] [flang] [llvm] add -floop-fuse to clang and flang (PR #142686)

2025-07-31 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: > What do you think is the right place in pass pipeline? I don't know, but just a gut feeling, somewhere in `buildModuleOptimizationPipeline` looks reasonable to me rather than `buildFunctionSimplificationPipeline`. However, again, it should be determined by what you'd like t

[clang] [flang] [llvm] add -floop-fuse to clang and flang (PR #142686)

2025-07-29 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj edited https://github.com/llvm/llvm-project/pull/142686 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] add -floop-fuse to clang and flang (PR #142686)

2025-07-29 Thread Ryotaro Kasuga via cfe-commits
@@ -518,6 +524,9 @@ PassBuilder::buildO1FunctionSimplificationPipeline(OptimizationLevel Level, invokeLoopOptimizerEndEPCallbacks(LPM2, Level); + if (PTO.LoopFuse) +FPM.addPass(LoopFusePass()); + kasuga-fj wrote: > LoopFusion is a function pass I do

[clang] [flang] [llvm] add -floop-fuse to clang and flang (PR #142686)

2025-07-29 Thread Ryotaro Kasuga via cfe-commits
@@ -32,6 +32,9 @@ page](https://llvm.org/releases/). ## New Compiler Flags +* -floop-interchange is now recognized by flang. kasuga-fj wrote: Seems a mistake while resolving the conflict. https://github.com/llvm/llvm-project/pull/142686

[clang] [flang] [llvm] add -floop-fuse to clang and flang (PR #142686)

2025-07-29 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj commented: FWIW, using merge instead of rebase might be a better. That way, you might avoid resolving the same conflicts repeatedly. https://github.com/llvm/llvm-project/pull/142686 ___ cfe-commits mailing list cfe-commits

[clang] [flang] [llvm] add -floop-fuse to clang and flang (PR #142686)

2025-07-28 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: You probably made a mistake with the rebase... https://github.com/llvm/llvm-project/pull/142686 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] add -floop-fuse to clang and flang (PR #142686)

2025-07-23 Thread Ryotaro Kasuga via cfe-commits
@@ -3157,7 +3157,7 @@ void tools::handleVectorizeSLPArgs(const ArgList &Args, void tools::handleInterchangeLoopsArgs(const ArgList &Args, ArgStringList &CmdArgs) { - // FIXME: instead of relying on shouldEnableVectorizerAtOLevel, we may

[clang] [flang] [llvm] add -floop-fuse to clang and flang (PR #142686)

2025-07-23 Thread Ryotaro Kasuga via cfe-commits
@@ -518,6 +524,9 @@ PassBuilder::buildO1FunctionSimplificationPipeline(OptimizationLevel Level, invokeLoopOptimizerEndEPCallbacks(LPM2, Level); + if (PTO.LoopFuse) +FPM.addPass(LoopFusePass()); + kasuga-fj wrote: Is this an appropriate place? I think

[clang] [flang] [llvm] add -floop-fuse to clang and flang (PR #142686)

2025-07-23 Thread Ryotaro Kasuga via cfe-commits
@@ -2112,7 +2124,6 @@ PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level, LPM.addPass(LoopFlattenPass()); LPM.addPass(IndVarSimplifyPass()); LPM.addPass(LoopDeletionPass()); - // FIXME: Add loop interchange. kasuga-fj wrote: I don't think t

[clang] [flang] [llvm] add -floop-fuse to clang and flang (PR #142686)

2025-07-23 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: So, why wouldn't adding a `cl::opt` flag work in the end? In fact, you've added `enable-loopfuse` flag in this patch. If it's enough, I personally think it might be better to avoid introducing additional flags unnecessarily. https://github.com/llvm/llvm-project/pull/142686 ___

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-07-16 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: Thanks for the reviews! https://github.com/llvm/llvm-project/pull/135163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-07-16 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj closed https://github.com/llvm/llvm-project/pull/135163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-07-15 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj edited https://github.com/llvm/llvm-project/pull/135163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-07-15 Thread Ryotaro Kasuga via cfe-commits
@@ -643,9 +650,7 @@ void LoopInfoStack::push(BasicBlock *Header, clang::ASTContext &Ctx, case LoopHintAttr::Disable: switch (Option) { case LoopHintAttr::Vectorize: -// Disable vectorization by specifying a width of 1. -setVectorizeWidth(1); -

[clang] [WIP] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-07-15 Thread Ryotaro Kasuga via cfe-commits
@@ -5237,8 +5237,8 @@ width/count of the set of target architectures supported by your application. ... } -Specifying a width/count of 1 disables the optimization, and is equivalent to -``vectorize(disable)`` or ``interleave(disable)``. +Specifying a *non-scalable* widt

[clang] [WIP] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-07-15 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj updated https://github.com/llvm/llvm-project/pull/135163 >From 79186af3df57357d40ec3b3e4eaf9da978b31ef6 Mon Sep 17 00:00:00 2001 From: Ryotaro Kasuga Date: Fri, 4 Apr 2025 12:32:57 + Subject: [PATCH 1/8] [clang][CodeGen] Fix metadata when vectorization is disab

[clang] [WIP] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-07-15 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj updated https://github.com/llvm/llvm-project/pull/135163 >From 79186af3df57357d40ec3b3e4eaf9da978b31ef6 Mon Sep 17 00:00:00 2001 From: Ryotaro Kasuga Date: Fri, 4 Apr 2025 12:32:57 + Subject: [PATCH 1/7] [clang][CodeGen] Fix metadata when vectorization is disab

[clang] [WIP] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-07-15 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj edited https://github.com/llvm/llvm-project/pull/135163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-07-15 Thread Ryotaro Kasuga via cfe-commits
@@ -643,9 +650,7 @@ void LoopInfoStack::push(BasicBlock *Header, clang::ASTContext &Ctx, case LoopHintAttr::Disable: switch (Option) { case LoopHintAttr::Vectorize: -// Disable vectorization by specifying a width of 1. -setVectorizeWidth(1); -

[clang] [WIP] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-07-15 Thread Ryotaro Kasuga via cfe-commits
@@ -5237,8 +5237,8 @@ width/count of the set of target architectures supported by your application. ... } -Specifying a width/count of 1 disables the optimization, and is equivalent to -``vectorize(disable)`` or ``interleave(disable)``. kasuga-fj wrote:

[clang] [WIP] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-07-15 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj edited https://github.com/llvm/llvm-project/pull/135163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-07-14 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: I somehow missed this until now, but it turns out that specifying `vectorize(disable) vectorize_width(scalable)` causes an error due to "incompatible directives" (godbolt: https://godbolt.org/z/vv1vKqdTn). I had been concerned that the ambiguity here might make implementation

[clang] [UserManual] Document clang option for loop interchange (PR #147014)

2025-07-06 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: As far as I can tell, it doesn't seem like a link to UsersManual is there, but you can reach both from [the top page](https://clang.llvm.org/docs/index.html). https://github.com/llvm/llvm-project/pull/147014 ___ cfe-commits mailing li

[clang] [UserManual] Document clang option for loop interchange (PR #147014)

2025-07-04 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj commented: It is already documented in [Clang command line argument reference](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-floop-interchange) (perhaps this is automatically generated based on [`clang/Driver/Options.td`](https://github

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-06-13 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: Gentle ping https://github.com/llvm/llvm-project/pull/135163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] add -floop-interchange and enable it with opt levels (PR #140182)

2025-05-26 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: There is still a correctness issue with LoopInterchange, as I reported in #140238. This problem is not specific to C/C++. The following code demonstrates a case where illegal loop-interchange occurs. ```fortran program main implicit none real, save :: A(5, 5) real,

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-05-15 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: Ping. I think there are two possible interpretations of `vectorize(disable) vectorize_width(scalable)`, as follows: - It is equivalent to `vectorize(disable)` so vectorization is disabled, as the document says: > Pragmas setting transformation options imply the transformati

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-05-15 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: Printing an error message looks reasonable to me, but I think we first need to clarify what codes are "unsupported". https://github.com/llvm/llvm-project/pull/131985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-05-15 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: > For this reason OpenMP 5.1 added new pragma: > > ```c > #pragma omp simd reduction(+:v0) > #pragma omp unroll partial(4) > ``` FWIW, I tried it and the following error occurred. ``` :10:1: error: OpenMP constructs may not be nested inside a simd region except for ordered si

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-05-14 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: Thanks for sharing. I haven't looked at the details yet, but I simplified it as follows. ```c #include void g(float); void f(int m) { #pragma omp parallel { float v0 = 0.0; #pragma omp simd reduction(+:v0) #pragma unroll(4) for(int i=0; i < m; i++) { v0 +

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-04-24 Thread Ryotaro Kasuga via cfe-commits
@@ -5237,8 +5237,8 @@ width/count of the set of target architectures supported by your application. ... } -Specifying a width/count of 1 disables the optimization, and is equivalent to -``vectorize(disable)`` or ``interleave(disable)``. kasuga-fj wrote:

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-04-23 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: > Unfortuantely IIRC there is a semantic difference between pragma and metadata: > >- llvm.loop.vectorize.enable==false disables vectorization AND > interleaving (by switching off the entire LoopVectorize pass which does both > of thise things) >- llvm.loop.vectorize.wi

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-04-23 Thread Ryotaro Kasuga via cfe-commits
@@ -5237,8 +5237,8 @@ width/count of the set of target architectures supported by your application. ... } -Specifying a width/count of 1 disables the optimization, and is equivalent to -``vectorize(disable)`` or ``interleave(disable)``. +Specifying a *non-scalable* widt

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-04-15 Thread Ryotaro Kasuga via cfe-commits
@@ -37,8 +37,8 @@ void test3(int *List, int Length) { List[i] = i * 2; } -// Check that disabling vectorization means a vectorization width of 1, and -// also that vectorization_predicate isn't enabled. +// Check that vectorize is disabled, and also that vectorization_pred

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-04-15 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj updated https://github.com/llvm/llvm-project/pull/135163 >From 79186af3df57357d40ec3b3e4eaf9da978b31ef6 Mon Sep 17 00:00:00 2001 From: Ryotaro Kasuga Date: Fri, 4 Apr 2025 12:32:57 + Subject: [PATCH 1/5] [clang][CodeGen] Fix metadata when vectorization is disab

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-04-11 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj edited https://github.com/llvm/llvm-project/pull/135163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-04-11 Thread Ryotaro Kasuga via cfe-commits
@@ -194,7 +194,7 @@ void for_test_scalable(int *List, int Length) { } } -// Verify for loop is performing scalable vectorization +// Verify for loop is NOT performing vectorization because the width is 1 kasuga-fj wrote: Fixed both code and docs. Thanks. h

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-04-11 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj updated https://github.com/llvm/llvm-project/pull/135163 >From 79186af3df57357d40ec3b3e4eaf9da978b31ef6 Mon Sep 17 00:00:00 2001 From: Ryotaro Kasuga Date: Fri, 4 Apr 2025 12:32:57 + Subject: [PATCH 1/4] [clang][CodeGen] Fix metadata when vectorization is disab

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-04-10 Thread Ryotaro Kasuga via cfe-commits
@@ -194,7 +194,7 @@ void for_test_scalable(int *List, int Length) { } } -// Verify for loop is performing scalable vectorization +// Verify for loop is NOT performing vectorization because the width is 1 kasuga-fj wrote: You are right, I misunderstood the c

[clang] [clang][CodeGen] Make pragma-loop test more rboust (NFC) (PR #133707)

2025-04-05 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj closed https://github.com/llvm/llvm-project/pull/133707 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-04-05 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj edited https://github.com/llvm/llvm-project/pull/131985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Make pragma-loop test more rboust (NFC) (PR #133707)

2025-03-31 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj edited https://github.com/llvm/llvm-project/pull/133707 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Make pragma-loop test more rboust (NFC) (PR #133707)

2025-03-31 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj created https://github.com/llvm/llvm-project/pull/133707 pragma-loop.cpp contains tests for loop metadata generated via pragma directives. These tests were not working as (perhaps) expected. This is because the regex `.*` consumes multiple elements in metadata. For

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-28 Thread Ryotaro Kasuga via cfe-commits
@@ -44,23 +44,19 @@ MDNode *LoopInfo::createPipeliningMetadata(const LoopAttributes &Attrs, else if (Attrs.PipelineInitiationInterval != 0) Enabled = true; + SmallVector Args; + Args.append(LoopProperties.begin(), LoopProperties.end()); + if (Enabled != true) { -

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-27 Thread Ryotaro Kasuga via cfe-commits
@@ -44,23 +44,19 @@ MDNode *LoopInfo::createPipeliningMetadata(const LoopAttributes &Attrs, else if (Attrs.PipelineInitiationInterval != 0) Enabled = true; + SmallVector Args; + Args.append(LoopProperties.begin(), LoopProperties.end()); + if (Enabled != true) { -

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-27 Thread Ryotaro Kasuga via cfe-commits
@@ -44,23 +44,19 @@ MDNode *LoopInfo::createPipeliningMetadata(const LoopAttributes &Attrs, else if (Attrs.PipelineInitiationInterval != 0) Enabled = true; + SmallVector Args; + Args.append(LoopProperties.begin(), LoopProperties.end()); + if (Enabled != true) { -

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-27 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj edited https://github.com/llvm/llvm-project/pull/131985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-27 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj closed https://github.com/llvm/llvm-project/pull/131985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-27 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj updated https://github.com/llvm/llvm-project/pull/131985 >From 63dec28732e6a90f5f3449441fa8472b5b60a9f4 Mon Sep 17 00:00:00 2001 From: Ryotaro Kasuga Date: Wed, 26 Mar 2025 07:29:18 + Subject: [PATCH] [clang][CodeGen] Generate follow-up metadata for loops in co

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj commented: Thanks for your review! https://github.com/llvm/llvm-project/pull/131985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Ryotaro Kasuga via cfe-commits
@@ -44,23 +44,19 @@ MDNode *LoopInfo::createPipeliningMetadata(const LoopAttributes &Attrs, else if (Attrs.PipelineInitiationInterval != 0) Enabled = true; + SmallVector Args; + Args.append(LoopProperties.begin(), LoopProperties.end()); + if (Enabled != true) { -

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Ryotaro Kasuga via cfe-commits
@@ -44,23 +44,19 @@ MDNode *LoopInfo::createPipeliningMetadata(const LoopAttributes &Attrs, else if (Attrs.PipelineInitiationInterval != 0) Enabled = true; + SmallVector Args; + Args.append(LoopProperties.begin(), LoopProperties.end()); + if (Enabled != true) { -

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj edited https://github.com/llvm/llvm-project/pull/131985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Ryotaro Kasuga via cfe-commits
@@ -227,36 +226,26 @@ void for_test_scalable_1(int *List, int Length) { // CHECK: ![[LOOP_5]] = distinct !{![[LOOP_5]], ![[UNROLL_DISABLE:.*]], ![[DISTRIBUTE_DISABLE:.*]], ![[WIDTH_1:.*]]} // CHECK: ![[WIDTH_1]] = !{!"llvm.loop.vectorize.width", i32 1} -// CHECK: ![[LOOP_6]]

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Ryotaro Kasuga via cfe-commits
@@ -170,11 +161,10 @@ LoopInfo::createUnrollAndJamMetadata(const LoopAttributes &Attrs, MDNode::get(Ctx, MDString::get(Ctx, "llvm.loop.unroll_and_jam.disable"))); bool FollowupHasTransforms = false; - MDNode *Followup = createPartialUnrollMetadata(Attrs, FollowupLoo

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Ryotaro Kasuga via cfe-commits
@@ -44,23 +44,19 @@ MDNode *LoopInfo::createPipeliningMetadata(const LoopAttributes &Attrs, else if (Attrs.PipelineInitiationInterval != 0) Enabled = true; + SmallVector Args; + Args.append(LoopProperties.begin(), LoopProperties.end()); + if (Enabled != true) { -

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj commented: > Possibly the `create*Metadata` should only return a list of properties > instead of an MDNode, with the MDNode only to be created when applying the > properties to a Loop. However, the easier fix would probably be to extract > the properties from the

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj edited https://github.com/llvm/llvm-project/pull/131985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoopUtils] Fix metadata generated by makeFollowupLoopID (PR #131985)

2025-03-26 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj updated https://github.com/llvm/llvm-project/pull/131985 >From 889f40c5570af8a02e301c2bf3c6382f69210140 Mon Sep 17 00:00:00 2001 From: Ryotaro Kasuga Date: Mon, 17 Mar 2025 11:24:47 + Subject: [PATCH 1/3] [LoopUtils] Fix metadata generated by makeFollowupLoopID

[clang] [llvm] [Clang][Driver] Add an option to control loop-interchange (PR #125830)

2025-02-07 Thread Ryotaro Kasuga via cfe-commits
kasuga-fj wrote: Thanks for the comments. I'll try to work on it in the near future. https://github.com/llvm/llvm-project/pull/125830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang][Driver] Add an option to control loop-interchange (PR #125830)

2025-02-06 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj approved this pull request. https://github.com/llvm/llvm-project/pull/125830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Support `#pragma clang loop pipeline(enable)` (PR #112501)

2024-10-16 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj edited https://github.com/llvm/llvm-project/pull/112501 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Support `#pragma clang loop pipeline(enable)` (PR #112501)

2024-10-16 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj created https://github.com/llvm/llvm-project/pull/112501 Previously `#pragma clang loop pipeline` only accepted `disable`. This patch adds `enable` as a valid argument for this pragma. This allows Software Pipelining optimization to be applied to some loops instead