summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-11-30 17:26:08 +0000
committerChris Lattner <sabre@nondot.org>2006-11-30 17:26:08 +0000
commit0390b9e6bb1a1dba3a1e2ae5b82db7cb63c2bfe2 (patch)
treed02e8dacb788e60f136bb2a6985314ba200bd411
parent3867383db07123b5d0932f12886bc4883fe4405b (diff)
downloadbcm5719-llvm-0390b9e6bb1a1dba3a1e2ae5b82db7cb63c2bfe2.tar.gz
bcm5719-llvm-0390b9e6bb1a1dba3a1e2ae5b82db7cb63c2bfe2.zip
Fix a bug in globalopt due to the recent cast patch.
llvm-svn: 32042
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 4ddc0716810..e0dfbe5aec6 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -1713,7 +1713,8 @@ static bool EvaluateFunction(Function *F, Constant *&RetVal,
getVal(Values, SI->getOperand(0)),
getVal(Values, SI->getOperand(1)));
} else if (CastInst *CI = dyn_cast<CastInst>(CurInst)) {
- InstResult = ConstantExpr::getCast(getVal(Values, CI->getOperand(0)),
+ InstResult = ConstantExpr::getCast(CI->getOpcode(),
+ getVal(Values, CI->getOperand(0)),
CI->getType());
} else if (SelectInst *SI = dyn_cast<SelectInst>(CurInst)) {
InstResult = ConstantExpr::getSelect(getVal(Values, SI->getOperand(0)),
OpenPOWER on IntegriCloud