[flang-commits] [flang] [flang][openacc] Do not loose attributes on folding (PR #80516)

Valentin Clement バレンタイン クレメン via flang-commits flang-commits at lists.llvm.org
Fri Feb 2 16:42:37 PST 2024


================
@@ -36,6 +37,18 @@ namespace {
 #include "flang/Optimizer/Dialect/CanonicalizationPatterns.inc"
 } // namespace
 
+static void propagateAttributes(mlir::Operation *fromOp,
+                                mlir::Operation *toOp) {
+  if (!fromOp || !toOp)
+    return;
+
+  for (mlir::NamedAttribute attr : fromOp->getAttrs()) {
+    if (attr.getName().str().rfind(
----------------
clementval wrote:

I might have overlooked it but std::string does not have `start_with`?


https://github.com/llvm/llvm-project/pull/80516


More information about the flang-commits mailing list