This is an archive of the discontinued LLVM Phabricator instance.

[mlir][LLVM] NFC - Refactor a lookupOrCreateFn to reuse common function creation.
ClosedPublic

Authored by nicolasvasilache on Feb 11 2021, 4:13 AM.

Diff Detail

Event Timeline

nicolasvasilache requested review of this revision.Feb 11 2021, 4:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2021, 4:13 AM
ftynse accepted this revision.Feb 11 2021, 4:18 AM

I believe async lowering also needs this, but leaving for future work.

mlir/include/mlir/Dialect/LLVMIR/FunctionCallUtils.h
10

among

56

Also add funcs for malloc and free?

mlir/lib/Dialect/LLVMIR/IR/FunctionCallUtils.cpp
39

Nit: spurious empty line here and below

85–88

Nit: could we make something like b.getSymbolRefAttr(fn) into a variable to make this formatting look less horrible?

This revision is now accepted and ready to land.Feb 11 2021, 4:18 AM
nicolasvasilache marked 4 inline comments as done.

Address review.

Simplify constant exprs.

This revision was landed with ongoing or failed builds.Feb 11 2021, 7:56 AM
This revision was automatically updated to reflect the committed changes.