Files
llvm-6502/lib/CodeGen/Analysis.cpp
Tim Northover 4b3f6b49e5 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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_36@239611 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-12 15:57:35 +00:00

26 KiB