diff options
author | Owen Anderson <resistor@mac.com> | 2011-01-03 23:51:43 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2011-01-03 23:51:43 +0000 |
commit | 392249fcf368a22f48091a16c180160221c7e89a (patch) | |
tree | dd8cb42da994ce4dd34ebb9dac0b51dc1b2b9deb /lib/Analysis/IPA | |
parent | bbdcd443614fc1ac012227d9975201c18b9e2ab4 (diff) | |
download | external_llvm-392249fcf368a22f48091a16c180160221c7e89a.zip external_llvm-392249fcf368a22f48091a16c180160221c7e89a.tar.gz external_llvm-392249fcf368a22f48091a16c180160221c7e89a.tar.bz2 |
Use the new addEscapingValue callback to update GlobalsModRef when GVN adds PHIs of GEPs. For the moment,
have GlobalsModRef handle this conservatively by simply removing the value from its maps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122787 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA')
-rw-r--r-- | lib/Analysis/IPA/GlobalsModRef.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp index c18dc47..116aaf4 100644 --- a/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/lib/Analysis/IPA/GlobalsModRef.cpp @@ -152,6 +152,7 @@ namespace { virtual void deleteValue(Value *V); virtual void copyValue(Value *From, Value *To); + virtual void addEscapingUse(Use &U); /// getAdjustedAnalysisPointer - This method is used when a pass implements /// an analysis interface through multiple inheritance. If needed, it @@ -596,3 +597,13 @@ void GlobalsModRef::deleteValue(Value *V) { void GlobalsModRef::copyValue(Value *From, Value *To) { AliasAnalysis::copyValue(From, To); } + +void GlobalsModRef::addEscapingUse(Use &U) { + // For the purposes of this analysis, it is conservatively correct to treat + // a newly escaping value equivalently to a deleted one. We could perhaps + // be more precise by processing the new use and attempting to update our + // saved analysis results to accomodate it. + deleteValue(U); + + AliasAnalysis::addEscapingUse(U); +} |