From: Gabor Greif Date: Tue, 26 Feb 2008 19:13:21 +0000 (+0000) Subject: fix http://llvm.org/bugs/show_bug.cgi?id=2097 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=53bdbd756581a9a1d6d381059f103c5f3c687bb6;p=oota-llvm.git fix http://llvm.org/bugs/show_bug.cgi?id=2097 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47615 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index 15ccbbd4204..d8b82b374dc 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -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