This is an archive of the discontinued LLVM Phabricator instance.

[ConstraintElimination] Refactor `checkAndReplaceCondition` (NFC)
ClosedPublic

Authored by antoniofrighetto on Jun 5 2023, 4:01 AM.

Details

Reviewers
fhahn
Summary

Handling true and false constant replacements is now abstracted out into a single lambda function ReplaceCmpWithConstant, so as to reduce code duplication.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJun 5 2023, 4:01 AM
antoniofrighetto requested review of this revision.Jun 5 2023, 4:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 5 2023, 4:01 AM
fhahn accepted this revision.Jun 5 2023, 5:54 AM

LGTM, thanks! Could you also update llvm/test/Transforms/ConstraintElimination/debug.ll to check printing the negated form?

This revision is now accepted and ready to land.Jun 5 2023, 5:54 AM
nikic added a subscriber: nikic.Jun 5 2023, 6:09 AM
nikic added inline comments.
llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
967–970