Page MenuHomePhabricator

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

Authored by aqjune on Sun, Jul 26, 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.Sun, Jul 26, 5:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptSun, Jul 26, 5:12 AM
nikic accepted this revision.Sun, Jul 26, 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.Sun, Jul 26, 5:46 AM
aqjune updated this revision to Diff 280721.Sun, Jul 26, 5:54 AM

Move the added check below compares

This revision was automatically updated to reflect the committed changes.