diff options
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/Transforms/EarlyCSE/AArch64/intrinsics.ll | 2 | ||||
-rw-r--r-- | llvm/test/Transforms/GVN/pr14166.ll | 4 | ||||
-rw-r--r-- | llvm/test/Transforms/InstSimplify/cast.ll | 27 |
3 files changed, 29 insertions, 4 deletions
diff --git a/llvm/test/Transforms/EarlyCSE/AArch64/intrinsics.ll b/llvm/test/Transforms/EarlyCSE/AArch64/intrinsics.ll index d166ff1e109..a75a6dc2107 100644 --- a/llvm/test/Transforms/EarlyCSE/AArch64/intrinsics.ll +++ b/llvm/test/Transforms/EarlyCSE/AArch64/intrinsics.ll @@ -40,7 +40,7 @@ entry: ; Check that the first @llvm.aarch64.neon.st2 is optimized away by Early CSE. ; CHECK-LABEL: @test_cse2 ; CHECK-NOT: call void @llvm.aarch64.neon.st2.v4i32.p0i8(<4 x i32> %3, <4 x i32> %3, i8* %0) -; CHECK: call void @llvm.aarch64.neon.st2.v4i32.p0i8(<4 x i32> %3, <4 x i32> %4, i8* %0) +; CHECK: call void @llvm.aarch64.neon.st2.v4i32.p0i8(<4 x i32> %s.coerce.fca.0.extract, <4 x i32> %s.coerce.fca.1.extract, i8* %0) %s.coerce.fca.0.extract = extractvalue [2 x <4 x i32>] %s.coerce, 0 %s.coerce.fca.1.extract = extractvalue [2 x <4 x i32>] %s.coerce, 1 br label %for.cond diff --git a/llvm/test/Transforms/GVN/pr14166.ll b/llvm/test/Transforms/GVN/pr14166.ll index ec1b1717f06..2e77496a2e4 100644 --- a/llvm/test/Transforms/GVN/pr14166.ll +++ b/llvm/test/Transforms/GVN/pr14166.ll @@ -18,9 +18,7 @@ define <2 x i32> @test1() { ; CHECK: %v4 = bitcast <2 x i32>* %v1 to <2 x i8*>* ; CHECK: store <2 x i8*> %v3, <2 x i8*>* %v4 ; CHECK: %1 = ptrtoint <2 x i8*> %v3 to <2 x i32> -; CHECK: %2 = bitcast <2 x i32> %1 to i64 -; CHECK: %3 = bitcast i64 %2 to <2 x i32> -; CHECK: ret <2 x i32> %3 +; CHECK: ret <2 x i32> %1 } declare void @anything(<2 x i32>*) diff --git a/llvm/test/Transforms/InstSimplify/cast.ll b/llvm/test/Transforms/InstSimplify/cast.ll new file mode 100644 index 00000000000..a656854478d --- /dev/null +++ b/llvm/test/Transforms/InstSimplify/cast.ll @@ -0,0 +1,27 @@ +; RUN: opt -S -instsimplify < %s | FileCheck %s + +define i1 @test1(i1 %V) { +entry: + %Z = zext i1 %V to i32 + %T = trunc i32 %Z to i1 + ret i1 %T +; CHECK-LABEL: define i1 @test1( +; CHECK: ret i1 %V +} + +define i8* @test2(i8* %V) { +entry: + %BC1 = bitcast i8* %V to i32* + %BC2 = bitcast i32* %BC1 to i8* + ret i8* %BC2 +; CHECK-LABEL: define i8* @test2( +; CHECK: ret i8* %V +} + +define i8* @test3(i8* %V) { +entry: + %BC = bitcast i8* %V to i8* + ret i8* %BC +; CHECK-LABEL: define i8* @test3( +; CHECK: ret i8* %V +} |