Add the CallInst optimizations that don't involve expanding inline assembly to
authorCameron Zwarich <zwarich@apple.com>
Thu, 6 Jan 2011 02:56:42 +0000 (02:56 +0000)
committerCameron Zwarich <zwarich@apple.com>
Thu, 6 Jan 2011 02:56:42 +0000 (02:56 +0000)
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

lib/Transforms/Scalar/CodeGenPrepare.cpp

index 166d9d6ee3ff00ee453fc03f391c27b48b014ca8..e3e634339e2be41cbb02842daf41afcb4f29c890 100644 (file)
@@ -1014,6 +1014,13 @@ bool CodeGenPrepare::OptimizeInst(Instruction *I) {
       MadeChange = true;
       OptimizeInst(NC);
     }
+  } else if (CallInst *CI = dyn_cast<CallInst>(I)) {
+    if (TLI && isa<InlineAsm>(CI->getCalledValue())) {
+      // Sink address computing for memory operands into the block.
+      MadeChange |= OptimizeInlineAsmInst(I, &(*CI), SunkAddrs);
+    } else {
+      MadeChange |= OptimizeCallInst(CI);
+    }
   }
 
   return MadeChange;