summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LazyBranchProbabilityInfo.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-06-24 23:34:50 +0000
committerCraig Topper <craig.topper@gmail.com>2017-06-24 23:34:50 +0000
commit010203964d7293c77e9ca5200dfe909c781a7f66 (patch)
treec838929c709adf4304471411eb689d5bb6ae19f8 /llvm/lib/Analysis/LazyBranchProbabilityInfo.cpp
parent914ad85c6a29a7b79009fe77c3c657435175dcbb (diff)
downloadbcm5719-llvm-010203964d7293c77e9ca5200dfe909c781a7f66.tar.gz
bcm5719-llvm-010203964d7293c77e9ca5200dfe909c781a7f66.zip
[SCEV] Avoid copying ConstantRange just to get the min/max value
Summary: This patch changes getRange to getRangeRef and returns a reference to the ConstantRange object stored inside the DenseMap caches. We then take advantage of that to add new helper methods that can return min/max value of a signed or unsigned ConstantRange using that reference without first copying the ConstantRange. getRangeRef calls itself recursively and I believe the reference return is fine for those calls. I've left getSignedRange and getUnsignedRange returning a ConstantRange object so they will make a copy now. This is to ensure safety since the reference will be invalidated if the DenseMap changes. I'm sure there are still more places that can take advantage of the reference and I'll submit future patches as I find them. Reviewers: sanjoy, davide Reviewed By: sanjoy Subscribers: zzheng, llvm-commits, mzolotukhin Differential Revision: https://reviews.llvm.org/D32978 llvm-svn: 306229
Diffstat (limited to 'llvm/lib/Analysis/LazyBranchProbabilityInfo.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud