This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] [NFC] separate a function foldICmpBinOpWithConstant
ClosedPublic

Authored by Chenbing.Zheng on May 12 2022, 2:25 AM.

Details

Summary

There is a long function foldICmpInstWithConstant,
we can separate a function foldICmpBinOpWithConstant from it.

Diff Detail

Event Timeline

Chenbing.Zheng created this revision.May 12 2022, 2:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2022, 2:25 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Chenbing.Zheng requested review of this revision.May 12 2022, 2:25 AM
spatel accepted this revision.May 12 2022, 5:33 AM

LGTM

This revision is now accepted and ready to land.May 12 2022, 5:33 AM
RKSimon added inline comments.May 12 2022, 6:09 AM
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
3337

@Chenbing.Zheng Is a return nullptr missing from the end of the function? Or just:

// TODO: These folds could be refactored to be part of the above calls.
return foldICmpBinOpEqualityWithConstant(Cmp, BO, C));
spatel requested changes to this revision.May 12 2022, 6:25 AM

@RKSimon spotted a bug (and that should have generated a compile warning too).

This revision now requires changes to proceed.May 12 2022, 6:25 AM
Chenbing.Zheng marked an inline comment as done.May 12 2022, 6:49 PM
Chenbing.Zheng added inline comments.
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
3337

yer, thanks for your advice. I have fixed it.

spatel accepted this revision.May 13 2022, 7:01 AM

LGTM

This revision is now accepted and ready to land.May 13 2022, 7:01 AM
This revision was landed with ongoing or failed builds.May 13 2022, 7:57 PM
This revision was automatically updated to reflect the committed changes.
Chenbing.Zheng marked an inline comment as done.