[llvm] d3d4e4b - [LVI] Extract addValueHandle() method (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 20 04:06:00 PDT 2020
Author: Nikita Popov
Date: 2020-06-20T13:05:42+02:00
New Revision: d3d4e4bcb7123878294fdf91fa72ecd36a111141
URL: https://github.com/llvm/llvm-project/commit/d3d4e4bcb7123878294fdf91fa72ecd36a111141
DIFF: https://github.com/llvm/llvm-project/commit/d3d4e4bcb7123878294fdf91fa72ecd36a111141.diff
LOG: [LVI] Extract addValueHandle() method (NFC)
There will be more places registering value handles.
Added:
Modified:
llvm/lib/Analysis/LazyValueInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index eb0bb267b585..12f7e6869a63 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -183,6 +183,12 @@ namespace {
return It->second.get();
}
+ void addValueHandle(Value *Val) {
+ auto HandleIt = ValueHandles.find_as(Val);
+ if (HandleIt == ValueHandles.end())
+ ValueHandles.insert({ Val, this });
+ }
+
public:
void insertResult(Value *Val, BasicBlock *BB,
const ValueLatticeElement &Result) {
@@ -195,9 +201,7 @@ namespace {
else
Entry->LatticeElements.insert({ Val, Result });
- auto HandleIt = ValueHandles.find_as(Val);
- if (HandleIt == ValueHandles.end())
- ValueHandles.insert({ Val, this });
+ addValueHandle(Val);
}
Optional<ValueLatticeElement> getCachedValueInfo(Value *V,
More information about the llvm-commits
mailing list