[IR] Add an ImplicitLocOpBuilder helper class for building IR with the same loc.
One common situation is to create a lot of IR at a well known location, e.g. when doing a big rewrite from one dialect to another where you're expanding ops out into lots of other ops. For these sorts of situations, it is annoying to pass the location into every create call. As we discused in a few threads on the forum, a way to help with this is to produce a new sort of builder that holds a location and provides it to each of the create<> calls automatically. This patch implements an ImplicitLocOpBuilder class that does this. We've had good experience with this in the CIRCT project, and it makes sense to upstream to MLIR. I picked a random pass to adopt it to show the impact, but I don't think there is any particular need to force adopt it in the codebase. Differential Revision: https://reviews.llvm.org/D93717
Loading
Please sign in to comment