[Mlir-commits] [mlir] [mlir][OpenMP] inscan reduction modifier and scan op mlir support (PR #114737)
Tom Eccles
llvmlistbot at llvm.org
Tue Dec 10 12:18:55 PST 2024
================
@@ -1560,6 +1560,26 @@ def CancellationPointOp : OpenMP_Op<"cancellation_point", clauses = [
let hasVerifier = 1;
}
+def ScanOp : OpenMP_Op<"scan", [
----------------
tblah wrote:
Overall I like @skatrak's proposal
The examples for inclusive scans [here](https://xinyaoyi.github.io/OpenMPProgrammingBookTest/contents/Chap_data_environment/10_scan_Directive.html) seem to indicate that we will need to allow yielding values from the `pre` to the `post` region.
As for whether we should allow non-terminators after (or before) the omp.scan, the language used in the standard is `structured block sequence`. I think that would mean that even if there are multiple structured blocks, all of those would still become logically part of the `scan` and so all operations before the scan should be in the `pre` and all after should be in the `post` region.
As for common subexpression hoisting, I think this is safe if an expression is hoisted all of the way out of the loop (because then it must not have any side effects or depend upon the loop iteration). I'm unsure about putting it before the scan inside of the loop. It would probably easier to generate the LLVMIR if this was not allowed.
https://github.com/llvm/llvm-project/pull/114737
More information about the Mlir-commits
mailing list