prevent folding a scalar FP load into a packed logical FP instruction (PR22371)
authorSanjay Patel <spatel@rotateright.com>
Tue, 17 Feb 2015 20:08:21 +0000 (20:08 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 17 Feb 2015 20:08:21 +0000 (20:08 +0000)
commit544843cee165f4f660f5695a1750b466cf4fff70
treefb2b54af9a2e6cc4ef76f684054174cdcc418680
parent38c028b3616c84b09d623953cf6d0211d4fe85a2
prevent folding a scalar FP load into a packed logical FP instruction (PR22371)

Change the memory operands in sse12_fp_packed_scalar_logical_alias from scalars to vectors.
That's what the hardware packed logical FP instructions define: 128-bit memory operands.
There are no scalar versions of these instructions...because this is x86.

Generating the wrong code (folding a scalar load into a 128-bit load) is still possible
using the peephole optimization pass and the load folding tables. We won't completely
solve this bug until we either fix the lowering in fabs/fneg/fcopysign and any other
places where scalar FP logic is created or fix the load folding in foldMemoryOperandImpl()
to make sure it isn't changing the size of the load.

Differential Revision: http://reviews.llvm.org/D7474

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229531 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrFragmentsSIMD.td
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86InstrSSE.td
test/CodeGen/X86/logical-load-fold.ll [new file with mode: 0644]
test/CodeGen/X86/stack-align.ll