This is an archive of the discontinued LLVM Phabricator instance.

[X86] Fix a bug in TEST with immediate creation
ClosedPublic

Authored by craig.topper on Jul 22 2021, 11:28 PM.

Details

Summary

This code tries to form a TEST from CMP+AND with an optional
truncate in between. If we looked through the truncate, we may
have extra bits in the AND mask that shouldn't participate in
the checks. Normally SimplifyDemendedBits takes care of this, but
the AND may have another user. So manually mask out any extra bits.

Fixes PR51175.

Diff Detail

Event Timeline

craig.topper created this revision.Jul 22 2021, 11:28 PM
craig.topper requested review of this revision.Jul 22 2021, 11:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2021, 11:28 PM
pengfei accepted this revision.Jul 23 2021, 12:13 AM

I believe we do need a mask here. LGTM.

This revision is now accepted and ready to land.Jul 23 2021, 12:13 AM
RKSimon accepted this revision.Jul 23 2021, 2:10 AM

LGTM

This revision was landed with ongoing or failed builds.Jul 23 2021, 9:04 AM
This revision was automatically updated to reflect the committed changes.