[llvm-commits] [llvm] r93200 - /llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp
Chris Lattner
sabre at nondot.org
Mon Jan 11 14:45:25 PST 2010
Author: lattner
Date: Mon Jan 11 16:45:25 2010
New Revision: 93200
URL: http://llvm.org/viewvc/llvm-project?rev=93200&view=rev
Log:
Disable folding sext(trunc(x)) -> x (and other similar cast/cast cases) when the
trunc has multiple uses. Codegen is not able to coalesce the subreg case
correctly and so this leads to higher register pressure and spilling (see PR5997).
This speeds up 256.bzip2 from 8.60 -> 8.04s on my machine, ~7%.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp?rev=93200&r1=93199&r2=93200&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp Mon Jan 11 16:45:25 2010
@@ -325,8 +325,11 @@
const Type *OrigTy = V->getType();
- // If this is an extension from the dest type, we can eliminate it.
- if ((isa<ZExtInst>(I) || isa<SExtInst>(I)) &&
+ // If this is an extension from the dest type, we can eliminate it, even if it
+ // has multiple uses.
+ // FIXME: This is currently disabled until codegen can handle this without
+ // pessimizing code, PR5997.
+ if (0 && (isa<ZExtInst>(I) || isa<SExtInst>(I)) &&
I->getOperand(0)->getType() == Ty)
return true;
@@ -606,8 +609,10 @@
if (!I) return false;
// If the input is a truncate from the destination type, we can trivially
- // eliminate it.
- if (isa<TruncInst>(I) && I->getOperand(0)->getType() == Ty)
+ // eliminate it, even if it has multiple uses.
+ // FIXME: This is currently disabled until codegen can handle this without
+ // pessimizing code, PR5997.
+ if (0 && isa<TruncInst>(I) && I->getOperand(0)->getType() == Ty)
return true;
// We can't extend or shrink something that has multiple uses: doing so would
@@ -853,8 +858,11 @@
Instruction *I = dyn_cast<Instruction>(V);
if (!I) return false;
- // If this is a truncate from the dest type, we can trivially eliminate it.
- if (isa<TruncInst>(I) && I->getOperand(0)->getType() == Ty)
+ // If this is a truncate from the dest type, we can trivially eliminate it,
+ // even if it has multiple uses.
+ // FIXME: This is currently disabled until codegen can handle this without
+ // pessimizing code, PR5997.
+ if (0 && isa<TruncInst>(I) && I->getOperand(0)->getType() == Ty)
return true;
// We can't extend or shrink something that has multiple uses: doing so would
More information about the llvm-commits
mailing list