This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] Improve `computeKnownBits` implementations of `sdiv` and `udiv`
ClosedPublic

Authored by goldstein.w.n on May 7 2023, 11:58 PM.

Details

Summary

Add exact flag handling for udiv and add entire sdiv case.

Diff Detail

Event Timeline

goldstein.w.n created this revision.May 7 2023, 11:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 7 2023, 11:58 PM
goldstein.w.n requested review of this revision.May 7 2023, 11:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 7 2023, 11:58 PM
RKSimon accepted this revision.May 8 2023, 3:33 AM

LGTM

This revision is now accepted and ready to land.May 8 2023, 3:33 AM

Causes regression in ARM

goldstein.w.n added inline comments.
llvm/test/CodeGen/ARM/select-imm.ll
660

@RKSimon this ends up causing a regression. Had only run x86 backend tests by mistake earlier. @t.p.northover is this acceptable for you guys? The change here is just adding more information to computeKnownBits so a regression in ARM backend likely means there is buggy/flakey fold.

goldstein.w.n added inline comments.May 13 2023, 10:47 AM
llvm/test/CodeGen/ARM/select-imm.ll
660

I'm going to assume this is okay. The middle end would never produce the IR (it constant evaluates to true).

This revision was landed with ongoing or failed builds.May 16 2023, 4:59 PM
This revision was automatically updated to reflect the committed changes.