summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/ptr-int-cast.ll
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-02-05 20:22:40 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-02-05 20:22:40 +0000
commit944e0abf044b8f615086a4a9068ee5c723bdbf31 (patch)
treeedb67bc5d3c81005fbb99fde30e3c0c4aec3e05a /llvm/test/Transforms/InstCombine/ptr-int-cast.ll
parentcb9870dad880402de00c13c72bac5bb13d26523f (diff)
downloadbcm5719-llvm-944e0abf044b8f615086a4a9068ee5c723bdbf31.tar.gz
bcm5719-llvm-944e0abf044b8f615086a4a9068ee5c723bdbf31.zip
InstCombine: Fix and simplify the inttoptr side too.
llvm-svn: 174438
Diffstat (limited to 'llvm/test/Transforms/InstCombine/ptr-int-cast.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/ptr-int-cast.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/ptr-int-cast.ll b/llvm/test/Transforms/InstCombine/ptr-int-cast.ll
index 40a1bc220a4..7a6ecff9c0b 100644
--- a/llvm/test/Transforms/InstCombine/ptr-int-cast.ll
+++ b/llvm/test/Transforms/InstCombine/ptr-int-cast.ll
@@ -42,3 +42,19 @@ define <4 x i128> @test5(<4 x i8*> %arg) nounwind {
%p1 = ptrtoint <4 x i8*> %arg to <4 x i128>
ret <4 x i128> %p1
}
+
+define <4 x i8*> @test6(<4 x i32> %arg) nounwind {
+; CHECK: @test6
+; CHECK: zext <4 x i32> %arg to <4 x i64>
+; CHECK: inttoptr <4 x i64> %1 to <4 x i8*>
+ %p1 = inttoptr <4 x i32> %arg to <4 x i8*>
+ ret <4 x i8*> %p1
+}
+
+define <4 x i8*> @test7(<4 x i128> %arg) nounwind {
+; CHECK: @test7
+; CHECK: trunc <4 x i128> %arg to <4 x i64>
+; CHECK: inttoptr <4 x i64> %1 to <4 x i8*>
+ %p1 = inttoptr <4 x i128> %arg to <4 x i8*>
+ ret <4 x i8*> %p1
+}
OpenPOWER on IntegriCloud