Add support for load folding of avx1 logical instructions
authorJim Grosbach <grosbach@apple.com>
Wed, 9 Apr 2014 23:39:25 +0000 (23:39 +0000)
committerJim Grosbach <grosbach@apple.com>
Wed, 9 Apr 2014 23:39:25 +0000 (23:39 +0000)
commitafb4ef3549c25bb3d4808be484aa0163bd829492
treeca5f7f6b887855944d0563a81337802c696e7e7a
parente9915738beed0d8b4b50dca8c0ed8c76e7d320db
Add support for load folding of avx1 logical instructions

AVX supports logical operations using an operand from memory. Unfortunately
because integer operations were not added until AVX2 the AVX1 logical
operation's types were preventing the isel from folding the loads. In a limited
number of cases the peephole optimizer would fold the loads, but most were
missed. This patch adds explicit patterns with appropriate casts in order for
these loads to be folded.

The included test cases run on reduced examples and disable the peephole
optimizer to ensure the folds are being pattern matched.

Patch by Louis Gerbarg <lgg@apple.com>

rdar://16355124

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205938 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrSSE.td
test/CodeGen/X86/avx1-logical-load-folding.ll [new file with mode: 0644]