From cd855f70c5230a79d0b91cbbf6fb959572e67c50 Mon Sep 17 00:00:00 2001 From: Evandro Menezes Date: Mon, 5 Mar 2018 17:02:47 +0000 Subject: [AArch64] Improve code generation of constant vectors Use the whole gammut of constant immediates available to set up a vector. Instead of using, for example, `mov w0, #0xffff; dup v0.4s, w0`, which transfers between register files, use the more efficient `movi v0.4s, #-1` instead. Not limited to just a few values, but any immediate value that can be encoded by all the variants of `FMOV`, `MOVI`, `MVNI`, thus eliminating the need to there be patterns to optimize special cases. Differential revision: https://reviews.llvm.org/D42133 llvm-svn: 326718 --- llvm/test/CodeGen/AArch64/arm64-vector-insertion.ll | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'llvm/test/CodeGen/AArch64/arm64-vector-insertion.ll') diff --git a/llvm/test/CodeGen/AArch64/arm64-vector-insertion.ll b/llvm/test/CodeGen/AArch64/arm64-vector-insertion.ll index c96e735dc81..23f9d906034 100644 --- a/llvm/test/CodeGen/AArch64/arm64-vector-insertion.ll +++ b/llvm/test/CodeGen/AArch64/arm64-vector-insertion.ll @@ -8,7 +8,7 @@ entry: ret void ; CHECK-LABEL: test0f - ; CHECK: movi.4s v[[TEMP:[0-9]+]], #0 + ; CHECK: movi.2d v[[TEMP:[0-9]+]], #0 ; CHECK: mov.s v[[TEMP]][0], v{{[0-9]+}}[0] ; CHECK: str q[[TEMP]], [x0] ; CHECK: ret @@ -24,9 +24,8 @@ entry: ret void ; CHECK-LABEL: test1f - ; CHECK: fmov s[[TEMP:[0-9]+]], #1.0000000 - ; CHECK: dup.4s v[[TEMP2:[0-9]+]], v[[TEMP]][0] - ; CHECK: mov.s v[[TEMP2]][0], v0[0] - ; CHECK: str q[[TEMP2]], [x0] + ; CHECK: fmov.4s v[[TEMP:[0-9]+]], #1.0 + ; CHECK: mov.s v[[TEMP]][0], v0[0] + ; CHECK: str q[[TEMP]], [x0] ; CHECK: ret } -- cgit v1.2.3