CodeGen: move over-zealous assert into actual if statement.
authorTim Northover <tnorthover@apple.com>
Wed, 6 May 2015 20:07:38 +0000 (20:07 +0000)
committerTim Northover <tnorthover@apple.com>
Wed, 6 May 2015 20:07:38 +0000 (20:07 +0000)
commite4310fe9466396b874576018ae3c8a7487c1b9c2
tree88b0b911ff9274bf702e0aaebca8dca13220b6ae
parent5db6639225a416662660125484bad58f81038e7a
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: 236635
llvm/lib/CodeGen/Analysis.cpp
llvm/test/CodeGen/AArch64/tail-call.ll