[Lldb-commits] [PATCH] D130822: Fixed loads of typos

2022-12-07 Thread Valentin Clement via Phabricator via lldb-commits
clementval requested changes to this revision.
clementval added inline comments.
This revision now requires changes to proceed.



Comment at: flang/docs/Extensions.md:157
   with each other.
-* Values for whole anonymous parent components in structure constructors
   (e.g., `EXTENDEDTYPE(PARENTTYPE(1,2,3))` rather than `EXTENDEDTYPE(1,2,3)`

This is just wrong


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130822/new/

https://reviews.llvm.org/D130822

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


[Lldb-commits] [PATCH] D145183: [libc++] Implement `stop_token`

2023-05-22 Thread Valentin Clement via Phabricator via lldb-commits
clementval added a comment.
Herald added a subscriber: JDevlieghere.

Something seems wrong with this patch. It contains multiple unrelated changes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145183/new/

https://reviews.llvm.org/D145183

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


[Lldb-commits] [PATCH] D87389: [flang][openacc] Lower clauses on loop construct to OpenACC dialect

2020-09-09 Thread Valentin Clement via Phabricator via lldb-commits
clementval created this revision.
clementval added reviewers: sscalpone, schweitz, jeanPerier, DavidTruby, 
jdoerfert.
Herald added subscribers: lldb-commits, rriddle.
Herald added a project: LLDB.
clementval requested review of this revision.
Herald added subscribers: stephenneuendorffer, JDevlieghere.

Lower OpenACCLoopConstruct and most of the clauses to the OpenACC acc.loop 
operation in MLIR.
This patch refelcts what can be upstream from PR 
flang-compiler/f18-llvm-project#419


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87389

Files:
  flang/include/flang/Optimizer/Dialect/FIRDialect.h
  flang/lib/Lower/OpenACC.cpp
  lldb/tools/lldb-vscode/VSCode.cpp

Index: lldb/tools/lldb-vscode/VSCode.cpp
===
--- lldb/tools/lldb-vscode/VSCode.cpp
+++ lldb/tools/lldb-vscode/VSCode.cpp
@@ -38,8 +38,8 @@
{"swift_catch", "Swift Catch", lldb::eLanguageTypeSwift},
{"swift_throw", "Swift Throw", lldb::eLanguageTypeSwift}}),
   focus_tid(LLDB_INVALID_THREAD_ID), sent_terminated_event(false),
