diff options
author | Tim Northover <tnorthover@apple.com> | 2015-02-10 19:49:18 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2015-02-10 19:49:18 +0000 |
commit | 43c0d2db50a90f54028877869d5fb86bdb0502b7 (patch) | |
tree | f41971964cd5752239bcd7b8be801adf15ae42ac /llvm/test | |
parent | 851563f9c3bc6b5db812cfa95add5387e6e433df (diff) | |
download | bcm5719-llvm-43c0d2db50a90f54028877869d5fb86bdb0502b7.tar.gz bcm5719-llvm-43c0d2db50a90f54028877869d5fb86bdb0502b7.zip |
DeadArgElim: arguments affect all returned sub-values by default.
Unless we meet an insertvalue on a path from some value to a return, that value
will be live if *any* of the return's components are live, so all of those
components must be added to the MaybeLiveUses.
Previously we were deleting arguments if sub-value 0 turned out to be dead.
llvm-svn: 228731
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/Transforms/DeadArgElim/aggregates.ll | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/test/Transforms/DeadArgElim/aggregates.ll b/llvm/test/Transforms/DeadArgElim/aggregates.ll index 153289947c1..84370834e11 100644 --- a/llvm/test/Transforms/DeadArgElim/aggregates.ll +++ b/llvm/test/Transforms/DeadArgElim/aggregates.ll @@ -113,3 +113,20 @@ define void @test_can_shrink_arrays() { ret void } + +; Case 5: %in gets passed directly to the return. It should mark be marked as +; used if *any* of the return values are, not just if value 0 is. + +; CHECK-LABEL: define internal i32 @ret_applies_to_all({ i32, i32 } %in) +; CHECK: [[RET:%.*]] = extractvalue { i32, i32 } %in, 1 +; CHECK: ret i32 [[RET]] + +define internal {i32, i32} @ret_applies_to_all({i32, i32} %in) { + ret {i32, i32} %in +} + +define i32 @test_ret_applies_to_all() { + %val = call {i32, i32} @ret_applies_to_all({i32, i32} {i32 42, i32 43}) + %ret = extractvalue {i32, i32} %val, 1 + ret i32 %ret +} |