summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/OverlappingInsertvalues.ll
diff options
context:
space:
mode:
authorMichael Zolotukhin <mzolotukhin@apple.com>2014-05-08 19:50:24 +0000
committerMichael Zolotukhin <mzolotukhin@apple.com>2014-05-08 19:50:24 +0000
commit292d3caa1528d3ed5ac056241dff9f57243aea11 (patch)
tree1ece83504beccbed9f5a636386829961b08ab472 /llvm/test/Transforms/InstCombine/OverlappingInsertvalues.ll
parent6f657c46e99528ab0146205c8f7028e6c679cd84 (diff)
downloadbcm5719-llvm-292d3caa1528d3ed5ac056241dff9f57243aea11.tar.gz
bcm5719-llvm-292d3caa1528d3ed5ac056241dff9f57243aea11.zip
[InstCombine] Some cleanup in optimization of redundant insertvalue instructions.
And one more test added. llvm-svn: 208355
Diffstat (limited to 'llvm/test/Transforms/InstCombine/OverlappingInsertvalues.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/OverlappingInsertvalues.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/OverlappingInsertvalues.ll b/llvm/test/Transforms/InstCombine/OverlappingInsertvalues.ll
index 3af684bf4b3..9248aecdf57 100644
--- a/llvm/test/Transforms/InstCombine/OverlappingInsertvalues.ll
+++ b/llvm/test/Transforms/InstCombine/OverlappingInsertvalues.ll
@@ -23,3 +23,14 @@ entry:
%4 = insertvalue { i8*, i64, i32 } %3, i32 777, 2
ret { i8*, i64, i32 } %4
}
+; Check that we propagate insertvalues only if they are use as the first
+; operand (as initial value of aggregate)
+; CHECK-LABEL: foo_use_as_second_operand
+; CHECK: i16 %x, 0
+; CHECK: %0, 1
+define { i8, {i16, i32} } @foo_use_as_second_operand(i16 %x) nounwind {
+entry:
+ %0 = insertvalue { i16, i32 } undef, i16 %x, 0
+ %1 = insertvalue { i8, {i16, i32} } undef, { i16, i32 } %0, 1
+ ret { i8, {i16, i32} } %1
+}
OpenPOWER on IntegriCloud