CodeGen: match up correct insertvalue indices when assessing tail calls.
authorTim Northover <tnorthover@apple.com>
Mon, 4 May 2015 20:41:51 +0000 (20:41 +0000)
committerTim Northover <tnorthover@apple.com>
Mon, 4 May 2015 20:41:51 +0000 (20:41 +0000)
commit7f88b179b1eaf6083b54176587fe58f9dbc11189
treef23615d84e31ed3d86dbedea249c9d67b39285de
parentc41c3a4c3b999a05e6d04e41d3d0153bc2aca056
CodeGen: match up correct insertvalue indices when assessing tail calls.

When deciding whether a value comes from the aggregate or inserted value of an
insertvalue instruction, we compare the indices against those of the location
we're interested in. One of the lists needs reversing because the input data is
backwards (so that modifications take place at the end of the SmallVector), but
we were reversing both before leading to incorrect results.

Should fix PR23408

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236457 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/Analysis.cpp
test/CodeGen/AArch64/tail-call.ll