summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-01-12 04:24:46 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-01-12 04:24:46 +0000
commitcddc9dfe975c3152a2db955b24cb6b4ee457e571 (patch)
treea06773a4c05b5949c043c0246fcb64b88f073653 /llvm/lib/Transforms/IPO/GlobalOpt.cpp
parente4c7fcd1bd0e85b1dc83bed2c8a293cbd1514317 (diff)
downloadbcm5719-llvm-cddc9dfe975c3152a2db955b24cb6b4ee457e571.tar.gz
bcm5719-llvm-cddc9dfe975c3152a2db955b24cb6b4ee457e571.zip
Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that get(bool) be replaced by get(const Type*, uint64_t). This implements those changes. llvm-svn: 33110
Diffstat (limited to 'llvm/lib/Transforms/IPO/GlobalOpt.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index ce30477c872..86657c2c0e5 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -1161,7 +1161,7 @@ static void ShrinkGlobalToBoolean(GlobalVariable *GV, Constant *OtherVal) {
// Only do this if we weren't storing a loaded value.
Value *StoreVal;
if (StoringOther || SI->getOperand(0) == InitVal)
- StoreVal = ConstantInt::get(StoringOther);
+ StoreVal = ConstantInt::get(Type::Int1Ty, StoringOther);
else {
// Otherwise, we are storing a previously loaded copy. To do this,
// change the copy from copying the original value to just copying the
@@ -1803,7 +1803,7 @@ static bool EvaluateFunction(Function *F, Constant *&RetVal,
// Cannot determine.
if (!Cond || Cond->getType() != Type::Int1Ty)
return false;
- NewBB = BI->getSuccessor(!Cond->getBoolValue());
+ NewBB = BI->getSuccessor(!Cond->getZExtValue());
}
} else if (SwitchInst *SI = dyn_cast<SwitchInst>(CurInst)) {
ConstantInt *Val =
OpenPOWER on IntegriCloud