Add a late SSEDomainFix pass that twiddles SSE instructions to avoid domain crossings.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 25 Mar 2010 17:25:00 +0000 (17:25 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 25 Mar 2010 17:25:00 +0000 (17:25 +0000)
commit352aa503faee6c58e9cdb5054cc5ec1d90c696b4
tree69c7938e0883c8745b56a81eb9aa556e74cf044b
parente4614f7e84a7219164e9992fff855dee3816a08e
Add a late SSEDomainFix pass that twiddles SSE instructions to avoid domain crossings.

On Nehalem and newer CPUs there is a 2 cycle latency penalty on using a register
in a different domain than where it was defined. Some instructions have
equvivalents for different domains, like por/orps/orpd.

The SSEDomainFix pass tries to minimize the number of domain crossings by
changing between equvivalent opcodes where possible.

This is a work in progress, in particular the pass doesn't do anything yet. SSE
instructions are tagged with their execution domain in TableGen using the last
two bits of TSFlags. Note that not all instructions are tagged correctly. Life
just isn't that simple.

The SSE execution domain issue is very similar to the ARM NEON/VFP pipeline
issue handled by NEONMoveFixPass. This pass may become target independent to
handle both.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99524 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/CMakeLists.txt
lib/Target/X86/SSEDomainFix.cpp [new file with mode: 0644]
lib/Target/X86/X86.h
lib/Target/X86/X86.td
lib/Target/X86/X86InstrFormats.td
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86InstrInfo.h
lib/Target/X86/X86TargetMachine.cpp
lib/Target/X86/X86TargetMachine.h