This is an archive of the discontinued LLVM Phabricator instance.

[IR] Export ConstantFold.h header (NFC)
ClosedPublic

Authored by nikic on Jun 20 2022, 8:45 AM.

Details

Summary

This is in preparation for https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179. As part of that change, we'll want to invoke some of these constant folding APIs explicitly, as it won't happen as part of ConstantExpr::getXYZ() anymore.

Ideally, we'd merge these with the DL-aware constant folding APIs and only call those, but this is not easily possible for some current usages (most important IRBuilder, which uses DL-independent constant folding by default, and some major layering changes would be needed to change that).

This is basically a reboot of D115035 with different motivation.

Diff Detail

Event Timeline

nikic created this revision.Jun 20 2022, 8:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 20 2022, 8:45 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
nikic requested review of this revision.Jun 20 2022, 8:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 20 2022, 8:45 AM
nhaehnle accepted this revision.Jun 21 2022, 3:34 AM
nhaehnle added a subscriber: nhaehnle.

LGTM

This revision is now accepted and ready to land.Jun 21 2022, 3:34 AM
This revision was landed with ongoing or failed builds.Jun 23 2022, 2:32 AM
This revision was automatically updated to reflect the committed changes.
mib added a subscriber: mib.Jun 23 2022, 11:59 AM

@nikic this broke the lldb macOS bot because you didn't update the module map. 148071fbae3f9a1015969376a75a47d433c49a13 should fix that.