This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Method for evaluation of FCmpInst for constant operands
ClosedPublic

Authored by sepavloff on Dec 22 2021, 8:02 AM.

Details

Summary

New method FCmpInst::compare is added, which evaluates the given
compare predicate for constant operands. Interface is made similar to
ICmpInst::compare.

Diff Detail

Event Timeline

sepavloff created this revision.Dec 22 2021, 8:02 AM
sepavloff requested review of this revision.Dec 22 2021, 8:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2021, 8:02 AM
nikic accepted this revision.Dec 23 2021, 12:06 AM

LG

llvm/lib/IR/ConstantFold.cpp
1804–1805

It's pretty weird that this function accepts the predicate as unsigned short. Would be great to switch it to CmpInst::Predicate (separately).

This revision is now accepted and ready to land.Dec 23 2021, 12:06 AM
This revision was landed with ongoing or failed builds.Dec 25 2021, 3:22 AM
This revision was automatically updated to reflect the committed changes.
sepavloff added inline comments.Dec 29 2021, 9:27 AM
llvm/lib/IR/ConstantFold.cpp
1804–1805

The patch is here: D116379.