This is an archive of the discontinued LLVM Phabricator instance.

APInt: Simplify and Optimize EqualSlowCase
ClosedPublic

Authored by MatzeB on Jan 26 2016, 8:07 PM.

Details

Summary

Previously the code used getActiveBits() to determine the highest set bit
of each APInt first. However doing so requires the same amount of
memory accesses as simply comparing both numbers right away.

Removing all the active bit checks leads to simpler code and is faster
in my benchmark.

(This function is worth optimizing because unfortunately it sometimes shows up in profiles because SCEV often uses 65Bit APInts)

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB updated this revision to Diff 46094.Jan 26 2016, 8:07 PM
MatzeB retitled this revision from to APInt: Simplify and Optimize EqualSlowCase.
MatzeB updated this object.
MatzeB added reviewers: bkramer, zhousheng00, foad, echristo.
MatzeB set the repository for this revision to rL LLVM.
MatzeB added a subscriber: llvm-commits.
This revision was automatically updated to reflect the committed changes.