[CodeGen] Fix FCOPYSIGN legalization to account for mismatched types.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Tue, 4 Aug 2015 00:32:55 +0000 (00:32 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Tue, 4 Aug 2015 00:32:55 +0000 (00:32 +0000)
commitf65371a235f5b6d0db700459a8bea654ee64a779
tree6cb4d34c0b79491566b580da0a31e8c2245b7f6c
parenta518b79601dda654d0f96bc82a5a0dcca10ab9c4
[CodeGen] Fix FCOPYSIGN legalization to account for mismatched types.

We used to legalize it like it's any other binary operations.  It's not,
because it accepts mismatched operand types.  Because of that, we used
to hit various asserts and miscompiles.

Specialize vector legalizations to, in the worst case, unroll, or, when
possible, to just legalize the operand that needs legalization.

Scalarization isn't covered, because I can't think of a target where
some but not all of the 1-element vector types are to be scalarized.

llvm-svn: 243924
llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
llvm/test/CodeGen/AArch64/vector-fcopysign.ll [new file with mode: 0644]