[AArch64] Fix performPostLD1Combine to check for constant lane index.
authorGeoff Berry <gberry@codeaurora.org>
Fri, 11 May 2018 16:25:06 +0000 (16:25 +0000)
committerGeoff Berry <gberry@codeaurora.org>
Fri, 11 May 2018 16:25:06 +0000 (16:25 +0000)
commit60460268c002eb608c2d8138f506fe133c478247
treea6164bdd219c21bd037cd68f189f7f2282a1d168
parentae2010813fbf7bed1764a33876436b0300923e32
[AArch64] Fix performPostLD1Combine to check for constant lane index.

Summary:
performPostLD1Combine in AArch64ISelLowering looks for vector
insert_vector_elt of a loaded value which it can optimize into a single
LD1LANE instruction.  The code checking for the pattern was not checking
if the lane index was a constant which could cause two problems:

- an assert when lowering the LD1LANE ISD node since it assumes an
  constant operand

- an assert in isel if the lane index value depends on the
  post-incremented base register

Both of these issues are avoided by simply checking that the lane index
is a constant.

Fixes bug 35822.

Reviewers: t.p.northover, javed.absar

Subscribers: rengolin, kristof.beyls, mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D46591

llvm-svn: 332103
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/arm64-indexed-vector-ldst-2.ll