This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Strengthen analysis in `computeKnownBits` of phi
ClosedPublic

Authored by goldstein.w.n on Aug 12 2023, 6:29 PM.

Details

Summary

Use the comparison based analysis to strengthen the standard
knownbits analysis rather than choosing either/or.

Diff Detail

Event Timeline

goldstein.w.n created this revision.Aug 12 2023, 6:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2023, 6:29 PM
goldstein.w.n requested review of this revision.Aug 12 2023, 6:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2023, 6:29 PM
nikic requested changes to this revision.Aug 13 2023, 12:56 AM

This has substantial compile-time impact: https://llvm-compile-time-tracker.com/compare.php?from=9e515bce8a9a342ab29a8e0d3011e4985e4ec67e&to=3ea691cbae271f81cfb4ef4e3e8c6180c43d96d9&stat=instructions:u How to support computeKnownBits across phis is an open problem, but I don't think this is the solution.

This revision now requires changes to proceed.Aug 13 2023, 12:56 AM

Remove extra depth

goldstein.w.n edited the summary of this revision. (Show Details)Aug 13 2023, 10:33 AM

This has substantial compile-time impact: https://llvm-compile-time-tracker.com/compare.php?from=9e515bce8a9a342ab29a8e0d3011e4985e4ec67e&to=3ea691cbae271f81cfb4ef4e3e8c6180c43d96d9&stat=instructions:u How to support computeKnownBits across phis is an open problem, but I don't think this is the solution.

Yeah :( dropped the depth changed + replaced with NFC. Tried a few variants that where more conservative but they also have big impact.

nikic added a comment.Aug 14 2023, 2:55 AM

There are test failures.

nikic added inline comments.Aug 14 2023, 2:57 AM
llvm/lib/Analysis/ValueTracking.cpp
1463

limiter?

goldstein.w.n marked an inline comment as done.Aug 14 2023, 9:23 AM

There are test failures.

Bah sorry, test didn't autogen.

nikic accepted this revision.Aug 15 2023, 2:09 AM

LGTM

This revision is now accepted and ready to land.Aug 15 2023, 2:09 AM

Update missing test

This revision was landed with ongoing or failed builds.Aug 22 2023, 8:59 AM
This revision was automatically updated to reflect the committed changes.