This is an archive of the discontinued LLVM Phabricator instance.

[ConstraintElim] Remove dead compares after simplification.
ClosedPublic

Authored by fhahn on Aug 24 2023, 11:29 AM.

Details

Summary

Remove compares after replacing all uses. Cleaning dead compares can
enable additional simplifications when adjusting the position of the
pass slightly. In particular, it seems like the additional dead
instructions may prevent SimplifyCFG performing some folds.

Diff Detail

Event Timeline

fhahn created this revision.Aug 24 2023, 11:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2023, 11:29 AM
fhahn requested review of this revision.Aug 24 2023, 11:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2023, 11:29 AM
nikic accepted this revision.Aug 24 2023, 11:32 AM

LGTM

As a possible followup, we could use RecursivelyDeleteTriviallyDeadInstructions to also remove the instructions feeding the icmp.

This revision is now accepted and ready to land.Aug 24 2023, 11:32 AM
This revision was landed with ongoing or failed builds.Aug 24 2023, 2:13 PM
This revision was automatically updated to reflect the committed changes.
fhahn added a comment.Aug 24 2023, 2:14 PM

LGTM

As a possible followup, we could use RecursivelyDeleteTriviallyDeadInstructions to also remove the instructions feeding the icmp.

Can do!