This is an archive of the discontinued LLVM Phabricator instance.

[X86] Fix `FindSingleBitChange` to handle NOT(V) where V is not an Instruction
ClosedPublic

Authored by goldstein.w.n on Jan 23 2023, 2:35 AM.

Details

Summary

Was previously buggy to assume that NOT'd Value was always an
instruction. If the NOT'd value is not an Instruction, we should just
return as its either a constant, in which can we will re-run the logic
after constant-folding, or its a type we can't evaluate anyways.

This is a follow up to: D140939

Diff Detail

Event Timeline

goldstein.w.n created this revision.Jan 23 2023, 2:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2023, 2:35 AM
goldstein.w.n requested review of this revision.Jan 23 2023, 2:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2023, 2:35 AM
  1. Verified that all the tests failed before this commit (and pass afterwards).
  2. Is revert of D140939 and D142166 preferable? I've already swung and missed so LMK if it's better.
pengfei accepted this revision.Jan 23 2023, 2:49 AM

Thanks for the fix! I think you can quick land this to solve the problem. I don't see any difference if revert the previous patch and then reland with this diff.

This revision is now accepted and ready to land.Jan 23 2023, 2:49 AM
RKSimon accepted this revision.Jan 23 2023, 2:56 AM

LGTM

Thanks for the fix! I think you can quick land this to solve the problem. I don't see any difference if revert the previous patch and then reland with this diff.

Thanks, will push shortly.

This revision was landed with ongoing or failed builds.Jan 23 2023, 3:46 AM
This revision was automatically updated to reflect the committed changes.