From 39b5f12dd68430c4794b1d24af0fd204c82bc12f Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Tue, 5 Feb 2013 20:22:40 +0000 Subject: InstCombine: Fix and simplify the inttoptr side too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174438 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/InstCombine/ptr-int-cast.ll | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/Transforms/InstCombine/ptr-int-cast.ll') diff --git a/test/Transforms/InstCombine/ptr-int-cast.ll b/test/Transforms/InstCombine/ptr-int-cast.ll index 40a1bc220a..7a6ecff9c0 100644 --- a/test/Transforms/InstCombine/ptr-int-cast.ll +++ b/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 +} -- cgit v1.2.3