[X86] Add broadcast instructions to the table used by ExeDepsFix pass.
authorQuentin Colombet <qcolombet@apple.com>
Wed, 26 Mar 2014 00:10:22 +0000 (00:10 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Wed, 26 Mar 2014 00:10:22 +0000 (00:10 +0000)
commit596516bef8425bbce7e6363d3a002e908747ec6f
treeb655c07a3347b6d4cca44bc7c45d6e6dc4f3cb94
parent81c66bcc13b85515db1e17c4e06034d2a2046cd1
[X86] Add broadcast instructions to the table used by ExeDepsFix pass.

Adds the different broadcast instructions to the ReplaceableInstrsAVX2 table.
That way the ExeDepsFix pass can take better decisions when AVX2 broadcasts are
across domain (int <-> float).

In particular, prior to this patch we were generating:
  vpbroadcastd  LCPI1_0(%rip), %ymm2
  vpand %ymm2, %ymm0, %ymm0
  vmaxps  %ymm1, %ymm0, %ymm0 ## <- domain change penalty

Now, we generate the following nice sequence where everything is in the float
domain:
  vbroadcastss  LCPI1_0(%rip), %ymm2
  vandps  %ymm2, %ymm0, %ymm0
  vmaxps  %ymm1, %ymm0, %ymm0

<rdar://problem/16354675>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204770 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrInfo.cpp
test/CodeGen/X86/avx2-intrinsics-x86.ll
test/CodeGen/X86/avx2-vbroadcast.ll
test/CodeGen/X86/exedepsfix-broadcast.ll [new file with mode: 0644]