Loading
Merging r236457 and r236635:
------------------------------------------------------------------------ r236457 | tnorthover | 2015-05-04 13:41:51 -0700 (Mon, 04 May 2015) | 9 lines 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. ------------------------------------------------------------------------ r236635 | tnorthover | 2015-05-06 13:07:38 -0700 (Wed, 06 May 2015) | 12 lines CodeGen: move over-zealous assert into actual if statement. It's quite possible to encounter an insertvalue instruction that's more deeply nested than the value we're looking for, but when that happens we really mustn't compare beyond the end of the index array. Since I couldn't see any guarantees about what comparisons std::equal makes, we probably need to directly check the size beforehand. In practice, I suspect most std::equal implementations would probably bail early, which would be OK. But just in case... rdar://20834485 llvm-svn: 239611