blob: 0960a8d6716b375b6ccd8347ca587b66bff8aa90 [file] [log] [blame]
Tony Jiang3b49dc52017-12-11 20:42:37 +00001# This file tests the scenario: ISEL RX, RY, RY, CR (X != 0 && Y != 0)
2# It is folded into a copy (%RX = OR %RY, %RY)
3# RUN: llc -ppc-gen-isel=true -run-pass ppc-expand-isel -o - %s | FileCheck %s
4
5--- |
6 target datalayout = "E-m:e-i64:64-n32:64"
7 target triple = "powerpc64-unknown-linux-gnu"
8 define signext i32 @testExpandISEL(i32 signext %i, i32 signext %j) {
9 entry:
10 %cmp = icmp sgt i32 %i, 0
11 %add = add nsw i32 %i, 1
12 %cond = select i1 %cmp, i32 %add, i32 %j
13 ret i32 %cond
14 }
15
16...
17---
18name: testExpandISEL
19alignment: 2
20exposesReturnsTwice: false
21legalized: false
22regBankSelected: false
23selected: false
24tracksRegLiveness: true
25liveins:
Puyan Lotfi43e94b12018-01-31 22:04:26 +000026 - { reg: '$x3' }
27 - { reg: '$x4' }
Tony Jiang3b49dc52017-12-11 20:42:37 +000028frameInfo:
29 isFrameAddressTaken: false
30 isReturnAddressTaken: false
31 hasStackMap: false
32 hasPatchPoint: false
33 stackSize: 0
34 offsetAdjustment: 0
35 maxAlignment: 0
36 adjustsStack: false
37 hasCalls: false
38 maxCallFrameSize: 0
39 hasOpaqueSPAdjustment: false
40 hasVAStart: false
41 hasMustTailInVarArgFunc: false
42body: |
43 bb.0.entry:
Puyan Lotfi43e94b12018-01-31 22:04:26 +000044 liveins: $x3, $x4
Tony Jiang3b49dc52017-12-11 20:42:37 +000045
Puyan Lotfi43e94b12018-01-31 22:04:26 +000046 $r5 = ADDI $r3, 1
47 $cr0 = CMPWI $r3, 0
48 $r3 = ISEL $r4, $r4, $cr0gt
Tony Jiang3b49dc52017-12-11 20:42:37 +000049 ; Test fold ISEL to a copy
Puyan Lotfi43e94b12018-01-31 22:04:26 +000050 ; CHECK: $r3 = OR $r4, $r4
Tony Jiang3b49dc52017-12-11 20:42:37 +000051
Puyan Lotfi43e94b12018-01-31 22:04:26 +000052 $x3 = EXTSW_32_64 $r3
Tony Jiang3b49dc52017-12-11 20:42:37 +000053
54...