This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Teach computeKnownBits that a nsw self multiply produce a positive value.
ClosedPublic

Authored by craig.topper on Jun 8 2022, 12:29 PM.

Details

Summary

This matches what we do in IR. For the RISC-V test case, this allows
us to use -8 for the AND mask instead of materializing a constant in a register.

Diff Detail

Event Timeline

craig.topper created this revision.Jun 8 2022, 12:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2022, 12:29 PM
craig.topper requested review of this revision.Jun 8 2022, 12:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2022, 12:29 PM
spatel accepted this revision.Jun 8 2022, 12:41 PM

LGTM

llvm/test/CodeGen/RISCV/rv64i-demanded-bits.ll
29

typo: convert

This revision is now accepted and ready to land.Jun 8 2022, 12:41 PM
This revision was landed with ongoing or failed builds.Jun 8 2022, 2:56 PM
This revision was automatically updated to reflect the committed changes.