[llvm] 5389ca7 - [ConstantFold][NFC] Move scalable vector unit tests under vscale.ll

Huihui Zhang via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 5 16:05:11 PST 2020


Author: Huihui Zhang
Date: 2020-02-05T16:03:51-08:00
New Revision: 5389ca7a1fb3b760013c1c5e53768f570a5e53f7

URL: https://github.com/llvm/llvm-project/commit/5389ca7a1fb3b760013c1c5e53768f570a5e53f7
DIFF: https://github.com/llvm/llvm-project/commit/5389ca7a1fb3b760013c1c5e53768f570a5e53f7.diff

LOG: [ConstantFold][NFC] Move scalable vector unit tests under vscale.ll

Added: 
    

Modified: 
    llvm/test/Analysis/ConstantFolding/vscale.ll

Removed: 
    llvm/test/Analysis/ConstantFolding/bitcast.ll
    llvm/test/Analysis/ConstantFolding/insertelement.ll
    llvm/test/Analysis/ConstantFolding/shufflevector.ll


################################################################################
diff  --git a/llvm/test/Analysis/ConstantFolding/bitcast.ll b/llvm/test/Analysis/ConstantFolding/bitcast.ll
deleted file mode 100644
index 68e4a5fe374d..000000000000
--- a/llvm/test/Analysis/ConstantFolding/bitcast.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -constprop -S -verify | FileCheck %s
-
-define <vscale x 4 x float> @bitcast_scalable_constant() {
-; CHECK-LABEL: @bitcast_scalable_constant(
-; CHECK-NEXT:    ret <vscale x 4 x float> bitcast (<vscale x 4 x i32> shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> undef, i32 1, i32 0), <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer) to <vscale x 4 x float>)
-;
-  %i1 = insertelement <vscale x 4 x i32> undef, i32 1, i32 0
-  %i2 = shufflevector <vscale x 4 x i32> %i1, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
-  %i3 = bitcast <vscale x 4 x i32> %i2 to <vscale x 4 x float>
-  ret <vscale x 4 x float> %i3
-}

diff  --git a/llvm/test/Analysis/ConstantFolding/insertelement.ll b/llvm/test/Analysis/ConstantFolding/insertelement.ll
deleted file mode 100644
index 960042acfb46..000000000000
--- a/llvm/test/Analysis/ConstantFolding/insertelement.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -constprop -S | FileCheck %s
-
-
-define <4 x i32> @insertelement_fixedlength_constant() {
-; CHECK-LABEL: @insertelement_fixedlength_constant(
-; CHECK-NEXT:    ret <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
-;
-  %i = insertelement <4 x i32> undef, i32 1, i32 0
-  ret <4 x i32> %i
-}
-
-define <vscale x 4 x i32> @insertelement_scalable_constant() {
-; CHECK-LABEL: @insertelement_scalable_constant(
-; CHECK-NEXT:    ret <vscale x 4 x i32> insertelement (<vscale x 4 x i32> undef, i32 1, i32 0)
-;
-  %i = insertelement <vscale x 4 x i32> undef, i32 1, i32 0
-  ret <vscale x 4 x i32> %i
-}

diff  --git a/llvm/test/Analysis/ConstantFolding/shufflevector.ll b/llvm/test/Analysis/ConstantFolding/shufflevector.ll
deleted file mode 100644
index d69c2caecc01..000000000000
--- a/llvm/test/Analysis/ConstantFolding/shufflevector.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -constprop -S | FileCheck %s
-
-define <vscale x 4 x i32> @shufflevector_scalable_constant() {
-; CHECK-LABEL: @shufflevector_scalable_constant(
-; CHECK-NEXT:    ret <vscale x 4 x i32> shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> undef, i32 1, i32 0), <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer)
-;
-  %i = insertelement <vscale x 4 x i32> undef, i32 1, i32 0
-  %i2 = shufflevector <vscale x 4 x i32> %i, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
-  ret <vscale x 4 x i32> %i2
-}

diff  --git a/llvm/test/Analysis/ConstantFolding/vscale.ll b/llvm/test/Analysis/ConstantFolding/vscale.ll
index 180e469a3555..2491308910df 100644
--- a/llvm/test/Analysis/ConstantFolding/vscale.ll
+++ b/llvm/test/Analysis/ConstantFolding/vscale.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -constprop -S | FileCheck %s
+; RUN: opt < %s -constprop -S -verify | FileCheck %s
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Unary Operations
@@ -165,6 +165,40 @@ define <vscale x 4 x i32> @xor() {
   ret <vscale x 4 x i32> %r
 }
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Vector Operations
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+define <vscale x 4 x i32> @insertelement() {
+; CHECK-LABEL: @insertelement(
+; CHECK-NEXT:    ret <vscale x 4 x i32> insertelement (<vscale x 4 x i32> undef, i32 1, i32 0)
+;
+  %i = insertelement <vscale x 4 x i32> undef, i32 1, i32 0
+  ret <vscale x 4 x i32> %i
+}
+
+define <vscale x 4 x i32> @shufflevector() {
+; CHECK-LABEL: @shufflevector(
+; CHECK-NEXT:    ret <vscale x 4 x i32> shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> undef, i32 1, i32 0), <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer)
+;
+  %i = insertelement <vscale x 4 x i32> undef, i32 1, i32 0
+  %i2 = shufflevector <vscale x 4 x i32> %i, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
+  ret <vscale x 4 x i32> %i2
+}
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Conversion Operations
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+define <vscale x 4 x float> @bitcast() {
+; CHECK-LABEL: @bitcast(
+; CHECK-NEXT:    ret <vscale x 4 x float> bitcast (<vscale x 4 x i32> shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> undef, i32 1, i32 0), <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer) to <vscale x 4 x float>)
+;
+  %i1 = insertelement <vscale x 4 x i32> undef, i32 1, i32 0
+  %i2 = shufflevector <vscale x 4 x i32> %i1, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
+  %i3 = bitcast <vscale x 4 x i32> %i2 to <vscale x 4 x float>
+  ret <vscale x 4 x float> %i3
+}
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Other Operations
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


        


More information about the llvm-commits mailing list