This is an archive of the discontinued LLVM Phabricator instance.

[APInt] Add early outs for a division by 1 to udiv/urem/udivrem
ClosedPublic

Authored by craig.topper on May 12 2017, 2:31 PM.

Details

Summary

We already counted the number of bits in the RHS so its pretty cheap to just check if the RHS is 1.

Turns out scalar evolution does divide by 1 sometimes in getRangeForAffineARHelper so this could be a slight compile time improvement.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.May 12 2017, 2:31 PM
hans accepted this revision.May 12 2017, 2:40 PM

lgtm

This revision is now accepted and ready to land.May 12 2017, 2:40 PM
This revision was automatically updated to reflect the committed changes.