summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-12-12 06:03:06 +0000
committerChris Lattner <sabre@nondot.org>2004-12-12 06:03:06 +0000
commit1cbd5be7a1e090794ad430c717d1f2a737c8f476 (patch)
treeec18c4b2f8ea194098b49a802de20ad6e251edda /llvm/lib/Transforms/IPO/GlobalOpt.cpp
parentaa40b7d08076921dcfa476df75224fbd86a54cc4 (diff)
downloadbcm5719-llvm-1cbd5be7a1e090794ad430c717d1f2a737c8f476.tar.gz
bcm5719-llvm-1cbd5be7a1e090794ad430c717d1f2a737c8f476.zip
Though the previous xform applies to literally dozens (hundreds?) of variables
in SPEC, the subsequent optimziations that we are after don't play with with FP values, so disable this xform for them. Really we just don't want stuff like: double G; (always 0 or 412312.312) = G; turning into: bool G_b; = G_b ? 412312.312 : 0; We'd rather just do the load. -Chris llvm-svn: 18819
Diffstat (limited to 'llvm/lib/Transforms/IPO/GlobalOpt.cpp')
-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