This is an archive of the discontinued LLVM Phabricator instance.

[KnownBits] Add blsi and blsmsk
ClosedPublic

Authored by goldstein.w.n on Jan 24 2023, 5:10 PM.

Diff Detail

Event Timeline

goldstein.w.n created this revision.Jan 24 2023, 5:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 24 2023, 5:10 PM
goldstein.w.n requested review of this revision.Jan 24 2023, 5:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 24 2023, 5:10 PM
craig.topper added inline comments.
llvm/lib/Support/KnownBits.cpp
639

Its -> It's

goldstein.w.n marked an inline comment as done.Jan 24 2023, 11:11 PM
foad added a comment.Jan 25 2023, 12:08 AM

Personally I still think this is too much extra complexity for uncertain benefit, but I won't stand in the way if the other reviewers are happy.

In any case the comments need work and the new functions should have exhaustive tests.

llvm/lib/Support/KnownBits.cpp
639–642

This description seems confused about whether C is added to X or subtracted from X.

Personally I still think this is too much extra complexity for uncertain benefit, but I won't stand in the way if the other reviewers are happy.

In any case the comments need work and the new functions should have exhaustive tests.

Do the overloaded blsmsk functions need exhaustive? They are unimplemented. Just think its
easier to design the full API now in case it ever becomes desired.

foad added a comment.Jan 25 2023, 11:19 AM

Things that are implemented should be tested. Things that aren't implemented shouldn't have the prototypes. (Of course you can design the full API now, but don't put the unimplemented parts in a patch and expect to commit it.)

goldstein.w.n marked an inline comment as done.

Revert to foad's method

goldstein.w.n added a comment.EditedJan 25 2023, 12:16 PM

Things that are implemented should be tested. Things that aren't implemented shouldn't have the prototypes. (Of course you can design the full API now, but don't put the unimplemented parts in a patch and expect to commit it.)

Okay, fair enough. Reverted back to your code.

nikic accepted this revision.Jan 25 2023, 1:34 PM

LGTM. I'd suggest adding a description of what the operation is supposed to do in the comment, for those not familiar with bmi instructions.

llvm/include/llvm/Support/KnownBits.h
425
429
This revision is now accepted and ready to land.Jan 25 2023, 1:34 PM

LGTM. I'd suggest adding a description of what the operation is supposed to do in the comment, for those not familiar with bmi instructions.

Thanks will do before pushing. How does the rest of the series look?

Rebase + update comments

This revision was landed with ongoing or failed builds.Feb 18 2023, 11:31 AM
Closed by commit rG6749d187c6df: [KnownBits] Add blsi and blsmsk (authored by foad, committed by goldstein.w.n). · Explain Why
This revision was automatically updated to reflect the committed changes.