2019-06-19 08:25:39 +08:00
|
|
|
# RUN: llc -march=mips -start-before=finalize-isel \
|
|
|
|
# RUN: -stop-after=finalize-isel -relocation-model=pic \
|
2017-10-11 19:45:06 +08:00
|
|
|
# RUN: -o /dev/null %s
|
|
|
|
|
|
|
|
# A simple test to show that we can parse the target specific flags: got-call,
|
|
|
|
# got.
|
|
|
|
|
|
|
|
--- |
|
|
|
|
@v = global i32 0, align 4
|
|
|
|
@j = external global i32, align 4
|
|
|
|
|
|
|
|
define i32 @_Z2k1i(i32 signext %asd) {
|
|
|
|
entry:
|
|
|
|
%call = tail call i32 @_Z1gi(i32 signext %asd)
|
|
|
|
%add = add nsw i32 %call, %asd
|
|
|
|
%0 = load i32, i32* @v, align 4
|
|
|
|
%add1 = add nsw i32 %add, %0
|
|
|
|
%1 = load i32, i32* @j, align 4
|
|
|
|
%add2 = add nsw i32 %add1, %1
|
|
|
|
ret i32 %add2
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i32 @_Z1gi(i32 signext)
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: _Z2k1i
|
[Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67433
llvm-svn: 371608
2019-09-11 19:16:48 +08:00
|
|
|
alignment: 4
|
2017-10-11 19:45:06 +08:00
|
|
|
exposesReturnsTwice: false
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
selected: false
|
|
|
|
tracksRegLiveness: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr32, preferred-register: '' }
|
|
|
|
- { id: 1, class: gpr32, preferred-register: '' }
|
|
|
|
- { id: 2, class: gpr32, preferred-register: '' }
|
|
|
|
- { id: 3, class: gpr32, preferred-register: '' }
|
|
|
|
- { id: 4, class: gpr32, preferred-register: '' }
|
|
|
|
- { id: 5, class: gpr32, preferred-register: '' }
|
|
|
|
- { id: 6, class: gpr32, preferred-register: '' }
|
|
|
|
- { id: 7, class: gpr32, preferred-register: '' }
|
|
|
|
- { id: 8, class: gpr32, preferred-register: '' }
|
|
|
|
- { id: 9, class: gpr32, preferred-register: '' }
|
|
|
|
- { id: 10, class: gpr32, preferred-register: '' }
|
|
|
|
- { id: 11, class: gpr32, preferred-register: '' }
|
|
|
|
- { id: 12, class: gpr32, preferred-register: '' }
|
|
|
|
liveins:
|
2018-02-01 06:04:26 +08:00
|
|
|
- { reg: '$a0', virtual-reg: '%0' }
|
|
|
|
- { reg: '$t9', virtual-reg: '' }
|
|
|
|
- { reg: '$v0', virtual-reg: '' }
|
2017-10-11 19:45:06 +08:00
|
|
|
frameInfo:
|
|
|
|
isFrameAddressTaken: false
|
|
|
|
isReturnAddressTaken: false
|
|
|
|
hasStackMap: false
|
|
|
|
hasPatchPoint: false
|
|
|
|
stackSize: 0
|
|
|
|
offsetAdjustment: 0
|
|
|
|
maxAlignment: 1
|
|
|
|
adjustsStack: false
|
|
|
|
hasCalls: true
|
|
|
|
stackProtector: ''
|
|
|
|
maxCallFrameSize: 4294967295
|
|
|
|
hasOpaqueSPAdjustment: false
|
|
|
|
hasVAStart: false
|
|
|
|
hasMustTailInVarArgFunc: false
|
|
|
|
savePoint: ''
|
|
|
|
restorePoint: ''
|
|
|
|
fixedStack:
|
|
|
|
stack:
|
|
|
|
constants:
|
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $a0, $t9, $v0
|
2017-10-11 19:45:06 +08:00
|
|
|
|
2018-02-01 06:04:26 +08:00
|
|
|
%1 = ADDu $v0, $t9
|
|
|
|
%0 = COPY $a0
|
|
|
|
ADJCALLSTACKDOWN 16, 0, implicit-def dead $sp, implicit $sp
|
2017-10-11 19:45:06 +08:00
|
|
|
%2 = LW %1, target-flags(mips-got-call) @_Z1gi :: (load 4 from call-entry @_Z1gi)
|
2018-02-01 06:04:26 +08:00
|
|
|
$a0 = COPY %0
|
|
|
|
$gp = COPY %1
|
|
|
|
JALRPseudo killed %2, csr_o32_fpxx, implicit-def dead $ra, implicit $a0, implicit $gp, implicit-def $sp, implicit-def $v0
|
|
|
|
ADJCALLSTACKUP 16, 0, implicit-def dead $sp, implicit $sp
|
|
|
|
%3 = COPY $v0
|
2017-10-11 19:45:06 +08:00
|
|
|
%4 = ADDu %3, %0
|
|
|
|
%5 = LW %1, target-flags(mips-got) @v :: (load 4 from got)
|
|
|
|
%6 = LW killed %5, 0 :: (dereferenceable load 4 from @v)
|
|
|
|
%7 = ADDu killed %4, killed %6
|
|
|
|
%8 = LW %1, target-flags(mips-got) @j :: (load 4 from got)
|
|
|
|
%9 = LW killed %8, 0 :: (dereferenceable load 4 from @j)
|
|
|
|
%10 = ADDu killed %7, killed %9
|
2018-02-01 06:04:26 +08:00
|
|
|
$v0 = COPY %10
|
|
|
|
RetRA implicit $v0
|
2017-10-11 19:45:06 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
|