This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Add tests for known bits after common BMI pattern (blsmsk/blsi); NFC
ClosedPublic

Authored by goldstein.w.n on Jan 20 2023, 9:10 PM.

Diff Detail

Event Timeline

goldstein.w.n created this revision.Jan 20 2023, 9:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2023, 9:10 PM
goldstein.w.n requested review of this revision.Jan 20 2023, 9:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2023, 9:10 PM

Improved test coverage

Remove 1/3 of tests

nikic accepted this revision.Jan 29 2023, 2:54 AM

LGTM

llvm/test/Analysis/ValueTracking/knownbits-bmi-pattern.ll
269

FWIW, I would remove all but one of these vector assume tests. They don't really add anything in a world where we just don't support vector assumes. (If we were to add support for them, that would get separate test coverage, and I doubt the canonical pattern we'd require for them would look like what you're doing here -- we'd probably want an assume over an and reduction.)

This revision is now accepted and ready to land.Jan 29 2023, 2:54 AM

Remove some unneeded vec tests, add case where checking X/-X is necessary

llvm/test/Analysis/ValueTracking/knownbits-bmi-pattern.ll
269

FWIW, I would remove all but one of these vector assume tests. They don't really add anything in a world where we just don't support vector assumes. (If we were to add support for them, that would get separate test coverage, and I doubt the canonical pattern we'd require for them would look like what you're doing here -- we'd probably want an assume over an and reduction.)

Removed all but 2, one for blsi and one for blsmsk (one for add_eval and one for cmp_eq).

Unrelated but I see you have a page tracking llvm build times. Do you know what the fastest build flags are for building clang itself (for development/rebuilding, don't care about executable perf, just want it to build v fast)?

nikic added inline comments.Jan 29 2023, 12:33 PM
llvm/test/Analysis/ValueTracking/knownbits-bmi-pattern.ll
269

Unrelated but I see you have a page tracking llvm build times.

Note that these are build times of other software when compiled with clang, not time to build clang :)

I did actually start to track time to build clang recently, resulting in this fun graph (on a 6 core server): https://llvm-compile-time-tracker.com/graphs.php?stat=wall-time&startDate=2023-01-22&bench=clang Thanks to ccache, build times tend to jump between 40 seconds and 25 minutes.

Do you know what the fastest build flags are for building clang itself (for development/rebuilding, don't care about executable perf, just want it to build v fast)?

Not really. It would probably be an unoptimized build without debug info, but if you also want to run tests, it will be slower overall.

I'm personally using release+asserts builds with lld and ccache. Only strong recommendation I have is to not use debug builds outside exceptional circumstances. They are miserable on so many levels, and you're almost always better served using -debug logging instead.

goldstein.w.n added inline comments.Jan 29 2023, 1:30 PM
llvm/test/Analysis/ValueTracking/knownbits-bmi-pattern.ll
269

Unrelated but I see you have a page tracking llvm build times.

Note that these are build times of other software when compiled with clang, not time to build clang :)

I did actually start to track time to build clang recently, resulting in this fun graph (on a 6 core server): https://llvm-compile-time-tracker.com/graphs.php?stat=wall-time&startDate=2023-01-22&bench=clang Thanks to ccache, build times tend to jump between 40 seconds and 25 minutes.

Do you know what the fastest build flags are for building clang itself (for development/rebuilding, don't care about executable perf, just want it to build v fast)?

Not really. It would probably be an unoptimized build without debug info, but if you also want to run tests, it will be slower overall.

I'm personally using release+asserts builds with lld and ccache. Only strong recommendation I have is to not use debug builds outside exceptional circumstances. They are miserable on so many levels, and you're almost always better served using -debug logging instead.

I see, I do basically the same but -O1 instead of release to make things a bit faster.

It might be useful to add a flag --build-fast that has some passes (like elim alloca that AFAICT make things faster) but is only trying to get the build done as fast a possible rather than optimizing. Might save a handful of dev time.

Thanks for the info :)

This revision was landed with ongoing or failed builds.Feb 18 2023, 11:31 AM
This revision was automatically updated to reflect the committed changes.