diff options
| author | Silviu Baranga <silviu.baranga@arm.com> | 2015-09-10 10:34:34 +0000 |
|---|---|---|
| committer | Silviu Baranga <silviu.baranga@arm.com> | 2015-09-10 10:34:34 +0000 |
| commit | df9ce8408a2ca784856032f0a2e32022430e5fec (patch) | |
| tree | cff626959ed38008a0986ffa3ba0101148c0d214 /llvm/test/CodeGen | |
| parent | d47634d78123c998dd2ae58dbf5ec29ee832b0b4 (diff) | |
| download | bcm5719-llvm-df9ce8408a2ca784856032f0a2e32022430e5fec.tar.gz bcm5719-llvm-df9ce8408a2ca784856032f0a2e32022430e5fec.zip | |
[DAGCombine] Truncate BUILD_VECTOR operators if necessary when constant folding vectors
Summary:
The BUILD_VECTOR node will truncate its operators to match the
type. We need to take this into account when constant folding -
we need to perform a truncation before constant folding the elements.
This is because the upper bits can change the result, depending on
the operation type (for example this is the case for min/max).
This change also adds a regression test.
Reviewers: jmolloy
Subscribers: jmolloy, llvm-commits
Differential Revision: http://reviews.llvm.org/D12697
llvm-svn: 247265
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/AArch64/aarch64-smax-constantfold.ll | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/aarch64-smax-constantfold.ll b/llvm/test/CodeGen/AArch64/aarch64-smax-constantfold.ll new file mode 100644 index 00000000000..0e5b59f9512 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/aarch64-smax-constantfold.ll @@ -0,0 +1,12 @@ +; RUN: llc -mtriple=aarch64-none-linux-gnu < %s -o -| FileCheck %s + +; Function Attrs: nounwind readnone +declare <4 x i16> @llvm.aarch64.neon.smax.v4i16(<4 x i16>, <4 x i16>) + +; CHECK-LABEL: test +define <4 x i16> @test() { +entry: +; CHECK: movi d{{[0-9]+}}, #0000000000000000 + %0 = tail call <4 x i16> @llvm.aarch64.neon.smax.v4i16(<4 x i16> <i16 -1, i16 -1, i16 -1, i16 -1>, <4 x i16> zeroinitializer) + ret <4 x i16> %0 +} |

