This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Implied conditions for lshr
ClosedPublic

Authored by caojoshua on May 26 2023, 1:20 AM.

Details

Summary

V1 >> V2 u<= V1 for any V1, V2

This works for lshr and any div's that are changed to lshr's

This fixes issues in clang and rustc:
https://github.com/llvm/llvm-project/issues/62441
https://github.com/rust-lang/rust/issues/110971

Diff Detail

Event Timeline

caojoshua created this revision.May 26 2023, 1:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2023, 1:20 AM

I've confirmed this fixes the clang issue. Not sure how to test for rustc, but it should fix based on what I'm seeing in the IR.

caojoshua published this revision for review.May 26 2023, 1:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2023, 1:53 AM
This revision is now accepted and ready to land.Jun 6 2023, 9:41 AM
This revision was landed with ongoing or failed builds.Jun 6 2023, 9:08 PM
This revision was automatically updated to reflect the committed changes.