summaryrefslogtreecommitdiff
path: root/lib/Analysis/LoadValueNumbering.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-06-29 00:53:34 +0000
committerChris Lattner <sabre@nondot.org>2003-06-29 00:53:34 +0000
commitaed2c6d2cb4e496a78d4bdf5c4d8266a84b6f4bf (patch)
treefa9dcef3a2dac59b370956dc087b5c83a9d2dc00 /lib/Analysis/LoadValueNumbering.cpp
parent62b5c167de0ca5883a7ad5eb0900eb0c15ad3707 (diff)
downloadllvm-aed2c6d2cb4e496a78d4bdf5c4d8266a84b6f4bf.tar.gz
llvm-aed2c6d2cb4e496a78d4bdf5c4d8266a84b6f4bf.tar.bz2
llvm-aed2c6d2cb4e496a78d4bdf5c4d8266a84b6f4bf.tar.xz
If the alias analysis algorithm we are using can provide MUST alias information,
expose it directly as value numbering information git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6972 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoadValueNumbering.cpp')
-rw-r--r--lib/Analysis/LoadValueNumbering.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Analysis/LoadValueNumbering.cpp b/lib/Analysis/LoadValueNumbering.cpp
index edacffd857..a850f81dcc 100644
--- a/lib/Analysis/LoadValueNumbering.cpp
+++ b/lib/Analysis/LoadValueNumbering.cpp
@@ -17,6 +17,7 @@
#include "llvm/Analysis/Dominators.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Pass.h"
+#include "llvm/Type.h"
#include "llvm/iMemory.h"
#include "llvm/BasicBlock.h"
#include "llvm/Support/CFG.h"
@@ -83,6 +84,10 @@ void LoadVN::getAnalysisUsage(AnalysisUsage &AU) const {
//
void LoadVN::getEqualNumberNodes(Value *V,
std::vector<Value*> &RetVals) const {
+ // If the alias analysis has any must alias information to share with us, we
+ // can definately use it.
+ if (isa<PointerType>(V->getType()))
+ getAnalysis<AliasAnalysis>().getMustAliases(V, RetVals);
if (LoadInst *LI = dyn_cast<LoadInst>(V)) {
// If we have a load instruction, find all of the load and store