This is an archive of the discontinued LLVM Phabricator instance.

[APSInt] Use APInt::compare and APInt::compareSigned to implement APSInt::compareValue
ClosedPublic

Authored by craig.topper on Apr 21 2017, 3:18 PM.

Details

Summary

APInt just got compare methods that return -1, 0, or 1 instead of just having ult/slt and eq.

This patch uses these methods to implement APSInt::compareValues so that we don't have to call do an equal comparison and then possibly a second less than comparison.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Apr 21 2017, 3:18 PM
hans accepted this revision.Apr 21 2017, 3:35 PM

lgtm

This revision is now accepted and ready to land.Apr 21 2017, 3:35 PM
This revision was automatically updated to reflect the committed changes.