From: Zvi Rackover Date: Sun, 2 Apr 2017 10:42:21 +0000 (+0000) Subject: Add another interesting shufflevector test case for InstSimplify. NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a544ecba50237372c99b39e7731f6a04bb70c3b4;p=llvm Add another interesting shufflevector test case for InstSimplify. NFC. Test case shows opportunity to constant fold a shuffle with one variable input vector operand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299327 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Transforms/InstSimplify/shufflevector.ll b/test/Transforms/InstSimplify/shufflevector.ll index 1baecd2e749..4a9c0dfb234 100644 --- a/test/Transforms/InstSimplify/shufflevector.ll +++ b/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> +; CHECK-NEXT: ret <4 x i32> [[SHUF]] +; + %shuf = shufflevector <4 x i32> %x, <4 x i32> zeroinitializer, <4 x i32> + 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