-  stop_at_entry(false), is_attach(false),
-  reverse_request_seq(0), waiting_for_run_in_terminal(false) {
+  stop_at_entry(false), is_attach(false), reverse_request_seq(0),
+  waiting_for_run_in_terminal(false) {
   const char *log_file_path = getenv("LLDBVSCODE_LOG");
 #if defined(_WIN32)
   // Windows opens stdout and stdin in text mode which converts \n to 13,10
Index: flang/lib/Lower/OpenACC.cpp
===
--- flang/lib/Lower/OpenACC.cpp
+++ flang/lib/Lower/OpenACC.cpp
@@ -11,16 +11,202 @@
 //===--===//
 
 #include "flang/Lower/OpenACC.h"
+#include "flang/Common/idioms.h"
 #include "flang/Lower/Bridge.h"
 #include "flang/Lower/FIRBuilder.h"
 #include "flang/Lower/PFTBuilder.h"
 #include "flang/Parser/parse-tree.h"
+#include "flang/Semantics/tools.h"
+#include "mlir/Dialect/OpenACC/OpenACC.h"
 #include "llvm/Frontend/OpenACC/ACC.h.inc"
 
 #define TODO() llvm_unreachable("not yet implemented")
 
+static const Fortran::parser::Name *
+GetDesignatorNameIfDataRef(const Fortran::parser::Designator &designator) {
+  const auto *dataRef{std::get_if(&designator.u)};
+  return dataRef ? std::get_if(&dataRef->u) : nullptr;
+}
+
+static void genObjectList(const Fortran::parser::AccObjectList &objectList,
+  Fortran::lower::AbstractConverter &converter,
+  std::int32_t &objectsCount,
+  SmallVector &operands) {
+  for (const auto &accObject : objectList.v) {
+std::visit(
+Fortran::common::visitors{
+[&](const Fortran::parser::Designator &designator) {
+  if (const auto *name = GetDesignatorNameIfDataRef(designator)) {
+++objectsCount;
+const auto variable = converter.getSymbolAddress(*name->symbol);
+operands.push_back(variable);
+  }
+},
+[&](const Fortran::parser::Name &name) {
+  ++objectsCount;
+  const auto variable = converter.getSymbolAddress(*name.symbol);
+  operands.push_back(variable);
+}},
+accObject.u);
+  }
+}
+
+static void genACC(Fortran::lower::AbstractConverter &converter,
+   Fortran::lower::pft::Evaluation &eval,
+   const Fortran::parser::OpenACCLoopConstruct &loopConstruct) {
+
+  const auto &beginLoopDirective =
+  std::get(loopConstruct.t);
+  const auto &loopDirective =
+  std::get(beginLoopDirective.t);
+
+  if (loopDirective.v == llvm::acc::ACCD_loop) {
+auto &firOpBuilder = converter.getFirOpBuilder();
+auto currentLocation = converter.getCurrentLocation();
+llvm::ArrayRef argTy;
+
+// Add attribute extracted from clauses.
+const auto &accClauseList =
+std::get(beginLoopDirective.t);
+
+mlir::Value workerNum;
+mlir::Value vectorLength;
+mlir::Value gangNum;
+mlir::Value gangStatic;
+std::int32_t tileOperands = 0;
+std::int32_t privateOperands = 0;
+std::int32_t reductionOperands = 0;
+std::int64_t executionMapping = mlir::acc::OpenACCExecMapping::NONE;
+SmallVector operands;
+
+// Lower clauses values mapped to operands.
+for (const auto &clause : accClauseList.v) {
+  if (const auto *gangClause =
+  std::get_if(&clause.u)) {
+if (gangClause->v) {
+  const Fortran::parser::AccGangArgument &x = *gangClause->v;
+  if (const auto &gangNumValue =
+  std::get>(
+  x.t)) {
+gangNum = converter.genExprValue(
+*Fortran::semantics::GetExpr(gangNumValue.value()));
+operands.push_back(gangNum);
+  }
+  if (const auto &gangStaticValue =
+  std::get>(x.t)) {
+const au

[Lldb-commits] [PATCH] D87389: [flang][openacc] Lower clauses on loop construct to OpenACC dialect

2020-09-09 Thread Valentin Clement via Phabricator via lldb-commits
clementval added inline comments.



Comment at: lldb/tools/lldb-vscode/VSCode.cpp:41
   focus_tid(LLDB_INVALID_THREAD_ID), sent_terminated_event(false),
-  stop_at_entry(false), is_attach(false),
-  reverse_request_seq(0), waiting_for_run_in_terminal(false) {
+  stop_at_entry(false), is_attach(false), reverse_request_seq(0),
+  waiting_for_run_in_terminal(false) {

teemperor wrote:
> Unrelated reformatting?
Sure it shouldn't be here. I'll remove it. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87389/new/

https://reviews.llvm.org/D87389

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


[Lldb-commits] [PATCH] D87389: [flang][openacc] Lower clauses on loop construct to OpenACC dialect

2020-09-10 Thread Valentin Clement via Phabricator via lldb-commits
clementval updated this revision to Diff 290770.
clementval added a comment.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Remove unrelated changes


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87389/new/

https://reviews.llvm.org/D87389

Files:
  flang/include/flang/Optimizer/Dialect/FIRDialect.h
  flang/lib/Lower/OpenACC.cpp

Index: flang/lib/Lower/OpenACC.cpp
===
--- flang/lib/Lower/OpenACC.cpp
+++ flang/lib/Lower/OpenACC.cpp
@@ -11,16 +11,202 @@
 //===--===//
 
 #include "flang/Lower/OpenACC.h"
+#include "flang/Common/idioms.h"
 #include "flang/Lower/Bridge.h"
 #include "flang/Lower/FIRBuilder.h"
 #include "flang/Lower/PFTBuilder.h"
 #include "flang/Parser/parse-tree.h"
+#include "flang/Semantics/tools.h"
+#include "mlir/Dialect/OpenACC/OpenACC.h"
 #include "llvm/Frontend/OpenACC/ACC.h.inc"
 
 #define TODO() llvm_unreachable("not yet implemented")
 
+static const Fortran::parser::Name *
+GetDesignatorNameIfDataRef(const Fortran::parser::Designator &designator) {
+  const auto *dataRef{std::get_if(&designator.u)};
+  return dataRef ? std::get_if(&dataRef->u) : nullptr;
+}
+
+static void genObjectList(const Fortran::parser::AccObjectList &objectList,
+  Fortran::lower::AbstractConverter &converter,
+  std::int32_t &objectsCount,
+  SmallVector &operands) {
+  for (const auto &accObject : objectList.v) {
+std::visit(
+Fortran::common::visitors{
+[&](const Fortran::parser::Designator &designator) {
+  if (const auto *name = GetDesignatorNameIfDataRef(designator)) {
+++objectsCount;
+const auto variable = converter.getSymbolAddress(*name->symbol);
+operands.push_back(variable);
+  }
+},
+[&](const Fortran::parser::Name &name) {
+  ++objectsCount;
+  const auto variable = converter.getSymbolAddress(*name.symbol);
+  operands.push_back(variable);
+}},
+accObject.u);
+  }
+}
+
+static void genACC(Fortran::lower::AbstractConverter &converter,
+   Fortran::lower::pft::Evaluation &eval,
+   const Fortran::parser::OpenACCLoopConstruct &loopConstruct) {
+
+  const auto &beginLoopDirective =
+  std::get(loopConstruct.t);
+  const auto &loopDirective =
+  std::get(beginLoopDirective.t);
+
+  if (loopDirective.v == llvm::acc::ACCD_loop) {
+auto &firOpBuilder = converter.getFirOpBuilder();
+auto currentLocation = converter.getCurrentLocation();
+llvm::ArrayRef argTy;
+
+// Add attribute extracted from clauses.
+const auto &accClauseList =
+std::get(beginLoopDirective.t);
+
+mlir::Value workerNum;
+mlir::Value vectorLength;
+mlir::Value gangNum;
+mlir::Value gangStatic;
+std::int32_t tileOperands = 0;
+std::int32_t privateOperands = 0;
+std::int32_t reductionOperands = 0;
+std::int64_t executionMapping = mlir::acc::OpenACCExecMapping::NONE;
+SmallVector operands;
+
+// Lower clauses values mapped to operands.
+for (const auto &clause : accClauseList.v) {
+  if (const auto *gangClause =
+  std::get_if(&clause.u)) {
+if (gangClause->v) {
+  const Fortran::parser::AccGangArgument &x = *gangClause->v;
+  if (const auto &gangNumValue =
+  std::get>(
+  x.t)) {
+gangNum = converter.genExprValue(
+*Fortran::semantics::GetExpr(gangNumValue.value()));
+operands.push_back(gangNum);
+  }
+  if (const auto &gangStaticValue =
+  std::get>(x.t)) {
+const auto &expr =
+std::get>(
+gangStaticValue.value().t);
+if (expr) {
+  gangStatic =
+  converter.genExprValue(*Fortran::semantics::GetExpr(*expr));
+} else {
+  // * was passed as value and will be represented as a -1 constant
+  // integer.
+  gangStatic = firOpBuilder.createIntegerConstant(
+  currentLocation, firOpBuilder.getIntegerType(32),
+  /* STAR */ -1);
+}
+operands.push_back(gangStatic);
+  }
+}
+executionMapping |= mlir::acc::OpenACCExecMapping::GANG;
+  } else if (const auto *workerClause =
+ std::get_if(
+ &clause.u)) {
+if (workerClause->v) {
+  workerNum = converter.genExprValue(
+  *Fortran::semantics::GetExpr(*workerClause->v));
+  operands.push_back(workerNum);
+}
+executionMapping |= mlir::acc::OpenACCExecMapping::WORKER;
+  } else if (const auto *ve