summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/PowerPC/knowCRBitSpill.ll
diff options
context:
space:
mode:
authorYi-Hong Lyu <Yi-Hong.Lyu@ibm.com>2019-09-12 06:49:02 +0000
committerYi-Hong Lyu <Yi-Hong.Lyu@ibm.com>2019-11-08 15:32:31 +0000
commita3db9c08ebdf1f39ed89f4a7afa09fc153cf98c5 (patch)
tree285bb4f1cfea51ba911e3e18d5aa370a6dae62e9 /llvm/test/CodeGen/PowerPC/knowCRBitSpill.ll
parent9ee76ab37f1efa91432ec4efcba05819ccaeb2b1 (diff)
downloadbcm5719-llvm-a3db9c08ebdf1f39ed89f4a7afa09fc153cf98c5.tar.gz
bcm5719-llvm-a3db9c08ebdf1f39ed89f4a7afa09fc153cf98c5.zip
[PowerPC] Remove redundant CRSET/CRUNSET in custom lowering of known CR bit spills
We lower known CR bit spills (CRSET/CRUNSET) to load and spill the known value but forgot to remove the redundant spills. e.g., This sequence was used to spill a CRUNSET: crclr 4*cr5+lt mfocrf r3,4 rlwinm r3,r3,20,0,0 stw r3,132(r1) Custom lowering of known CR bit spills lower it to: crxor 4*cr5+lt, 4*cr5+lt, 4*cr5+lt li r3,0 stw r3,132(r1) crxor is redundant if there is no use of 4*cr5+lt so we should remove it Differential revision: https://reviews.llvm.org/D67722
Diffstat (limited to 'llvm/test/CodeGen/PowerPC/knowCRBitSpill.ll')
-rw-r--r--llvm/test/CodeGen/PowerPC/knowCRBitSpill.ll7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/PowerPC/knowCRBitSpill.ll b/llvm/test/CodeGen/PowerPC/knowCRBitSpill.ll
index e3a0e0ba9c3..7f8807d2f46 100644
--- a/llvm/test/CodeGen/PowerPC/knowCRBitSpill.ll
+++ b/llvm/test/CodeGen/PowerPC/knowCRBitSpill.ll
@@ -2,6 +2,9 @@
; RUN: -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | FileCheck %s
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 \
; RUN: -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | FileCheck %s
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -ppc-late-peephole=false \
+; RUN: -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | FileCheck %s \
+; RUN: --implicit-check-not creqv --implicit-check-not crxor
; For known CRBit spills, CRSET/CRUNSET, it is more efficient to just load and
@@ -21,7 +24,7 @@ define dso_local signext i32 @spillCRSET(i32 signext %p1, i32 signext %p2) {
; CHECK-DAG: mfocrf [[REG2:.*]], [[CREG]]
; CHECK-DAG: rlwinm [[REG2]], [[REG2]]
; CHECK: .LBB0_3:
-; CHECK-DAG: creqv [[CREG:.*]]*cr5+lt, [[CREG]]*cr5+lt, [[CREG]]*cr5+lt
+; CHECK-NOT: #UNENCODED_NOP
; CHECK: lis [[REG1:.*]], -32768
; CHECK: .LBB0_4:
; CHECK-NOT: mfocrf [[REG2:.*]], [[CREG]]
@@ -81,8 +84,8 @@ if.end13: ; preds = %if.then6, %for.end,
define dso_local signext i32 @spillCRUNSET(%struct.p5rx* readonly %p1, i32 signext %p2, i32 signext %p3) {
; CHECK-LABEL: spillCRUNSET:
; CHECK: # %bb.0: # %entry
-; CHECK-DAG: crxor [[CREG:.*]]*cr5+lt, [[CREG]]*cr5+lt, [[CREG]]*cr5+lt
; CHECK-DAG: li [[REG1:.*]], 0
+; CHECK-NOT: #UNENCODED_NOP
; CHECK-NOT: mfocrf [[REG2:.*]], [[CREG]]
; CHECK-NOT: rlwinm [[REG2]], [[REG2]]
; CHECK: stw [[REG1]]
OpenPOWER on IntegriCloud