fix http://llvm.org/bugs/show_bug.cgi?id=2097
authorGabor Greif <ggreif@gmail.com>
Tue, 26 Feb 2008 19:13:21 +0000 (19:13 +0000)
committerGabor Greif <ggreif@gmail.com>
Tue, 26 Feb 2008 19:13:21 +0000 (19:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47615 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/CodeGenPrepare.cpp

index 15ccbbd42043da7cdd70e73a1d850c9ac4dfbfdc..d8b82b374dcecc6e3f1c53cf751e904ffacffbfb 100644 (file)
@@ -991,7 +991,7 @@ bool CodeGenPrepare::OptimizeExtUses(Instruction *I) {
     return false;
 
   // Only do this xform if truncating is free.
-  if (!TLI->isTruncateFree(I->getType(), Src->getType()))
+  if (TLI && !TLI->isTruncateFree(I->getType(), Src->getType()))
     return false;
 
   // Only safe to perform the optimization if the source is also defined in