If the alias analysis algorithm we are using can provide MUST alias information,
authorChris Lattner <sabre@nondot.org>
Sun, 29 Jun 2003 00:53:34 +0000 (00:53 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 29 Jun 2003 00:53:34 +0000 (00:53 +0000)
expose it directly as value numbering information

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6972 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/LoadValueNumbering.cpp

index edacffd857ff5bd9b8b85e568a9d930f1d9bc603..a850f81dcc58514b037eca7896b1c48431d6cdb1 100644 (file)
@@ -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