summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/SparsePropagation.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-08-09 17:23:35 +0000
committerChris Lattner <sabre@nondot.org>2008-08-09 17:23:35 +0000
commit09e3b65a99e427fba1433ec338e6d708a81281d7 (patch)
tree2859efb70a38161954cc3bb06b7f209931773276 /llvm/lib/Analysis/SparsePropagation.cpp
parentcbad725bf4c173c9ec645b295d555c5584eca7ae (diff)
downloadbcm5719-llvm-09e3b65a99e427fba1433ec338e6d708a81281d7.tar.gz
bcm5719-llvm-09e3b65a99e427fba1433ec338e6d708a81281d7.zip
"This patch adds a virtual call to AbstractLatticeFunction to derive a
type lattice value for an Argument*, giving clients the opportunity to use something other than Top for it if they choose to." Patch by John McCall! llvm-svn: 54589
Diffstat (limited to 'llvm/lib/Analysis/SparsePropagation.cpp')
-rw-r--r--llvm/lib/Analysis/SparsePropagation.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/SparsePropagation.cpp b/llvm/lib/Analysis/SparsePropagation.cpp
index 2fda64c7335..8f042c27839 100644
--- a/llvm/lib/Analysis/SparsePropagation.cpp
+++ b/llvm/lib/Analysis/SparsePropagation.cpp
@@ -57,8 +57,10 @@ SparseSolver::LatticeVal SparseSolver::getOrInitValueState(Value *V) {
return LatticeFunc->getUntrackedVal();
else if (Constant *C = dyn_cast<Constant>(V))
LV = LatticeFunc->ComputeConstant(C);
+ else if (Argument *A = dyn_cast<Argument>(V))
+ LV = LatticeFunc->ComputeArgument(A);
else if (!isa<Instruction>(V))
- // Non-instructions (e.g. formal arguments) are overdefined.
+ // All other non-instructions are overdefined.
LV = LatticeFunc->getOverdefinedVal();
else
// All instructions are underdefined by default.
OpenPOWER on IntegriCloud