[llvm-branch-commits] [clang] [flang] [llvm] [Clang][OpenMP] Add permutation clause (PR #92030)

2024-07-19 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur closed 
https://github.com/llvm/llvm-project/pull/92030
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [flang] [llvm] [Clang][OpenMP] Add permutation clause (PR #92030)

2024-07-19 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur reopened 
https://github.com/llvm/llvm-project/pull/92030
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Automate operand structure definition (PR #99508)

2024-07-19 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur edited 
https://github.com/llvm/llvm-project/pull/99508
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Automate operand structure definition (PR #99508)

2024-07-19 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur commented:

👍 for automatically generating this.

https://github.com/llvm/llvm-project/pull/99508
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Automate operand structure definition (PR #99508)

2024-07-19 Thread Michael Kruse via llvm-branch-commits


@@ -148,6 +169,110 @@ static void verifyClause(Record *op, Record *clause) {
 "or explicitly skipping this field.");
 }
 
+/// Translate the type of an OpenMP clause's argument to its corresponding
+/// representation for clause operand structures.
+///
+/// All kinds of values are represented as `mlir::Value` fields, whereas
+/// attributes are represented based on their `storageType`.
+///
+/// \param[in] init The `DefInit` object representing the argument.
+/// \param[out] rank Number of levels of array nesting associated with the
+/// type.
+///
+/// \return the name of the base type to represent elements of the argument
+/// type.

Meinersbur wrote:

[nit] indention
```suggestion
/// \return the name of the base type to represent elements of the argument
/// type.
```

https://github.com/llvm/llvm-project/pull/99508
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Automate operand structure definition (PR #99508)

2024-07-19 Thread Michael Kruse via llvm-branch-commits


@@ -148,6 +169,110 @@ static void verifyClause(Record *op, Record *clause) {
 "or explicitly skipping this field.");
 }
 
+/// Translate the type of an OpenMP clause's argument to its corresponding
+/// representation for clause operand structures.
+///
+/// All kinds of values are represented as `mlir::Value` fields, whereas
+/// attributes are represented based on their `storageType`.
+///
+/// \param[in] init The `DefInit` object representing the argument.
+/// \param[out] rank Number of levels of array nesting associated with the
+/// type.

Meinersbur wrote:

[nit] indention
```suggestion
/// \param[out] rank Number of levels of array nesting associated with the
///  type.
```

https://github.com/llvm/llvm-project/pull/99508
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Automate operand structure definition (PR #99508)

2024-07-19 Thread Michael Kruse via llvm-branch-commits


@@ -148,6 +169,110 @@ static void verifyClause(Record *op, Record *clause) {
 "or explicitly skipping this field.");
 }
 
+/// Translate the type of an OpenMP clause's argument to its corresponding
+/// representation for clause operand structures.
+///
+/// All kinds of values are represented as `mlir::Value` fields, whereas
+/// attributes are represented based on their `storageType`.
+///
+/// \param[in] init The `DefInit` object representing the argument.
+/// \param[out] rank Number of levels of array nesting associated with the
+/// type.
+///
+/// \return the name of the base type to represent elements of the argument
+/// type.
+static StringRef translateArgumentType(Init *init, int &rank) {
+  Record *def = cast(init)->getDef();
+  bool isAttr = false, isValue = false;
+
+  for (auto [sc, _] : def->getSuperClasses()) {
+std::string scName = sc->getNameInitAsString();
+if (scName == "OptionalAttr")
+  return translateArgumentType(def->getValue("baseAttr")->getValue(), 
rank);
+
+if (scName == "TypedArrayAttrBase") {
+  ++rank;
+  return translateArgumentType(def->getValue("elementAttr")->getValue(),
+   rank);
+}
+
+if (scName == "ElementsAttrBase") {
+  rank += def->getValueAsInt("rank");
+  return def->getValueAsString("elementReturnType").trim();
+}
+
+if (scName == "Attr")
+  isAttr = true;
+else if (scName == "TypeConstraint")
+  isValue = true;
+else if (scName == "Variadic")
+  ++rank;
+  }
+
+  if (isValue) {
+assert(!isAttr);
+return "::mlir::Value";
+  }
+
+  assert(isAttr);

Meinersbur wrote:

[nit] Add description on why `isAttr` is required here. It is not used on the 
next line.

https://github.com/llvm/llvm-project/pull/99508
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Automate operand structure definition (PR #99508)

2024-07-19 Thread Michael Kruse via llvm-branch-commits


@@ -23,303 +23,31 @@
 #define GET_ATTRDEF_CLASSES
 #include "mlir/Dialect/OpenMP/OpenMPOpsAttributes.h.inc"
 
+#include "mlir/Dialect/OpenMP/OpenMPClauseOps.h.inc"
+
 namespace mlir {
 namespace omp {
 
 
//===--===//
-// Mixin structures defining MLIR operands associated with each OpenMP clause.
+// Extra clause operand structures.
 
//===--===//
 
-struct AlignedClauseOps {
-  llvm::SmallVector alignedVars;
-  llvm::SmallVector alignments;
-};
-
-struct AllocateClauseOps {
-  llvm::SmallVector allocateVars, allocatorVars;
-};
-
-struct CancelDirectiveNameClauseOps {
-  ClauseCancellationConstructTypeAttr cancelDirective;
-};
-
-struct CollapseClauseOps {
-  llvm::SmallVector collapseLowerBound, collapseUpperBound, 
collapseStep;
-};
-
-struct CopyprivateClauseOps {
-  llvm::SmallVector copyprivateVars;
-  llvm::SmallVector copyprivateSyms;
-};
-
-struct CriticalNameClauseOps {
-  StringAttr symName;
-};
-
-struct DependClauseOps {
-  llvm::SmallVector dependKinds;
-  llvm::SmallVector dependVars;
-};
-
-struct DeviceClauseOps {
-  Value device;
-};
-
 struct DeviceTypeClauseOps {

Meinersbur wrote:

Why is the `device_type` clause not generated?

https://github.com/llvm/llvm-project/pull/99508
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Automate operand structure definition (PR #99508)

2024-07-19 Thread Michael Kruse via llvm-branch-commits


@@ -12,11 +12,43 @@
 
 #include "mlir/TableGen/GenInfo.h"
 
+#include "mlir/TableGen/CodeGenHelpers.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/TypeSwitch.h"
 #include "llvm/TableGen/Error.h"
 #include "llvm/TableGen/Record.h"
 
 using namespace llvm;
 
+/// The code block defining the base mixin class for combining clause operand
+/// structures.
+static const char *const baseMixinClass = R"(
+namespace detail {
+template 
+struct Clauses : public Mixins... {};
+} // namespace detail
+)";
+
+/// The code block defining operation argument structures.
+static const char *const operationArgStruct = R"(
+using {0}Operands = detail::Clauses<{1}>;
+)";
+
+/// Remove multiple optional prefixes and suffixes from \c str.

Meinersbur wrote:

Is being ordered intended. I.e. `CollapseClauseSkip` is normalized to 
`Collapse`, but not `CollapseSkipClause`? Whatever the intention, it should be 
documented.

https://github.com/llvm/llvm-project/pull/99508
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [llvm] [mlir] [MLIR][OpenMP][OMPIRBuilder] Add lowering support for omp.target_triples (PR #100156)

2024-07-24 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/100156
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Add omp.target_triples attribute to the OffloadModuleInterface (PR #100154)

2024-07-24 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/100154
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [mlir] [MLIR][OpenMP] Create `LoopRelatedClause` (PR #99506)

2024-07-26 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur approved this pull request.

LGTM, thank you!

https://github.com/llvm/llvm-project/pull/99506
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [mlir] [MLIR][OpenMP] NFC: Sort clauses alphabetically (2/2) (PR #101194)

2024-07-31 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/101194
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [LAA] Refine stride checks for SCEVs during dependence analysis. (#99… (PR #102201)

2024-08-09 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/102201
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Introduce the LoopWrapperInterface (PR #87232)

2024-04-02 Thread Michael Kruse via llvm-branch-commits


@@ -1730,9 +1730,28 @@ LogicalResult LoopNestOp::verify() {
  << "range argument type does not match corresponding IV type";
   }
 
+  auto wrapper =
+  llvm::dyn_cast_if_present((*this)->getParentOp());
+
+  if (!wrapper || !wrapper.isWrapper())
+return emitOpError() << "expects parent op to be a valid loop wrapper";
+
   return success();
 }
 
+SmallVector LoopNestOp::getWrappers() {

Meinersbur wrote:

```suggestion
void LoopNestOp::findSurroundingWrappers(SmallVectorImpl 
&list) {
```
Instead of returning a list, LLVM often uses this pattern that fill's a 
caller's list. This may have been done because `SmallVector` has a SmallSize 
argument that should not be hardcoded in a public API, but with it being 
optional I don't know how relevant this still is. Another reason is to avoid 
the impression that this is a simple getter. Also, it allows hoisting the 
declaration of the list outside a loop. See 
https://llvm.org/docs/ProgrammersManual.html#vector and the note in 
https://llvm.org/docs/ProgrammersManual.html#llvm-adt-smallvector-h

https://github.com/llvm/llvm-project/pull/87232
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Introduce the LoopWrapperInterface (PR #87232)

2024-04-02 Thread Michael Kruse via llvm-branch-commits


@@ -69,6 +69,74 @@ def ReductionClauseInterface : 
OpInterface<"ReductionClauseInterface"> {
   ];
 }
 
+def LoopWrapperInterface : OpInterface<"LoopWrapperInterface"> {
+  let description = [{
+OpenMP operations that can wrap a single loop nest. When taking a wrapper
+role, these operations must only contain a single region with a single 
block
+in which there's a single operation and a terminator. That nested operation
+must be another loop wrapper or an `omp.loop_nest`.
+  }];
+
+  let cppNamespace = "::mlir::omp";
+
+  let methods = [
+InterfaceMethod<
+  /*description=*/[{
+Tell whether the operation could be taking the role of a loop wrapper.
+That is, it has a single region with a single block in which there are
+two operations: another wrapper or `omp.loop_nest` operation and a
+terminator.
+  }],
+  /*retTy=*/"bool",
+  /*methodName=*/"isWrapper",
+  (ins ), [{}], [{
+if ($_op->getNumRegions() != 1)
+  return false;
+
+::mlir::Region &r = $_op->getRegion(0);
+if (!r.hasOneBlock())
+  return false;
+
+if (std::distance(r.op_begin(), r.op_end()) != 2)

Meinersbur wrote:

```suggestion
if (llvm::range_size(r.getOps()) != 2)
```

https://github.com/llvm/llvm-project/pull/87232
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Introduce the LoopWrapperInterface (PR #87232)

2024-04-02 Thread Michael Kruse via llvm-branch-commits


@@ -69,6 +69,74 @@ def ReductionClauseInterface : 
OpInterface<"ReductionClauseInterface"> {
   ];
 }
 
+def LoopWrapperInterface : OpInterface<"LoopWrapperInterface"> {
+  let description = [{
+OpenMP operations that can wrap a single loop nest. When taking a wrapper
+role, these operations must only contain a single region with a single 
block
+in which there's a single operation and a terminator. That nested operation
+must be another loop wrapper or an `omp.loop_nest`.
+  }];
+
+  let cppNamespace = "::mlir::omp";
+
+  let methods = [
+InterfaceMethod<
+  /*description=*/[{
+Tell whether the operation could be taking the role of a loop wrapper.
+That is, it has a single region with a single block in which there are
+two operations: another wrapper or `omp.loop_nest` operation and a
+terminator.
+  }],
+  /*retTy=*/"bool",
+  /*methodName=*/"isWrapper",
+  (ins ), [{}], [{
+if ($_op->getNumRegions() != 1)
+  return false;
+
+::mlir::Region &r = $_op->getRegion(0);
+if (!r.hasOneBlock())
+  return false;
+
+if (std::distance(r.op_begin(), r.op_end()) != 2)
+  return false;
+
+::mlir::Operation &firstOp = *r.op_begin();
+::mlir::Operation &secondOp = *(++r.op_begin());

Meinersbur wrote:

[serious]
```suggestion
::mlir::Operation &secondOp = *(std::next(r.op_begin()));
```
`++` would potentially modify the underlying iterator. I think it's a temporary 
here, but there is also no reason to modify a temporary.

Also, why not `r.op_begin()[0]` and `r.op_begin()[1]`?

https://github.com/llvm/llvm-project/pull/87232
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Introduce the LoopWrapperInterface (PR #87232)

2024-04-02 Thread Michael Kruse via llvm-branch-commits


@@ -69,6 +69,74 @@ def ReductionClauseInterface : 
OpInterface<"ReductionClauseInterface"> {
   ];
 }
 
+def LoopWrapperInterface : OpInterface<"LoopWrapperInterface"> {
+  let description = [{
+OpenMP operations that can wrap a single loop nest. When taking a wrapper
+role, these operations must only contain a single region with a single 
block
+in which there's a single operation and a terminator. That nested operation
+must be another loop wrapper or an `omp.loop_nest`.
+  }];
+
+  let cppNamespace = "::mlir::omp";
+
+  let methods = [
+InterfaceMethod<
+  /*description=*/[{
+Tell whether the operation could be taking the role of a loop wrapper.
+That is, it has a single region with a single block in which there are
+two operations: another wrapper or `omp.loop_nest` operation and a
+terminator.
+  }],
+  /*retTy=*/"bool",
+  /*methodName=*/"isWrapper",
+  (ins ), [{}], [{
+if ($_op->getNumRegions() != 1)
+  return false;
+
+::mlir::Region &r = $_op->getRegion(0);

Meinersbur wrote:

[style]
```suggestion
Region &r = $_op->getRegion(0);
```
Since this is emitted into the `mlir::omp` namespace, declaring the namespace 
for each type seems unnecessary. Or use `auto`?


https://github.com/llvm/llvm-project/pull/87232
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Make omp.taskloop into a loop wrapper (PR #87253)

2024-04-02 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur approved this pull request.


https://github.com/llvm/llvm-project/pull/87253
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Make omp.distribute into a loop wrapper (PR #87239)

2024-04-02 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur approved this pull request.


https://github.com/llvm/llvm-project/pull/87239
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] NFC: Remove LoopControl parsing/printing code (PR #88909)

2024-04-16 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/88909
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Update op verifiers dependent on omp.wsloop (2/5) (PR #89211)

2024-04-19 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/89211
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Update omp.wsloop translation to LLVM IR (4/5) (PR #89214)

2024-04-19 Thread Michael Kruse via llvm-branch-commits


@@ -379,14 +385,16 @@ llvm.func @body(i32)
 
 // CHECK-LABEL: @test_omp_wsloop_static_defchunk
 llvm.func @test_omp_wsloop_static_defchunk(%lb : i32, %ub : i32, %step : i32) 
-> () {
- omp.wsloop schedule(static)
- for (%iv) : i32 = (%lb) to (%ub) step (%step) {
-   // CHECK: call void @__kmpc_for_static_init_4u(ptr @{{.*}}, i32 %{{.*}}, 
i32 34, ptr %{{.*}}, ptr %{{.*}}, ptr %{{.*}}, ptr %{{.*}}, i32 1, i32 0)
-   // CHECK: call void @__kmpc_for_static_fini
-   llvm.call @body(%iv) : (i32) -> ()
-   omp.yield
- }
- llvm.return
+  omp.wsloop schedule(static) {
+omp.loop_nest (%iv) : i32 = (%lb) to (%ub) step (%step) {
+  // CHECK: call void @__kmpc_for_static_init_4u(ptr @{{.*}}, i32 %{{.*}}, 
i32 34, ptr %{{.*}}, ptr %{{.*}}, ptr %{{.*}}, ptr %{{.*}}, i32 1, i32 0)
+  // CHECK: call void @__kmpc_for_static_fini

Meinersbur wrote:

I was staring at this for why the generated body changes, only realize after 
some time that it is only the indention. For some reason sometimes GitHub 
highlights what has changed in a line, but here it doesn't 😒.

https://github.com/llvm/llvm-project/pull/89214
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Update omp.wsloop translation to LLVM IR (4/5) (PR #89214)

2024-04-19 Thread Michael Kruse via llvm-branch-commits


@@ -1008,33 +1009,34 @@ convertOmpWsloop(Operation &opInst, llvm::IRBuilderBase 
&builder,
   auto bodyGen = [&](llvm::OpenMPIRBuilder::InsertPointTy ip, llvm::Value *iv) 
{
 // Make sure further conversions know about the induction variable.
 moduleTranslation.mapValue(
-loop.getRegion().front().getArgument(loopInfos.size()), iv);
+loopOp.getRegion().front().getArgument(loopInfos.size()), iv);
 
 // Capture the body insertion point for use in nested loops. BodyIP of the
 // CanonicalLoopInfo always points to the beginning of the entry block of
 // the body.
 bodyInsertPoints.push_back(ip);
 
-if (loopInfos.size() != loop.getNumLoops() - 1)
+if (loopInfos.size() != loopOp.getNumLoops() - 1)
   return;
 
 // Convert the body of the loop.
 builder.restoreIP(ip);
-convertOmpOpRegions(loop.getRegion(), "omp.wsloop.region", builder,
+convertOmpOpRegions(loopOp.getRegion(), "omp.wsloop.region", builder,
 moduleTranslation, bodyGenStatus);
   };
 
   // Delegate actual loop construction to the OpenMP IRBuilder.
-  // TODO: this currently assumes Wsloop is semantically similar to SCF loop,
-  // i.e. it has a positive step, uses signed integer semantics. Reconsider
-  // this code when Wsloop clearly supports more cases.
+  // TODO: this currently assumes omp.loop_nest is semantically similar to SCF
+  // loop, i.e. it has a positive step, uses signed integer semantics.
+  // Reconsider this code when the nested loop operation clearly supports more
+  // cases.

Meinersbur wrote:

I don't undertand the context of this comment. `scf.for` is not used here. 
`OpenMPIRBuilder::createCanonicalLoop` should support all these cases.

https://github.com/llvm/llvm-project/pull/89214
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Update omp.wsloop translation to LLVM IR (4/5) (PR #89214)

2024-04-19 Thread Michael Kruse via llvm-branch-commits


@@ -916,49 +916,50 @@ static LogicalResult inlineReductionCleanup(
 static LogicalResult
 convertOmpWsloop(Operation &opInst, llvm::IRBuilderBase &builder,
  LLVM::ModuleTranslation &moduleTranslation) {
-  auto loop = cast(opInst);
-  const bool isByRef = loop.getByref();
+  auto wsloopOp = cast(opInst);
+  auto loopOp = cast(wsloopOp.getWrappedLoop());

Meinersbur wrote:

Will this be updated for when `omp.wsloop { omp.simd { omp.loop_nest ...` is 
going to be supported? Does the current verifier reject this?

https://github.com/llvm/llvm-project/pull/89214
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][SCF] Update scf.parallel lowering to OpenMP (3/5) (PR #89212)

2024-04-19 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur approved this pull request.


https://github.com/llvm/llvm-project/pull/89212
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][SCF] Update scf.parallel lowering to OpenMP (3/5) (PR #89212)

2024-04-19 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur edited 
https://github.com/llvm/llvm-project/pull/89212
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][SCF] Update scf.parallel lowering to OpenMP (3/5) (PR #89212)

2024-04-19 Thread Michael Kruse via llvm-branch-commits


@@ -461,18 +461,51 @@ struct ParallelOpLowering : public 
OpRewritePattern {
   // Replace the loop.
   {
 OpBuilder::InsertionGuard allocaGuard(rewriter);
-auto loop = rewriter.create(
+// Create worksharing loop wrapper.
+auto wsloopOp = rewriter.create(parallelOp.getLoc());
+if (!reductionVariables.empty()) {
+  wsloopOp.setReductionsAttr(
+  ArrayAttr::get(rewriter.getContext(), reductionDeclSymbols));
+  wsloopOp.getReductionVarsMutable().append(reductionVariables);
+}
+rewriter.create(loc); // omp.parallel terminator.
+
+// The wrapper's entry block arguments will define the reduction
+// variables.
+llvm::SmallVector reductionTypes;
+reductionTypes.reserve(reductionVariables.size());
+llvm::transform(reductionVariables, std::back_inserter(reductionTypes),
+[](mlir::Value v) { return v.getType(); });
+rewriter.createBlock(
+&wsloopOp.getRegion(), {}, reductionTypes,
+llvm::SmallVector(reductionVariables.size(),
+  parallelOp.getLoc()));
+
+rewriter.setInsertionPoint(
+rewriter.create(parallelOp.getLoc()));
+
+// Create loop nest and populate region with contents of scf.parallel.
+auto loopOp = rewriter.create(
 parallelOp.getLoc(), parallelOp.getLowerBound(),
 parallelOp.getUpperBound(), parallelOp.getStep());
-rewriter.create(loc);
 
-rewriter.inlineRegionBefore(parallelOp.getRegion(), loop.getRegion(),
-loop.getRegion().begin());
+rewriter.inlineRegionBefore(parallelOp.getRegion(), loopOp.getRegion(),
+loopOp.getRegion().begin());
+
+// Remove reduction-related block arguments from omp.loop_nest and
+// redirect uses to the corresponding omp.wsloop block argument.
+mlir::Block &loopOpEntryBlock = loopOp.getRegion().front();
+unsigned numLoops = parallelOp.getNumLoops();
+rewriter.replaceAllUsesWith(
+loopOpEntryBlock.getArguments().drop_front(numLoops),
+wsloopOp.getRegion().getArguments());
+loopOpEntryBlock.eraseArguments(
+numLoops, loopOpEntryBlock.getNumArguments() - numLoops);
 
-Block *ops = rewriter.splitBlock(&*loop.getRegion().begin(),
- loop.getRegion().begin()->begin());
+Block *ops = rewriter.splitBlock(&*loopOp.getRegion().begin(),
+ loopOp.getRegion().begin()->begin());

Meinersbur wrote:

With `loopOpEntryBlock`, this can be simplified
```suggestion
Block *ops = rewriter.splitBlock(&loopOpEntryBlock,
 loopOpEntryBlock.begin());
rewriter.setInsertionPointToStart(&loopOpEntryBlock);
```

https://github.com/llvm/llvm-project/pull/89212
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [Flang][OpenMP][Lower] Update workshare-loop lowering (5/5) (PR #89215)

2024-04-19 Thread Michael Kruse via llvm-branch-commits


@@ -249,31 +249,33 @@ subroutine simple_loop_1
   real, allocatable :: r;
   ! FIRDialect:  omp.parallel
   !$OMP PARALLEL PRIVATE(r)
-  ! FIRDialect: %[[ALLOCA_IV:.*]] = fir.alloca i32 {{{.*}}, pinned}
+  ! FIRDialect:  %[[ALLOCA_IV:.*]] = fir.alloca i32 {{{.*}}, pinned}

Meinersbur wrote:

Please avoid whitespace-only changes

https://github.com/llvm/llvm-project/pull/89215
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [Flang][OpenMP][Lower] Update workshare-loop lowering (5/5) (PR #89215)

2024-04-19 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur edited 
https://github.com/llvm/llvm-project/pull/89215
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [Flang][OpenMP][Lower] Update workshare-loop lowering (5/5) (PR #89215)

2024-04-19 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur approved this pull request.


https://github.com/llvm/llvm-project/pull/89215
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [Flang][OpenMP][Lower] Update workshare-loop lowering (5/5) (PR #89215)

2024-04-19 Thread Michael Kruse via llvm-branch-commits


@@ -369,7 +369,9 @@ getDeclareTargetFunctionDevice(
 static llvm::SmallVector

Meinersbur wrote:

Consider adding documentation for what this function does an the meaning of the 
variables.

https://github.com/llvm/llvm-project/pull/89215
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Update omp.wsloop translation to LLVM IR (4/5) (PR #89214)

2024-04-19 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur edited 
https://github.com/llvm/llvm-project/pull/89214
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Update omp.wsloop translation to LLVM IR (4/5) (PR #89214)

2024-04-22 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/89214
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [LAA] Support different strides & non constant dep distances using SCEV. (PR #88039)

2024-04-22 Thread Michael Kruse via llvm-branch-commits


@@ -2071,34 +2092,51 @@ MemoryDepChecker::Dependence::DepType 
MemoryDepChecker::isDependent(
 // NOTE: There is no need to update MaxSafeVectorWidthInBits after call to
 // couldPreventStoreLoadForward, even if it changed MinDepDistBytes, since 
a
 // forward dependency will allow vectorization using any width.
-if (IsTrueDataDependence && EnableForwardingConflictDetection &&
-(!HasSameSize || couldPreventStoreLoadForward(Val.abs().getZExtValue(),
-  TypeByteSize))) {
-  LLVM_DEBUG(dbgs() << "LAA: Forward but may prevent st->ld forwarding\n");
-  return Dependence::ForwardButPreventsForwarding;
+if (IsTrueDataDependence && EnableForwardingConflictDetection) {
+  if (!C) {
+// TODO: Relax requirement that there is a common stride to retry with
+// non-constant distance dependencies.
+FoundNonConstantDistanceDependence |= !!CommonStride;
+return Dependence::Unknown;
+  }
+  if (!HasSameSize ||
+  couldPreventStoreLoadForward(C->getAPInt().abs().getZExtValue(),
+   TypeByteSize)) {
+LLVM_DEBUG(
+dbgs() << "LAA: Forward but may prevent st->ld forwarding\n");
+return Dependence::ForwardButPreventsForwarding;
+  }
 }
 
 LLVM_DEBUG(dbgs() << "LAA: Dependence is negative\n");
 return Dependence::Forward;
   }
 
-  // Write to the same location with the same size.
-  if (Val == 0) {
-if (HasSameSize)
-  return Dependence::Forward;
-LLVM_DEBUG(
-dbgs() << "LAA: Zero dependence difference but different type 
sizes\n");
+  if (!C) {
+// TODO: Relax requirement that there is a common stride to retry with
+// non-constant distance dependencies.
+FoundNonConstantDistanceDependence |= !!CommonStride;
+LLVM_DEBUG(dbgs() << "LAA: Dependence because of non-constant distance\n");

Meinersbur wrote:

This is the bail-out moved here from line 2047. Is this done so return 
Dependence::Forward with negative distance can be returned also on non-constant 
distances?

`FoundNonConstantDistanceDependence` is not set if there is no common stride, 
but what does it have to do with the distance between the pointers? Before this 
patch it would set that flag independent of any stride.

https://github.com/llvm/llvm-project/pull/88039
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [LAA] Support different strides & non constant dep distances using SCEV. (PR #88039)

2024-04-22 Thread Michael Kruse via llvm-branch-commits


@@ -2028,41 +2029,61 @@ MemoryDepChecker::Dependence::DepType 
MemoryDepChecker::isDependent(
   if (std::holds_alternative(Res))
 return std::get(Res);
 
-  const auto &[Dist, Stride, TypeByteSize, AIsWrite, BIsWrite] =
+  const auto &[Dist, StrideA, StrideB, TypeByteSize, AIsWrite, BIsWrite] =
   std::get(Res);
   bool HasSameSize = TypeByteSize > 0;
 
+  std::optional CommonStride =
+  StrideA == StrideB ? std::make_optional(StrideA) : std::nullopt;
+  if (isa(Dist)) {
+// TODO: Relax requirement that there is a common stride to retry with
+// non-constant distance dependencies.
+FoundNonConstantDistanceDependence |= !!CommonStride;
+LLVM_DEBUG(dbgs() << "LAA: Dependence because of uncomputable 
distance.\n");
+return Dependence::Unknown;
+  }
+
   ScalarEvolution &SE = *PSE.getSE();
   auto &DL = InnermostLoop->getHeader()->getModule()->getDataLayout();
   // If the distance between the acecsses is larger than their absolute stride
   // multiplied by the backedge taken count, the accesses are independet, i.e.
   // they are far enough appart that accesses won't access the same location
   // across all loop ierations.
-  if (!isa(Dist) && HasSameSize &&
+  if (HasSameSize && CommonStride &&
   isSafeDependenceDistance(DL, SE, *(PSE.getBackedgeTakenCount()), *Dist,
-   Stride, TypeByteSize))
+   *CommonStride, TypeByteSize))
 return Dependence::NoDep;
 
   const SCEVConstant *C = dyn_cast(Dist);
-  if (!C) {
-LLVM_DEBUG(dbgs() << "LAA: Dependence because of non-constant distance\n");
-FoundNonConstantDistanceDependence = true;
-return Dependence::Unknown;
-  }
 
-  const APInt &Val = C->getAPInt();
-  int64_t Distance = Val.getSExtValue();
-
-  // If the distance between accesses and their strides are known constants,
-  // check whether the accesses interlace each other.
-  if (std::abs(Distance) > 0 && Stride > 1 && HasSameSize &&
-  areStridedAccessesIndependent(std::abs(Distance), Stride, TypeByteSize)) 
{
-LLVM_DEBUG(dbgs() << "LAA: Strided accesses are independent\n");
-return Dependence::NoDep;
+  // Attempt to prove strided accesses independent.
+  if (C) {
+const APInt &Val = C->getAPInt();
+int64_t Distance = Val.getSExtValue();
+// If the distance between accesses and their strides are known constants,
+// check whether the accesses interlace each other.
+if (std::abs(Distance) > 0 && CommonStride && *CommonStride > 1 &&
+HasSameSize &&
+areStridedAccessesIndependent(std::abs(Distance), *CommonStride,
+  TypeByteSize)) {
+  LLVM_DEBUG(dbgs() << "LAA: Strided accesses are independent\n");
+  return Dependence::NoDep;
+}
   }
 
   // Negative distances are not plausible dependencies.
-  if (Val.isNegative()) {
+  if (SE.isKnownNonPositive(Dist)) {
+if (!SE.isKnownNegative(Dist)) {

Meinersbur wrote:

[serious] Not knowing something doesn't imply anything.
```suggestion
// KnownNonPositive && KnownNonNegative => KnownZero
if (SE.isKnownNonNegative(Dist)) {
```


https://github.com/llvm/llvm-project/pull/88039
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [LAA] Support different strides & non constant dep distances using SCEV. (PR #88039)

2024-04-22 Thread Michael Kruse via llvm-branch-commits


@@ -2028,41 +2029,61 @@ MemoryDepChecker::Dependence::DepType 
MemoryDepChecker::isDependent(
   if (std::holds_alternative(Res))
 return std::get(Res);
 
-  const auto &[Dist, Stride, TypeByteSize, AIsWrite, BIsWrite] =
+  const auto &[Dist, StrideA, StrideB, TypeByteSize, AIsWrite, BIsWrite] =
   std::get(Res);
   bool HasSameSize = TypeByteSize > 0;
 
+  std::optional CommonStride =
+  StrideA == StrideB ? std::make_optional(StrideA) : std::nullopt;
+  if (isa(Dist)) {
+// TODO: Relax requirement that there is a common stride to retry with
+// non-constant distance dependencies.
+FoundNonConstantDistanceDependence |= !!CommonStride;
+LLVM_DEBUG(dbgs() << "LAA: Dependence because of uncomputable 
distance.\n");
+return Dependence::Unknown;
+  }
+
   ScalarEvolution &SE = *PSE.getSE();
   auto &DL = InnermostLoop->getHeader()->getModule()->getDataLayout();
   // If the distance between the acecsses is larger than their absolute stride
   // multiplied by the backedge taken count, the accesses are independet, i.e.
   // they are far enough appart that accesses won't access the same location
   // across all loop ierations.
-  if (!isa(Dist) && HasSameSize &&
+  if (HasSameSize && CommonStride &&

Meinersbur wrote:

`isSafeDependenceDistance` could be easily modified as well to support 
different sizes, but it's unrelated to this patch.

https://github.com/llvm/llvm-project/pull/88039
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [bolt] Revise IDE folder structure (PR #89742)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur created 
https://github.com/llvm/llvm-project/pull/89742

Reviewers of #89153 suggested to break up the patch into per-subproject 
patches. This is the BOLT part. See #89153 for the entire series and motivation.

Update the folder titles for targets in the monorepository that have not seen 
taken care of for some time. These are the folders that targets are organized 
in Visual Studio and XCode (`set_property(TARGET  PROPERTY FOLDER 
"")`) when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically 
deduce the folder. This reduces the number of 
`set_property`/`set_target_property`, but are still necessary when 
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A 
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root 
CMakeLists.txt.


Update the folder titles for targets in the monorepository that have not seen 
taken care of for some time. These are the folders that targets are organized 
in Visual Studio and XCode (`set_property(TARGET  PROPERTY FOLDER 
"")`) when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically 
deduce the folder. This reduces the number of 
`set_property`/`set_target_property`, but are still necessary when 
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A 
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root 
CMakeLists.txt.


>From 140a539c9e3248b128bdffdbc9ae5e2e8b4366c0 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:23:47 +0200
Subject: [PATCH] [bolt] Revise IDE folder structure

---
 bolt/CMakeLists.txt  | 2 ++
 bolt/cmake/modules/AddBOLT.cmake | 1 -
 bolt/docs/CMakeLists.txt | 1 +
 bolt/test/CMakeLists.txt | 3 +--
 bolt/unittests/CMakeLists.txt| 2 +-
 5 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/bolt/CMakeLists.txt b/bolt/CMakeLists.txt
index cc3a70fa35e0ab..26df6a4208b7a9 100644
--- a/bolt/CMakeLists.txt
+++ b/bolt/CMakeLists.txt
@@ -1,3 +1,5 @@
+set(LLVM_SUBPROJECT_TITLE "BOLT")
+
 include(ExternalProject)
 
 set(BOLT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
diff --git a/bolt/cmake/modules/AddBOLT.cmake b/bolt/cmake/modules/AddBOLT.cmake
index 1f69b9046320a7..c7ac662c6b1217 100644
--- a/bolt/cmake/modules/AddBOLT.cmake
+++ b/bolt/cmake/modules/AddBOLT.cmake
@@ -3,7 +3,6 @@ include(LLVMDistributionSupport)
 
 macro(add_bolt_executable name)
   add_llvm_executable(${name} ${ARGN})
-  set_target_properties(${name} PROPERTIES FOLDER "BOLT")
 endmacro()
 
 macro(add_bolt_tool name)
diff --git a/bolt/docs/CMakeLists.txt b/bolt/docs/CMakeLists.txt
index b230512fe57170..12ae852566785f 100644
--- a/bolt/docs/CMakeLists.txt
+++ b/bolt/docs/CMakeLists.txt
@@ -79,6 +79,7 @@ if (LLVM_ENABLE_DOXYGEN)
 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 COMMENT "Generating bolt doxygen documentation." VERBATIM)
+  set_target_properties(doxygen-bolt PROPERTIES FOLDER "BOLT/Docs")
 
   if (LLVM_BUILD_DOCS)
 add_dependencies(doxygen doxygen-bolt)
diff --git a/bolt/test/CMakeLists.txt b/bolt/test/CMakeLists.txt
index 89862fd59eb8ec..d468ff984840fc 100644
--- a/bolt/test/CMakeLists.txt
+++ b/bolt/test/CMakeLists.txt
@@ -56,7 +56,7 @@ list(APPEND BOLT_TEST_DEPS
   )
 
 add_custom_target(bolt-test-depends DEPENDS ${BOLT_TEST_DEPS})
-set_target_properties(bolt-test-depends PROPERTIES FOLDER "BOLT")
+set_target_properties(bolt-test-depends PROPERTIES FOLDER "BOLT/Tests")
 
 add_lit_testsuite(check-bolt "Running the BOLT regression tests"
   ${CMAKE_CURRENT_BINARY_DIR}
@@ -64,7 +64,6 @@ add_lit_testsuite(check-bolt "Running the BOLT regression 
tests"
   DEPENDS ${BOLT_TEST_DEPS}
   ARGS ${BOLT_TEST_EXTRA_ARGS}
   )
-set_target_properties(check-bolt PROPERTIES FOLDER "BOLT")
 
 add_lit_testsuites(BOLT ${CMAKE_CURRENT_SOURCE_DIR}
   PARAMS ${BOLT_TEST_PARAMS}
diff --git a/bolt/unittests/CMakeLists.txt b/bolt/unittests/CMakeLists.txt
index 77159e92dec557..64414b83d39fe8 100644
--- a/bolt/unittests/CMakeLists.txt
+++ b/bolt/unittests/CMakeLists.txt
@@ -1,5 +1,5 @@
 add_custom_target(BoltUnitTests)
-set_target_properties(BoltUnitTests PROPERTIES FOLDER "BOLT tests")
+set_target_properties(BoltUnitTests PROPERTIES FOLDER "BOLT/Tests")
 
 function(add_bolt_unittest test_dirname)
   add_unittest(BoltUnitTests ${test_dirname} ${ARGN})

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/m

[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur created 
https://github.com/llvm/llvm-project/pull/89743

Reviewers of #89153 suggested to break up the patch into per-subproject 
patches. This is the Clang part. See #89153 for the entire series and 
motivation.

Update the folder titles for targets in the monorepository that have not seen 
taken care of for some time. These are the folders that targets are organized 
in Visual Studio and XCode (`set_property(TARGET  PROPERTY FOLDER 
"")`) when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically 
deduce the folder. This reduces the number of 
`set_property`/`set_target_property`, but are still necessary when 
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A 
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root 
CMakeLists.txt.


Update the folder titles for targets in the monorepository that have not seen 
taken care of for some time. These are the folders that targets are organized 
in Visual Studio and XCode (`set_property(TARGET  PROPERTY FOLDER 
"")`) when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically 
deduce the folder. This reduces the number of 
`set_property`/`set_target_property`, but are still necessary when 
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A 
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root 
CMakeLists.txt.


>From afadef1f53e03e2cf3a1695f3c693913b27382dd Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:03:11 +0200
Subject: [PATCH] [clang] Revise IDE folder structure

---
 clang/CMakeLists.txt| 8 +---
 clang/bindings/python/tests/CMakeLists.txt  | 2 +-
 clang/cmake/modules/AddClang.cmake  | 3 ---
 clang/docs/CMakeLists.txt   | 1 +
 clang/lib/Analysis/FlowSensitive/CMakeLists.txt | 1 +
 clang/lib/Headers/CMakeLists.txt| 4 ++--
 clang/lib/Tooling/CMakeLists.txt| 2 ++
 clang/test/CMakeLists.txt   | 5 ++---
 clang/tools/libclang/CMakeLists.txt | 2 +-
 clang/unittests/CMakeLists.txt  | 2 +-
 clang/utils/ClangVisualizers/CMakeLists.txt | 2 +-
 clang/utils/TableGen/CMakeLists.txt | 2 --
 clang/utils/hmaptool/CMakeLists.txt | 2 +-
 13 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index f092766fa19f07..09da3ad9979ffd 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -1,4 +1,5 @@
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "Clang")
 
 if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
   set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -390,7 +391,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   # Installing the headers needs to depend on generating any public
   # tablegen'd headers.
   add_custom_target(clang-headers DEPENDS clang-tablegen-targets)
-  set_target_properties(clang-headers PROPERTIES FOLDER "Misc")
+  set_target_properties(clang-headers PROPERTIES FOLDER "Clang/Resources")
   if(NOT LLVM_ENABLE_IDE)
 add_llvm_install_targets(install-clang-headers
  DEPENDS clang-headers
@@ -398,6 +399,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   endif()
 
   add_custom_target(bash-autocomplete DEPENDS utils/bash-autocomplete.sh)
+  set_target_properties(bash-autocomplete PROPERTIES FOLDER "Clang/Misc")
   install(FILES utils/bash-autocomplete.sh
   DESTINATION "${CMAKE_INSTALL_DATADIR}/clang"
   COMPONENT bash-autocomplete)
@@ -478,7 +480,7 @@ add_custom_target(clang-tablegen-targets
   omp_gen
   ClangDriverOptions
   ${CLANG_TABLEGEN_TARGETS})
-set_target_properties(clang-tablegen-targets PROPERTIES FOLDER "Misc")
+set_target_properties(clang-tablegen-targets PROPERTIES FOLDER 
"Clang/Tablegenning/Targets")
 list(APPEND LLVM_COMMON_DEPENDS clang-tablegen-targets)
 
 # Force target to be built as soon as possible. Clang modules builds depend
@@ -541,7 +543,7 @@ endif()
 
 # Custom target to install all clang libraries.
 add_custom_target(clang-libraries)
-set_target_properties(clang-libraries PROPERTIES FOLDER "Misc")
+set_target_properties(clang-libraries PROPERTIES FOLDER "Clang/Install")
 
 if(NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-clang-libraries
diff --git a/clang/bindings/python/tests/CMakeLists.txt 
b/clang/bindings/python/tests/CMakeLists.txt
index c4cd2539e9d6cf..2543cf739463d9 100644
--- a/clang/bindings/python/tests/CMakeLists.

[llvm-branch-commits] [clang-tools-extra] [clang-tools-extra] Revise IDE folder structure (PR #89744)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur created 
https://github.com/llvm/llvm-project/pull/89744

Reviewers of #89153 suggested to break up the patch into per-subproject 
patches. This is the Clang-tools-extra part. See #89153 for the entire series 
and motivation.

Update the folder titles for targets in the monorepository that have not seen 
taken care of for some time. These are the folders that targets are organized 
in Visual Studio and XCode (`set_property(TARGET  PROPERTY FOLDER 
"")`) when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically 
deduce the folder. This reduces the number of 
`set_property`/`set_target_property`, but are still necessary when 
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A 
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root 
CMakeLists.txt.

>From 937a7728542d880fd37c439bec6dca4ccd3f07d2 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:06:06 +0200
Subject: [PATCH] [clang-tools-extra] Revise IDE folder structure

---
 clang-tools-extra/CMakeLists.txt   | 2 ++
 clang-tools-extra/clang-tidy/CMakeLists.txt| 2 +-
 clang-tools-extra/clang-tidy/misc/CMakeLists.txt   | 2 ++
 clang-tools-extra/clangd/unittests/CMakeLists.txt  | 1 +
 clang-tools-extra/docs/CMakeLists.txt  | 1 +
 clang-tools-extra/include-cleaner/unittests/CMakeLists.txt | 1 +
 clang-tools-extra/pseudo/include/CMakeLists.txt| 1 +
 clang-tools-extra/pseudo/tool/CMakeLists.txt   | 1 +
 clang-tools-extra/pseudo/unittests/CMakeLists.txt  | 1 +
 clang-tools-extra/test/CMakeLists.txt  | 1 -
 clang-tools-extra/unittests/CMakeLists.txt | 2 +-
 11 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/clang-tools-extra/CMakeLists.txt b/clang-tools-extra/CMakeLists.txt
index 6a3f741721ee6c..f6a6b57b5ef0bc 100644
--- a/clang-tools-extra/CMakeLists.txt
+++ b/clang-tools-extra/CMakeLists.txt
@@ -1,3 +1,5 @@
+set(LLVM_SUBPROJECT_TITLE "Clang Tools Extra")
+
 include(CMakeDependentOption)
 include(GNUInstallDirs)
 
diff --git a/clang-tools-extra/clang-tidy/CMakeLists.txt 
b/clang-tools-extra/clang-tidy/CMakeLists.txt
index 7e1905aa897b7e..430ea4cdbb38e1 100644
--- a/clang-tools-extra/clang-tidy/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/CMakeLists.txt
@@ -121,7 +121,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
 PATTERN "*.h"
 )
   add_custom_target(clang-tidy-headers)
-  set_target_properties(clang-tidy-headers PROPERTIES FOLDER "Misc")
+  set_target_properties(clang-tidy-headers PROPERTIES FOLDER "Clang Tools 
Extra/Resources")
   if(NOT LLVM_ENABLE_IDE)
 add_llvm_install_targets(install-clang-tidy-headers
  DEPENDS clang-tidy-headers
diff --git a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt 
b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
index d9ec268650c053..4eda705c45d2af 100644
--- a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
@@ -15,6 +15,7 @@ add_custom_command(
 DEPENDS ${clang_tidy_confusable_chars_gen_target} 
ConfusableTable/confusables.txt)
 
 add_custom_target(genconfusable DEPENDS Confusables.inc)
+set_target_properties(genconfusable PROPERTIES FOLDER "Clang Tools 
Extra/Tablegenning")
 
 add_clang_library(clangTidyMiscModule
   ConstCorrectnessCheck.cpp
@@ -51,6 +52,7 @@ add_clang_library(clangTidyMiscModule
   genconfusable
   ClangDriverOptions
   )
+set_target_properties(clangTidyMiscModule PROPERTIES FOLDER "Clang Tools 
Extra/Libraries")
 
 clang_target_link_libraries(clangTidyMiscModule
   PRIVATE
diff --git a/clang-tools-extra/clangd/unittests/CMakeLists.txt 
b/clang-tools-extra/clangd/unittests/CMakeLists.txt
index 7f1ae5c43d80c6..0d4628ccf25d8c 100644
--- a/clang-tools-extra/clangd/unittests/CMakeLists.txt
+++ b/clang-tools-extra/clangd/unittests/CMakeLists.txt
@@ -29,6 +29,7 @@ 
include(${CMAKE_CURRENT_SOURCE_DIR}/../quality/CompletionModel.cmake)
 gen_decision_forest(${CMAKE_CURRENT_SOURCE_DIR}/decision_forest_model 
DecisionForestRuntimeTest ::ns1::ns2::test::Example)
 
 add_custom_target(ClangdUnitTests)
+set_target_properties(ClangdUnitTests PROPERTIES FOLDER "Clang Tools 
Extra/Tests")
 add_unittest(ClangdUnitTests ClangdTests
   Annotations.cpp
   ASTTests.cpp
diff --git a/clang-tools-extra/docs/CMakeLists.txt 
b/clang-tools-extra/docs/CMakeLists.txt
index 8f442e1f661ed3..272db266b50546 100644
--- a/clang-tools-extra/docs/CMakeLists.txt
+++ b/clang-tools-extra/docs/CMakeLists.txt
@@ -77,6 +77,7 @@ if (DOXYGEN_FOUND)
   COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 

[llvm-branch-commits] [flang] [flang] Revise IDE folder structure (PR #89745)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur created 
https://github.com/llvm/llvm-project/pull/89745

Reviewers of #89153 suggested to break up the patch into per-subproject 
patches. This is the Flang part. See #89153 for the entire series and 
motivation.

Update the folder titles for targets in the monorepository that have not seen 
taken care of for some time. These are the folders that targets are organized 
in Visual Studio and XCode (`set_property(TARGET  PROPERTY FOLDER 
"")`) when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically 
deduce the folder. This reduces the number of 
`set_property`/`set_target_property`, but are still necessary when 
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A 
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root 
CMakeLists.txt.


>From 90d0d0f3bed2d826dc38e962a7a9140bf2ff3615 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:13:53 +0200
Subject: [PATCH] [flang] Revise IDE folder structure

---
 flang/CMakeLists.txt | 3 ++-
 flang/cmake/modules/AddFlang.cmake   | 3 +--
 flang/docs/CMakeLists.txt| 2 +-
 flang/include/flang/Optimizer/Dialect/CMakeLists.txt | 2 ++
 flang/runtime/CMakeLists.txt | 5 +
 flang/test/CMakeLists.txt| 3 ++-
 flang/tools/f18/CMakeLists.txt   | 1 +
 flang/unittests/CMakeLists.txt   | 3 ++-
 flang/unittests/Evaluate/CMakeLists.txt  | 1 +
 9 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt
index c8e75024823f2c..3bc4b5dd10c0ea 100644
--- a/flang/CMakeLists.txt
+++ b/flang/CMakeLists.txt
@@ -1,4 +1,5 @@
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "Flang")
 
 if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
   set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -481,7 +482,7 @@ endif()
 
 # Custom target to install Flang libraries.
 add_custom_target(flang-libraries)
-set_target_properties(flang-libraries PROPERTIES FOLDER "Misc")
+set_target_properties(flang-libraries PROPERTIES FOLDER "Flang/Meta")
 
 if (NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-flang-libraries
diff --git a/flang/cmake/modules/AddFlang.cmake 
b/flang/cmake/modules/AddFlang.cmake
index 41ce8738e7bf27..3a5119b83831f9 100644
--- a/flang/cmake/modules/AddFlang.cmake
+++ b/flang/cmake/modules/AddFlang.cmake
@@ -94,13 +94,12 @@ function(add_flang_library name)
 add_custom_target(${name})
   endif()
 
-  set_target_properties(${name} PROPERTIES FOLDER "Flang libraries")
+  set_target_properties(${name} PROPERTIES FOLDER "Flang/Libraries")
   set_flang_windows_version_resource_properties(${name})
 endfunction(add_flang_library)
 
 macro(add_flang_executable name)
   add_llvm_executable(${name} ${ARGN})
-  set_target_properties(${name} PROPERTIES FOLDER "Flang executables")
   set_flang_windows_version_resource_properties(${name})
 endmacro(add_flang_executable)
 
diff --git a/flang/docs/CMakeLists.txt b/flang/docs/CMakeLists.txt
index 3414b8e3acc463..3e4883e881ffac 100644
--- a/flang/docs/CMakeLists.txt
+++ b/flang/docs/CMakeLists.txt
@@ -79,7 +79,7 @@ if (LLVM_ENABLE_DOXYGEN)
 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 COMMENT "Generating flang doxygen documentation." VERBATIM)
-
+  set_target_properties(doxygen-flang PROPERTIES FOLDER "Flang/Docs")
   if (LLVM_BUILD_DOCS)
add_dependencies(doxygen doxygen-flang)
   endif()
diff --git a/flang/include/flang/Optimizer/Dialect/CMakeLists.txt 
b/flang/include/flang/Optimizer/Dialect/CMakeLists.txt
index f00993d4d37780..203ac212d3ccfa 100644
--- a/flang/include/flang/Optimizer/Dialect/CMakeLists.txt
+++ b/flang/include/flang/Optimizer/Dialect/CMakeLists.txt
@@ -31,6 +31,7 @@ mlir_tablegen(CanonicalizationPatterns.inc -gen-rewriters)
 add_public_tablegen_target(CanonicalizationPatternsIncGen)
 
 add_custom_target(flang-doc)
+set_target_properties(flang-doc PROPERTIES FOLDER "Flang/Meta")
 set(dialect_doc_filename "FIRLangRef")
 
 set(LLVM_TARGET_DEFINITIONS FIROps.td)
@@ -43,4 +44,5 @@ add_custom_command(
 ${GEN_DOC_FILE}
 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${dialect_doc_filename}.md)
 add_custom_target(${dialect_doc_filename}DocGen DEPENDS ${GEN_DOC_FILE})
+set_target_properties(${dialect_doc_filename}DocGen PROPERTIES FOLDER 
"Flang/Docs")
 add_dependencies(flang-doc ${dialect_doc_filename}DocGen)
diff --git a/flang/runtime/CMakeLists.txt b/flang/runtime/CMakeLists.txt
index bdd0e07bbfd4d1..eaa79851046c6c 100644
--- a/flang/runtime/CMakeLists.txt
+++ b/flan

[llvm-branch-commits] [libclc] [libclc] Revise IDE folder structure (PR #89746)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur created 
https://github.com/llvm/llvm-project/pull/89746

Reviewers of #89153 suggested to break up the patch into per-subproject 
patches. This is the libclc part. See #89153 for the entire series and 
motivation.

Update the folder titles for targets in the monorepository that have not seen 
taken care of for some time. These are the folders that targets are organized 
in Visual Studio and XCode (`set_property(TARGET  PROPERTY FOLDER 
"")`) when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically 
deduce the folder. This reduces the number of 
`set_property`/`set_target_property`, but are still necessary when 
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A 
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root 
CMakeLists.txt.

>From 24ed445050def3e41569cc25bc04dd3dc107c04f Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:25:53 +0200
Subject: [PATCH] [libclc] Revise IDE folder structure

---
 libclc/CMakeLists.txt| 13 -
 libclc/cmake/modules/AddLibclc.cmake |  5 -
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 5ce17952430854..05e0061d42298a 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -1,6 +1,7 @@
 cmake_minimum_required(VERSION 3.20.0)
 
 project( libclc VERSION 0.2.0 LANGUAGES CXX C)
+set(LLVM_SUBPROJECT_TITLE "libclc")
 
 set(CMAKE_CXX_STANDARD 17)
 
@@ -54,7 +55,10 @@ if( LIBCLC_STANDALONE_BUILD OR CMAKE_SOURCE_DIR STREQUAL 
CMAKE_CURRENT_SOURCE_DI
 foreach( tool IN ITEMS clang llvm-as llvm-link opt )
   find_program( LLVM_TOOL_${tool} ${tool} PATHS ${LLVM_TOOLS_BINARY_DIR} 
NO_DEFAULT_PATH )
   add_executable( libclc::${tool} IMPORTED GLOBAL )
-  set_target_properties( libclc::${tool} PROPERTIES IMPORTED_LOCATION 
${LLVM_TOOL_${tool}} )
+  set_target_properties( libclc::${tool} PROPERTIES
+IMPORTED_LOCATION ${LLVM_TOOL_${tool}}
+FOLDER "libclc/Tools"
+  )
 endforeach()
   endif()
 else()
@@ -168,6 +172,7 @@ if( LIBCLC_STANDALONE_BUILD )
 else()
   add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp )
 endif()
+set_target_properties( prepare_builtins PROPERTIES FOLDER 
"libclc/Tablegenning")
 target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
 # These were not properly reported in early LLVM and we don't need them
 target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )
@@ -225,12 +230,14 @@ add_custom_command(
   COMMAND ${Python3_EXECUTABLE} ${script_loc} > convert.cl
   DEPENDS ${script_loc} )
 add_custom_target( "generate_convert.cl" DEPENDS convert.cl )
+set_target_properties( "generate_convert.cl" PROPERTIES FOLDER 
"libclc/Tablegenning" )
 
 add_custom_command(
   OUTPUT clspv-convert.cl
   COMMAND ${Python3_EXECUTABLE} ${script_loc} --clspv > clspv-convert.cl
   DEPENDS ${script_loc} )
 add_custom_target( "clspv-generate_convert.cl" DEPENDS clspv-convert.cl )
+set_target_properties( "clspv-generate_convert.cl" PROPERTIES FOLDER 
"libclc/Tablegenning" )
 
 enable_testing()
 
@@ -394,6 +401,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 DEPENDS ${builtins_link_lib}
   )
   add_custom_target( "prepare-${spv_suffix}" ALL DEPENDS "${spv_suffix}" )
+  set_target_properties( "prepare-${spv_suffix}" PROPERTIES FOLDER 
"libclc/Tablegenning" )
   install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${spv_suffix}
  DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
 else()
@@ -410,6 +418,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
   )
   set_target_properties( ${builtins_opt_lib_tgt}
 PROPERTIES TARGET_FILE ${builtins_opt_lib_tgt}.bc
+   FOLDER "libclc/BC Genning"
   )
 
   set( builtins_opt_lib 
$ )
@@ -420,6 +429,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 COMMAND prepare_builtins -o ${obj_suffix} ${builtins_opt_lib}
 DEPENDS ${builtins_opt_lib} prepare_builtins )
   add_custom_target( prepare-${obj_suffix} ALL DEPENDS ${obj_suffix} )
+  set_target_properties( "prepare-${obj_suffix}" PROPERTIES FOLDER 
"libclc/BC Genning" )
 
   # nvptx-- targets don't include workitem builtins
   if( NOT clang_triple MATCHES ".*ptx.*--$" )
@@ -434,6 +444,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 add_custom_target( ${alias_suffix} ALL
   COMMAND ${CMAKE_COMMAND} -E create_symlink ${obj_suffix} 
${alias_suffix}
   DEPENDS prepare-${obj_suffix} )
+set_target_properties( "${alias_suffix}" PROPERTIES FOLDER "libclc/BC 
Genning" )
 install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION 
"${CMAKE_INSTALL_DATADIR}/clc" )
  

[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur edited 
https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] [lld] Revise IDE folder structure (PR #89747)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur created 
https://github.com/llvm/llvm-project/pull/89747

Reviewers of #89153 suggested to break up the patch into per-subproject 
patches. This is the LLD part. See #89153 for the entire series and motivation.

Update the folder titles for targets in the monorepository that have not seen 
taken care of for some time. These are the folders that targets are organized 
in Visual Studio and XCode (`set_property(TARGET  PROPERTY FOLDER 
"")`) when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically 
deduce the folder. This reduces the number of 
`set_property`/`set_target_property`, but are still necessary when 
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A 
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root 
CMakeLists.txt.

>From 6c3206c8100ed68ab77ceb98741bef42659bcfc1 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:12:03 +0200
Subject: [PATCH] [lld] Revise IDE folder structure

---
 lld/CMakeLists.txt | 2 ++
 lld/cmake/modules/AddLLD.cmake | 2 --
 lld/test/CMakeLists.txt| 5 ++---
 lld/unittests/CMakeLists.txt   | 2 --
 4 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt
index cd8ba627306edb..64c9f238055092 100644
--- a/lld/CMakeLists.txt
+++ b/lld/CMakeLists.txt
@@ -1,4 +1,5 @@
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "LLD")
 
 if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
   set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -192,6 +193,7 @@ add_subdirectory(tools/lld)
 
 if (LLVM_INCLUDE_TESTS)
   add_custom_target(LLDUnitTests)
+  set_target_properties(LLDUnitTests PROPERTIES FOLDER "LLD/Tests")
   if (TARGET llvm_gtest)
 add_subdirectory(unittests)
   endif()
diff --git a/lld/cmake/modules/AddLLD.cmake b/lld/cmake/modules/AddLLD.cmake
index 2ee066b4153519..9f2684b6f933ec 100644
--- a/lld/cmake/modules/AddLLD.cmake
+++ b/lld/cmake/modules/AddLLD.cmake
@@ -11,7 +11,6 @@ macro(add_lld_library name)
 set(ARG_ENABLE_SHARED SHARED)
   endif()
   llvm_add_library(${name} ${ARG_ENABLE_SHARED} ${ARG_UNPARSED_ARGUMENTS})
-  set_target_properties(${name} PROPERTIES FOLDER "lld libraries")
 
   if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
 get_target_export_arg(${name} LLD export_to_lldtargets)
@@ -33,7 +32,6 @@ endmacro(add_lld_library)
 
 macro(add_lld_executable name)
   add_llvm_executable(${name} ${ARGN})
-  set_target_properties(${name} PROPERTIES FOLDER "lld executables")
 endmacro(add_lld_executable)
 
 macro(add_lld_tool name)
diff --git a/lld/test/CMakeLists.txt b/lld/test/CMakeLists.txt
index bb6164f19dcef3..25d8f0a424926d 100644
--- a/lld/test/CMakeLists.txt
+++ b/lld/test/CMakeLists.txt
@@ -83,10 +83,9 @@ add_lit_testsuite(check-lld "Running lld test suite"
   ${CMAKE_CURRENT_BINARY_DIR}
   DEPENDS ${LLD_TEST_DEPS}
   )
-set_target_properties(check-lld PROPERTIES FOLDER "lld tests")
 
 add_custom_target(lld-test-depends DEPENDS ${LLD_TEST_DEPS})
-set_target_properties(lld-test-depends PROPERTIES FOLDER "lld tests")
+set_target_properties(lld-test-depends PROPERTIES FOLDER "LLD/Tests")
 
 add_lit_testsuites(LLD ${CMAKE_CURRENT_SOURCE_DIR}
   DEPENDS ${LLD_TEST_DEPS}
@@ -95,4 +94,4 @@ add_lit_testsuites(LLD ${CMAKE_CURRENT_SOURCE_DIR}
 # Add a legacy target spelling: lld-test
 add_custom_target(lld-test)
 add_dependencies(lld-test check-lld)
-set_target_properties(lld-test PROPERTIES FOLDER "lld tests")
+set_target_properties(lld-test PROPERTIES FOLDER "LLD/Tests")
diff --git a/lld/unittests/CMakeLists.txt b/lld/unittests/CMakeLists.txt
index ac878fa0190833..ffaea3f2078330 100644
--- a/lld/unittests/CMakeLists.txt
+++ b/lld/unittests/CMakeLists.txt
@@ -1,5 +1,3 @@
-set_target_properties(LLDUnitTests PROPERTIES FOLDER "lld tests")
-
 function(add_lld_unittests test_dirname)
   add_unittest(LLDUnitTests ${test_dirname} ${ARGN})
 endfunction()

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lldb] [lldb] Revise IDE folder structure (PR #89748)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur created 
https://github.com/llvm/llvm-project/pull/89748

Reviewers of #89153 suggested to break up the patch into per-subproject 
patches. This is the BOLT part. See #89153 for the entire series and motivation.

Update the folder titles for targets in the monorepository that have not seen 
taken care of for some time. These are the folders that targets are organized 
in Visual Studio and XCode (`set_property(TARGET  PROPERTY FOLDER 
"")`) when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically 
deduce the folder. This reduces the number of 
`set_property`/`set_target_property`, but are still necessary when 
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A 
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root 
CMakeLists.txt.

>From e29002224ef168934ae414e75e765cf197f65bc0 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:21:43 +0200
Subject: [PATCH] [lldb] Revise IDE folder structure

---
 lldb/CMakeLists.txt | 1 +
 lldb/cmake/modules/AddLLDB.cmake| 6 ++
 lldb/cmake/modules/LLDBConfig.cmake | 2 +-
 lldb/cmake/modules/LLDBFramework.cmake  | 2 +-
 lldb/cmake/modules/LLDBStandalone.cmake | 4 ++--
 lldb/docs/CMakeLists.txt| 1 +
 lldb/source/API/CMakeLists.txt  | 3 +--
 lldb/test/API/CMakeLists.txt| 1 +
 lldb/test/CMakeLists.txt| 4 ++--
 lldb/test/Shell/CMakeLists.txt  | 1 +
 lldb/test/Unit/CMakeLists.txt   | 1 +
 lldb/tools/driver/CMakeLists.txt| 2 --
 .../lldb-commandinterpreter-fuzzer/CMakeLists.txt   | 1 +
 lldb/tools/lldb-fuzzer/lldb-target-fuzzer/CMakeLists.txt| 1 +
 lldb/tools/lldb-server/CMakeLists.txt   | 1 -
 lldb/unittests/CMakeLists.txt   | 2 +-
 lldb/unittests/tools/lldb-server/CMakeLists.txt | 2 +-
 lldb/utils/TableGen/CMakeLists.txt  | 1 -
 lldb/utils/lit-cpuid/CMakeLists.txt | 2 +-
 lldb/utils/lldb-dotest/CMakeLists.txt   | 2 +-
 lldb/utils/lldb-repro/CMakeLists.txt| 2 +-
 21 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index 7844d93d78d29a..db9e5517e287b2 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -1,4 +1,5 @@
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "LLDB")
 
 if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
   set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
diff --git a/lldb/cmake/modules/AddLLDB.cmake b/lldb/cmake/modules/AddLLDB.cmake
index fdc4ee0c05d755..538029037dd46a 100644
--- a/lldb/cmake/modules/AddLLDB.cmake
+++ b/lldb/cmake/modules/AddLLDB.cmake
@@ -29,7 +29,6 @@ function(lldb_tablegen)
 
   if(LTG_TARGET)
 add_public_tablegen_target(${LTG_TARGET})
-set_target_properties( ${LTG_TARGET} PROPERTIES FOLDER "LLDB tablegenning")
 set_property(GLOBAL APPEND PROPERTY LLDB_TABLEGEN_TARGETS ${LTG_TARGET})
   endif()
 endfunction(lldb_tablegen)
@@ -165,10 +164,10 @@ function(add_lldb_library name)
 get_property(parent_dir DIRECTORY PROPERTY PARENT_DIRECTORY)
 if(EXISTS ${parent_dir})
   get_filename_component(category ${parent_dir} NAME)
-  set_target_properties(${name} PROPERTIES FOLDER "lldb 
plugins/${category}")
+  set_target_properties(${name} PROPERTIES FOLDER 
"LLDB/Plugins/${category}")
 endif()
   else()
-set_target_properties(${name} PROPERTIES FOLDER "lldb libraries")
+set_target_properties(${name} PROPERTIES FOLDER "LLDB/Libraries")
   endif()
 
   # If we want to export all lldb symbols (i.e LLDB_EXPORT_ALL_SYMBOLS=ON), we
@@ -208,7 +207,6 @@ function(add_lldb_executable name)
   else()
 target_link_libraries(${name} PRIVATE ${ARG_CLANG_LIBS})
   endif()
-  set_target_properties(${name} PROPERTIES FOLDER "lldb executables")
 
   if (ARG_BUILD_RPATH)
 set_target_properties(${name} PROPERTIES BUILD_RPATH "${ARG_BUILD_RPATH}")
diff --git a/lldb/cmake/modules/LLDBConfig.cmake 
b/lldb/cmake/modules/LLDBConfig.cmake
index a758261073ac57..13d07a4fabd6de 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -271,7 +271,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
 )
 
   add_custom_target(lldb-headers)
-  set_target_properties(lldb-headers PROPERTIES FOLDER "lldb misc")
+  set_target_properties(lldb-headers PROPERTIES FOLDER "LLDB/Resources")
 
   i

[llvm-branch-commits] [lldb] [lldb] Revise IDE folder structure (PR #89748)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur edited 
https://github.com/llvm/llvm-project/pull/89748
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [mlir] Revise IDE folder structure (PR #89749)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur created 
https://github.com/llvm/llvm-project/pull/89749

Reviewers of #89153 suggested to break up the patch into per-subproject 
patches. This is the MLIR part. See #89153 for the entire series and motivation.

Update the folder titles for targets in the monorepository that have not seen 
taken care of for some time. These are the folders that targets are organized 
in Visual Studio and XCode (`set_property(TARGET  PROPERTY FOLDER 
"")`) when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically 
deduce the folder. This reduces the number of 
`set_property`/`set_target_property`, but are still necessary when 
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A 
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root 
CMakeLists.txt.

>From 82bac5ccd7d6d2b4e146ed4e383a8484e735606e Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:08:54 +0200
Subject: [PATCH] [mlir] Revise IDE folder structure

---
 mlir/CMakeLists.txt| 9 ++---
 mlir/cmake/modules/AddMLIR.cmake   | 5 +++--
 mlir/docs/CMakeLists.txt   | 1 +
 mlir/examples/toy/CMakeLists.txt   | 2 +-
 mlir/examples/transform/CMakeLists.txt | 1 +
 mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt | 2 ++
 mlir/lib/TableGen/CMakeLists.txt   | 1 +
 mlir/test/CAPI/CMakeLists.txt  | 2 ++
 mlir/test/CMakeLists.txt   | 2 +-
 mlir/tools/mlir-linalg-ods-gen/CMakeLists.txt  | 1 +
 mlir/tools/mlir-pdll/CMakeLists.txt| 1 -
 mlir/tools/mlir-tblgen/CMakeLists.txt  | 1 -
 mlir/unittests/CMakeLists.txt  | 2 --
 13 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 5c4301af040b47..0ff6658f831f5d 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -1,5 +1,6 @@
 # MLIR project.
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "MLIR")
 
 if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
   set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -96,12 +97,13 @@ endif()
 # tablegen'd targets.
 # mlir-generic-headers are dialect-independent.
 add_custom_target(mlir-generic-headers)
-set_target_properties(mlir-generic-headers PROPERTIES FOLDER "Misc")
+set_target_properties(mlir-generic-headers PROPERTIES FOLDER "MLIR/Resources")
 # mlir-headers may be dialect-dependent.
 add_custom_target(mlir-headers)
-set_target_properties(mlir-headers PROPERTIES FOLDER "Misc")
+set_target_properties(mlir-headers PROPERTIES FOLDER "MLIR/Resources")
 add_dependencies(mlir-headers mlir-generic-headers)
 add_custom_target(mlir-doc)
+set_target_properties(mlir-doc PROPERTIES FOLDER "MLIR/Docs")
 
 # Only enable execution engine if the native target is available.
 if(${LLVM_NATIVE_ARCH} IN_LIST LLVM_TARGETS_TO_BUILD)
@@ -198,6 +200,7 @@ add_subdirectory(lib/CAPI)
 if (MLIR_INCLUDE_TESTS)
   add_definitions(-DMLIR_INCLUDE_TESTS)
   add_custom_target(MLIRUnitTests)
+  set_target_properties(MLIRUnitTests PROPERTIES FOLDER "MLIR/Tests")
   if (EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest/googletest/include/gtest/gtest.h)
 add_subdirectory(unittests)
   else()
@@ -258,7 +261,7 @@ endif()
 
 # Custom target to install all mlir libraries
 add_custom_target(mlir-libraries)
-set_target_properties(mlir-libraries PROPERTIES FOLDER "Misc")
+set_target_properties(mlir-libraries PROPERTIES FOLDER "MLIR/Install")
 
 if (NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-mlir-libraries
diff --git a/mlir/cmake/modules/AddMLIR.cmake b/mlir/cmake/modules/AddMLIR.cmake
index 1d2ed748bc2f13..5a9a5b799763a9 100644
--- a/mlir/cmake/modules/AddMLIR.cmake
+++ b/mlir/cmake/modules/AddMLIR.cmake
@@ -173,6 +173,7 @@ function(add_mlir_doc doc_filename output_file 
output_directory command)
   DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${output_file}.md)
   add_custom_target(${output_file}DocGen DEPENDS ${GEN_DOC_FILE})
   add_dependencies(mlir-doc ${output_file}DocGen)
+  set_target_properties(${output_file}DocGen PROPERTIES FOLDER "MLIR/Docs")
 endfunction()
 
 # Sets ${srcs} to contain the list of additional headers for the target. Extra
@@ -252,7 +253,7 @@ function(add_mlir_example_library name)
   list(APPEND ARG_DEPENDS mlir-generic-headers)
 
   llvm_add_library(${name} ${LIBTYPE} ${ARG_UNPARSED_ARGUMENTS} ${srcs} 
DEPENDS ${ARG_DEPENDS} LINK_COMPONENTS ${ARG_LINK_COMPONENTS} LINK_LIBS 
${ARG_LINK_LIBS})
-  set_target_properties(${name} PROPERTIES FOLDER "Examples")
+  set_target_properties(${name} PROPERTIES FOLDER "MLIR/Examples")
   if (LLVM_BUILD_EXAMPLES AND NOT ${ARG_DISABLE_INSTALL})
 

[llvm-branch-commits] [llvm] [openmp] [openmp] Revise IDE folder structure (PR #89750)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur created 
https://github.com/llvm/llvm-project/pull/89750

Reviewers of #89153 suggested to break up the patch into per-subproject 
patches. This is the OpenMP part. See #89153 for the entire series and 
motivation.

Update the folder titles for targets in the monorepository that have not seen 
taken care of for some time. These are the folders that targets are organized 
in Visual Studio and XCode (`set_property(TARGET  PROPERTY FOLDER 
"")`) when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically 
deduce the folder. This reduces the number of 
`set_property`/`set_target_property`, but are still necessary when 
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A 
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root 
CMakeLists.txt.

>From c3edd260d7a917e120d02253083eb472e0985844 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:27:20 +0200
Subject: [PATCH] [openmp] Revise IDE folder structure

---
 offload/unittests/CMakeLists.txt| 2 +-
 openmp/CMakeLists.txt   | 1 +
 openmp/docs/CMakeLists.txt  | 1 +
 openmp/runtime/cmake/LibompMicroTests.cmake | 5 +
 openmp/runtime/src/CMakeLists.txt   | 7 +++
 5 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/offload/unittests/CMakeLists.txt b/offload/unittests/CMakeLists.txt
index 73c87b708d25fd..c818a3d985ba34 100644
--- a/offload/unittests/CMakeLists.txt
+++ b/offload/unittests/CMakeLists.txt
@@ -1,5 +1,5 @@
 add_custom_target(LibomptUnitTests)
-set_target_properties(LibomptUnitTests PROPERTIES FOLDER "Tests/UnitTests")
+set_target_properties(LibomptUnitTests PROPERTIES FOLDER "Tests")
 
 function(add_libompt_unittest test_dirname)
   add_unittest(LibomptUnitTests ${test_dirname} ${ARGN})
diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index 95f2425db3ee6b..daef2b77fd4dd5 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -1,4 +1,5 @@
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "OpenMP")
 
 set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
 
diff --git a/openmp/docs/CMakeLists.txt b/openmp/docs/CMakeLists.txt
index 1e4be31a6f609e..4cb9fb486ff34f 100644
--- a/openmp/docs/CMakeLists.txt
+++ b/openmp/docs/CMakeLists.txt
@@ -78,6 +78,7 @@ if (LLVM_ENABLE_DOXYGEN)
 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 COMMENT "Generating openmp doxygen documentation." VERBATIM)
+  set_target_properties(doxygen-openmp PROPERTIES FOLDER "OpenMP/Docs")
 
   if (LLVM_BUILD_DOCS)
 add_dependencies(doxygen doxygen-openmp)
diff --git a/openmp/runtime/cmake/LibompMicroTests.cmake 
b/openmp/runtime/cmake/LibompMicroTests.cmake
index e8cc218af0c294..6fcde37259931e 100644
--- a/openmp/runtime/cmake/LibompMicroTests.cmake
+++ b/openmp/runtime/cmake/LibompMicroTests.cmake
@@ -126,6 +126,7 @@ macro(libomp_test_touch_recipe test_touch_dir)
 endmacro()
 libomp_append(libomp_test_touch_env "KMP_VERSION=1")
 add_custom_target(libomp-test-touch DEPENDS ${libomp_test_touch_targets})
+set_target_properties(libomp-test-touch PROPERTIES FOLDER "OpenMP/Tests")
 if(WIN32)
   libomp_test_touch_recipe(test-touch-mt)
   libomp_test_touch_recipe(test-touch-md)
@@ -135,6 +136,7 @@ endif()
 
 # test-relo
 add_custom_target(libomp-test-relo DEPENDS test-relo/.success)
+set_target_properties(libomp-test-relo PROPERTIES FOLDER "OpenMP/Tests")
 add_custom_command(
   OUTPUT  test-relo/.success test-relo/readelf.log
   COMMAND ${CMAKE_COMMAND} -E make_directory 
${CMAKE_CURRENT_BINARY_DIR}/test-relo
@@ -146,6 +148,7 @@ add_custom_command(
 
 # test-execstack
 add_custom_target(libomp-test-execstack DEPENDS test-execstack/.success)
+set_target_properties(libomp-test-execstack PROPERTIES FOLDER "OpenMP/Tests")
 add_custom_command(
   OUTPUT  test-execstack/.success
   COMMAND ${CMAKE_COMMAND} -E make_directory 
${CMAKE_CURRENT_BINARY_DIR}/test-execstack
@@ -157,6 +160,7 @@ add_custom_command(
 
 # test-instr
 add_custom_target(libomp-test-instr DEPENDS test-instr/.success)
+set_target_properties(libomp-test-instr PROPERTIES FOLDER "OpenMP/Tests")
 add_custom_command(
   OUTPUT  test-instr/.success
   COMMAND ${CMAKE_COMMAND} -E make_directory 
${CMAKE_CURRENT_BINARY_DIR}/test-instr
@@ -168,6 +172,7 @@ add_custom_command(
 
 # test-deps
 add_custom_target(libomp-test-deps DEPENDS test-deps/.success)
+set_target_properties(libomp-test-deps PROPERTIES FOLDER "OpenMP/Tests")
 set(libomp_expected_library_deps)
 if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
   set(libomp_expected_library_deps libc.so.7 libthr.so.3 libm.so.5)
diff --git a/openmp/runtime/src/CMakeLists.txt 
b/open

[llvm-branch-commits] [polly] [polly] Revise IDE folder structure (PR #89752)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur created 
https://github.com/llvm/llvm-project/pull/89752

Reviewers of #89153 suggested to break up the patch into per-subproject 
patches. This is the Polly part. See #89153 for the entire series and 
motivation.

Update the folder titles for targets in the monorepository that have not seen 
taken care of for some time. These are the folders that targets are organized 
in Visual Studio and XCode (`set_property(TARGET  PROPERTY FOLDER 
"")`) when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically 
deduce the folder. This reduces the number of 
`set_property`/`set_target_property`, but are still necessary when 
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A 
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root 
CMakeLists.txt.

>From a85a17723d76371ccc8feb245c455d6aaf2c297f Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:19:16 +0200
Subject: [PATCH] [polly] Revise IDE folder structure

---
 polly/CMakeLists.txt   | 5 +++--
 polly/cmake/polly_macros.cmake | 2 +-
 polly/docs/CMakeLists.txt  | 1 +
 polly/lib/CMakeLists.txt   | 4 +---
 polly/test/CMakeLists.txt  | 7 ++-
 polly/unittests/CMakeLists.txt | 2 +-
 6 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/polly/CMakeLists.txt b/polly/CMakeLists.txt
index 5d0f2cd7f00ece..a0d1ab49e78379 100644
--- a/polly/CMakeLists.txt
+++ b/polly/CMakeLists.txt
@@ -4,6 +4,7 @@ if (NOT DEFINED LLVM_MAIN_SRC_DIR)
   cmake_minimum_required(VERSION 3.20.0)
   set(POLLY_STANDALONE_BUILD TRUE)
 endif()
+set(LLVM_SUBPROJECT_TITLE "Polly")
 
 # Must go below project(..)
 include(GNUInstallDirs)
@@ -157,8 +158,8 @@ foreach (file IN LISTS files)
 endforeach ()
 
 add_custom_target(polly-check-format DEPENDS ${check_format_depends})
-set_target_properties(polly-check-format PROPERTIES FOLDER "Polly")
+set_target_properties(polly-check-format PROPERTIES FOLDER "Polly/Meta")
 
 add_custom_target(polly-update-format DEPENDS ${update_format_depends})
-set_target_properties(polly-update-format PROPERTIES FOLDER "Polly")
+set_target_properties(polly-update-format PROPERTIES FOLDER "Polly/Meta")
 
diff --git a/polly/cmake/polly_macros.cmake b/polly/cmake/polly_macros.cmake
index df541eeccc4cb5..b1bd1e1b03cda8 100644
--- a/polly/cmake/polly_macros.cmake
+++ b/polly/cmake/polly_macros.cmake
@@ -21,7 +21,7 @@ macro(add_polly_library name)
 set(libkind)
   endif()
   add_library( ${name} ${libkind} ${srcs} )
-  set_target_properties(${name} PROPERTIES FOLDER "Polly")
+  set_target_properties(${name} PROPERTIES FOLDER "Polly/Libraries")
 
   if( LLVM_COMMON_DEPENDS )
 add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
diff --git a/polly/docs/CMakeLists.txt b/polly/docs/CMakeLists.txt
index a1ef5ce5277f7a..2bd16e53c542f6 100644
--- a/polly/docs/CMakeLists.txt
+++ b/polly/docs/CMakeLists.txt
@@ -77,6 +77,7 @@ if (LLVM_ENABLE_DOXYGEN)
 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 COMMENT "Generating polly doxygen documentation." VERBATIM)
+  set_target_properties(doxygen-polly PROPERTIES FOLDER "Polly/Docs")
 
   if (LLVM_BUILD_DOCS)
 add_dependencies(doxygen doxygen-polly)
diff --git a/polly/lib/CMakeLists.txt b/polly/lib/CMakeLists.txt
index 4557878e515e66..f18cdcd09cfca7 100644
--- a/polly/lib/CMakeLists.txt
+++ b/polly/lib/CMakeLists.txt
@@ -92,8 +92,6 @@ add_llvm_pass_plugin(Polly
   LINK_COMPONENTS
   ${POLLY_COMPONENTS}
   )
-set_target_properties(obj.Polly PROPERTIES FOLDER "Polly")
-set_target_properties(Polly PROPERTIES FOLDER "Polly")
 
 if (MSVC_IDE OR XCODE)
   # Configure source groups for Polly source files. By default, in the IDE 
there
@@ -120,7 +118,7 @@ if (WIN32 OR CYGWIN OR NOT LLVM_ENABLE_PIC)
   # Add dummy target, either because loadable modules are not supported
   # as on Windows or because PIC code has been disabled
   add_custom_target(LLVMPolly)
-  set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly")
+  set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly/Meta")
 else ()
   add_polly_loadable_module(LLVMPolly
 Plugin/Polly.cpp
diff --git a/polly/test/CMakeLists.txt b/polly/test/CMakeLists.txt
index 81cee34a780d61..338c7dbfa1158c 100644
--- a/polly/test/CMakeLists.txt
+++ b/polly/test/CMakeLists.txt
@@ -1,7 +1,7 @@
 set(LLVM_SHLIBEXT "${CMAKE_SHARED_MODULE_SUFFIX}")
 
 add_custom_target(check-polly)
-set_target_properties(check-polly PROPERTIES FOLDER "Polly")
+set_target_properties(check-polly PROPERTIES FOLDER "Polly/Tests")
 
 if(NOT LLVM_MAIN_SRC_DIR)
   find_program(LLVM_OPT NAMES opt HINTS ${LLVM_TOOLS_BINARY_DIR})
@@ -64,7 +64,6 @@ add_lit_testsuite(check-polly-tests "Running polly regres

[llvm-branch-commits] [compiler-rt] [compiler-rt] Revise IDE folder structure (PR #89753)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur created 
https://github.com/llvm/llvm-project/pull/89753

Reviewers of #89153 suggested to break up the patch into per-subproject 
patches. This is the Compiler-RT part. See #89153 for the entire series and 
motivation.

Update the folder titles for targets in the monorepository that have not seen 
taken care of for some time. These are the folders that targets are organized 
in Visual Studio and XCode (`set_property(TARGET  PROPERTY FOLDER 
"")`) when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically 
deduce the folder. This reduces the number of 
`set_property`/`set_target_property`, but are still necessary when 
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A 
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root 
CMakeLists.txt.

>From 19ef183fcfb44fa8b9bae34bdc8eafb8d2425722 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:15:38 +0200
Subject: [PATCH] [compiler-rt] Revise IDE folder structure

---
 compiler-rt/CMakeLists.txt|  3 ++-
 compiler-rt/cmake/Modules/AddCompilerRT.cmake | 21 ++-
 .../cmake/Modules/CompilerRTDarwinUtils.cmake |  4 ++--
 .../cmake/Modules/CompilerRTUtils.cmake   |  4 ++--
 compiler-rt/cmake/base-config-ix.cmake|  4 ++--
 compiler-rt/include/CMakeLists.txt|  2 +-
 compiler-rt/lib/asan/tests/CMakeLists.txt |  8 +++
 compiler-rt/lib/builtins/CMakeLists.txt   |  2 +-
 compiler-rt/lib/fuzzer/tests/CMakeLists.txt   |  6 +++---
 compiler-rt/lib/gwp_asan/tests/CMakeLists.txt |  4 ++--
 .../lib/interception/tests/CMakeLists.txt |  4 ++--
 compiler-rt/lib/memprof/tests/CMakeLists.txt  |  4 ++--
 compiler-rt/lib/orc/tests/CMakeLists.txt  |  6 +++---
 .../lib/sanitizer_common/tests/CMakeLists.txt |  4 ++--
 compiler-rt/lib/stats/CMakeLists.txt  |  2 +-
 compiler-rt/lib/tsan/CMakeLists.txt   |  2 +-
 compiler-rt/lib/tsan/dd/CMakeLists.txt|  2 +-
 compiler-rt/lib/tsan/rtl/CMakeLists.txt   |  2 +-
 compiler-rt/lib/xray/tests/CMakeLists.txt |  4 ++--
 compiler-rt/test/CMakeLists.txt   |  1 +
 compiler-rt/test/asan/CMakeLists.txt  |  3 ---
 compiler-rt/test/asan_abi/CMakeLists.txt  |  1 -
 compiler-rt/test/builtins/CMakeLists.txt  |  1 -
 compiler-rt/test/cfi/CMakeLists.txt   |  3 ---
 compiler-rt/test/dfsan/CMakeLists.txt |  1 -
 compiler-rt/test/fuzzer/CMakeLists.txt|  1 -
 compiler-rt/test/gwp_asan/CMakeLists.txt  |  1 -
 compiler-rt/test/hwasan/CMakeLists.txt|  2 --
 compiler-rt/test/interception/CMakeLists.txt  |  1 -
 compiler-rt/test/lsan/CMakeLists.txt  |  1 -
 compiler-rt/test/memprof/CMakeLists.txt   |  3 ---
 compiler-rt/test/metadata/CMakeLists.txt  |  1 -
 compiler-rt/test/msan/CMakeLists.txt  |  1 -
 compiler-rt/test/orc/CMakeLists.txt   |  1 -
 compiler-rt/test/profile/CMakeLists.txt   |  1 -
 compiler-rt/test/safestack/CMakeLists.txt |  1 -
 .../test/sanitizer_common/CMakeLists.txt  |  2 --
 .../test/shadowcallstack/CMakeLists.txt   |  1 -
 compiler-rt/test/tsan/CMakeLists.txt  |  1 -
 compiler-rt/test/ubsan/CMakeLists.txt |  2 --
 compiler-rt/test/ubsan_minimal/CMakeLists.txt |  1 -
 compiler-rt/test/xray/CMakeLists.txt  |  1 -
 42 files changed, 46 insertions(+), 74 deletions(-)

diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index 6ce451e3cac2e3..65063e0057bbca 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -4,6 +4,7 @@
 # based on the ability of the host toolchain to target various platforms.
 
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "Compiler-RT")
 
 if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
   set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -90,7 +91,7 @@ if (COMPILER_RT_STANDALONE_BUILD)
   if (TARGET intrinsics_gen)
 # Loading the llvm config causes this target to be imported so place it
 # under the appropriate folder in an IDE.
-set_target_properties(intrinsics_gen PROPERTIES FOLDER "Compiler-RT Misc")
+set_target_properties(intrinsics_gen PROPERTIES FOLDER "LLVM/Tablegenning")
   endif()
 
   find_package(Python3 COMPONENTS Interpreter)
diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake 
b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
index 6e0d9dbff65a9e..61c727b36bff30 100644
--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -89,7 +89,7 @@ function(add_compiler_rt_object_libraries name)
 "${libname}" MATCHES ".*\.osx.*")
   foreach(arch ${LIB_ARCHS_${libname}})
 list(APPEND target_flags
-  "

[llvm-branch-commits] [libc] [libcxx] [libcxxabi] [libunwind] [llvm] [pstl] Revise IDE folder structure (PR #89755)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur created 
https://github.com/llvm/llvm-project/pull/89755

Reviewers of #89153 suggested to break up the patch into per-subproject 
patches. This is the part for the remaining subprojects that have just one file 
changed each. For the runtime subprojects this is because they cannot be used 
in `LLVM_ENABLE_PROJECTS` and therefore its targets do not appear in the IDE 
when compiling as part of LLVM. `LLVM_SUBPROJECT_TITLE` is still defined and 
useful when loading the project from the `runtimes/runtimes-bins` folder 
withing the LLVM build dir, or for out-of-tree builds. A follow-up patch may do 
a more complete folder organization. See #89153 for the entire series and 
motivation.

Update the folder titles for targets in the monorepository that have not seen 
taken care of for some time. These are the folders that targets are organized 
in Visual Studio and XCode (`set_property(TARGET  PROPERTY FOLDER 
"")`) when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically 
deduce the folder. This reduces the number of 
`set_property`/`set_target_property`, but are still necessary when 
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A 
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root 
CMakeLists.txt.

>From 0ce849c6e5455577a77f4c25d08e8ec83115a290 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:29:28 +0200
Subject: [PATCH] Revise IDE folder structure

---
 cross-project-tests/CMakeLists.txt | 6 +-
 libc/CMakeLists.txt| 1 +
 libcxx/CMakeLists.txt  | 1 +
 libcxxabi/CMakeLists.txt   | 1 +
 libunwind/CMakeLists.txt   | 1 +
 llvm-libgcc/CMakeLists.txt | 1 +
 offload/CMakeLists.txt | 1 +
 pstl/CMakeLists.txt| 1 +
 runtimes/CMakeLists.txt| 1 +
 9 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/cross-project-tests/CMakeLists.txt 
b/cross-project-tests/CMakeLists.txt
index f7c2ca7ad83de3..7f2fee48fda778 100644
--- a/cross-project-tests/CMakeLists.txt
+++ b/cross-project-tests/CMakeLists.txt
@@ -3,6 +3,7 @@
 # The subset inside debuginfo-tests invoke clang to generate programs with
 # various types of debug info, and then run those programs under a debugger
 # such as GDB or LLDB to verify the results.
+set(LLVM_SUBPROJECT_TITLE "Cross-Project")
 
 find_package(Python3 COMPONENTS Interpreter)
 
@@ -97,8 +98,3 @@ add_lit_testsuite(check-cross-amdgpu "Running AMDGPU 
cross-project tests"
 add_lit_testsuites(CROSS_PROJECT ${CMAKE_CURRENT_SOURCE_DIR}
   DEPENDS ${CROSS_PROJECT_TEST_DEPS}
   )
-
-set_target_properties(check-cross-project PROPERTIES FOLDER "Tests")
-set_target_properties(check-debuginfo PROPERTIES FOLDER "Tests")
-set_target_properties(check-intrinsic-headers PROPERTIES FOLDER "Tests")
-set_target_properties(check-cross-amdgpu PROPERTIES FOLDER "Tests")
diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index 175efd89d67e6d..f35471a06a53e5 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -1,4 +1,5 @@
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "libc")
 
 # Include LLVM's cmake policies.
 if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 2977c26646cb2e..d75f22ecf02229 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -5,6 +5,7 @@
 # Setup Project
 
#===
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "libc++")
 
 set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
 
diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index da998d2221dc4f..f7673da25d20e0 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -5,6 +5,7 @@
 
#===
 
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "libc++abi")
 
 set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
 
diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt
index 806d5a783ec39c..2117cd9e756efc 100644
--- a/libunwind/CMakeLists.txt
+++ b/libunwind/CMakeLists.txt
@@ -3,6 +3,7 @@
 
#===
 
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "libunwind")
 
 set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
 
diff --git a/llvm-libgcc/CMakeLists.txt b/llvm-libgcc/CMakeLists.txt
index 013c9ca2e33076..c6641ab9e32191 100644
--- a/llvm-libgcc/CMakeLists.txt
+++ b/llvm-libgcc/CMakeLists.txt
@@ -3,6 +3,7 @@
 
#==

[llvm-branch-commits] [llvm] [bolt] Revise IDE folder structure (PR #89742)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur edited 
https://github.com/llvm/llvm-project/pull/89742
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lldb] [lldb] Revise IDE folder structure (PR #89748)

2024-04-23 Thread Michael Kruse via llvm-branch-commits


@@ -232,7 +231,7 @@ elseif (LLDB_EXPORT_ALL_SYMBOLS)
   )
 
   add_llvm_symbol_exports(liblldb ${exported_symbol_file})
-  set_target_properties(liblldb_exports PROPERTIES FOLDER "lldb misc")
+  set_target_properties(liblldb PROPERTIES FOLDER "LLDB/Misc")

Meinersbur wrote:

This `set_target_properties` is actually redundant: `add_llvm_symbol_exports` 
already puts it into a folder. It is also `${LLVM_SUBPROJECT_TITLE}/Misc`. I 
agree `${LLVM_SUBPROJECT_TITLE}/API` would be a better name. I am going to make 
that change in #89741. Thanks.

https://github.com/llvm/llvm-project/pull/89748
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lldb] [lldb] Revise IDE folder structure (PR #89748)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/89748

>From e29002224ef168934ae414e75e765cf197f65bc0 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:21:43 +0200
Subject: [PATCH 1/2] [lldb] Revise IDE folder structure

---
 lldb/CMakeLists.txt | 1 +
 lldb/cmake/modules/AddLLDB.cmake| 6 ++
 lldb/cmake/modules/LLDBConfig.cmake | 2 +-
 lldb/cmake/modules/LLDBFramework.cmake  | 2 +-
 lldb/cmake/modules/LLDBStandalone.cmake | 4 ++--
 lldb/docs/CMakeLists.txt| 1 +
 lldb/source/API/CMakeLists.txt  | 3 +--
 lldb/test/API/CMakeLists.txt| 1 +
 lldb/test/CMakeLists.txt| 4 ++--
 lldb/test/Shell/CMakeLists.txt  | 1 +
 lldb/test/Unit/CMakeLists.txt   | 1 +
 lldb/tools/driver/CMakeLists.txt| 2 --
 .../lldb-commandinterpreter-fuzzer/CMakeLists.txt   | 1 +
 lldb/tools/lldb-fuzzer/lldb-target-fuzzer/CMakeLists.txt| 1 +
 lldb/tools/lldb-server/CMakeLists.txt   | 1 -
 lldb/unittests/CMakeLists.txt   | 2 +-
 lldb/unittests/tools/lldb-server/CMakeLists.txt | 2 +-
 lldb/utils/TableGen/CMakeLists.txt  | 1 -
 lldb/utils/lit-cpuid/CMakeLists.txt | 2 +-
 lldb/utils/lldb-dotest/CMakeLists.txt   | 2 +-
 lldb/utils/lldb-repro/CMakeLists.txt| 2 +-
 21 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index 7844d93d78d29a..db9e5517e287b2 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -1,4 +1,5 @@
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "LLDB")
 
 if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
   set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
diff --git a/lldb/cmake/modules/AddLLDB.cmake b/lldb/cmake/modules/AddLLDB.cmake
index fdc4ee0c05d755..538029037dd46a 100644
--- a/lldb/cmake/modules/AddLLDB.cmake
+++ b/lldb/cmake/modules/AddLLDB.cmake
@@ -29,7 +29,6 @@ function(lldb_tablegen)
 
   if(LTG_TARGET)
 add_public_tablegen_target(${LTG_TARGET})
-set_target_properties( ${LTG_TARGET} PROPERTIES FOLDER "LLDB tablegenning")
 set_property(GLOBAL APPEND PROPERTY LLDB_TABLEGEN_TARGETS ${LTG_TARGET})
   endif()
 endfunction(lldb_tablegen)
@@ -165,10 +164,10 @@ function(add_lldb_library name)
 get_property(parent_dir DIRECTORY PROPERTY PARENT_DIRECTORY)
 if(EXISTS ${parent_dir})
   get_filename_component(category ${parent_dir} NAME)
-  set_target_properties(${name} PROPERTIES FOLDER "lldb 
plugins/${category}")
+  set_target_properties(${name} PROPERTIES FOLDER 
"LLDB/Plugins/${category}")
 endif()
   else()
-set_target_properties(${name} PROPERTIES FOLDER "lldb libraries")
+set_target_properties(${name} PROPERTIES FOLDER "LLDB/Libraries")
   endif()
 
   # If we want to export all lldb symbols (i.e LLDB_EXPORT_ALL_SYMBOLS=ON), we
@@ -208,7 +207,6 @@ function(add_lldb_executable name)
   else()
 target_link_libraries(${name} PRIVATE ${ARG_CLANG_LIBS})
   endif()
-  set_target_properties(${name} PROPERTIES FOLDER "lldb executables")
 
   if (ARG_BUILD_RPATH)
 set_target_properties(${name} PROPERTIES BUILD_RPATH "${ARG_BUILD_RPATH}")
diff --git a/lldb/cmake/modules/LLDBConfig.cmake 
b/lldb/cmake/modules/LLDBConfig.cmake
index a758261073ac57..13d07a4fabd6de 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -271,7 +271,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
 )
 
   add_custom_target(lldb-headers)
-  set_target_properties(lldb-headers PROPERTIES FOLDER "lldb misc")
+  set_target_properties(lldb-headers PROPERTIES FOLDER "LLDB/Resources")
 
   if (NOT CMAKE_CONFIGURATION_TYPES)
 add_llvm_install_targets(install-lldb-headers
diff --git a/lldb/cmake/modules/LLDBFramework.cmake 
b/lldb/cmake/modules/LLDBFramework.cmake
index f915839f6b45a5..88ea6a568ec4ca 100644
--- a/lldb/cmake/modules/LLDBFramework.cmake
+++ b/lldb/cmake/modules/LLDBFramework.cmake
@@ -104,7 +104,7 @@ endforeach()
 
 # Wrap output in a target, so lldb-framework can depend on it.
 add_custom_target(liblldb-resource-headers DEPENDS ${lldb_staged_headers})
-set_target_properties(liblldb-resource-headers PROPERTIES FOLDER "lldb misc")
+set_target_properties(liblldb-resource-headers PROPERTIES FOLDER 
"LLDB/Resources")
 add_dependencies(liblldb liblldb-resource-headers)
 
 # At build time, copy the staged headers into the framework bundle (and do
diff --git a/lldb/cmake/modules/LLDBStandalone.cmake 
b/lldb/cmake/modules/LLDBStandalone.cmake
index fd16716d71419c..c9367214848fda 100644
--- a/lldb/cmake/modules/LLDBStand

[llvm-branch-commits] [llvm] [bolt] Revise IDE folder structure (PR #89742)

2024-04-24 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/89742
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-04-24 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-04-24 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/89743

>From afadef1f53e03e2cf3a1695f3c693913b27382dd Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:03:11 +0200
Subject: [PATCH 1/2] [clang] Revise IDE folder structure

---
 clang/CMakeLists.txt| 8 +---
 clang/bindings/python/tests/CMakeLists.txt  | 2 +-
 clang/cmake/modules/AddClang.cmake  | 3 ---
 clang/docs/CMakeLists.txt   | 1 +
 clang/lib/Analysis/FlowSensitive/CMakeLists.txt | 1 +
 clang/lib/Headers/CMakeLists.txt| 4 ++--
 clang/lib/Tooling/CMakeLists.txt| 2 ++
 clang/test/CMakeLists.txt   | 5 ++---
 clang/tools/libclang/CMakeLists.txt | 2 +-
 clang/unittests/CMakeLists.txt  | 2 +-
 clang/utils/ClangVisualizers/CMakeLists.txt | 2 +-
 clang/utils/TableGen/CMakeLists.txt | 2 --
 clang/utils/hmaptool/CMakeLists.txt | 2 +-
 13 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index f092766fa19f07..09da3ad9979ffd 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -1,4 +1,5 @@
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "Clang")
 
 if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
   set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -390,7 +391,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   # Installing the headers needs to depend on generating any public
   # tablegen'd headers.
   add_custom_target(clang-headers DEPENDS clang-tablegen-targets)
-  set_target_properties(clang-headers PROPERTIES FOLDER "Misc")
+  set_target_properties(clang-headers PROPERTIES FOLDER "Clang/Resources")
   if(NOT LLVM_ENABLE_IDE)
 add_llvm_install_targets(install-clang-headers
  DEPENDS clang-headers
@@ -398,6 +399,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   endif()
 
   add_custom_target(bash-autocomplete DEPENDS utils/bash-autocomplete.sh)
+  set_target_properties(bash-autocomplete PROPERTIES FOLDER "Clang/Misc")
   install(FILES utils/bash-autocomplete.sh
   DESTINATION "${CMAKE_INSTALL_DATADIR}/clang"
   COMPONENT bash-autocomplete)
@@ -478,7 +480,7 @@ add_custom_target(clang-tablegen-targets
   omp_gen
   ClangDriverOptions
   ${CLANG_TABLEGEN_TARGETS})
-set_target_properties(clang-tablegen-targets PROPERTIES FOLDER "Misc")
+set_target_properties(clang-tablegen-targets PROPERTIES FOLDER 
"Clang/Tablegenning/Targets")
 list(APPEND LLVM_COMMON_DEPENDS clang-tablegen-targets)
 
 # Force target to be built as soon as possible. Clang modules builds depend
@@ -541,7 +543,7 @@ endif()
 
 # Custom target to install all clang libraries.
 add_custom_target(clang-libraries)
-set_target_properties(clang-libraries PROPERTIES FOLDER "Misc")
+set_target_properties(clang-libraries PROPERTIES FOLDER "Clang/Install")
 
 if(NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-clang-libraries
diff --git a/clang/bindings/python/tests/CMakeLists.txt 
b/clang/bindings/python/tests/CMakeLists.txt
index c4cd2539e9d6cf..2543cf739463d9 100644
--- a/clang/bindings/python/tests/CMakeLists.txt
+++ b/clang/bindings/python/tests/CMakeLists.txt
@@ -11,7 +11,7 @@ add_custom_target(check-clang-python
 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
 
 set(RUN_PYTHON_TESTS TRUE)
-set_target_properties(check-clang-python PROPERTIES FOLDER "Clang tests")
+set_target_properties(check-clang-python PROPERTIES FOLDER "Clang/Tests")
 
 # Tests require libclang.so which is only built with LLVM_ENABLE_PIC=ON
 if(NOT LLVM_ENABLE_PIC)
diff --git a/clang/cmake/modules/AddClang.cmake 
b/clang/cmake/modules/AddClang.cmake
index 75b0080f671564..a5ef639187d9db 100644
--- a/clang/cmake/modules/AddClang.cmake
+++ b/clang/cmake/modules/AddClang.cmake
@@ -26,7 +26,6 @@ function(clang_tablegen)
 
   if(CTG_TARGET)
 add_public_tablegen_target(${CTG_TARGET})
-set_target_properties( ${CTG_TARGET} PROPERTIES FOLDER "Clang 
tablegenning")
 set_property(GLOBAL APPEND PROPERTY CLANG_TABLEGEN_TARGETS ${CTG_TARGET})
   endif()
 endfunction(clang_tablegen)
@@ -138,13 +137,11 @@ macro(add_clang_library name)
 endif()
   endforeach()
 
-  set_target_properties(${name} PROPERTIES FOLDER "Clang libraries")
   set_clang_windows_version_resource_properties(${name})
 endmacro(add_clang_library)
 
 macro(add_clang_executable name)
   add_llvm_executable( ${name} ${ARGN} )
-  set_target_properties(${name} PROPERTIES FOLDER "Clang executables")
   set_clang_windows_version_resource_properties(${name})
 endmacro(add_clang_executable)
 
diff --git a/clang/docs/CMakeLists.txt b/clang/docs/CMakeLists.txt
index 4163dd2d90ad5b..51e9db29f887f3 100644
--- a/clang/docs/CMakeLists.txt
+++ b/clang/docs/CMakeLists.txt
@@ -78,6 +78,7 @@ if (LLVM_ENABLE_DOXYGEN)
 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
 WORKING_DIRECTORY 

[llvm-branch-commits] [compiler-rt] [compiler-rt] Revise IDE folder structure (PR #89753)

2024-04-30 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/89753

>From 19ef183fcfb44fa8b9bae34bdc8eafb8d2425722 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:15:38 +0200
Subject: [PATCH 1/2] [compiler-rt] Revise IDE folder structure

---
 compiler-rt/CMakeLists.txt|  3 ++-
 compiler-rt/cmake/Modules/AddCompilerRT.cmake | 21 ++-
 .../cmake/Modules/CompilerRTDarwinUtils.cmake |  4 ++--
 .../cmake/Modules/CompilerRTUtils.cmake   |  4 ++--
 compiler-rt/cmake/base-config-ix.cmake|  4 ++--
 compiler-rt/include/CMakeLists.txt|  2 +-
 compiler-rt/lib/asan/tests/CMakeLists.txt |  8 +++
 compiler-rt/lib/builtins/CMakeLists.txt   |  2 +-
 compiler-rt/lib/fuzzer/tests/CMakeLists.txt   |  6 +++---
 compiler-rt/lib/gwp_asan/tests/CMakeLists.txt |  4 ++--
 .../lib/interception/tests/CMakeLists.txt |  4 ++--
 compiler-rt/lib/memprof/tests/CMakeLists.txt  |  4 ++--
 compiler-rt/lib/orc/tests/CMakeLists.txt  |  6 +++---
 .../lib/sanitizer_common/tests/CMakeLists.txt |  4 ++--
 compiler-rt/lib/stats/CMakeLists.txt  |  2 +-
 compiler-rt/lib/tsan/CMakeLists.txt   |  2 +-
 compiler-rt/lib/tsan/dd/CMakeLists.txt|  2 +-
 compiler-rt/lib/tsan/rtl/CMakeLists.txt   |  2 +-
 compiler-rt/lib/xray/tests/CMakeLists.txt |  4 ++--
 compiler-rt/test/CMakeLists.txt   |  1 +
 compiler-rt/test/asan/CMakeLists.txt  |  3 ---
 compiler-rt/test/asan_abi/CMakeLists.txt  |  1 -
 compiler-rt/test/builtins/CMakeLists.txt  |  1 -
 compiler-rt/test/cfi/CMakeLists.txt   |  3 ---
 compiler-rt/test/dfsan/CMakeLists.txt |  1 -
 compiler-rt/test/fuzzer/CMakeLists.txt|  1 -
 compiler-rt/test/gwp_asan/CMakeLists.txt  |  1 -
 compiler-rt/test/hwasan/CMakeLists.txt|  2 --
 compiler-rt/test/interception/CMakeLists.txt  |  1 -
 compiler-rt/test/lsan/CMakeLists.txt  |  1 -
 compiler-rt/test/memprof/CMakeLists.txt   |  3 ---
 compiler-rt/test/metadata/CMakeLists.txt  |  1 -
 compiler-rt/test/msan/CMakeLists.txt  |  1 -
 compiler-rt/test/orc/CMakeLists.txt   |  1 -
 compiler-rt/test/profile/CMakeLists.txt   |  1 -
 compiler-rt/test/safestack/CMakeLists.txt |  1 -
 .../test/sanitizer_common/CMakeLists.txt  |  2 --
 .../test/shadowcallstack/CMakeLists.txt   |  1 -
 compiler-rt/test/tsan/CMakeLists.txt  |  1 -
 compiler-rt/test/ubsan/CMakeLists.txt |  2 --
 compiler-rt/test/ubsan_minimal/CMakeLists.txt |  1 -
 compiler-rt/test/xray/CMakeLists.txt  |  1 -
 42 files changed, 46 insertions(+), 74 deletions(-)

diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index 6ce451e3cac2e3..65063e0057bbca 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -4,6 +4,7 @@
 # based on the ability of the host toolchain to target various platforms.
 
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "Compiler-RT")
 
 if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
   set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -90,7 +91,7 @@ if (COMPILER_RT_STANDALONE_BUILD)
   if (TARGET intrinsics_gen)
 # Loading the llvm config causes this target to be imported so place it
 # under the appropriate folder in an IDE.
-set_target_properties(intrinsics_gen PROPERTIES FOLDER "Compiler-RT Misc")
+set_target_properties(intrinsics_gen PROPERTIES FOLDER "LLVM/Tablegenning")
   endif()
 
   find_package(Python3 COMPONENTS Interpreter)
diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake 
b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
index 6e0d9dbff65a9e..61c727b36bff30 100644
--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -89,7 +89,7 @@ function(add_compiler_rt_object_libraries name)
 "${libname}" MATCHES ".*\.osx.*")
   foreach(arch ${LIB_ARCHS_${libname}})
 list(APPEND target_flags
-  "SHELL:-target ${arch}-apple-macos${DARWIN_osx_MIN_VER} 
-darwin-target-variant ${arch}-apple-ios13.1-macabi")
+  "SHELL:-target ${arch}-apple-macos${DARWIN_osx_MIN_V357ER} 
-darwin-target-variant ${arch}-apple-ios13.1-macabi")
   endforeach()
 endif()
 
@@ -97,7 +97,7 @@ function(add_compiler_rt_object_libraries name)
   ${extra_cflags_${libname}} ${target_flags})
 set_property(TARGET ${libname} APPEND PROPERTY
   COMPILE_DEFINITIONS ${LIB_DEFS})
-set_target_properties(${libname} PROPERTIES FOLDER "Compiler-RT Libraries")
+set_target_properties(${libname} PROPERTIES FOLDER "Compiler-RT/Libraries")
 if(APPLE)
   set_target_properties(${libname} PROPERTIES
 OSX_ARCHITECTURES "${LIB_ARCHS_${libname}}")
@@ -116,7 +116,7 @@ endmacro()
 
 function(add_compiler_rt_component name)
   add_custom_target(${name})
-  set_target_properties(${name} PROPERTIES FOLDER "Compiler-RT Misc")
+  set_target_properties(${

[llvm-branch-commits] [compiler-rt] [compiler-rt] Revise IDE folder structure (PR #89753)

2024-04-30 Thread Michael Kruse via llvm-branch-commits


@@ -89,15 +89,15 @@ function(add_compiler_rt_object_libraries name)
 "${libname}" MATCHES ".*\.osx.*")
   foreach(arch ${LIB_ARCHS_${libname}})
 list(APPEND target_flags
-  "SHELL:-target ${arch}-apple-macos${DARWIN_osx_MIN_VER} 
-darwin-target-variant ${arch}-apple-ios13.1-macabi")
+  "SHELL:-target ${arch}-apple-macos${DARWIN_osx_MIN_V357ER} 
-darwin-target-variant ${arch}-apple-ios13.1-macabi")

Meinersbur wrote:

This was not intentional. It is possible that I was trying to jump to line 357 
and instead typed into the edited. I always look for unnecessary changes before 
pushing but seem to have missed this one.

Thanks for noticing.

https://github.com/llvm/llvm-project/pull/89753
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [openmp] [Clang][OpenMP][Tile] Allow non-constant tile sizes. (PR #91345)

2024-05-07 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur created 
https://github.com/llvm/llvm-project/pull/91345

Allow non-constants in the `sizes` clause such as
```
#pragma omp tile sizes(a)
for (int i = 0; i < n; ++i)
```
This is permitted since tile was introduced in [OpenMP 
5.1](https://www.openmp.org/spec-html/5.1/openmpsu53.html#x78-860002.11.9).

It is possible to sneak-in negative numbers at runtime as in
```
int a = -1;
#pragma omp tile sizes(a)
```
Even though it is not well-formed, it should still result in every loop 
iteration to be executed exactly once, an invariant of the tile construct that 
we should ensure. `ParseOpenMPExprListClause` is extracted-out to be reused by 
the `permutation` clause if the `interchange` construct. Some care was put in 
to ensure correct behavior in template contexts.

This patch also adds end-to-end tests. This is to avoid errors like the 
off-by-one error I caused with the initial implementation of the unroll 
construct.


>From a2aa6950ce3880b8e669025d95ac9e72245e26a7 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 7 May 2024 16:42:41 +0200
Subject: [PATCH] Allow non-constant tile sizes

---
 clang/include/clang/Parse/Parser.h|  17 ++
 clang/lib/Parse/ParseOpenMP.cpp   |  65 --
 clang/lib/Sema/SemaOpenMP.cpp | 113 +++--
 clang/test/OpenMP/tile_ast_print.cpp  |  17 ++
 clang/test/OpenMP/tile_codegen.cpp| 216 --
 clang/test/OpenMP/tile_messages.cpp   |  50 +++-
 openmp/runtime/test/transform/tile/intfor.c   | 187 +++
 .../test/transform/tile/negtile_intfor.c  |  44 
 .../tile/parallel-wsloop-collapse-intfor.cpp  | 100 
 9 files changed, 737 insertions(+), 72 deletions(-)
 create mode 100644 openmp/runtime/test/transform/tile/intfor.c
 create mode 100644 openmp/runtime/test/transform/tile/negtile_intfor.c
 create mode 100644 
openmp/runtime/test/transform/tile/parallel-wsloop-collapse-intfor.cpp

diff --git a/clang/include/clang/Parse/Parser.h 
b/clang/include/clang/Parse/Parser.h
index daefd4f28f011a..1b500c11457f4d 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -3553,6 +3553,23 @@ class Parser : public CodeCompletionHandler {
   OMPClause *ParseOpenMPVarListClause(OpenMPDirectiveKind DKind,
   OpenMPClauseKind Kind, bool ParseOnly);
 
+  /// Parses a clause consisting of a list of expressions.
+  ///
+  /// \param Kind  The clause to parse.
+  /// \param ClauseNameLoc [out] The location of the clause name.
+  /// \param OpenLoc   [out] The location of '('.
+  /// \param CloseLoc  [out] The location of ')'.
+  /// \param Exprs [out] The parsed expressions.
+  /// \param ReqIntConst   If true, each expression must be an integer 
constant.
+  ///
+  /// \return Whether the clause was parsed successfully.
+  bool ParseOpenMPExprListClause(OpenMPClauseKind Kind,
+ SourceLocation &ClauseNameLoc,
+ SourceLocation &OpenLoc,
+ SourceLocation &CloseLoc,
+ SmallVectorImpl &Exprs,
+ bool ReqIntConst = false);
+
   /// Parses and creates OpenMP 5.0 iterators expression:
   ///  = 'iterator' '(' { [  ] identifier =
   ///  }+ ')'
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 18ba1185ee8de7..b8b32f9546c4fb 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -3107,34 +3107,14 @@ bool Parser::ParseOpenMPSimpleVarList(
 }
 
 OMPClause *Parser::ParseOpenMPSizesClause() {
-  SourceLocation ClauseNameLoc = ConsumeToken();
+  SourceLocation ClauseNameLoc, OpenLoc, CloseLoc;
   SmallVector ValExprs;
-
-  BalancedDelimiterTracker T(*this, tok::l_paren, 
tok::annot_pragma_openmp_end);
-  if (T.consumeOpen()) {
-Diag(Tok, diag::err_expected) << tok::l_paren;
+  if (ParseOpenMPExprListClause(OMPC_sizes, ClauseNameLoc, OpenLoc, CloseLoc,
+ValExprs))
 return nullptr;
-  }
-
-  while (true) {
-ExprResult Val = ParseConstantExpression();
-if (!Val.isUsable()) {
-  T.skipToEnd();
-  return nullptr;
-}
-
-ValExprs.push_back(Val.get());
-
-if (Tok.is(tok::r_paren) || Tok.is(tok::annot_pragma_openmp_end))
-  break;
-
-ExpectAndConsume(tok::comma);
-  }
-
-  T.consumeClose();
 
-  return Actions.OpenMP().ActOnOpenMPSizesClause(
-  ValExprs, ClauseNameLoc, T.getOpenLocation(), T.getCloseLocation());
+  return Actions.OpenMP().ActOnOpenMPSizesClause(ValExprs, ClauseNameLoc,
+ OpenLoc, CloseLoc);
 }
 
 OMPClause *Parser::ParseOpenMPUsesAllocatorClause(OpenMPDirectiveKind DKind) {
@@ -4991,3 +4971,38 @@ OMPClause 
*Parser::ParseOpenMPVarListClause(OpenMPDirectiveKind DKind,
   OMPVarListLocTy Locs(Loc, LOpen, Data.RLoc);
   return Action

[llvm-branch-commits] [clang] [openmp] [Clang][OpenMP][Tile] Allow non-constant tile sizes. (PR #91345)

2024-05-07 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/91345

>From a2aa6950ce3880b8e669025d95ac9e72245e26a7 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 7 May 2024 16:42:41 +0200
Subject: [PATCH 1/2] Allow non-constant tile sizes

---
 clang/include/clang/Parse/Parser.h|  17 ++
 clang/lib/Parse/ParseOpenMP.cpp   |  65 --
 clang/lib/Sema/SemaOpenMP.cpp | 113 +++--
 clang/test/OpenMP/tile_ast_print.cpp  |  17 ++
 clang/test/OpenMP/tile_codegen.cpp| 216 --
 clang/test/OpenMP/tile_messages.cpp   |  50 +++-
 openmp/runtime/test/transform/tile/intfor.c   | 187 +++
 .../test/transform/tile/negtile_intfor.c  |  44 
 .../tile/parallel-wsloop-collapse-intfor.cpp  | 100 
 9 files changed, 737 insertions(+), 72 deletions(-)
 create mode 100644 openmp/runtime/test/transform/tile/intfor.c
 create mode 100644 openmp/runtime/test/transform/tile/negtile_intfor.c
 create mode 100644 
openmp/runtime/test/transform/tile/parallel-wsloop-collapse-intfor.cpp

diff --git a/clang/include/clang/Parse/Parser.h 
b/clang/include/clang/Parse/Parser.h
index daefd4f28f011..1b500c11457f4 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -3553,6 +3553,23 @@ class Parser : public CodeCompletionHandler {
   OMPClause *ParseOpenMPVarListClause(OpenMPDirectiveKind DKind,
   OpenMPClauseKind Kind, bool ParseOnly);
 
+  /// Parses a clause consisting of a list of expressions.
+  ///
+  /// \param Kind  The clause to parse.
+  /// \param ClauseNameLoc [out] The location of the clause name.
+  /// \param OpenLoc   [out] The location of '('.
+  /// \param CloseLoc  [out] The location of ')'.
+  /// \param Exprs [out] The parsed expressions.
+  /// \param ReqIntConst   If true, each expression must be an integer 
constant.
+  ///
+  /// \return Whether the clause was parsed successfully.
+  bool ParseOpenMPExprListClause(OpenMPClauseKind Kind,
+ SourceLocation &ClauseNameLoc,
+ SourceLocation &OpenLoc,
+ SourceLocation &CloseLoc,
+ SmallVectorImpl &Exprs,
+ bool ReqIntConst = false);
+
   /// Parses and creates OpenMP 5.0 iterators expression:
   ///  = 'iterator' '(' { [  ] identifier =
   ///  }+ ')'
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 18ba1185ee8de..b8b32f9546c4f 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -3107,34 +3107,14 @@ bool Parser::ParseOpenMPSimpleVarList(
 }
 
 OMPClause *Parser::ParseOpenMPSizesClause() {
-  SourceLocation ClauseNameLoc = ConsumeToken();
+  SourceLocation ClauseNameLoc, OpenLoc, CloseLoc;
   SmallVector ValExprs;
-
-  BalancedDelimiterTracker T(*this, tok::l_paren, 
tok::annot_pragma_openmp_end);
-  if (T.consumeOpen()) {
-Diag(Tok, diag::err_expected) << tok::l_paren;
+  if (ParseOpenMPExprListClause(OMPC_sizes, ClauseNameLoc, OpenLoc, CloseLoc,
+ValExprs))
 return nullptr;
-  }
-
-  while (true) {
-ExprResult Val = ParseConstantExpression();
-if (!Val.isUsable()) {
-  T.skipToEnd();
-  return nullptr;
-}
-
-ValExprs.push_back(Val.get());
-
-if (Tok.is(tok::r_paren) || Tok.is(tok::annot_pragma_openmp_end))
-  break;
-
-ExpectAndConsume(tok::comma);
-  }
-
-  T.consumeClose();
 
-  return Actions.OpenMP().ActOnOpenMPSizesClause(
-  ValExprs, ClauseNameLoc, T.getOpenLocation(), T.getCloseLocation());
+  return Actions.OpenMP().ActOnOpenMPSizesClause(ValExprs, ClauseNameLoc,
+ OpenLoc, CloseLoc);
 }
 
 OMPClause *Parser::ParseOpenMPUsesAllocatorClause(OpenMPDirectiveKind DKind) {
@@ -4991,3 +4971,38 @@ OMPClause 
*Parser::ParseOpenMPVarListClause(OpenMPDirectiveKind DKind,
   OMPVarListLocTy Locs(Loc, LOpen, Data.RLoc);
   return Actions.OpenMP().ActOnOpenMPVarListClause(Kind, Vars, Locs, Data);
 }
+
+bool Parser::ParseOpenMPExprListClause(OpenMPClauseKind Kind,
+   SourceLocation &ClauseNameLoc,
+   SourceLocation &OpenLoc,
+   SourceLocation &CloseLoc,
+   SmallVectorImpl &Exprs,
+   bool ReqIntConst) {
+  assert(getOpenMPClauseName(Kind) == PP.getSpelling(Tok) &&
+ "Expected parsing to start at clause name");
+  ClauseNameLoc = ConsumeToken();
+
+  // Parse inside of '(' and ')'.
+  BalancedDelimiterTracker T(*this, tok::l_paren, 
tok::annot_pragma_openmp_end);
+  if (T.consumeOpen()) {
+Diag(Tok, diag::err_expected) << tok::l_paren;
+return true;
+  }
+
+  // Parse the list with interleaved comma

[llvm-branch-commits] [clang] [openmp] [Clang][OpenMP][Tile] Allow non-constant tile sizes. (PR #91345)

2024-05-08 Thread Michael Kruse via llvm-branch-commits

Meinersbur wrote:

Test failure is from unrelated `DataFlowSanitizer-x86_64 :: 
release_shadow_space.c`

https://github.com/llvm/llvm-project/pull/91345
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [openmp] [Clang][OpenMP][Tile] Allow non-constant tile sizes. (PR #91345)

2024-05-08 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/91345
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [openmp] [Clang][OpenMP][Tile] Allow non-constant tile sizes. (PR #91345)

2024-05-08 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/91345

>From a2aa6950ce3880b8e669025d95ac9e72245e26a7 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 7 May 2024 16:42:41 +0200
Subject: [PATCH 1/3] Allow non-constant tile sizes

---
 clang/include/clang/Parse/Parser.h|  17 ++
 clang/lib/Parse/ParseOpenMP.cpp   |  65 --
 clang/lib/Sema/SemaOpenMP.cpp | 113 +++--
 clang/test/OpenMP/tile_ast_print.cpp  |  17 ++
 clang/test/OpenMP/tile_codegen.cpp| 216 --
 clang/test/OpenMP/tile_messages.cpp   |  50 +++-
 openmp/runtime/test/transform/tile/intfor.c   | 187 +++
 .../test/transform/tile/negtile_intfor.c  |  44 
 .../tile/parallel-wsloop-collapse-intfor.cpp  | 100 
 9 files changed, 737 insertions(+), 72 deletions(-)
 create mode 100644 openmp/runtime/test/transform/tile/intfor.c
 create mode 100644 openmp/runtime/test/transform/tile/negtile_intfor.c
 create mode 100644 
openmp/runtime/test/transform/tile/parallel-wsloop-collapse-intfor.cpp

diff --git a/clang/include/clang/Parse/Parser.h 
b/clang/include/clang/Parse/Parser.h
index daefd4f28f011..1b500c11457f4 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -3553,6 +3553,23 @@ class Parser : public CodeCompletionHandler {
   OMPClause *ParseOpenMPVarListClause(OpenMPDirectiveKind DKind,
   OpenMPClauseKind Kind, bool ParseOnly);
 
+  /// Parses a clause consisting of a list of expressions.
+  ///
+  /// \param Kind  The clause to parse.
+  /// \param ClauseNameLoc [out] The location of the clause name.
+  /// \param OpenLoc   [out] The location of '('.
+  /// \param CloseLoc  [out] The location of ')'.
+  /// \param Exprs [out] The parsed expressions.
+  /// \param ReqIntConst   If true, each expression must be an integer 
constant.
+  ///
+  /// \return Whether the clause was parsed successfully.
+  bool ParseOpenMPExprListClause(OpenMPClauseKind Kind,
+ SourceLocation &ClauseNameLoc,
+ SourceLocation &OpenLoc,
+ SourceLocation &CloseLoc,
+ SmallVectorImpl &Exprs,
+ bool ReqIntConst = false);
+
   /// Parses and creates OpenMP 5.0 iterators expression:
   ///  = 'iterator' '(' { [  ] identifier =
   ///  }+ ')'
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 18ba1185ee8de..b8b32f9546c4f 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -3107,34 +3107,14 @@ bool Parser::ParseOpenMPSimpleVarList(
 }
 
 OMPClause *Parser::ParseOpenMPSizesClause() {
-  SourceLocation ClauseNameLoc = ConsumeToken();
+  SourceLocation ClauseNameLoc, OpenLoc, CloseLoc;
   SmallVector ValExprs;
-
-  BalancedDelimiterTracker T(*this, tok::l_paren, 
tok::annot_pragma_openmp_end);
-  if (T.consumeOpen()) {
-Diag(Tok, diag::err_expected) << tok::l_paren;
+  if (ParseOpenMPExprListClause(OMPC_sizes, ClauseNameLoc, OpenLoc, CloseLoc,
+ValExprs))
 return nullptr;
-  }
-
-  while (true) {
-ExprResult Val = ParseConstantExpression();
-if (!Val.isUsable()) {
-  T.skipToEnd();
-  return nullptr;
-}
-
-ValExprs.push_back(Val.get());
-
-if (Tok.is(tok::r_paren) || Tok.is(tok::annot_pragma_openmp_end))
-  break;
-
-ExpectAndConsume(tok::comma);
-  }
-
-  T.consumeClose();
 
-  return Actions.OpenMP().ActOnOpenMPSizesClause(
-  ValExprs, ClauseNameLoc, T.getOpenLocation(), T.getCloseLocation());
+  return Actions.OpenMP().ActOnOpenMPSizesClause(ValExprs, ClauseNameLoc,
+ OpenLoc, CloseLoc);
 }
 
 OMPClause *Parser::ParseOpenMPUsesAllocatorClause(OpenMPDirectiveKind DKind) {
@@ -4991,3 +4971,38 @@ OMPClause 
*Parser::ParseOpenMPVarListClause(OpenMPDirectiveKind DKind,
   OMPVarListLocTy Locs(Loc, LOpen, Data.RLoc);
   return Actions.OpenMP().ActOnOpenMPVarListClause(Kind, Vars, Locs, Data);
 }
+
+bool Parser::ParseOpenMPExprListClause(OpenMPClauseKind Kind,
+   SourceLocation &ClauseNameLoc,
+   SourceLocation &OpenLoc,
+   SourceLocation &CloseLoc,
+   SmallVectorImpl &Exprs,
+   bool ReqIntConst) {
+  assert(getOpenMPClauseName(Kind) == PP.getSpelling(Tok) &&
+ "Expected parsing to start at clause name");
+  ClauseNameLoc = ConsumeToken();
+
+  // Parse inside of '(' and ')'.
+  BalancedDelimiterTracker T(*this, tok::l_paren, 
tok::annot_pragma_openmp_end);
+  if (T.consumeOpen()) {
+Diag(Tok, diag::err_expected) << tok::l_paren;
+return true;
+  }
+
+  // Parse the list with interleaved comma

[llvm-branch-commits] [clang] [openmp] [Clang][OpenMP][Tile] Allow non-constant tile sizes. (PR #91345)

2024-05-08 Thread Michael Kruse via llvm-branch-commits


@@ -4991,3 +4971,38 @@ OMPClause 
*Parser::ParseOpenMPVarListClause(OpenMPDirectiveKind DKind,
   OMPVarListLocTy Locs(Loc, LOpen, Data.RLoc);
   return Actions.OpenMP().ActOnOpenMPVarListClause(Kind, Vars, Locs, Data);
 }
+
+bool Parser::ParseOpenMPExprListClause(OpenMPClauseKind Kind,
+   SourceLocation &ClauseNameLoc,
+   SourceLocation &OpenLoc,
+   SourceLocation &CloseLoc,
+   SmallVectorImpl &Exprs,
+   bool ReqIntConst) {
+  assert(getOpenMPClauseName(Kind) == PP.getSpelling(Tok) &&
+ "Expected parsing to start at clause name");
+  ClauseNameLoc = ConsumeToken();
+
+  // Parse inside of '(' and ')'.
+  BalancedDelimiterTracker T(*this, tok::l_paren, 
tok::annot_pragma_openmp_end);
+  if (T.consumeOpen()) {
+Diag(Tok, diag::err_expected) << tok::l_paren;
+return true;
+  }
+
+  // Parse the list with interleaved commas.
+  do {
+ExprResult Val =
+ReqIntConst ? ParseConstantExpression() : ParseAssignmentExpression();
+if (!Val.isUsable()) {
+  // Encountered something other than an expression; abort to ')'.
+  T.skipToEnd();
+  return true;

Meinersbur wrote:

Callers should not use the output parameters when returning true. This seems to 
be common for `Parse...` methods, such as `ParseOpenACCIntExprList`, 
`parseOpenMPDeclareMapperVarDecl`, `ParseOpenMPParensExpr`, ...

https://github.com/llvm/llvm-project/pull/91345
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [openmp] [Clang][OpenMP][Tile] Allow non-constant tile sizes. (PR #91345)

2024-05-08 Thread Michael Kruse via llvm-branch-commits


@@ -17432,16 +17457,54 @@ OMPClause 
*SemaOpenMP::ActOnOpenMPSizesClause(ArrayRef SizeExprs,
   SourceLocation StartLoc,
   SourceLocation LParenLoc,
   SourceLocation EndLoc) {
-  for (Expr *SizeExpr : SizeExprs) {
-ExprResult NumForLoopsResult = VerifyPositiveIntegerConstantInClause(
-SizeExpr, OMPC_sizes, /*StrictlyPositive=*/true);
-if (!NumForLoopsResult.isUsable())
-  return nullptr;
+  SmallVector SanitizedSizeExprs;
+  llvm::append_range(SanitizedSizeExprs, SizeExprs);
+
+  for (Expr *&SizeExpr : SanitizedSizeExprs) {
+// Skip if already sanitized, e.g. during a partial template instantiation.
+if (!SizeExpr)
+  continue;
+
+bool IsValid = isNonNegativeIntegerValue(SizeExpr, SemaRef, OMPC_sizes,
+ /*StrictlyPositive=*/true);
+
+// isNonNegativeIntegerValue returns true for non-integral types (but still
+// emits error diagnostic), so check for the expected type explicitly.
+QualType SizeTy = SizeExpr->getType();
+if (!SizeTy->isIntegerType())
+  IsValid = false;
+
+// Handling in templates is tricky. There are four possibilities to
+// consider:
+//
+// 1a. The expression is valid and we are in a instantiated template or not
+// in a template:
+//   Pass valid expression to be further analysed later in Sema.
+// 1b. The expression is valid and we are in a template (including partial
+// instantiation):
+//   isNonNegativeIntegerValue skipped any checks so there is no
+//   guarantee it will be correct after instantiation.
+//   ActOnOpenMPSizesClause will be called again at instantiation when
+//   it is not in a dependent context anymore. This may cause warnings
+//   to be emitted multiple times.
+// 2a. The expression is invalid and we are in an instantiated template or
+// not in a template:
+//   Invalidate the expression with a clearly wrong value (nullptr) so
+//   later in Sema we do not have to do the same validity analysis 
again
+//   or crash from unexpected data. Error diagnostics have already been
+//   emitted.
+// 2b. The expression is invalid and we are in a template (including 
partial
+// instantiation):
+//   Pass the invalid expression as-is, template instantiation may
+//   replace unexpected types/values with valid ones. The directives
+//   with this clause must not try to use these expressions in 
dependent
+//   contexts.

Meinersbur wrote:

Case 2b is already adhered to in `ActOnOpenMPTileDirective`:
```
  // Delay tiling to when template is completely instantiated.
  if (SemaRef.CurContext->isDependentContext())
return OMPTileDirective::Create(Context, StartLoc, EndLoc, Clauses,
NumLoops, AStmt, nullptr, nullptr);
```
Delaying further analysis seems generally to be what OpenMP does, e.g. 
```
isNonNegativeIntegerValue(...) {
  if (!ValExpr->isTypeDependent() && !ValExpr->isValueDependent() &&
  !ValExpr->isInstantiationDependent()) {
```

https://github.com/llvm/llvm-project/pull/91345
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [openmp] [Clang][OpenMP][Tile] Allow non-constant tile sizes. (PR #91345)

2024-05-08 Thread Michael Kruse via llvm-branch-commits


@@ -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 = [&SemaRef = this->SemaRef, &CopyTransformer, &Context,
+  SizesClause, CurScope](int I) -> Expr * {
+Expr *DimTileSizeExpr = SizesClause->getSizesRefs()[I];
+if (isa(DimTileSizeExpr))
+  return AssertSuccess(CopyTransformer.TransformExpr(DimTileSizeExpr));
+
+// When the tile size is not a constant but a variable, it is possible to
+// pass non-positive numbers. To preserve the invariant that every loop

Meinersbur wrote:

```
int a = 0;
#pragma omp tile sizes(a)
for (int i = 0; i < 42; ++i)
  body(i);
```
While I don't think it can be expected this gives any useful tiling, it should 
still execute `body` 42 times.

https://github.com/llvm/llvm-project/pull/91345
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [openmp] [Clang][OpenMP] Fix tile/unroll on iterator- and foreach-loops. (PR #91459)

2024-05-13 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/91459
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [openmp] [Clang][OpenMP][Tile] Allow non-constant tile sizes. (PR #91345)

2024-05-13 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/91345

>From a2aa6950ce3880b8e669025d95ac9e72245e26a7 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 7 May 2024 16:42:41 +0200
Subject: [PATCH 1/4] Allow non-constant tile sizes

---
 clang/include/clang/Parse/Parser.h|  17 ++
 clang/lib/Parse/ParseOpenMP.cpp   |  65 --
 clang/lib/Sema/SemaOpenMP.cpp | 113 +++--
 clang/test/OpenMP/tile_ast_print.cpp  |  17 ++
 clang/test/OpenMP/tile_codegen.cpp| 216 --
 clang/test/OpenMP/tile_messages.cpp   |  50 +++-
 openmp/runtime/test/transform/tile/intfor.c   | 187 +++
 .../test/transform/tile/negtile_intfor.c  |  44 
 .../tile/parallel-wsloop-collapse-intfor.cpp  | 100 
 9 files changed, 737 insertions(+), 72 deletions(-)
 create mode 100644 openmp/runtime/test/transform/tile/intfor.c
 create mode 100644 openmp/runtime/test/transform/tile/negtile_intfor.c
 create mode 100644 
openmp/runtime/test/transform/tile/parallel-wsloop-collapse-intfor.cpp

diff --git a/clang/include/clang/Parse/Parser.h 
b/clang/include/clang/Parse/Parser.h
index daefd4f28f011..1b500c11457f4 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -3553,6 +3553,23 @@ class Parser : public CodeCompletionHandler {
   OMPClause *ParseOpenMPVarListClause(OpenMPDirectiveKind DKind,
   OpenMPClauseKind Kind, bool ParseOnly);
 
+  /// Parses a clause consisting of a list of expressions.
+  ///
+  /// \param Kind  The clause to parse.
+  /// \param ClauseNameLoc [out] The location of the clause name.
+  /// \param OpenLoc   [out] The location of '('.
+  /// \param CloseLoc  [out] The location of ')'.
+  /// \param Exprs [out] The parsed expressions.
+  /// \param ReqIntConst   If true, each expression must be an integer 
constant.
+  ///
+  /// \return Whether the clause was parsed successfully.
+  bool ParseOpenMPExprListClause(OpenMPClauseKind Kind,
+ SourceLocation &ClauseNameLoc,
+ SourceLocation &OpenLoc,
+ SourceLocation &CloseLoc,
+ SmallVectorImpl &Exprs,
+ bool ReqIntConst = false);
+
   /// Parses and creates OpenMP 5.0 iterators expression:
   ///  = 'iterator' '(' { [  ] identifier =
   ///  }+ ')'
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 18ba1185ee8de..b8b32f9546c4f 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -3107,34 +3107,14 @@ bool Parser::ParseOpenMPSimpleVarList(
 }
 
 OMPClause *Parser::ParseOpenMPSizesClause() {
-  SourceLocation ClauseNameLoc = ConsumeToken();
+  SourceLocation ClauseNameLoc, OpenLoc, CloseLoc;
   SmallVector ValExprs;
-
-  BalancedDelimiterTracker T(*this, tok::l_paren, 
tok::annot_pragma_openmp_end);
-  if (T.consumeOpen()) {
-Diag(Tok, diag::err_expected) << tok::l_paren;
+  if (ParseOpenMPExprListClause(OMPC_sizes, ClauseNameLoc, OpenLoc, CloseLoc,
+ValExprs))
 return nullptr;
-  }
-
-  while (true) {
-ExprResult Val = ParseConstantExpression();
-if (!Val.isUsable()) {
-  T.skipToEnd();
-  return nullptr;
-}
-
-ValExprs.push_back(Val.get());
-
-if (Tok.is(tok::r_paren) || Tok.is(tok::annot_pragma_openmp_end))
-  break;
-
-ExpectAndConsume(tok::comma);
-  }
-
-  T.consumeClose();
 
-  return Actions.OpenMP().ActOnOpenMPSizesClause(
-  ValExprs, ClauseNameLoc, T.getOpenLocation(), T.getCloseLocation());
+  return Actions.OpenMP().ActOnOpenMPSizesClause(ValExprs, ClauseNameLoc,
+ OpenLoc, CloseLoc);
 }
 
 OMPClause *Parser::ParseOpenMPUsesAllocatorClause(OpenMPDirectiveKind DKind) {
@@ -4991,3 +4971,38 @@ OMPClause 
*Parser::ParseOpenMPVarListClause(OpenMPDirectiveKind DKind,
   OMPVarListLocTy Locs(Loc, LOpen, Data.RLoc);
   return Actions.OpenMP().ActOnOpenMPVarListClause(Kind, Vars, Locs, Data);
 }
+
+bool Parser::ParseOpenMPExprListClause(OpenMPClauseKind Kind,
+   SourceLocation &ClauseNameLoc,
+   SourceLocation &OpenLoc,
+   SourceLocation &CloseLoc,
+   SmallVectorImpl &Exprs,
+   bool ReqIntConst) {
+  assert(getOpenMPClauseName(Kind) == PP.getSpelling(Tok) &&
+ "Expected parsing to start at clause name");
+  ClauseNameLoc = ConsumeToken();
+
+  // Parse inside of '(' and ')'.
+  BalancedDelimiterTracker T(*this, tok::l_paren, 
tok::annot_pragma_openmp_end);
+  if (T.consumeOpen()) {
+Diag(Tok, diag::err_expected) << tok::l_paren;
+return true;
+  }
+
+  // Parse the list with interleaved comma

[llvm-branch-commits] [clang] [openmp] [Clang][OpenMP][Tile] Allow non-constant tile sizes. (PR #91345)

2024-05-13 Thread Michael Kruse via llvm-branch-commits


@@ -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 = [&SemaRef = this->SemaRef, &CopyTransformer, &Context,
+  SizesClause, CurScope](int I) -> Expr * {
+Expr *DimTileSizeExpr = SizesClause->getSizesRefs()[I];
+if (isa(DimTileSizeExpr))
+  return AssertSuccess(CopyTransformer.TransformExpr(DimTileSizeExpr));
+
+// When the tile size is not a constant but a variable, it is possible to
+// pass non-positive numbers. To preserve the invariant that every loop

Meinersbur wrote:

Added the example to the comment to clarify

https://github.com/llvm/llvm-project/pull/91345
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [openmp] [Clang][OpenMP][Tile] Allow non-constant tile sizes. (PR #91345)

2024-05-13 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/91345

>From a2aa6950ce3880b8e669025d95ac9e72245e26a7 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 7 May 2024 16:42:41 +0200
Subject: [PATCH 1/5] Allow non-constant tile sizes

---
 clang/include/clang/Parse/Parser.h|  17 ++
 clang/lib/Parse/ParseOpenMP.cpp   |  65 --
 clang/lib/Sema/SemaOpenMP.cpp | 113 +++--
 clang/test/OpenMP/tile_ast_print.cpp  |  17 ++
 clang/test/OpenMP/tile_codegen.cpp| 216 --
 clang/test/OpenMP/tile_messages.cpp   |  50 +++-
 openmp/runtime/test/transform/tile/intfor.c   | 187 +++
 .../test/transform/tile/negtile_intfor.c  |  44 
 .../tile/parallel-wsloop-collapse-intfor.cpp  | 100 
 9 files changed, 737 insertions(+), 72 deletions(-)
 create mode 100644 openmp/runtime/test/transform/tile/intfor.c
 create mode 100644 openmp/runtime/test/transform/tile/negtile_intfor.c
 create mode 100644 
openmp/runtime/test/transform/tile/parallel-wsloop-collapse-intfor.cpp

diff --git a/clang/include/clang/Parse/Parser.h 
b/clang/include/clang/Parse/Parser.h
index daefd4f28f011..1b500c11457f4 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -3553,6 +3553,23 @@ class Parser : public CodeCompletionHandler {
   OMPClause *ParseOpenMPVarListClause(OpenMPDirectiveKind DKind,
   OpenMPClauseKind Kind, bool ParseOnly);
 
+  /// Parses a clause consisting of a list of expressions.
+  ///
+  /// \param Kind  The clause to parse.
+  /// \param ClauseNameLoc [out] The location of the clause name.
+  /// \param OpenLoc   [out] The location of '('.
+  /// \param CloseLoc  [out] The location of ')'.
+  /// \param Exprs [out] The parsed expressions.
+  /// \param ReqIntConst   If true, each expression must be an integer 
constant.
+  ///
+  /// \return Whether the clause was parsed successfully.
+  bool ParseOpenMPExprListClause(OpenMPClauseKind Kind,
+ SourceLocation &ClauseNameLoc,
+ SourceLocation &OpenLoc,
+ SourceLocation &CloseLoc,
+ SmallVectorImpl &Exprs,
+ bool ReqIntConst = false);
+
   /// Parses and creates OpenMP 5.0 iterators expression:
   ///  = 'iterator' '(' { [  ] identifier =
   ///  }+ ')'
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 18ba1185ee8de..b8b32f9546c4f 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -3107,34 +3107,14 @@ bool Parser::ParseOpenMPSimpleVarList(
 }
 
 OMPClause *Parser::ParseOpenMPSizesClause() {
-  SourceLocation ClauseNameLoc = ConsumeToken();
+  SourceLocation ClauseNameLoc, OpenLoc, CloseLoc;
   SmallVector ValExprs;
-
-  BalancedDelimiterTracker T(*this, tok::l_paren, 
tok::annot_pragma_openmp_end);
-  if (T.consumeOpen()) {
-Diag(Tok, diag::err_expected) << tok::l_paren;
+  if (ParseOpenMPExprListClause(OMPC_sizes, ClauseNameLoc, OpenLoc, CloseLoc,
+ValExprs))
 return nullptr;
-  }
-
-  while (true) {
-ExprResult Val = ParseConstantExpression();
-if (!Val.isUsable()) {
-  T.skipToEnd();
-  return nullptr;
-}
-
-ValExprs.push_back(Val.get());
-
-if (Tok.is(tok::r_paren) || Tok.is(tok::annot_pragma_openmp_end))
-  break;
-
-ExpectAndConsume(tok::comma);
-  }
-
-  T.consumeClose();
 
-  return Actions.OpenMP().ActOnOpenMPSizesClause(
-  ValExprs, ClauseNameLoc, T.getOpenLocation(), T.getCloseLocation());
+  return Actions.OpenMP().ActOnOpenMPSizesClause(ValExprs, ClauseNameLoc,
+ OpenLoc, CloseLoc);
 }
 
 OMPClause *Parser::ParseOpenMPUsesAllocatorClause(OpenMPDirectiveKind DKind) {
@@ -4991,3 +4971,38 @@ OMPClause 
*Parser::ParseOpenMPVarListClause(OpenMPDirectiveKind DKind,
   OMPVarListLocTy Locs(Loc, LOpen, Data.RLoc);
   return Actions.OpenMP().ActOnOpenMPVarListClause(Kind, Vars, Locs, Data);
 }
+
+bool Parser::ParseOpenMPExprListClause(OpenMPClauseKind Kind,
+   SourceLocation &ClauseNameLoc,
+   SourceLocation &OpenLoc,
+   SourceLocation &CloseLoc,
+   SmallVectorImpl &Exprs,
+   bool ReqIntConst) {
+  assert(getOpenMPClauseName(Kind) == PP.getSpelling(Tok) &&
+ "Expected parsing to start at clause name");
+  ClauseNameLoc = ConsumeToken();
+
+  // Parse inside of '(' and ')'.
+  BalancedDelimiterTracker T(*this, tok::l_paren, 
tok::annot_pragma_openmp_end);
+  if (T.consumeOpen()) {
+Diag(Tok, diag::err_expected) << tok::l_paren;
+return true;
+  }
+
+  // Parse the list with interleaved comma

[llvm-branch-commits] [clang] [openmp] [Clang][OpenMP][Tile] Allow non-constant tile sizes. (PR #91345)

2024-05-13 Thread Michael Kruse via llvm-branch-commits


@@ -17432,16 +17457,54 @@ OMPClause 
*SemaOpenMP::ActOnOpenMPSizesClause(ArrayRef SizeExprs,
   SourceLocation StartLoc,
   SourceLocation LParenLoc,
   SourceLocation EndLoc) {
-  for (Expr *SizeExpr : SizeExprs) {
-ExprResult NumForLoopsResult = VerifyPositiveIntegerConstantInClause(
-SizeExpr, OMPC_sizes, /*StrictlyPositive=*/true);
-if (!NumForLoopsResult.isUsable())
-  return nullptr;
+  SmallVector SanitizedSizeExprs;
+  llvm::append_range(SanitizedSizeExprs, SizeExprs);
+
+  for (Expr *&SizeExpr : SanitizedSizeExprs) {
+// Skip if already sanitized, e.g. during a partial template instantiation.
+if (!SizeExpr)
+  continue;
+
+bool IsValid = isNonNegativeIntegerValue(SizeExpr, SemaRef, OMPC_sizes,
+ /*StrictlyPositive=*/true);
+
+// isNonNegativeIntegerValue returns true for non-integral types (but still
+// emits error diagnostic), so check for the expected type explicitly.
+QualType SizeTy = SizeExpr->getType();
+if (!SizeTy->isIntegerType())
+  IsValid = false;
+
+// Handling in templates is tricky. There are four possibilities to
+// consider:
+//
+// 1a. The expression is valid and we are in a instantiated template or not
+// in a template:
+//   Pass valid expression to be further analysed later in Sema.
+// 1b. The expression is valid and we are in a template (including partial
+// instantiation):
+//   isNonNegativeIntegerValue skipped any checks so there is no
+//   guarantee it will be correct after instantiation.
+//   ActOnOpenMPSizesClause will be called again at instantiation when
+//   it is not in a dependent context anymore. This may cause warnings
+//   to be emitted multiple times.
+// 2a. The expression is invalid and we are in an instantiated template or
+// not in a template:
+//   Invalidate the expression with a clearly wrong value (nullptr) so
+//   later in Sema we do not have to do the same validity analysis 
again
+//   or crash from unexpected data. Error diagnostics have already been
+//   emitted.
+// 2b. The expression is invalid and we are in a template (including 
partial
+// instantiation):
+//   Pass the invalid expression as-is, template instantiation may
+//   replace unexpected types/values with valid ones. The directives
+//   with this clause must not try to use these expressions in 
dependent
+//   contexts.

Meinersbur wrote:

Added clarification

https://github.com/llvm/llvm-project/pull/91345
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-05-13 Thread Michael Kruse via llvm-branch-commits

Meinersbur wrote:

@AaronBallman Thanks for having a look.

> With this patch, I get errors when loading a visual studio solution generated 
> with these change, and all of clang's libraries are placed at the top level. 
> The error is a dialog box saying "The solution already contains an item named 
> 'clang'."

I got similar errors with "Unittest" and "UnitTest". I only solved it by using 
"Unit". I am assuming this is because there is something else already with that 
name but inconsistent case. I never for this for "Clang"/"clang", but it could 
be when not all patches from the series are applied. Specifically I think 
clang-tools-extra may use "Clang"/"clang".

> Another thing (that is existing behavior) worth noting is that at some point, 
> we lost the ability to browse directly to files in Visual Studio. Instead of 
> going to `Clang Libraries->clangDriver->Source Files->ToolChain.cpp`, you 
> have to go to `Object Libraries->obj.clangDriver->Source 
> Files->ToolChain.cpp` which is pretty strange. Your patch doesn't change 
> this, but if we're correcting folder structure behavior, we should probably 
> address that at the same time if we can.

This is how CMake handles object libraries. There is one target 
`obj.clangDriver` that builds all the *.obj file, and a library that is not 
used. The target `clangDriver` then has a dependency on `obj.clangDriver` and 
has its *.obj files added, but not the source files. This is to be able to link 
a static library (`clangDriver_static`) and a dynamic library (`clangDriver`) 
at the [same 
time](https://github.com/llvm/llvm-project/blob/ca1bd5995f6ed934f9187305190a5abfac049173/llvm/cmake/modules/AddLLVM.cmake#L593)
 but compiling the source files just once. I don't know the reason, but in 
contrast to other subprojects Clang uses this build mode [even when building 
just one 
library](https://github.com/llvm/llvm-project/blob/ca1bd5995f6ed934f9187305190a5abfac049173/clang/cmake/modules/AddClang.cmake#L102).
 

There is an exception for XCode, and we could do the same for MSVC (or add the 
source files as `ADDITIONAL_HEADERS` to make them show up). However, for this 
patch series I did not intent to change anything about how the build system 
works.

https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [flang] [llvm] [openmp] [Clang][OpenMP] Add reverse and interchange directives (PR #92030)

2024-05-13 Thread Michael Kruse via llvm-branch-commits

Meinersbur wrote:

Buildkite failure is unrelated: `fatal error C1060: compiler is out of heap 
space`

https://github.com/llvm/llvm-project/pull/92030
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [flang] [llvm] [openmp] [Clang][OpenMP] Add reverse and interchange directives (PR #92030)

2024-05-13 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/92030
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [MLIR][OpenMP] Support clause-based representation of operations (PR #92519)

2024-05-17 Thread Michael Kruse via llvm-branch-commits

Meinersbur wrote:

I like the idea, but also have some questions:
1. How does an operation definition look like with all its clauses defined? 
Does it have to be repeated for each operation supporting the same clause(s)?
2. It seems this requires all properties of a clause specified in its 
constructor. Wouldn't it be better if you could subclass `OpenMP_Clause` and in 
there overwrite all the properties that are non-default?
3. Have you considered to define/derive from all this info in OpenMP.td of 
LLVMFrontend? Clause information should be language-independent. 

https://github.com/llvm/llvm-project/pull/92519
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

Meinersbur wrote:

@AaronBallman Would you mind reviewing D89741 ? I was convinced a stakeholder 
there but they decided to drop out instead of approving it.

https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [flang] [llvm] [openmp] [Clang][OpenMP] Add reverse and interchange directives (PR #92030)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur edited 
https://github.com/llvm/llvm-project/pull/92030
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [flang] [llvm] [openmp] [Clang][OpenMP] Add reverse and interchange directives (PR #92030)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur edited 
https://github.com/llvm/llvm-project/pull/92030
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [flang] [llvm] [openmp] [Clang][OpenMP] Add interchange directive (PR #92030)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur edited 
https://github.com/llvm/llvm-project/pull/92030
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [flang] [llvm] [openmp] [Clang][OpenMP] Add interchange directive (PR #92030)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

Meinersbur wrote:

Extracted out the reverse part into #92916

https://github.com/llvm/llvm-project/pull/92030
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [llvm] [openmp] [Clang][OpenMP] Add reverse directive (PR #92916)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/92916
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [flang] [llvm] [openmp] [Clang][OpenMP] Add interchange directive (PR #92030)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur edited 
https://github.com/llvm/llvm-project/pull/92030
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

Meinersbur wrote:

> Oh the fun of PR numbers now lining up with Phabricator numbers. I thought 
> you meant https://reviews.llvm.org/D89741 and was very confused until I saw 
> #89741. :-D I'll take a look!

Well, seems I still have muscle memory from Phabricator times :-)

Thanks for the review!

https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [clang-tools-extra] Revise IDE folder structure (PR #89744)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/89744
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [compiler-rt] Revise IDE folder structure (PR #89753)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/89753
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang] Revise IDE folder structure (PR #89745)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/89745
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libclc] [libclc] Revise IDE folder structure (PR #89746)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/89746
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] [lld] Revise IDE folder structure (PR #89747)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/89747
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lldb] [lldb] Revise IDE folder structure (PR #89748)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/89748
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [mlir] Revise IDE folder structure (PR #89749)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/89749
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [openmp] [openmp] Revise IDE folder structure (PR #89750)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/89750
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libc] [libcxx] [libcxxabi] [libunwind] [llvm] [pstl] Revise IDE folder structure (PR #89755)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/89755
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [polly] [polly] Revise IDE folder structure (PR #89752)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/89752
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] [lld] Revise IDE folder structure (PR #89747)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/89747

>From 6c3206c8100ed68ab77ceb98741bef42659bcfc1 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:12:03 +0200
Subject: [PATCH] [lld] Revise IDE folder structure

---
 lld/CMakeLists.txt | 2 ++
 lld/cmake/modules/AddLLD.cmake | 2 --
 lld/test/CMakeLists.txt| 5 ++---
 lld/unittests/CMakeLists.txt   | 2 --
 4 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt
index cd8ba627306ed..64c9f23805509 100644
--- a/lld/CMakeLists.txt
+++ b/lld/CMakeLists.txt
@@ -1,4 +1,5 @@
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "LLD")
 
 if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
   set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -192,6 +193,7 @@ add_subdirectory(tools/lld)
 
 if (LLVM_INCLUDE_TESTS)
   add_custom_target(LLDUnitTests)
+  set_target_properties(LLDUnitTests PROPERTIES FOLDER "LLD/Tests")
   if (TARGET llvm_gtest)
 add_subdirectory(unittests)
   endif()
diff --git a/lld/cmake/modules/AddLLD.cmake b/lld/cmake/modules/AddLLD.cmake
index 2ee066b415351..9f2684b6f933e 100644
--- a/lld/cmake/modules/AddLLD.cmake
+++ b/lld/cmake/modules/AddLLD.cmake
@@ -11,7 +11,6 @@ macro(add_lld_library name)
 set(ARG_ENABLE_SHARED SHARED)
   endif()
   llvm_add_library(${name} ${ARG_ENABLE_SHARED} ${ARG_UNPARSED_ARGUMENTS})
-  set_target_properties(${name} PROPERTIES FOLDER "lld libraries")
 
   if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
 get_target_export_arg(${name} LLD export_to_lldtargets)
@@ -33,7 +32,6 @@ endmacro(add_lld_library)
 
 macro(add_lld_executable name)
   add_llvm_executable(${name} ${ARGN})
-  set_target_properties(${name} PROPERTIES FOLDER "lld executables")
 endmacro(add_lld_executable)
 
 macro(add_lld_tool name)
diff --git a/lld/test/CMakeLists.txt b/lld/test/CMakeLists.txt
index bb6164f19dcef..25d8f0a424926 100644
--- a/lld/test/CMakeLists.txt
+++ b/lld/test/CMakeLists.txt
@@ -83,10 +83,9 @@ add_lit_testsuite(check-lld "Running lld test suite"
   ${CMAKE_CURRENT_BINARY_DIR}
   DEPENDS ${LLD_TEST_DEPS}
   )
-set_target_properties(check-lld PROPERTIES FOLDER "lld tests")
 
 add_custom_target(lld-test-depends DEPENDS ${LLD_TEST_DEPS})
-set_target_properties(lld-test-depends PROPERTIES FOLDER "lld tests")
+set_target_properties(lld-test-depends PROPERTIES FOLDER "LLD/Tests")
 
 add_lit_testsuites(LLD ${CMAKE_CURRENT_SOURCE_DIR}
   DEPENDS ${LLD_TEST_DEPS}
@@ -95,4 +94,4 @@ add_lit_testsuites(LLD ${CMAKE_CURRENT_SOURCE_DIR}
 # Add a legacy target spelling: lld-test
 add_custom_target(lld-test)
 add_dependencies(lld-test check-lld)
-set_target_properties(lld-test PROPERTIES FOLDER "lld tests")
+set_target_properties(lld-test PROPERTIES FOLDER "LLD/Tests")
diff --git a/lld/unittests/CMakeLists.txt b/lld/unittests/CMakeLists.txt
index ac878fa019083..ffaea3f207833 100644
--- a/lld/unittests/CMakeLists.txt
+++ b/lld/unittests/CMakeLists.txt
@@ -1,5 +1,3 @@
-set_target_properties(LLDUnitTests PROPERTIES FOLDER "lld tests")
-
 function(add_lld_unittests test_dirname)
   add_unittest(LLDUnitTests ${test_dirname} ${ARGN})
 endfunction()

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [clang-tools-extra] Revise IDE folder structure (PR #89744)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/89744

>From 937a7728542d880fd37c439bec6dca4ccd3f07d2 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:06:06 +0200
Subject: [PATCH] [clang-tools-extra] Revise IDE folder structure

---
 clang-tools-extra/CMakeLists.txt   | 2 ++
 clang-tools-extra/clang-tidy/CMakeLists.txt| 2 +-
 clang-tools-extra/clang-tidy/misc/CMakeLists.txt   | 2 ++
 clang-tools-extra/clangd/unittests/CMakeLists.txt  | 1 +
 clang-tools-extra/docs/CMakeLists.txt  | 1 +
 clang-tools-extra/include-cleaner/unittests/CMakeLists.txt | 1 +
 clang-tools-extra/pseudo/include/CMakeLists.txt| 1 +
 clang-tools-extra/pseudo/tool/CMakeLists.txt   | 1 +
 clang-tools-extra/pseudo/unittests/CMakeLists.txt  | 1 +
 clang-tools-extra/test/CMakeLists.txt  | 1 -
 clang-tools-extra/unittests/CMakeLists.txt | 2 +-
 11 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/clang-tools-extra/CMakeLists.txt b/clang-tools-extra/CMakeLists.txt
index 6a3f741721ee6..f6a6b57b5ef0b 100644
--- a/clang-tools-extra/CMakeLists.txt
+++ b/clang-tools-extra/CMakeLists.txt
@@ -1,3 +1,5 @@
+set(LLVM_SUBPROJECT_TITLE "Clang Tools Extra")
+
 include(CMakeDependentOption)
 include(GNUInstallDirs)
 
diff --git a/clang-tools-extra/clang-tidy/CMakeLists.txt 
b/clang-tools-extra/clang-tidy/CMakeLists.txt
index 7e1905aa897b7..430ea4cdbb38e 100644
--- a/clang-tools-extra/clang-tidy/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/CMakeLists.txt
@@ -121,7 +121,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
 PATTERN "*.h"
 )
   add_custom_target(clang-tidy-headers)
-  set_target_properties(clang-tidy-headers PROPERTIES FOLDER "Misc")
+  set_target_properties(clang-tidy-headers PROPERTIES FOLDER "Clang Tools 
Extra/Resources")
   if(NOT LLVM_ENABLE_IDE)
 add_llvm_install_targets(install-clang-tidy-headers
  DEPENDS clang-tidy-headers
diff --git a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt 
b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
index d9ec268650c05..4eda705c45d2a 100644
--- a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
@@ -15,6 +15,7 @@ add_custom_command(
 DEPENDS ${clang_tidy_confusable_chars_gen_target} 
ConfusableTable/confusables.txt)
 
 add_custom_target(genconfusable DEPENDS Confusables.inc)
+set_target_properties(genconfusable PROPERTIES FOLDER "Clang Tools 
Extra/Tablegenning")
 
 add_clang_library(clangTidyMiscModule
   ConstCorrectnessCheck.cpp
@@ -51,6 +52,7 @@ add_clang_library(clangTidyMiscModule
   genconfusable
   ClangDriverOptions
   )
+set_target_properties(clangTidyMiscModule PROPERTIES FOLDER "Clang Tools 
Extra/Libraries")
 
 clang_target_link_libraries(clangTidyMiscModule
   PRIVATE
diff --git a/clang-tools-extra/clangd/unittests/CMakeLists.txt 
b/clang-tools-extra/clangd/unittests/CMakeLists.txt
index 7f1ae5c43d80c..0d4628ccf25d8 100644
--- a/clang-tools-extra/clangd/unittests/CMakeLists.txt
+++ b/clang-tools-extra/clangd/unittests/CMakeLists.txt
@@ -29,6 +29,7 @@ 
include(${CMAKE_CURRENT_SOURCE_DIR}/../quality/CompletionModel.cmake)
 gen_decision_forest(${CMAKE_CURRENT_SOURCE_DIR}/decision_forest_model 
DecisionForestRuntimeTest ::ns1::ns2::test::Example)
 
 add_custom_target(ClangdUnitTests)
+set_target_properties(ClangdUnitTests PROPERTIES FOLDER "Clang Tools 
Extra/Tests")
 add_unittest(ClangdUnitTests ClangdTests
   Annotations.cpp
   ASTTests.cpp
diff --git a/clang-tools-extra/docs/CMakeLists.txt 
b/clang-tools-extra/docs/CMakeLists.txt
index 8f442e1f661ed..272db266b5054 100644
--- a/clang-tools-extra/docs/CMakeLists.txt
+++ b/clang-tools-extra/docs/CMakeLists.txt
@@ -77,6 +77,7 @@ if (DOXYGEN_FOUND)
   COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
   COMMENT "Generating clang doxygen documentation." VERBATIM)
+set_target_properties(doxygen-clang-tools PROPERTIES FOLDER "Clang Tools 
Extra/Docs")
 
 if (LLVM_BUILD_DOCS)
   add_dependencies(doxygen doxygen-clang-tools)
diff --git a/clang-tools-extra/include-cleaner/unittests/CMakeLists.txt 
b/clang-tools-extra/include-cleaner/unittests/CMakeLists.txt
index 1e89534b51116..416535649f622 100644
--- a/clang-tools-extra/include-cleaner/unittests/CMakeLists.txt
+++ b/clang-tools-extra/include-cleaner/unittests/CMakeLists.txt
@@ -4,6 +4,7 @@ set(LLVM_LINK_COMPONENTS
   )
 
 add_custom_target(ClangIncludeCleanerUnitTests)
+set_target_properties(ClangIncludeCleanerUnitTests PROPERTIES FOLDER "Clang 
Tools Extra/Tests")
 add_unittest(ClangIncludeCleanerUnitTests ClangIncludeCleanerTests
   AnalysisTest.cpp
   FindHeadersTest.cpp
diff --git a/clang-tools-extra/pseudo/include/CMakeLists.txt 
b/clang-tools-extra/pseudo/include/CMakeLists.txt
index 2334cfa12e337..

[llvm-branch-commits] [polly] [polly] Revise IDE folder structure (PR #89752)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/89752

>From a85a17723d76371ccc8feb245c455d6aaf2c297f Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:19:16 +0200
Subject: [PATCH 1/2] [polly] Revise IDE folder structure

---
 polly/CMakeLists.txt   | 5 +++--
 polly/cmake/polly_macros.cmake | 2 +-
 polly/docs/CMakeLists.txt  | 1 +
 polly/lib/CMakeLists.txt   | 4 +---
 polly/test/CMakeLists.txt  | 7 ++-
 polly/unittests/CMakeLists.txt | 2 +-
 6 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/polly/CMakeLists.txt b/polly/CMakeLists.txt
index 5d0f2cd7f00ec..a0d1ab49e7837 100644
--- a/polly/CMakeLists.txt
+++ b/polly/CMakeLists.txt
@@ -4,6 +4,7 @@ if (NOT DEFINED LLVM_MAIN_SRC_DIR)
   cmake_minimum_required(VERSION 3.20.0)
   set(POLLY_STANDALONE_BUILD TRUE)
 endif()
+set(LLVM_SUBPROJECT_TITLE "Polly")
 
 # Must go below project(..)
 include(GNUInstallDirs)
@@ -157,8 +158,8 @@ foreach (file IN LISTS files)
 endforeach ()
 
 add_custom_target(polly-check-format DEPENDS ${check_format_depends})
-set_target_properties(polly-check-format PROPERTIES FOLDER "Polly")
+set_target_properties(polly-check-format PROPERTIES FOLDER "Polly/Meta")
 
 add_custom_target(polly-update-format DEPENDS ${update_format_depends})
-set_target_properties(polly-update-format PROPERTIES FOLDER "Polly")
+set_target_properties(polly-update-format PROPERTIES FOLDER "Polly/Meta")
 
diff --git a/polly/cmake/polly_macros.cmake b/polly/cmake/polly_macros.cmake
index df541eeccc4cb..b1bd1e1b03cda 100644
--- a/polly/cmake/polly_macros.cmake
+++ b/polly/cmake/polly_macros.cmake
@@ -21,7 +21,7 @@ macro(add_polly_library name)
 set(libkind)
   endif()
   add_library( ${name} ${libkind} ${srcs} )
-  set_target_properties(${name} PROPERTIES FOLDER "Polly")
+  set_target_properties(${name} PROPERTIES FOLDER "Polly/Libraries")
 
   if( LLVM_COMMON_DEPENDS )
 add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
diff --git a/polly/docs/CMakeLists.txt b/polly/docs/CMakeLists.txt
index a1ef5ce5277f7..2bd16e53c542f 100644
--- a/polly/docs/CMakeLists.txt
+++ b/polly/docs/CMakeLists.txt
@@ -77,6 +77,7 @@ if (LLVM_ENABLE_DOXYGEN)
 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 COMMENT "Generating polly doxygen documentation." VERBATIM)
+  set_target_properties(doxygen-polly PROPERTIES FOLDER "Polly/Docs")
 
   if (LLVM_BUILD_DOCS)
 add_dependencies(doxygen doxygen-polly)
diff --git a/polly/lib/CMakeLists.txt b/polly/lib/CMakeLists.txt
index 4557878e515e6..f18cdcd09cfca 100644
--- a/polly/lib/CMakeLists.txt
+++ b/polly/lib/CMakeLists.txt
@@ -92,8 +92,6 @@ add_llvm_pass_plugin(Polly
   LINK_COMPONENTS
   ${POLLY_COMPONENTS}
   )
-set_target_properties(obj.Polly PROPERTIES FOLDER "Polly")
-set_target_properties(Polly PROPERTIES FOLDER "Polly")
 
 if (MSVC_IDE OR XCODE)
   # Configure source groups for Polly source files. By default, in the IDE 
there
@@ -120,7 +118,7 @@ if (WIN32 OR CYGWIN OR NOT LLVM_ENABLE_PIC)
   # Add dummy target, either because loadable modules are not supported
   # as on Windows or because PIC code has been disabled
   add_custom_target(LLVMPolly)
-  set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly")
+  set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly/Meta")
 else ()
   add_polly_loadable_module(LLVMPolly
 Plugin/Polly.cpp
diff --git a/polly/test/CMakeLists.txt b/polly/test/CMakeLists.txt
index 81cee34a780d6..338c7dbfa1158 100644
--- a/polly/test/CMakeLists.txt
+++ b/polly/test/CMakeLists.txt
@@ -1,7 +1,7 @@
 set(LLVM_SHLIBEXT "${CMAKE_SHARED_MODULE_SUFFIX}")
 
 add_custom_target(check-polly)
-set_target_properties(check-polly PROPERTIES FOLDER "Polly")
+set_target_properties(check-polly PROPERTIES FOLDER "Polly/Tests")
 
 if(NOT LLVM_MAIN_SRC_DIR)
   find_program(LLVM_OPT NAMES opt HINTS ${LLVM_TOOLS_BINARY_DIR})
@@ -64,7 +64,6 @@ add_lit_testsuite(check-polly-tests "Running polly regression 
tests"
   polly_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
   DEPENDS ${POLLY_TEST_DEPS}
   )
-set_target_properties(check-polly-tests PROPERTIES FOLDER "Polly")
 add_dependencies(check-polly check-polly-tests)
 
 configure_lit_site_cfg(
@@ -80,7 +79,6 @@ if (POLLY_GTEST_AVAIL)
 EXCLUDE_FROM_CHECK_ALL
 DEPENDS PollyUnitTests
 )
-  set_target_properties(check-polly-unittests PROPERTIES FOLDER "Polly")
 endif ()
 
 configure_file(
@@ -94,7 +92,6 @@ if (POLLY_BUNDLED_ISL)
 EXCLUDE_FROM_CHECK_ALL
 DEPENDS polly-isl-test
 )
-  set_target_properties(check-polly-isl PROPERTIES FOLDER "Polly")
 endif (POLLY_BUNDLED_ISL)
 
 # Run polly-check-format as part of polly-check only if we are compiling with
@@ -114,5 +111,5 @@ configure_file(
 
 # Add a legacy target spelling: polly-test
 add_custom_target(polly-test)
-set_target_properties(polly-test PROPERTIES FOLDER "Polly")
+set_target_properties(polly-test PROPERTIE

[llvm-branch-commits] [libc] [libcxx] [libcxxabi] [libunwind] [llvm] [pstl] Revise IDE folder structure (PR #89755)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/89755

>From 0ce849c6e5455577a77f4c25d08e8ec83115a290 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:29:28 +0200
Subject: [PATCH] Revise IDE folder structure

---
 cross-project-tests/CMakeLists.txt | 6 +-
 libc/CMakeLists.txt| 1 +
 libcxx/CMakeLists.txt  | 1 +
 libcxxabi/CMakeLists.txt   | 1 +
 libunwind/CMakeLists.txt   | 1 +
 llvm-libgcc/CMakeLists.txt | 1 +
 offload/CMakeLists.txt | 1 +
 pstl/CMakeLists.txt| 1 +
 runtimes/CMakeLists.txt| 1 +
 9 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/cross-project-tests/CMakeLists.txt 
b/cross-project-tests/CMakeLists.txt
index f7c2ca7ad83de..7f2fee48fda77 100644
--- a/cross-project-tests/CMakeLists.txt
+++ b/cross-project-tests/CMakeLists.txt
@@ -3,6 +3,7 @@
 # The subset inside debuginfo-tests invoke clang to generate programs with
 # various types of debug info, and then run those programs under a debugger
 # such as GDB or LLDB to verify the results.
+set(LLVM_SUBPROJECT_TITLE "Cross-Project")
 
 find_package(Python3 COMPONENTS Interpreter)
 
@@ -97,8 +98,3 @@ add_lit_testsuite(check-cross-amdgpu "Running AMDGPU 
cross-project tests"
 add_lit_testsuites(CROSS_PROJECT ${CMAKE_CURRENT_SOURCE_DIR}
   DEPENDS ${CROSS_PROJECT_TEST_DEPS}
   )
-
-set_target_properties(check-cross-project PROPERTIES FOLDER "Tests")
-set_target_properties(check-debuginfo PROPERTIES FOLDER "Tests")
-set_target_properties(check-intrinsic-headers PROPERTIES FOLDER "Tests")
-set_target_properties(check-cross-amdgpu PROPERTIES FOLDER "Tests")
diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index 175efd89d67e6..f35471a06a53e 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -1,4 +1,5 @@
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "libc")
 
 # Include LLVM's cmake policies.
 if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 2977c26646cb2..d75f22ecf0222 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -5,6 +5,7 @@
 # Setup Project
 
#===
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "libc++")
 
 set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
 
diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index da998d2221dc4..f7673da25d20e 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -5,6 +5,7 @@
 
#===
 
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "libc++abi")
 
 set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
 
diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt
index 806d5a783ec39..2117cd9e756ef 100644
--- a/libunwind/CMakeLists.txt
+++ b/libunwind/CMakeLists.txt
@@ -3,6 +3,7 @@
 
#===
 
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "libunwind")
 
 set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
 
diff --git a/llvm-libgcc/CMakeLists.txt b/llvm-libgcc/CMakeLists.txt
index 013c9ca2e3307..c6641ab9e3219 100644
--- a/llvm-libgcc/CMakeLists.txt
+++ b/llvm-libgcc/CMakeLists.txt
@@ -3,6 +3,7 @@
 
#===
 
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "LLVM libgcc")
 
 set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
 
diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt
index abc8baa0805ff..44a3d17b2e59a 100644
--- a/offload/CMakeLists.txt
+++ b/offload/CMakeLists.txt
@@ -11,6 +11,7 @@
 
##===--===##
 
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "liboffload")
 
 if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
   set(OPENMP_STANDALONE_BUILD TRUE)
diff --git a/pstl/CMakeLists.txt b/pstl/CMakeLists.txt
index 255e22af9a26b..592e11d356473 100644
--- a/pstl/CMakeLists.txt
+++ b/pstl/CMakeLists.txt
@@ -6,6 +6,7 @@
 #
 #===--===##
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "Parallel STL")
 
 set(PARALLELSTL_VERSION_FILE 
"${CMAKE_CURRENT_SOURCE_DIR}/include/pstl/internal/pstl_config.h")
 file(STRINGS "${PARALLELSTL_VERSION_FILE}" PARALLELSTL_VERSION_SOURCE REGEX 
"#define _PSTL_VERSION .*$")
diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt
index fcc59c8fa1c37..76ad8aa1f353e 100644
--- a/runtimes/CMakeLists.txt
+++ b/runtimes/CMakeLists.txt
@@ -9,6 +9,7 @@ include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
 include(${LLVM_COMMON_CMAKE_UTILS}/Modules/LL

[llvm-branch-commits] [llvm] [bolt] Revise IDE folder structure (PR #89742)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/89742

>From 140a539c9e3248b128bdffdbc9ae5e2e8b4366c0 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:23:47 +0200
Subject: [PATCH 1/2] [bolt] Revise IDE folder structure

---
 bolt/CMakeLists.txt  | 2 ++
 bolt/cmake/modules/AddBOLT.cmake | 1 -
 bolt/docs/CMakeLists.txt | 1 +
 bolt/test/CMakeLists.txt | 3 +--
 bolt/unittests/CMakeLists.txt| 2 +-
 5 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/bolt/CMakeLists.txt b/bolt/CMakeLists.txt
index cc3a70fa35e0a..26df6a4208b7a 100644
--- a/bolt/CMakeLists.txt
+++ b/bolt/CMakeLists.txt
@@ -1,3 +1,5 @@
+set(LLVM_SUBPROJECT_TITLE "BOLT")
+
 include(ExternalProject)
 
 set(BOLT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
diff --git a/bolt/cmake/modules/AddBOLT.cmake b/bolt/cmake/modules/AddBOLT.cmake
index 1f69b9046320a..c7ac662c6b121 100644
--- a/bolt/cmake/modules/AddBOLT.cmake
+++ b/bolt/cmake/modules/AddBOLT.cmake
@@ -3,7 +3,6 @@ include(LLVMDistributionSupport)
 
 macro(add_bolt_executable name)
   add_llvm_executable(${name} ${ARGN})
-  set_target_properties(${name} PROPERTIES FOLDER "BOLT")
 endmacro()
 
 macro(add_bolt_tool name)
diff --git a/bolt/docs/CMakeLists.txt b/bolt/docs/CMakeLists.txt
index b230512fe5717..12ae852566785 100644
--- a/bolt/docs/CMakeLists.txt
+++ b/bolt/docs/CMakeLists.txt
@@ -79,6 +79,7 @@ if (LLVM_ENABLE_DOXYGEN)
 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 COMMENT "Generating bolt doxygen documentation." VERBATIM)
+  set_target_properties(doxygen-bolt PROPERTIES FOLDER "BOLT/Docs")
 
   if (LLVM_BUILD_DOCS)
 add_dependencies(doxygen doxygen-bolt)
diff --git a/bolt/test/CMakeLists.txt b/bolt/test/CMakeLists.txt
index 89862fd59eb8e..d468ff984840f 100644
--- a/bolt/test/CMakeLists.txt
+++ b/bolt/test/CMakeLists.txt
@@ -56,7 +56,7 @@ list(APPEND BOLT_TEST_DEPS
   )
 
 add_custom_target(bolt-test-depends DEPENDS ${BOLT_TEST_DEPS})
-set_target_properties(bolt-test-depends PROPERTIES FOLDER "BOLT")
+set_target_properties(bolt-test-depends PROPERTIES FOLDER "BOLT/Tests")
 
 add_lit_testsuite(check-bolt "Running the BOLT regression tests"
   ${CMAKE_CURRENT_BINARY_DIR}
@@ -64,7 +64,6 @@ add_lit_testsuite(check-bolt "Running the BOLT regression 
tests"
   DEPENDS ${BOLT_TEST_DEPS}
   ARGS ${BOLT_TEST_EXTRA_ARGS}
   )
-set_target_properties(check-bolt PROPERTIES FOLDER "BOLT")
 
 add_lit_testsuites(BOLT ${CMAKE_CURRENT_SOURCE_DIR}
   PARAMS ${BOLT_TEST_PARAMS}
diff --git a/bolt/unittests/CMakeLists.txt b/bolt/unittests/CMakeLists.txt
index 77159e92dec55..64414b83d39fe 100644
--- a/bolt/unittests/CMakeLists.txt
+++ b/bolt/unittests/CMakeLists.txt
@@ -1,5 +1,5 @@
 add_custom_target(BoltUnitTests)
-set_target_properties(BoltUnitTests PROPERTIES FOLDER "BOLT tests")
+set_target_properties(BoltUnitTests PROPERTIES FOLDER "BOLT/Tests")
 
 function(add_bolt_unittest test_dirname)
   add_unittest(BoltUnitTests ${test_dirname} ${ARGN})

>From ad704f8babf3c065d928329bf6f663b995f7323e Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 21 May 2024 22:05:54 +0200
Subject: [PATCH 2/2] Finetune BOLT folders

---
 bolt/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bolt/CMakeLists.txt b/bolt/CMakeLists.txt
index 26df6a4208b7a..3c1fe967d6597 100644
--- a/bolt/CMakeLists.txt
+++ b/bolt/CMakeLists.txt
@@ -123,7 +123,7 @@ option(BOLT_BUILD_TOOLS
   "Build the BOLT tools. If OFF, just generate build targets." ON)
 
 add_custom_target(bolt)
-set_target_properties(bolt PROPERTIES FOLDER "BOLT")
+set_target_properties(bolt PROPERTIES FOLDER "BOLT/Meta")
 add_llvm_install_targets(install-bolt DEPENDS bolt COMPONENT bolt)
 
 include_directories(

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang] Revise IDE folder structure (PR #89745)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/89745

>From 90d0d0f3bed2d826dc38e962a7a9140bf2ff3615 Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:13:53 +0200
Subject: [PATCH 1/2] [flang] Revise IDE folder structure

---
 flang/CMakeLists.txt | 3 ++-
 flang/cmake/modules/AddFlang.cmake   | 3 +--
 flang/docs/CMakeLists.txt| 2 +-
 flang/include/flang/Optimizer/Dialect/CMakeLists.txt | 2 ++
 flang/runtime/CMakeLists.txt | 5 +
 flang/test/CMakeLists.txt| 3 ++-
 flang/tools/f18/CMakeLists.txt   | 1 +
 flang/unittests/CMakeLists.txt   | 3 ++-
 flang/unittests/Evaluate/CMakeLists.txt  | 1 +
 9 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt
index c8e75024823f2..3bc4b5dd10c0e 100644
--- a/flang/CMakeLists.txt
+++ b/flang/CMakeLists.txt
@@ -1,4 +1,5 @@
 cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "Flang")
 
 if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
   set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -481,7 +482,7 @@ endif()
 
 # Custom target to install Flang libraries.
 add_custom_target(flang-libraries)
-set_target_properties(flang-libraries PROPERTIES FOLDER "Misc")
+set_target_properties(flang-libraries PROPERTIES FOLDER "Flang/Meta")
 
 if (NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-flang-libraries
diff --git a/flang/cmake/modules/AddFlang.cmake 
b/flang/cmake/modules/AddFlang.cmake
index 41ce8738e7bf2..3a5119b83831f 100644
--- a/flang/cmake/modules/AddFlang.cmake
+++ b/flang/cmake/modules/AddFlang.cmake
@@ -94,13 +94,12 @@ function(add_flang_library name)
 add_custom_target(${name})
   endif()
 
-  set_target_properties(${name} PROPERTIES FOLDER "Flang libraries")
+  set_target_properties(${name} PROPERTIES FOLDER "Flang/Libraries")
   set_flang_windows_version_resource_properties(${name})
 endfunction(add_flang_library)
 
 macro(add_flang_executable name)
   add_llvm_executable(${name} ${ARGN})
-  set_target_properties(${name} PROPERTIES FOLDER "Flang executables")
   set_flang_windows_version_resource_properties(${name})
 endmacro(add_flang_executable)
 
diff --git a/flang/docs/CMakeLists.txt b/flang/docs/CMakeLists.txt
index 3414b8e3acc46..3e4883e881ffa 100644
--- a/flang/docs/CMakeLists.txt
+++ b/flang/docs/CMakeLists.txt
@@ -79,7 +79,7 @@ if (LLVM_ENABLE_DOXYGEN)
 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 COMMENT "Generating flang doxygen documentation." VERBATIM)
-
+  set_target_properties(doxygen-flang PROPERTIES FOLDER "Flang/Docs")
   if (LLVM_BUILD_DOCS)
add_dependencies(doxygen doxygen-flang)
   endif()
diff --git a/flang/include/flang/Optimizer/Dialect/CMakeLists.txt 
b/flang/include/flang/Optimizer/Dialect/CMakeLists.txt
index f00993d4d3778..203ac212d3ccf 100644
--- a/flang/include/flang/Optimizer/Dialect/CMakeLists.txt
+++ b/flang/include/flang/Optimizer/Dialect/CMakeLists.txt
@@ -31,6 +31,7 @@ mlir_tablegen(CanonicalizationPatterns.inc -gen-rewriters)
 add_public_tablegen_target(CanonicalizationPatternsIncGen)
 
 add_custom_target(flang-doc)
+set_target_properties(flang-doc PROPERTIES FOLDER "Flang/Meta")
 set(dialect_doc_filename "FIRLangRef")
 
 set(LLVM_TARGET_DEFINITIONS FIROps.td)
@@ -43,4 +44,5 @@ add_custom_command(
 ${GEN_DOC_FILE}
 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${dialect_doc_filename}.md)
 add_custom_target(${dialect_doc_filename}DocGen DEPENDS ${GEN_DOC_FILE})
+set_target_properties(${dialect_doc_filename}DocGen PROPERTIES FOLDER 
"Flang/Docs")
 add_dependencies(flang-doc ${dialect_doc_filename}DocGen)
diff --git a/flang/runtime/CMakeLists.txt b/flang/runtime/CMakeLists.txt
index bdd0e07bbfd4d..eaa79851046c6 100644
--- a/flang/runtime/CMakeLists.txt
+++ b/flang/runtime/CMakeLists.txt
@@ -269,21 +269,26 @@ else()
 LINK_LIBS
 FortranDecimal.static
 INSTALL_WITH_TOOLCHAIN)
+  set_target_properties(FortranRuntime.static PROPERTIES FOLDER "Flang/Runtime 
Libraries")
   set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
   add_flang_library(FortranRuntime.dynamic ${sources}
 LINK_LIBS
 FortranDecimal.dynamic
 INSTALL_WITH_TOOLCHAIN)
+  set_target_properties(FortranRuntime.dynamic PROPERTIES FOLDER 
"Flang/Runtime Libraries")
   set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDebug)
   add_flang_library(FortranRuntime.static_dbg ${sources}
 LINK_LIBS
 FortranDecimal.static_dbg
 INSTALL_WITH_TOOLCHAIN)
+  set_target_properties(FortranRuntime.static_dbg PROPERTIES FOLDER 
"Flang/Runtime Libraries")
   set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDebugDLL)
   add_flang_library(FortranRuntime.dynamic_dbg ${sources}
 LINK_LIBS
 FortranDecimal.dynamic_dbg
 INSTALL_WITH_TOOLCHAIN)
+ 

  1   2   3   4   5   >