This is an archive of the discontinued LLVM Phabricator instance.

[InstSimplify] with logical ops: (X & Y) == -1 ? X : -1 --> -1
ClosedPublic

Authored by Allen on Apr 25 2023, 8:08 PM.

Details

Summary

Use simplifySelectWithICmpEq to handle the implied equalities from the icmp-and,
then both of ICMP_NE and ICMP_EQ will be addressed including vector type.

(X & Y) == -1 ?  X : -1 --> -1 (commuted 2 ways)
(X & Y) != -1 ? -1 :  X --> -1 (commuted 2 ways)

This is a supplement to the icmp-or scenario on D148986.

Diff Detail

Event Timeline

Allen created this revision.Apr 25 2023, 8:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2023, 8:08 PM
Allen requested review of this revision.Apr 25 2023, 8:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2023, 8:08 PM
nikic accepted this revision.Apr 26 2023, 12:23 AM

LGTM

This revision is now accepted and ready to land.Apr 26 2023, 12:23 AM
This revision was landed with ongoing or failed builds.Apr 26 2023, 12:57 AM
This revision was automatically updated to reflect the committed changes.