diff options
author | Eli Friedman <efriedma@quicinc.com> | 2019-12-06 12:33:46 -0800 |
---|---|---|
committer | Eli Friedman <efriedma@quicinc.com> | 2019-12-09 15:31:50 -0800 |
commit | 7c69a03c56601a55f47f29ea59e33c37e62db556 (patch) | |
tree | 946b82b7006ec374ce5f2d504361ba63626287e7 /llvm/test/Analysis | |
parent | 584ed8822631481ced8d3574cc1fed1585aed77d (diff) | |
download | bcm5719-llvm-7c69a03c56601a55f47f29ea59e33c37e62db556.tar.gz bcm5719-llvm-7c69a03c56601a55f47f29ea59e33c37e62db556.zip |
[ConstantFold][SVE] Fix constant folding for shufflevector.
Don't try to fold away shuffles which can't be folded. Fix creation of
shufflevector constant expressions.
Differential Revision: https://reviews.llvm.org/D71147
Diffstat (limited to 'llvm/test/Analysis')
-rw-r--r-- | llvm/test/Analysis/ConstantFolding/shufflevector.ll | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/Analysis/ConstantFolding/shufflevector.ll b/llvm/test/Analysis/ConstantFolding/shufflevector.ll new file mode 100644 index 00000000000..d69c2caecc0 --- /dev/null +++ b/llvm/test/Analysis/ConstantFolding/shufflevector.ll @@ -0,0 +1,11 @@ +; 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 +} |