DeadArgElim: fix mismatch in accounting of array return types.
authorTim Northover <tnorthover@apple.com>
Mon, 9 Feb 2015 01:21:00 +0000 (01:21 +0000)
committerTim Northover <tnorthover@apple.com>
Mon, 9 Feb 2015 01:21:00 +0000 (01:21 +0000)
commit968ed6a5f0e69e75de0b61982e19698848442c6f
tree0adc2bc61403e97caca956de1f973458da874ed7
parentc4af8c94675626aac3e1ed3fa1809df753273d28
DeadArgElim: fix mismatch in accounting of array return types.

Some parts of DeadArgElim were only considering the individual fields
of StructTypes separately, but others (where insertvalue &
extractvalue instructions occur) also looked into ArrayTypes.

This one is an actual bug; the mismatch can lead to an argument being
considered used by a return sub-value that isn't being tracked (and
hence is dead by default). It then gets incorrectly eliminated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228559 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/DeadArgumentElimination.cpp
test/Transforms/DeadArgElim/aggregates.ll