This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][OpenMP] Place alloca scope within wsloop in scf.parallel to omp lowering
ClosedPublic

Authored by wsmoses on Mar 1 2022, 2:04 PM.

Details

Summary

https://reviews.llvm.org/D120423 replaced the use of stacksave/restore with memref.alloca_scope, but kept the save/restore at the same location. This PR places the allocation scope within the wsloop, thus keeping the same allocation scope as the original scf.parallel (e.g. no longer over stack allocating).

Diff Detail

Event Timeline

wsmoses created this revision.Mar 1 2022, 2:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 1 2022, 2:04 PM
wsmoses requested review of this revision.Mar 1 2022, 2:04 PM
ftynse added inline comments.Mar 2 2022, 9:09 AM
mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp
406–407

Splice doesn't work well with patterns, consider something like rewriter.mergeBlocks instead.

wsmoses updated this revision to Diff 412454.Mar 2 2022, 9:26 AM

Use mergeBlock

ftynse accepted this revision.Mar 2 2022, 9:30 AM
This revision is now accepted and ready to land.Mar 2 2022, 9:30 AM