[Mlir-commits] [mlir] [mlir][OpenMP] inscan reduction modifier and scan op mlir support (PR #114737)

Tom Eccles llvmlistbot at llvm.org
Wed Jan 8 02:31:12 PST 2025


================
@@ -1560,6 +1560,26 @@ def CancellationPointOp : OpenMP_Op<"cancellation_point", clauses = [
   let hasVerifier = 1;
 }
 
+def ScanOp : OpenMP_Op<"scan", [
----------------
tblah wrote:

Yeah I guess giving the scan memory effects could work. I can't think of a reason off the top of my head why @skatrak's suggestion to use the memory effects only on the exclusive/inclusive arguments wouldn't work.

But just to be safe I would probably do the initial implementation saying it has some broadly specified memory effects. If we follow the recommendations for modelling syscalls given [here](https://mlir.llvm.org/docs/Rationale/SideEffectsAndSpeculation/), I think that should ensure that any observable effects before the scan must stay before (and vice versa). 

So it would be modeled a bit like

```
input phase code;
write(1, "I am a scan statement.\n", 23);
output phase code;
```

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


More information about the Mlir-commits mailing list