ARM64: handle v1i1 types arising from setcc properly.
authorTim Northover <tnorthover@apple.com>
Fri, 4 Apr 2014 14:49:21 +0000 (14:49 +0000)
committerTim Northover <tnorthover@apple.com>
Fri, 4 Apr 2014 14:49:21 +0000 (14:49 +0000)
commit4a4d62bfb923f81d0cc8203bdca487a764bb0945
tree0b01c2b83297b39f2289aa8da591138f30412acb
parent148692bafe85b8b9b6c96917d1aeafe2862bfe56
ARM64: handle v1i1 types arising from setcc properly.

There were several overlapping problems here, and this solution is
closely inspired by the one adopted in AArch64 in r201381.

Firstly, scalarisation of v1i1 setcc operations simply fails if the
input types are legal. This is fixed in LegalizeVectorTypes.cpp this
time, and allows AArch64 code to be simplified slightly.

Second, vselect with such a setcc feeding into it ends up in
ScalarizeVectorOperand, where it's not handled. I experimented with an
implementation, but found that whatever DAG came out was rather
horrific. I think Hao's DAG combine approach is a good one for
quality, though there are edge cases it won't catch (to be fixed
separately).

Should fix PR19335.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205625 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
lib/Target/AArch64/AArch64ISelLowering.cpp
lib/Target/ARM64/ARM64ISelLowering.cpp
test/CodeGen/ARM64/neon-v1i1-setcc.ll [new file with mode: 0644]