[llvm] 9cd8db1 - [NFC][PowerPC] Add 2 test cases to early-ret.mir to test BLR and BCCLR
Kang Zhang via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 17 08:53:23 PDT 2020
Author: Kang Zhang
Date: 2020-03-17T15:52:44Z
New Revision: 9cd8db1c80c252719e1294c753996000aa23527d
URL: https://github.com/llvm/llvm-project/commit/9cd8db1c80c252719e1294c753996000aa23527d
DIFF: https://github.com/llvm/llvm-project/commit/9cd8db1c80c252719e1294c753996000aa23527d.diff
LOG: [NFC][PowerPC] Add 2 test cases to early-ret.mir to test BLR and BCCLR
Added:
Modified:
llvm/test/CodeGen/PowerPC/early-ret.mir
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/PowerPC/early-ret.mir b/llvm/test/CodeGen/PowerPC/early-ret.mir
index 6897b208bb92..f534fd0e2702 100644
--- a/llvm/test/CodeGen/PowerPC/early-ret.mir
+++ b/llvm/test/CodeGen/PowerPC/early-ret.mir
@@ -1,6 +1,39 @@
# RUN: llc -mtriple powerpc64le-unknown-linux-gnu -run-pass=ppc-early-ret -o \
# RUN: - %s -verify-machineinstrs | FileCheck %s
+---
+name: testBLR
+body: |
+ bb.0.entry:
+ successors: %bb.1(0x40000000), %bb.2(0x40000000)
+ liveins: $r3, $r4
+
+ renamable $cr0 = CMPWI renamable $r3, 0
+ BC killed renamable $cr0gt, %bb.1
+ B %bb.2
+
+ bb.1.entry:
+ successors: %bb.2(0x80000000)
+ liveins: $r4
+
+ renamable $r3 = ADDI killed renamable $r4, 0
+
+ bb.2.entry:
+ liveins: $r3, $r4, $cr0eq, $cr0lt, $cr0un, $cr0, $cr0gt, $r3, $r3, $r4, $r3, $cr0gt
+
+ BLR implicit $lr, implicit $rm, implicit killed $r3
+
+ ; CHECK-LABEL: name: testBLR
+ ; CHECK: bb.0.entry:
+ ; CHECK: renamable $cr0 = CMPWI renamable $r3, 0
+ ; CHECK: BC killed renamable $cr0gt, %bb.1
+ ; CHECK: BLR implicit $lr, implicit $rm, implicit $lr, implicit $rm, implicit killed $r3
+ ; CHECK: bb.1.entry:
+ ; CHECK: renamable $r3 = ADDI killed renamable $r4, 0
+ ; CHECK: BLR implicit $lr, implicit $rm, implicit killed $r3
+...
+
+
---
name: testBCLRn
body: |
@@ -81,3 +114,33 @@ body: |
; CHECK: $v2 = VOR killed $v3, $v3
; CHECK: BLR implicit $lr, implicit $rm, implicit killed $v2
...
+
+
+---
+name: testBCCLR
+body: |
+ bb.0.entry:
+ successors: %bb.2(0x40000000), %bb.1(0x40000000)
+
+ renamable $r4 = LI 0
+ renamable $cr0 = CMPLWI killed renamable $r4, 0
+ BCC 68, renamable $cr0, %bb.2
+
+ bb.1:
+ successors: %bb.2(0x40000000)
+ liveins: $cr0
+
+ BCC 68, killed renamable $cr0, %bb.2
+
+ bb.2:
+ BLR implicit $lr, implicit $rm
+
+ ; CHECK-LABEL: name: testBCCLR
+ ; CHECK: bb.0.entry:
+ ; CHECK: renamable $r4 = LI 0
+ ; CHECK: renamable $cr0 = CMPLWI killed renamable $r4, 0
+ ; CHECK: BCCLR 68, $cr0, implicit $lr, implicit $rm, implicit $lr, implicit $rm
+ ; CHECK: bb.1:
+ ; CHECK: BCCLR 68, $cr0, implicit $lr, implicit $rm, implicit $lr, implicit $rm
+ ; CHECK: BLR implicit $lr, implicit $rm
+...
More information about the llvm-commits
mailing list