Page MenuHomePhabricator

[InstCombine] [NFC] separate a function foldICmpBinOpWithConstant
ClosedPublic

Authored by Chenbing.Zheng on Thu, May 12, 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.Thu, May 12, 2:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptThu, May 12, 2:25 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Chenbing.Zheng requested review of this revision.Thu, May 12, 2:25 AM
spatel accepted this revision.Thu, May 12, 5:33 AM

LGTM

This revision is now accepted and ready to land.Thu, May 12, 5:33 AM
RKSimon added inline comments.Thu, May 12, 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.Thu, May 12, 6:25 AM

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

This revision now requires changes to proceed.Thu, May 12, 6:25 AM
Chenbing.Zheng marked an inline comment as done.Thu, May 12, 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.Fri, May 13, 7:01 AM

LGTM

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