This is an archive of the discontinued LLVM Phabricator instance.

[ConstantFolding] Fold freeze if it is never undef or poison
ClosedPublic

Authored by aqjune on Jul 26 2020, 5:12 AM.

Details

Summary

This is a simple patch that adds constant folding for freeze
instruction.

IIUC, it isn't needed to update ConstantFold.cpp because there is no freeze
constexpr.

Diff Detail

Event Timeline

aqjune created this revision.Jul 26 2020, 5:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 26 2020, 5:12 AM
nikic accepted this revision.Jul 26 2020, 5:46 AM

LGTM

llvm/lib/Analysis/ConstantFolding.cpp
1073

I'd move this below the llvm_unreachable case for compares.

This revision is now accepted and ready to land.Jul 26 2020, 5:46 AM
aqjune updated this revision to Diff 280721.Jul 26 2020, 5:54 AM

Move the added check below compares

This revision was automatically updated to reflect the committed changes.