From a941fe247ef597fbc9f449adb8bc02f5a9e32863 Mon Sep 17 00:00:00 2001 From: Nemanja Ivanovic Date: Thu, 22 Sep 2016 09:52:19 +0000 Subject: [Power9] Add exploitation of non-permuting memory ops This patch corresponds to review: https://reviews.llvm.org/D19825 The new lxvx/stxvx instructions do not require the swaps to line the elements up correctly. In order to select them over the lxvd2x/lxvw4x instructions which require swaps, the patterns for the old instruction have a predicate that ensures they won't be selected on Power9 and newer CPUs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282143 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/PowerPC/lxvw4x-bug.ll | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test/CodeGen/PowerPC/lxvw4x-bug.ll') diff --git a/test/CodeGen/PowerPC/lxvw4x-bug.ll b/test/CodeGen/PowerPC/lxvw4x-bug.ll index 9390819d560..33185671d40 100644 --- a/test/CodeGen/PowerPC/lxvw4x-bug.ll +++ b/test/CodeGen/PowerPC/lxvw4x-bug.ll @@ -1,4 +1,13 @@ -; RUN: llc -verify-machineinstrs -O0 -mcpu=pwr8 -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s +; RUN: llc -verify-machineinstrs -O0 -mcpu=pwr8 \ +; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s + +; RUN: llc -verify-machineinstrs -O0 -mcpu=pwr9 \ +; RUN: -mtriple=powerpc64le-unknown-unknown < %s \ +; RUN: | FileCheck %s --check-prefix=CHECK-P9 --implicit-check-not xxswapd + +; RUN: llc -verify-machineinstrs -O0 -mcpu=pwr9 -mattr=-power9-vector \ +; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s + ; Function Attrs: nounwind define void @test() { entry: @@ -17,6 +26,8 @@ entry: ; CHECK: lwa [[REG0:[0-9]+]], ; CHECK: lxvd2x [[REG1:[0-9]+]], {{[0-9]+}}, [[REG0]] ; CHECK: xxswapd [[REG1]], [[REG1]] +; CHECK-P9: lwa [[REG0:[0-9]+]], +; CHECK-P9: lxvx [[REG1:[0-9]+]], {{[0-9]+}}, [[REG0]] store <4 x i32> %4, <4 x i32>* %j, align 16 ret void } -- cgit v1.2.3