================
@@ -1721,13 +1721,17 @@ mlir::LogicalResult 
CIRToLLVMLoadOpLowering::matchAndRewrite(
 
   // TODO: nontemporal.
   assert(!cir::MissingFeatures::opLoadStoreNontemporal());
-  std::optional<llvm::StringRef> syncScope =
-      getLLVMSyncScope(op.getSyncScope());
+
+  std::optional<std::string> llvmSyncScope;
+  if (std::optional<cir::SyncScopeKind> syncScope = op.getSyncScope())
+    llvmSyncScope =
+        lowerMod->getTargetLoweringInfo().getLLVMSyncScope(*syncScope);
----------------
andykaylor wrote:

I think a target lowering pass such as you are suggesting would be good. I 
would like to see calling convention handling implemented as a more general 
MLIR pass that could be shared with Flang (and any other MLIR-based front end), 
similar to the goals of the [ABI lowering 
library](https://discourse.llvm.org/t/rfc-an-abi-lowering-library-for-llvm/84495)
 that was started last year. @adams381 is going to be starting work on this 
very soon.

https://github.com/llvm/llvm-project/pull/173393
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to