reenable the piece that turns trunc(zext(x)) -> x even if zext has multiple uses,
authorChris Lattner <sabre@nondot.org>
Mon, 11 Jan 2010 22:49:40 +0000 (22:49 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 11 Jan 2010 22:49:40 +0000 (22:49 +0000)
codegen has no apparent problem with the trunc version of this, because it turns
into a simple subreg idiom

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93202 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombineCasts.cpp

index b5da3e615be5be1f5503dd9daa2666fde627f8e8..e018b351082a23b7abc229ba7f8d415d01ed852d 100644 (file)
@@ -327,9 +327,7 @@ static bool CanEvaluateTruncated(Value *V, const Type *Ty) {
   
   // 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)) && 
+  if ((isa<ZExtInst>(I) || isa<SExtInst>(I)) && 
       I->getOperand(0)->getType() == Ty)
     return true;