[AArch64] Fix SelectionDAG infinite loop for v1i64 SCALAR_TO_VECTOR
authorJohn Brawn <john.brawn@arm.com>
Thu, 22 Nov 2018 11:45:23 +0000 (11:45 +0000)
committerJohn Brawn <john.brawn@arm.com>
Thu, 22 Nov 2018 11:45:23 +0000 (11:45 +0000)
commitd6e0ebea1054f6026ae4830f04a66eda9460572c
treef888de3edae8f7c633d1601024577cd2eeade1d1
parent94a16cb6111c0e10681f2047e043ff19882473e0
[AArch64] Fix SelectionDAG infinite loop for v1i64 SCALAR_TO_VECTOR

A consequence of r347274 is that SCALAR_TO_VECTOR can be converted into
BUILD_VECTOR by SimplifyDemandedBits, but LowerBUILD_VECTOR can turn
BUILD_VECTOR into SCALAR_TO_VECTOR so we get an infinite loop.

Fix this by making LowerBUILD_VECTOR not do this transformation for those
vectors that would get transformed back, i.e. BUILD_VECTOR of a single-element
constant vector. Doing that means we get a DUP, which we then need to recognise
in ISel as a copy.

llvm-svn: 347456
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.td
llvm/test/CodeGen/AArch64/arm64-build-vector.ll