[llvm] r320014 - [InstSimplify] Add tests for the rL319894

Igor Laevsky via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 00:52:25 PST 2017


Author: igor.laevsky
Date: Thu Dec  7 00:52:24 2017
New Revision: 320014

URL: http://llvm.org/viewvc/llvm-project?rev=320014&view=rev
Log:
[InstSimplify] Add tests for the rL319894

Differential Revision: https://reviews.llvm.org/D40650


Added:
    llvm/trunk/test/Transforms/InstCombine/pr28725.ll
    llvm/trunk/test/Transforms/InstSimplify/insertelement.ll

Added: llvm/trunk/test/Transforms/InstCombine/pr28725.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/pr28725.ll?rev=320014&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/pr28725.ll (added)
+++ llvm/trunk/test/Transforms/InstCombine/pr28725.ll Thu Dec  7 00:52:24 2017
@@ -0,0 +1,11 @@
+; RUN: opt -S -instcombine < %s | FileCheck %s
+%S = type { i16, i32 }
+
+define <2 x i16> @test1() {
+entry:
+  %b = insertelement <2 x i16> <i16 undef, i16 0>, i16 extractvalue (%S select (i1 icmp eq (i16 extractelement (<2 x i16> bitcast (<1 x i32> <i32 1> to <2 x i16>), i32 0), i16 0), %S zeroinitializer, %S { i16 0, i32 1 }), 0), i32 0
+  ret <2 x i16> %b
+}
+
+; CHECK-LABEL: @test1(
+; CHECK: ret <2 x i16> zeroinitializer

Added: llvm/trunk/test/Transforms/InstSimplify/insertelement.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstSimplify/insertelement.ll?rev=320014&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/InstSimplify/insertelement.ll (added)
+++ llvm/trunk/test/Transforms/InstSimplify/insertelement.ll Thu Dec  7 00:52:24 2017
@@ -0,0 +1,25 @@
+; RUN: opt -S -instsimplify < %s | FileCheck %s
+
+define <4 x i32> @test1(<4 x i32> %A) {
+  %I = insertelement <4 x i32> %A, i32 5, i64 4294967296
+  ; CHECK: ret <4 x i32> undef
+  ret <4 x i32> %I
+}
+
+define <4 x i32> @test2(<4 x i32> %A) {
+  %I = insertelement <4 x i32> %A, i32 5, i64 4
+  ; CHECK: ret <4 x i32> undef
+  ret <4 x i32> %I
+}
+
+define <4 x i32> @test3(<4 x i32> %A) {
+  %I = insertelement <4 x i32> %A, i32 5, i64 1
+  ; CHECK: ret <4 x i32> %I
+  ret <4 x i32> %I
+}
+
+define <4 x i32> @test4(<4 x i32> %A) {
+  %I = insertelement <4 x i32> %A, i32 5, i128 100
+  ; CHECK: ret <4 x i32> undef
+  ret <4 x i32> %I
+}




More information about the llvm-commits mailing list