diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-04-21 16:13:15 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-04-21 16:13:15 +0000 |
commit | 1dc8fc8bfae61bf06b335ab75b79185e07e6a87b (patch) | |
tree | 34fa73368321a6a6c73c688fff48c043e1afeba2 /llvm/lib/Analysis/ValueTracking.cpp | |
parent | a66f42caa988df0c41f8cec486f61a289b44a130 (diff) | |
download | bcm5719-llvm-1dc8fc8bfae61bf06b335ab75b79185e07e6a87b.tar.gz bcm5719-llvm-1dc8fc8bfae61bf06b335ab75b79185e07e6a87b.zip |
[APInt] Add compare/compareSigned methods that return -1, 0, 1. Reimplement slt/ult and friends using them
Currently sle and ule have to call slt/ult and eq to get the proper answer. This results in extra code for both calls and additional scans of multiword APInts.
This patch replaces slt/ult with a compareSigned/compare that can return -1, 0, or 1 so we can cover all the comparison functions with a single call.
While I was there I removed the activeBits calls and other checks at the start of the slow part of ult. Both of the activeBits calls potentially scan through each of the APInts separately. I can't imagine that's any better than just scanning them in parallel and doing the compares. Now we just share the code with tcCompare.
These changes seem to be good for about a 7-8k reduction on the size of the opt binary on my local x86-64 build.
Differential Revision: https://reviews.llvm.org/D32339
llvm-svn: 300995
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
0 files changed, 0 insertions, 0 deletions