222 lines · plain
1# RUN: llc -mtriple=ve -verify-machineinstrs -run-pass peephole-opt -o - %s | FileCheck %s2 3---4## Ensure fold immediate as simm7 at rhs5#CHECK-LABEL: name: addsl_ri6#CHECK: %2:i64 = nsw ADDSLri %0, 57name: addsl_ri8alignment: 169exposesReturnsTwice: false10legalized: false11regBankSelected: false12selected: false13failedISel: false14tracksRegLiveness: true15hasWinCFI: false16registers:17 - { id: 0, class: i64, preferred-register: '' }18 - { id: 1, class: i64, preferred-register: '' }19liveins:20 - { reg: '$sx0', virtual-reg: '%0' }21frameInfo:22 isFrameAddressTaken: false23 isReturnAddressTaken: false24 hasStackMap: false25 hasPatchPoint: false26 stackSize: 027 offsetAdjustment: 028 maxAlignment: 829 adjustsStack: false30 hasCalls: false31 stackProtector: ''32 maxCallFrameSize: 429496729533 cvBytesOfCalleeSavedRegisters: 034 hasOpaqueSPAdjustment: false35 hasVAStart: false36 hasMustTailInVarArgFunc: false37 localFrameSize: 038 savePoint: []39 restorePoint: []40fixedStack: []41stack: []42callSites: []43debugValueSubstitutions: []44constants: []45machineFunctionInfo: {}46body: |47 bb.0:48 liveins: $sx049 50 %0:i64 = COPY $sx051 %1:i64 = ORim 5, 052 %2:i64 = nsw ADDSLrr %0, %153 $sx0 = COPY %254 RET implicit $sx10, implicit $sx055 56...57 58---59## Ensure fold immediate as mimm at rhs60#CHECK-LABEL: name: addsl_rm61#CHECK: %2:i64 = nsw ADDSLrm %0, 12062name: addsl_rm63alignment: 1664exposesReturnsTwice: false65legalized: false66regBankSelected: false67selected: false68failedISel: false69tracksRegLiveness: true70hasWinCFI: false71registers:72 - { id: 0, class: i64, preferred-register: '' }73 - { id: 1, class: i64, preferred-register: '' }74liveins:75 - { reg: '$sx0', virtual-reg: '%0' }76frameInfo:77 isFrameAddressTaken: false78 isReturnAddressTaken: false79 hasStackMap: false80 hasPatchPoint: false81 stackSize: 082 offsetAdjustment: 083 maxAlignment: 884 adjustsStack: false85 hasCalls: false86 stackProtector: ''87 maxCallFrameSize: 429496729588 cvBytesOfCalleeSavedRegisters: 089 hasOpaqueSPAdjustment: false90 hasVAStart: false91 hasMustTailInVarArgFunc: false92 localFrameSize: 093 savePoint: []94 restorePoint: []95fixedStack: []96stack: []97callSites: []98debugValueSubstitutions: []99constants: []100machineFunctionInfo: {}101body: |102 bb.0:103 liveins: $sx0104 105 %0:i64 = COPY $sx0106 %1:i64 = ORim 0, 120107 %2:i64 = nsw ADDSLrr %0, %1108 $sx0 = COPY %2109 RET implicit $sx10, implicit $sx0110 111...112 113---114## Ensure fold immediate as simm7 at lhs115#CHECK-LABEL: name: addsl_ri_com116#CHECK: %2:i64 = nsw ADDSLri %0, 5117name: addsl_ri_com118alignment: 16119exposesReturnsTwice: false120legalized: false121regBankSelected: false122selected: false123failedISel: false124tracksRegLiveness: true125hasWinCFI: false126registers:127 - { id: 0, class: i64, preferred-register: '' }128 - { id: 1, class: i64, preferred-register: '' }129liveins:130 - { reg: '$sx0', virtual-reg: '%0' }131frameInfo:132 isFrameAddressTaken: false133 isReturnAddressTaken: false134 hasStackMap: false135 hasPatchPoint: false136 stackSize: 0137 offsetAdjustment: 0138 maxAlignment: 8139 adjustsStack: false140 hasCalls: false141 stackProtector: ''142 maxCallFrameSize: 4294967295143 cvBytesOfCalleeSavedRegisters: 0144 hasOpaqueSPAdjustment: false145 hasVAStart: false146 hasMustTailInVarArgFunc: false147 localFrameSize: 0148 savePoint: []149 restorePoint: []150fixedStack: []151stack: []152callSites: []153debugValueSubstitutions: []154constants: []155machineFunctionInfo: {}156body: |157 bb.0:158 liveins: $sx0159 160 %0:i64 = COPY $sx0161 %1:i64 = ORim 5, 0162 %2:i64 = nsw ADDSLrr %1, %0163 $sx0 = COPY %2164 RET implicit $sx10, implicit $sx0165 166...167 168---169## Ensure fold immediate as mimm at rhs170#CHECK-LABEL: name: addsl_rm_com171#CHECK: %2:i64 = nsw ADDSLrm %0, 120172name: addsl_rm_com173alignment: 16174exposesReturnsTwice: false175legalized: false176regBankSelected: false177selected: false178failedISel: false179tracksRegLiveness: true180hasWinCFI: false181registers:182 - { id: 0, class: i64, preferred-register: '' }183 - { id: 1, class: i64, preferred-register: '' }184liveins:185 - { reg: '$sx0', virtual-reg: '%0' }186frameInfo:187 isFrameAddressTaken: false188 isReturnAddressTaken: false189 hasStackMap: false190 hasPatchPoint: false191 stackSize: 0192 offsetAdjustment: 0193 maxAlignment: 8194 adjustsStack: false195 hasCalls: false196 stackProtector: ''197 maxCallFrameSize: 4294967295198 cvBytesOfCalleeSavedRegisters: 0199 hasOpaqueSPAdjustment: false200 hasVAStart: false201 hasMustTailInVarArgFunc: false202 localFrameSize: 0203 savePoint: []204 restorePoint: []205fixedStack: []206stack: []207callSites: []208debugValueSubstitutions: []209constants: []210machineFunctionInfo: {}211body: |212 bb.0:213 liveins: $sx0214 215 %0:i64 = COPY $sx0216 %1:i64 = ORim 0, 120217 %2:i64 = nsw ADDSLrr %1, %0218 $sx0 = COPY %2219 RET implicit $sx10, implicit $sx0220 221...222