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 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
|
# RUN: llc -mtriple=ve -verify-machineinstrs -run-pass peephole-opt -o - %s | FileCheck %s
---
## Ensure fold immediate as simm7 at rhs
#CHECK-LABEL: name: addsl_ri
#CHECK: %2:i64 = nsw ADDSLri %0, 5
name: addsl_ri
alignment: 16
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
failedISel: false
tracksRegLiveness: true
hasWinCFI: false
registers:
- { id: 0, class: i64, preferred-register: '' }
- { id: 1, class: i64, preferred-register: '' }
liveins:
- { reg: '$sx0', virtual-reg: '%0' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 0
offsetAdjustment: 0
maxAlignment: 8
adjustsStack: false
hasCalls: false
stackProtector: ''
maxCallFrameSize: 4294967295
cvBytesOfCalleeSavedRegisters: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
localFrameSize: 0
savePoint: ''
restorePoint: ''
fixedStack: []
stack: []
callSites: []
debugValueSubstitutions: []
constants: []
machineFunctionInfo: {}
body: |
bb.0:
liveins: $sx0
%0:i64 = COPY $sx0
%1:i64 = ORim 5, 0
%2:i64 = nsw ADDSLrr %0, %1
$sx0 = COPY %2
RET implicit $sx10, implicit $sx0
...
---
## Ensure fold immediate as mimm at rhs
#CHECK-LABEL: name: addsl_rm
#CHECK: %2:i64 = nsw ADDSLrm %0, 120
name: addsl_rm
alignment: 16
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
failedISel: false
tracksRegLiveness: true
hasWinCFI: false
registers:
- { id: 0, class: i64, preferred-register: '' }
- { id: 1, class: i64, preferred-register: '' }
liveins:
- { reg: '$sx0', virtual-reg: '%0' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 0
offsetAdjustment: 0
maxAlignment: 8
adjustsStack: false
hasCalls: false
stackProtector: ''
maxCallFrameSize: 4294967295
cvBytesOfCalleeSavedRegisters: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
localFrameSize: 0
savePoint: ''
restorePoint: ''
fixedStack: []
stack: []
callSites: []
debugValueSubstitutions: []
constants: []
machineFunctionInfo: {}
body: |
bb.0:
liveins: $sx0
%0:i64 = COPY $sx0
%1:i64 = ORim 0, 120
%2:i64 = nsw ADDSLrr %0, %1
$sx0 = COPY %2
RET implicit $sx10, implicit $sx0
...
---
## Ensure fold immediate as simm7 at lhs
#CHECK-LABEL: name: addsl_ri_com
#CHECK: %2:i64 = nsw ADDSLri %0, 5
name: addsl_ri_com
alignment: 16
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
failedISel: false
tracksRegLiveness: true
hasWinCFI: false
registers:
- { id: 0, class: i64, preferred-register: '' }
- { id: 1, class: i64, preferred-register: '' }
liveins:
- { reg: '$sx0', virtual-reg: '%0' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 0
offsetAdjustment: 0
maxAlignment: 8
adjustsStack: false
hasCalls: false
stackProtector: ''
maxCallFrameSize: 4294967295
cvBytesOfCalleeSavedRegisters: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
localFrameSize: 0
savePoint: ''
restorePoint: ''
fixedStack: []
stack: []
callSites: []
debugValueSubstitutions: []
constants: []
machineFunctionInfo: {}
body: |
bb.0:
liveins: $sx0
%0:i64 = COPY $sx0
%1:i64 = ORim 5, 0
%2:i64 = nsw ADDSLrr %1, %0
$sx0 = COPY %2
RET implicit $sx10, implicit $sx0
...
---
## Ensure fold immediate as mimm at rhs
#CHECK-LABEL: name: addsl_rm_com
#CHECK: %2:i64 = nsw ADDSLrm %0, 120
name: addsl_rm_com
alignment: 16
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
failedISel: false
tracksRegLiveness: true
hasWinCFI: false
registers:
- { id: 0, class: i64, preferred-register: '' }
- { id: 1, class: i64, preferred-register: '' }
liveins:
- { reg: '$sx0', virtual-reg: '%0' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 0
offsetAdjustment: 0
maxAlignment: 8
adjustsStack: false
hasCalls: false
stackProtector: ''
maxCallFrameSize: 4294967295
cvBytesOfCalleeSavedRegisters: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
localFrameSize: 0
savePoint: ''
restorePoint: ''
fixedStack: []
stack: []
callSites: []
debugValueSubstitutions: []
constants: []
machineFunctionInfo: {}
body: |
bb.0:
liveins: $sx0
%0:i64 = COPY $sx0
%1:i64 = ORim 0, 120
%2:i64 = nsw ADDSLrr %1, %0
$sx0 = COPY %2
RET implicit $sx10, implicit $sx0
...
|