1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
|
# RUN: llc -march=hexagon -run-pass=hexagon-rdf-opt -hexagon-rdf-dump -verify-machineinstrs -o /dev/null %s 2>&1 | FileCheck %s
# Check that RDF graph has a phi node for R28 register in bb.3 and bb.4
# R28 is clobbered by memcpy call. The clobbering def must be present in bb.4's IDF
# This phi node should prevent $r27 from being replaced by $r28 by RDF copy propagation
#CHECK-LABEL: Starting copy propagation on: foo
#CHECK-LABEL: --- %bb.3 ---
#CHECK: p{{[0-9]+}}: phi [+d{{[0-9]+}}<R28>
#CHECK-LABEL: --- %bb.4 ---
#CHECK: p{{[0-9]+}}: phi [+d{{[0-9]+}}<R28>
#CHECK-LABEL: After Hexagon RDF optimizations
#CHECK-LABEL: bb.3:
#CHECK: renamable $r0 = A2_add renamable $r27
--- |
define internal fastcc void @foo() unnamed_addr {
entry:
ret void
}
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg)
---
name: foo
alignment: 16
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
failedISel: false
tracksRegLiveness: true
hasWinCFI: false
callsEHReturn: false
callsUnwindInit: false
hasEHContTarget: false
hasEHScopes: false
hasEHFunclets: false
isOutlined: false
debugInstrRef: false
failsVerification: false
tracksDebugUserValues: true
registers: []
liveins:
- { reg: '$d0', virtual-reg: '' }
- { reg: '$d3', virtual-reg: '' }
- { reg: '$r23', virtual-reg: '' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 0
offsetAdjustment: 0
maxAlignment: 8
adjustsStack: true
hasCalls: true
stackProtector: ''
functionContext: ''
maxCallFrameSize: 4294967295
cvBytesOfCalleeSavedRegisters: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
hasTailCall: false
isCalleeSavedInfoValid: false
localFrameSize: 0
savePoint: ''
restorePoint: ''
fixedStack:
- { id: 0, type: default, offset: 40, size: 8, alignment: 8, stack-id: default,
isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
stack:
- { id: 0, name: '', type: spill-slot, offset: 0, size: 8, alignment: 8,
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
- { id: 1, name: '', type: spill-slot, offset: 0, size: 8, alignment: 8,
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
- { id: 2, name: '', type: spill-slot, offset: 0, size: 8, alignment: 8,
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
- { id: 3, name: '', type: spill-slot, offset: 0, size: 8, alignment: 8,
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
entry_values: []
callSites: []
debugValueSubstitutions: []
constants: []
machineFunctionInfo: {}
body: |
bb.0.entry:
successors: %bb.1
liveins: $d0, $d3, $r23
J2_jump %bb.1, implicit-def dead $pc
bb.1:
successors: %bb.2
liveins: $d0:0x0000000000000003, $d3:0x0000000000000003, $r23
renamable $r28 = L2_loadri_io %fixed-stack.0, 0 :: (load (s32) from %fixed-stack.0)
renamable $r27 = COPY killed renamable $r28
bb.2:
successors: %bb.3
liveins: $d0:0x0000000000000003, $d3:0x0000000000000003, $r23, $r27
renamable $d10 = L2_loadrd_io %stack.0, 0 :: (load (s64) from %stack.0)
renamable $d11 = L2_loadrd_io %stack.1, 0 :: (load (s64) from %stack.1)
bb.3:
successors: %bb.4, %bb.3
liveins: $d0:0x0000000000000003, $d3:0x0000000000000003, $d10:0x0000000000000003, $d11:0x0000000000000002, $r23, $r27
ADJCALLSTACKDOWN 0, 0, implicit-def $r29, implicit-def dead $r30, implicit $r31, implicit $r30, implicit $r29
renamable $r1 = A2_add renamable $r23, killed renamable $r0
$r2 = COPY renamable $r22
renamable $r0 = A2_add renamable $r27, killed renamable $r6
J2_call &memcpy, hexagoncsr, implicit-def dead $pc, implicit-def dead $r31, implicit $r29, implicit $r0, implicit $r1, implicit $r2, implicit-def $r29, implicit-def dead $r0
renamable $p0 = C2_cmpgtp renamable $d11, renamable $d10
ADJCALLSTACKUP 0, 0, implicit-def dead $r29, implicit-def dead $r30, implicit-def dead $r31, implicit $r29
J2_jumpt killed renamable $p0, %bb.3, implicit-def dead $pc
J2_jump %bb.4, implicit-def dead $pc
bb.4:
successors: %bb.5, %bb.2
liveins: $d10:0x0000000000000003, $d11:0x0000000000000002, $r23, $r27
renamable $d0 = L2_loadrd_io %stack.2, 0 :: (load (s64) from %stack.2)
renamable $d3 = L2_loadrd_io %stack.3, 0 :: (load (s64) from %stack.3)
renamable $p0 = C2_cmpgtp killed renamable $d0, killed renamable $d3
J2_jumpt killed renamable $p0, %bb.2, implicit-def dead $pc
J2_jump %bb.5, implicit-def dead $pc
bb.5:
PS_jmpret $r31, implicit-def dead $pc
...
|