diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-09-12 16:04:59 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-09-12 16:04:59 +0000 |
commit | c83044d9bb6a1fc7b0962f499c03144c6858a7bc (patch) | |
tree | c0ae7de20a16f5fcc21828cd56e95457efef1296 /llvm/test/Transforms/FunctionAttrs | |
parent | 0531f0a5bbd581bcb794bfa05b80c57a4aec68cc (diff) | |
download | bcm5719-llvm-c83044d9bb6a1fc7b0962f499c03144c6858a7bc.tar.gz bcm5719-llvm-c83044d9bb6a1fc7b0962f499c03144c6858a7bc.zip |
[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
Diffstat (limited to 'llvm/test/Transforms/FunctionAttrs')
-rw-r--r-- | llvm/test/Transforms/FunctionAttrs/returned.ll | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/Transforms/FunctionAttrs/returned.ll b/llvm/test/Transforms/FunctionAttrs/returned.ll index 4e419693d9f..ede9481e433 100644 --- a/llvm/test/Transforms/FunctionAttrs/returned.ll +++ b/llvm/test/Transforms/FunctionAttrs/returned.ll @@ -16,3 +16,15 @@ lor.lhs.false: ; preds = %entry cond.end: ; preds = %entry ret i32 %p } + +; CHECK: define i32 @test2(i32 %p1, i32 returned %p2) +define i32 @test2(i32 %p1, i32 returned %p2) { + %_tmp4 = icmp eq i32 %p1, %p2 + br i1 %_tmp4, label %bb2, label %bb1 + +bb2: ; preds = %0 + ret i32 %p1 + +bb1: ; preds = %bb1, %0 + br label %bb1 +} |