summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/PowerPC
diff options
context:
space:
mode:
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>2018-08-17 12:35:44 +0000
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>2018-08-17 12:35:44 +0000
commit39751276b0aa7b22e50c40913b4c9f8e8a449c51 (patch)
treee5a501aab0bb4bbc44bb54ccbd6b11f246fd8674 /llvm/test/CodeGen/PowerPC
parent03e57521c0fc720b6bf7ab858f232e4d02942be4 (diff)
downloadbcm5719-llvm-39751276b0aa7b22e50c40913b4c9f8e8a449c51.tar.gz
bcm5719-llvm-39751276b0aa7b22e50c40913b4c9f8e8a449c51.zip
[PowerPC] Generate Power9 extswsli extend sign and shift immediate instruction
Add a DAG combine for the PowerPC code generator to generate the Power9 extswsli extend sign and shift immediate instruction. Patch by RolandF. Differential revision: https://reviews.llvm.org/D49879 llvm-svn: 340016
Diffstat (limited to 'llvm/test/CodeGen/PowerPC')
-rw-r--r--llvm/test/CodeGen/PowerPC/extswsli.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PowerPC/extswsli.ll b/llvm/test/CodeGen/PowerPC/extswsli.ll
new file mode 100644
index 00000000000..62014aa1042
--- /dev/null
+++ b/llvm/test/CodeGen/PowerPC/extswsli.ll
@@ -0,0 +1,17 @@
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
+; RUN: -mcpu=pwr9 -ppc-asm-full-reg-names < %s | FileCheck %s
+
+@z = external local_unnamed_addr global i32*, align 8
+
+; Function Attrs: norecurse nounwind readonly
+define signext i32 @_Z2tcii(i32 signext %x, i32 signext %y) local_unnamed_addr #0 {
+entry:
+ %0 = load i32*, i32** @z, align 8
+ %add = add nsw i32 %y, %x
+ %idxprom = sext i32 %add to i64
+ %arrayidx = getelementptr inbounds i32, i32* %0, i64 %idxprom
+ %1 = load i32, i32* %arrayidx, align 4
+ ret i32 %1
+; CHECK-LABEL: @_Z2tcii
+; CHECK: extswsli {{r[0-9]+}}, {{r[0-9]+}}, 2
+}
OpenPOWER on IntegriCloud