]> granicus.if.org Git - llvm/commit
Codegen: LICM Remove check for exactly 1 register def.
authorKyle Butt <kyle+llvm@iteratee.net>
Thu, 23 Jun 2016 21:38:49 +0000 (21:38 +0000)
committerKyle Butt <kyle+llvm@iteratee.net>
Thu, 23 Jun 2016 21:38:49 +0000 (21:38 +0000)
commitffdf177de1aa74d936a3fdcbdbe07eff2fe0cce6
tree769b6a7878b34d0f2ddf202e158e358a4523f25d
parent680b0ddfb52dd57d6df36b98a465d4ef71fea910
Codegen: LICM Remove check for exactly 1 register def.

When considering whether to split an instruction with a memory operand
into an explicit load and a register-based instruction, we currently
check that the resulting instruction has exactly 1 def. This prevents 2
important LICM optimizations: compares with memory operands, and double
indirect calls. All the tests and the test-suite pass without the check.
My guess as to original intent is to limit the additional register pressure
created by the new instruction, but given that we only split out a single
register, it is already limited.

The licm-dominance test now checks actual memory loads for hoisting instead of
undef, and it tests compares.
hoist-invariant-load.ll now checks for 2 hoists, the intended hoist, and a bonus
from calling a got-relative function in a loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273616 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineLICM.cpp
test/CodeGen/X86/hoist-invariant-load.ll
test/CodeGen/X86/licm-dominance.ll