From: Cameron Zwarich Date: Thu, 6 Jan 2011 02:56:42 +0000 (+0000) Subject: Add the CallInst optimizations that don't involve expanding inline assembly to X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=6cf34abe1c99e79565c75cd3e62755239463e574;p=oota-llvm.git Add the CallInst optimizations that don't involve expanding inline assembly to OptimizeInst() so that they can be used on a worklist instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122945 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index 166d9d6ee3f..e3e634339e2 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -1014,6 +1014,13 @@ bool CodeGenPrepare::OptimizeInst(Instruction *I) { MadeChange = true; OptimizeInst(NC); } + } else if (CallInst *CI = dyn_cast(I)) { + if (TLI && isa(CI->getCalledValue())) { + // Sink address computing for memory operands into the block. + MadeChange |= OptimizeInlineAsmInst(I, &(*CI), SunkAddrs); + } else { + MadeChange |= OptimizeCallInst(CI); + } } return MadeChange;