diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-05-06 03:35:15 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-05-06 03:35:15 +0000 |
commit | 2b195fd2c358b66d9f6b7bde7d06fed74c8ef81d (patch) | |
tree | d81713e46eede810b7d6fd7bb6617d9e5571cbbb /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | 28d89dbd3fc9a175bb2ad1964d17d9149d9f2526 (diff) | |
download | bcm5719-llvm-2b195fd2c358b66d9f6b7bde7d06fed74c8ef81d.tar.gz bcm5719-llvm-2b195fd2c358b66d9f6b7bde7d06fed74c8ef81d.zip |
[LazyValueInfo] Avoid unnecessary copies of ConstantRanges
Summary:
ConstantRange contains two APInts which can allocate memory if their width is larger than 64-bits. So we shouldn't copy it when we can avoid it.
This changes LVILatticeVal::getConstantRange() to return its internal ConstantRange by reference. This allows many places that just need a ConstantRange reference to avoid making a copy.
Several places now capture the return value of getConstantRange() by reference so they can call methods on it that don't need a new object.
Lastly it adds std::move in one place to capture to move a local ConstantRange into an LVILatticeVal.
Reviewers: reames, dberlin, sanjoy, anna
Reviewed By: reames
Subscribers: grandinj, llvm-commits
Differential Revision: https://reviews.llvm.org/D32884
llvm-svn: 302331
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
0 files changed, 0 insertions, 0 deletions