Do extremely simple sinking of instructions when they are only used in a
authorChris Lattner <sabre@nondot.org>
Wed, 8 Dec 2004 23:43:58 +0000 (23:43 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 8 Dec 2004 23:43:58 +0000 (23:43 +0000)
commitea1c45405d8e886497cabb90370e82114d4166ba
treeac816510ef606b2d62d168592cba120a111ba337
parenta95cf3024b9a3c3ed6bf3e862d956ce46a8cbebe
Do extremely simple sinking of instructions when they are only used in a
successor block.  This turns cases like this:

x = a op b
if (c) {
  use x
}

into:

if (c) {
  x = a op b
  use x
}

This triggers 3965 times in spec, and is tested by
Regression/Transforms/InstCombine/sink_instruction.ll

This appears to expose a bug in the X86 backend for 177.mesa, which I'm
looking in to.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18677 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/InstructionCombining.cpp