This is an archive of the discontinued LLVM Phabricator instance.

[KnownBits] Add a computeForMul method
ClosedPublic

Authored by qcolombet on Oct 6 2020, 4:20 PM.

Details

Summary

This patch refactors the logic in ValueTracking.cpp so that
computeKnownBitsForMul now uses a helper function from KnownBits.

NFC

Diff Detail

Event Timeline

qcolombet created this revision.Oct 6 2020, 4:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 6 2020, 4:20 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
qcolombet requested review of this revision.Oct 6 2020, 4:20 PM
lebedev.ri accepted this revision.Oct 6 2020, 11:31 PM

Looks good to me.

llvm/unittests/Support/KnownBitsTest.cpp
183

// ComputedMul is conservatively correct, but not guaranteed to be precise.

This revision is now accepted and ready to land.Oct 6 2020, 11:31 PM
lebedev.ri added inline comments.Oct 6 2020, 11:32 PM
llvm/include/llvm/Support/KnownBits.h
247–250

Please move it here though, closer to similar ones.

RKSimon accepted this revision.Oct 7 2020, 12:59 AM

LGTM - cheers

llvm/include/llvm/Support/KnownBits.h
247–250

+1

qcolombet updated this revision to Diff 296806.Oct 7 2020, 2:59 PM
  • Move method earlier in the header
  • Fix comment in test
qcolombet marked 3 inline comments as done.Oct 7 2020, 3:00 PM

Thanks guys for the quick review!

This revision was landed with ongoing or failed builds.Oct 8 2020, 11:35 AM
This revision was automatically updated to reflect the committed changes.