summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstSimplify
diff options
context:
space:
mode:
authorZvi Rackover <zvi.rackover@intel.com>2017-04-02 10:42:21 +0000
committerZvi Rackover <zvi.rackover@intel.com>2017-04-02 10:42:21 +0000
commite479980686e35ae872f03f8c56f0010bf8a5bc52 (patch)
tree649b1cfdbd5ebe13c0d5e375bf88433310752142 /llvm/test/Transforms/InstSimplify
parent15e484aa2b42bd9a199d30d1215b61297a08b2d0 (diff)
downloadbcm5719-llvm-e479980686e35ae872f03f8c56f0010bf8a5bc52.tar.gz
bcm5719-llvm-e479980686e35ae872f03f8c56f0010bf8a5bc52.zip
Add another interesting shufflevector test case for InstSimplify. NFC.
Test case shows opportunity to constant fold a shuffle with one variable input vector operand. llvm-svn: 299327
Diffstat (limited to 'llvm/test/Transforms/InstSimplify')
-rw-r--r--llvm/test/Transforms/InstSimplify/shufflevector.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/shufflevector.ll b/llvm/test/Transforms/InstSimplify/shufflevector.ll
index 1baecd2e749..4a9c0dfb234 100644
--- a/llvm/test/Transforms/InstSimplify/shufflevector.ll
+++ b/llvm/test/Transforms/InstSimplify/shufflevector.ll
@@ -1,6 +1,15 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instsimplify -S | FileCheck %s
+define <4 x i32> @const_folding(<4 x i32> %x) {
+; CHECK-LABEL: @const_folding(
+; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x i32> [[X:%.*]], <4 x i32> zeroinitializer, <4 x i32> <i32 5, i32 4, i32 5, i32 4>
+; CHECK-NEXT: ret <4 x i32> [[SHUF]]
+;
+ %shuf = shufflevector <4 x i32> %x, <4 x i32> zeroinitializer, <4 x i32> <i32 5, i32 4, i32 5, i32 4>
+ ret <4 x i32> %shuf
+}
+
define <4 x i32> @splat_operand(<4 x i32> %x) {
; CHECK-LABEL: @splat_operand(
; CHECK-NEXT: [[SPLAT:%.*]] = shufflevector <4 x i32> [[X:%.*]], <4 x i32> undef, <4 x i32> zeroinitializer
OpenPOWER on IntegriCloud