This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Affine] Add `MLIRContext` argument to `concatAffineMaps`.
AcceptedPublic

Authored by mravishankar on Nov 16 2022, 12:11 AM.

Details

Summary

Avoid segfault in concatAffineMaps, when the first map of the list
of maps to be concatenated is querried for the context. If no maps are
passed then this leads to a segfault. Pass the context explicitly and
return an empty map instead. This has a cascading effect where
context needs to be passed into many methods.

Depends D138096

Diff Detail

Event Timeline

mravishankar created this revision.Nov 16 2022, 12:11 AM
Herald added a reviewer: aartbik. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
mravishankar requested review of this revision.Nov 16 2022, 12:11 AM
nicolasvasilache accepted this revision.Dec 1 2022, 2:11 PM

Generally looks good, thanks Mahesh!
I flagged one place where it seems things could be simplified a bit

mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.h
37

Could we use the linalgOp to derive the context here and avoid passing it through this path and callers?

This revision is now accepted and ready to land.Dec 1 2022, 2:11 PM