[PATCH] D31104: [ConstantRange] Add setSizeSmallerThanOf method.

Michael Zolotukhin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 14:15:19 PDT 2017


mzolotukhin created this revision.

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%


https://reviews.llvm.org/D31104

Files:
  include/llvm/IR/ConstantRange.h
  lib/IR/ConstantRange.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31104.92204.patch
Type: text/x-patch
Size: 3360 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170317/b566885b/attachment.bin>


More information about the llvm-commits mailing list