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)
commit07a8ff4892b2a54f0bd5843f863bcffa7a258f1f
treed9642a2e243c2c35ddbee69d36d518bee33db1d4
parent92a47442f4a362fd634353316d632a1ef87ea106
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.

llvm-svn: 205625
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/ARM64/ARM64ISelLowering.cpp
llvm/test/CodeGen/ARM64/neon-v1i1-setcc.ll [new file with mode: 0644]