]> granicus.if.org Git - llvm/commit
[ConstantRange] Add setSizeSmallerThanOf method.
authorMichael Zolotukhin <mzolotukhin@apple.com>
Mon, 20 Mar 2017 06:33:07 +0000 (06:33 +0000)
committerMichael Zolotukhin <mzolotukhin@apple.com>
Mon, 20 Mar 2017 06:33:07 +0000 (06:33 +0000)
commit63f2656869e7dab5e8e7f3a8745397e3d70dd8e6
tree96fd42fa9c5d65a286b334741667bb5112f86c67
parent21a749ea8f0557f7b864f92dc58d0ef25a916ae0
[ConstantRange] Add setSizeSmallerThanOf method.

Summary:
ConstantRange class currently has a method getSetSize, which is mostly used to
compare set sizes of two constant ranges (there is only one spot where it's used
in a slightly different scenario). This patch introduces setSizeSmallerThanOf
method, which does such comparison in a more efficient way. In the original
method we have to extend our types to (BitWidth+1), which can result it using
slow case of APInt, extra memory allocations, etc.

The change is supposed to not change any functionality, but it slightly improves
compile time. Here is compile time improvements that I observed on CTMark:
* tramp3d-v4 -2.02%
* pairlocalalign -1.82%
* lencod -1.67%

Reviewers: sanjoy, atrick, pete

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31104

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298236 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/ConstantRange.h
lib/IR/ConstantRange.cpp