summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms')
-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 6309c3b5081..5ae693b65b2 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -954,7 +954,8 @@ bool GlobalOpt::ProcessInternalGlobal(GlobalVariable *GV,
// Otherwise, if the global was not a boolean, we can shrink it to be a
// boolean.
if (Constant *SOVConstant = dyn_cast<Constant>(GS.StoredOnceValue))
- if (GV->getType()->getElementType() != Type::BoolTy) {
+ if (GV->getType()->getElementType() != Type::BoolTy &&
+ !GV->getType()->getElementType()->isFloatingPoint()) {
DEBUG(std::cerr << " *** SHRINKING TO BOOL: " << *GV);
ShrinkGlobalToBoolean(GV, SOVConstant);
++NumShrunkToBool;
OpenPOWER on IntegriCloud