1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

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
This commit is contained in:
Chris Lattner 2004-12-12 06:03:06 +00:00
parent 55c163e41e
commit 97adae1fa4

View File

@ -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;