• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llc -start-after=dead-mi-elimination -stop-after=twoaddressinstruction -o - %s | FileCheck %s
2
3--- |
4  target datalayout = "E-m:e-i64:64-n32:64"
5  target triple = "powerpc64-unknown-linux-gnu"
6
7  @d = global i32 15, align 4
8  @b = global i32* @d, align 8
9  @a = common global i32 0, align 4
10
11  ; Function Attrs: nounwind
12  define signext i32 @main() #0 {
13  entry:
14    %0 = load i32*, i32** @b, align 8
15    %1 = load i32, i32* @a, align 4
16    %lnot = icmp eq i32 %1, 0
17    %lnot.ext = zext i1 %lnot to i32
18    %shr.i = lshr i32 2072, %lnot.ext
19    %call.lobit = lshr i32 %shr.i, 7
20    %2 = and i32 %call.lobit, 1
21    %3 = load i32, i32* %0, align 4
22    %or = or i32 %2, %3
23    store i32 %or, i32* %0, align 4
24    %4 = load i32, i32* @a, align 4
25    %lnot.1 = icmp eq i32 %4, 0
26    %lnot.ext.1 = zext i1 %lnot.1 to i32
27    %shr.i.1 = lshr i32 2072, %lnot.ext.1
28    %call.lobit.1 = lshr i32 %shr.i.1, 7
29    %5 = and i32 %call.lobit.1, 1
30    %or.1 = or i32 %5, %or
31    store i32 %or.1, i32* %0, align 4
32    ret i32 %or.1
33  }
34
35  attributes #0 = { nounwind "target-cpu"="ppc64" }
36
37...
38---
39name:            main
40alignment:       4
41exposesReturnsTwice: false
42tracksRegLiveness: true
43registers:
44  - { id: 0, class: g8rc_and_g8rc_nox0 }
45  - { id: 1, class: g8rc_and_g8rc_nox0 }
46  - { id: 2, class: gprc }
47  - { id: 3, class: gprc }
48  - { id: 4, class: gprc }
49  - { id: 5, class: g8rc_and_g8rc_nox0 }
50  - { id: 6, class: g8rc_and_g8rc_nox0 }
51  - { id: 7, class: gprc }
52  - { id: 8, class: gprc }
53  - { id: 9, class: gprc }
54  - { id: 10, class: g8rc }
55frameInfo:
56  isFrameAddressTaken: false
57  isReturnAddressTaken: false
58  hasStackMap:     false
59  hasPatchPoint:   false
60  stackSize:       0
61  offsetAdjustment: 0
62  maxAlignment:    0
63  adjustsStack:    false
64  hasCalls:        false
65  maxCallFrameSize: 0
66  hasOpaqueSPAdjustment: false
67  hasVAStart:      false
68  hasMustTailInVarArgFunc: false
69body:             |
70  bb.0.entry:
71    liveins: $x2
72
73    %0 = ADDIStocHA8 $x2, @b
74    %1 = LD target-flags(ppc-toc-lo) @b, killed %0 :: (load 8 from @b)
75    %2 = LWZ 0, %1 :: (load 4 from %ir.0)
76    %3 = LI 0
77    %4 = RLWIMI %3, killed %2, 0, 0, 31
78    ; CHECK-LABEL: name: main
79    ; CHECK: %[[REG1:[0-9]+]]:gprc = LI 0
80    ; CHECK: %[[REG2:[0-9]+]]:gprc = COPY %[[REG1]]
81    ; CHECK: %[[REG2]]:gprc = RLWIMI %[[REG2]], killed %2, 0, 0, 31
82    %8 = RLWIMI %3, %4, 0, 0, 31
83    STW %4, 0, %1 :: (store 4 into %ir.0)
84    %10 = EXTSW_32_64 %8
85    STW %8, 0, %1 :: (store 4 into %ir.0)
86    $x3 = COPY %10
87    BLR8 implicit $x3, implicit $lr8, implicit $rm
88
89...
90