This is an archive of the discontinued LLVM Phabricator instance.

[mlir][NFC] Move asOpFoldResult helper functions to StaticValueUtils
ClosedPublic

Authored by springerm on Jul 7 2021, 7:02 PM.

Diff Detail

Event Timeline

springerm created this revision.Jul 7 2021, 7:02 PM
springerm requested review of this revision.Jul 7 2021, 7:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2021, 7:02 PM
rriddle requested changes to this revision.Jul 7 2021, 7:32 PM
rriddle added inline comments.
mlir/include/mlir/Dialect/Utils/StaticValueUtils.h
47

Same comment here as below.

51

The name here feels much more general than the description.

mlir/lib/Dialect/Utils/StaticValueUtils.cpp
53

This looks quite weird, why not use m_Constant here.

This revision now requires changes to proceed.Jul 7 2021, 7:32 PM
rriddle added inline comments.Jul 7 2021, 7:35 PM
mlir/lib/Dialect/Utils/StaticValueUtils.cpp
53

I see, the name of this function led me to believe this was a general utility.

rriddle added inline comments.Jul 7 2021, 7:41 PM
mlir/include/mlir/Dialect/Utils/StaticValueUtils.h
51

Can you rename these to something closer to what they do, or update the behavior to be as general as the current name?

springerm updated this revision to Diff 357124.Jul 7 2021, 8:16 PM
springerm marked 5 inline comments as done.

address comments

Updated function implementation to match all kind of constants.

rriddle accepted this revision.Jul 13 2021, 12:42 PM

I almost think these should be in IR/ next to (or inside of) OpFoldResult, but here is alright for now. Thanks!

This revision is now accepted and ready to land.Jul 13 2021, 12:42 PM
This revision was landed with ongoing or failed builds.Jul 14 2021, 6:34 PM
This revision was automatically updated to reflect the committed changes.