[FunctionAttrs] Don't try to infer returned if it is already on an argument
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 12 Sep 2016 16:04:59 +0000 (16:04 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Mon, 12 Sep 2016 16:04:59 +0000 (16:04 +0000)
commitc83044d9bb6a1fc7b0962f499c03144c6858a7bc
treec0ae7de20a16f5fcc21828cd56e95457efef1296
parent0531f0a5bbd581bcb794bfa05b80c57a4aec68cc
[FunctionAttrs] Don't try to infer returned if it is already on an argument

Trying to infer the 'returned' attribute if an argument is already
'returned' can lead to verification failure: inference might determine
that a different argument is passed through which would result in two
different arguments marked as 'returned'.

This fixes PR30350.

llvm-svn: 281221
llvm/lib/Transforms/IPO/FunctionAttrs.cpp
llvm/test/Transforms/FunctionAttrs/returned.ll