2017-10-19 07:33:31 +08:00
|
|
|
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
2018-05-06 05:19:59 +08:00
|
|
|
# RUN: llc -mtriple=i386-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL
|
2017-05-01 14:08:32 +08:00
|
|
|
|
|
|
|
--- |
|
|
|
|
define i8 @test_load_i8(i8* %p1) {
|
|
|
|
%r = load i8, i8* %p1
|
|
|
|
ret i8 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i16 @test_load_i16(i16* %p1) {
|
|
|
|
%r = load i16, i16* %p1
|
|
|
|
ret i16 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @test_load_i32(i32* %p1) {
|
|
|
|
%r = load i32, i32* %p1
|
|
|
|
ret i32 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i8* @test_store_i8(i8 %val, i8* %p1) {
|
|
|
|
store i8 %val, i8* %p1
|
|
|
|
ret i8* %p1
|
|
|
|
}
|
|
|
|
|
|
|
|
define i16* @test_store_i16(i16 %val, i16* %p1) {
|
|
|
|
store i16 %val, i16* %p1
|
|
|
|
ret i16* %p1
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32* @test_store_i32(i32 %val, i32* %p1) {
|
|
|
|
store i32 %val, i32* %p1
|
|
|
|
ret i32* %p1
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32* @test_load_ptr(i32** %ptr1) {
|
|
|
|
%p = load i32*, i32** %ptr1
|
|
|
|
ret i32* %p
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test_store_ptr(i32** %ptr1, i32* %a) {
|
|
|
|
store i32* %a, i32** %ptr1
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_load_i8
|
[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: 16
|
2017-05-01 14:08:32 +08:00
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
- { id: 2, class: gpr }
|
|
|
|
fixedStack:
|
|
|
|
- { id: 0, offset: 0, size: 4, alignment: 16, isImmutable: true, isAliased: false }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2017-10-19 07:33:31 +08:00
|
|
|
; ALL-LABEL: name: test_load_i8
|
2019-01-31 07:09:28 +08:00
|
|
|
; ALL: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.0, align 16)
|
2018-02-01 06:04:26 +08:00
|
|
|
; ALL: [[MOV8rm:%[0-9]+]]:gr8 = MOV8rm [[MOV32rm]], 1, $noreg, 0, $noreg :: (load 1 from %ir.p1)
|
|
|
|
; ALL: $al = COPY [[MOV8rm]]
|
|
|
|
; ALL: RET 0, implicit $al
|
2017-05-01 14:08:32 +08:00
|
|
|
%1(p0) = G_FRAME_INDEX %fixed-stack.0
|
2019-01-31 07:09:28 +08:00
|
|
|
%0(p0) = G_LOAD %1(p0) :: (invariant load 4 from %fixed-stack.0, align 16)
|
2017-05-01 14:08:32 +08:00
|
|
|
%2(s8) = G_LOAD %0(p0) :: (load 1 from %ir.p1)
|
2018-02-01 06:04:26 +08:00
|
|
|
$al = COPY %2(s8)
|
|
|
|
RET 0, implicit $al
|
2017-05-01 14:08:32 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_load_i16
|
[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: 16
|
2017-05-01 14:08:32 +08:00
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
- { id: 2, class: gpr }
|
|
|
|
fixedStack:
|
|
|
|
- { id: 0, offset: 0, size: 4, alignment: 16, isImmutable: true, isAliased: false }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2017-10-19 07:33:31 +08:00
|
|
|
; ALL-LABEL: name: test_load_i16
|
2019-01-31 07:09:28 +08:00
|
|
|
; ALL: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.0, align 16)
|
2018-02-01 06:04:26 +08:00
|
|
|
; ALL: [[MOV16rm:%[0-9]+]]:gr16 = MOV16rm [[MOV32rm]], 1, $noreg, 0, $noreg :: (load 2 from %ir.p1)
|
|
|
|
; ALL: $ax = COPY [[MOV16rm]]
|
|
|
|
; ALL: RET 0, implicit $ax
|
2017-05-01 14:08:32 +08:00
|
|
|
%1(p0) = G_FRAME_INDEX %fixed-stack.0
|
2019-01-31 07:09:28 +08:00
|
|
|
%0(p0) = G_LOAD %1(p0) :: (invariant load 4 from %fixed-stack.0, align 16)
|
2017-05-01 14:08:32 +08:00
|
|
|
%2(s16) = G_LOAD %0(p0) :: (load 2 from %ir.p1)
|
2018-02-01 06:04:26 +08:00
|
|
|
$ax = COPY %2(s16)
|
|
|
|
RET 0, implicit $ax
|
2017-05-01 14:08:32 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_load_i32
|
[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: 16
|
2017-05-01 14:08:32 +08:00
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
- { id: 2, class: gpr }
|
|
|
|
fixedStack:
|
|
|
|
- { id: 0, offset: 0, size: 4, alignment: 16, isImmutable: true, isAliased: false }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2017-10-19 07:33:31 +08:00
|
|
|
; ALL-LABEL: name: test_load_i32
|
2019-01-31 07:09:28 +08:00
|
|
|
; ALL: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.0, align 16)
|
2018-02-01 06:04:26 +08:00
|
|
|
; ALL: [[MOV32rm1:%[0-9]+]]:gr32 = MOV32rm [[MOV32rm]], 1, $noreg, 0, $noreg :: (load 4 from %ir.p1)
|
|
|
|
; ALL: $eax = COPY [[MOV32rm1]]
|
|
|
|
; ALL: RET 0, implicit $eax
|
2017-05-01 14:08:32 +08:00
|
|
|
%1(p0) = G_FRAME_INDEX %fixed-stack.0
|
2019-01-31 07:09:28 +08:00
|
|
|
%0(p0) = G_LOAD %1(p0) :: (invariant load 4 from %fixed-stack.0, align 16)
|
2017-05-01 14:08:32 +08:00
|
|
|
%2(s32) = G_LOAD %0(p0) :: (load 4 from %ir.p1)
|
2018-02-01 06:04:26 +08:00
|
|
|
$eax = COPY %2(s32)
|
|
|
|
RET 0, implicit $eax
|
2017-05-01 14:08:32 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_store_i8
|
[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: 16
|
2017-05-01 14:08:32 +08:00
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
- { id: 2, class: gpr }
|
|
|
|
- { id: 3, class: gpr }
|
|
|
|
fixedStack:
|
|
|
|
- { id: 0, offset: 4, size: 4, alignment: 4, isImmutable: true, isAliased: false }
|
|
|
|
- { id: 1, offset: 0, size: 1, alignment: 16, isImmutable: true, isAliased: false }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2017-10-19 07:33:31 +08:00
|
|
|
; ALL-LABEL: name: test_store_i8
|
2019-01-31 07:09:28 +08:00
|
|
|
; ALL: [[MOV8rm:%[0-9]+]]:gr8 = MOV8rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load 1 from %fixed-stack.0, align 16)
|
|
|
|
; ALL: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.1, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.1)
|
2018-02-01 06:04:26 +08:00
|
|
|
; ALL: MOV8mr [[MOV32rm]], 1, $noreg, 0, $noreg, [[MOV8rm]] :: (store 1 into %ir.p1)
|
|
|
|
; ALL: $eax = COPY [[MOV32rm]]
|
|
|
|
; ALL: RET 0, implicit $eax
|
2017-05-01 14:08:32 +08:00
|
|
|
%2(p0) = G_FRAME_INDEX %fixed-stack.1
|
2019-01-31 07:09:28 +08:00
|
|
|
%0(s8) = G_LOAD %2(p0) :: (invariant load 1 from %fixed-stack.1, align 16)
|
2017-05-01 14:08:32 +08:00
|
|
|
%3(p0) = G_FRAME_INDEX %fixed-stack.0
|
2019-01-31 07:09:28 +08:00
|
|
|
%1(p0) = G_LOAD %3(p0) :: (invariant load 4 from %fixed-stack.0, align 4)
|
2017-05-01 14:08:32 +08:00
|
|
|
G_STORE %0(s8), %1(p0) :: (store 1 into %ir.p1)
|
2018-02-01 06:04:26 +08:00
|
|
|
$eax = COPY %1(p0)
|
|
|
|
RET 0, implicit $eax
|
2017-05-01 14:08:32 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_store_i16
|
[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: 16
|
2017-05-01 14:08:32 +08:00
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
- { id: 2, class: gpr }
|
|
|
|
- { id: 3, class: gpr }
|
|
|
|
fixedStack:
|
|
|
|
- { id: 0, offset: 4, size: 4, alignment: 4, isImmutable: true, isAliased: false }
|
|
|
|
- { id: 1, offset: 0, size: 2, alignment: 16, isImmutable: true, isAliased: false }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2017-10-19 07:33:31 +08:00
|
|
|
; ALL-LABEL: name: test_store_i16
|
2019-01-31 07:09:28 +08:00
|
|
|
; ALL: [[MOV16rm:%[0-9]+]]:gr16 = MOV16rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load 2 from %fixed-stack.0, align 16)
|
|
|
|
; ALL: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.1, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.1)
|
2018-02-01 06:04:26 +08:00
|
|
|
; ALL: MOV16mr [[MOV32rm]], 1, $noreg, 0, $noreg, [[MOV16rm]] :: (store 2 into %ir.p1)
|
|
|
|
; ALL: $eax = COPY [[MOV32rm]]
|
|
|
|
; ALL: RET 0, implicit $eax
|
2017-05-01 14:08:32 +08:00
|
|
|
%2(p0) = G_FRAME_INDEX %fixed-stack.1
|
2019-01-31 07:09:28 +08:00
|
|
|
%0(s16) = G_LOAD %2(p0) :: (invariant load 2 from %fixed-stack.1, align 16)
|
2017-05-01 14:08:32 +08:00
|
|
|
%3(p0) = G_FRAME_INDEX %fixed-stack.0
|
2019-01-31 07:09:28 +08:00
|
|
|
%1(p0) = G_LOAD %3(p0) :: (invariant load 4 from %fixed-stack.0, align 4)
|
2017-05-01 14:08:32 +08:00
|
|
|
G_STORE %0(s16), %1(p0) :: (store 2 into %ir.p1)
|
2018-02-01 06:04:26 +08:00
|
|
|
$eax = COPY %1(p0)
|
|
|
|
RET 0, implicit $eax
|
2017-05-01 14:08:32 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_store_i32
|
[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: 16
|
2017-05-01 14:08:32 +08:00
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
- { id: 2, class: gpr }
|
|
|
|
- { id: 3, class: gpr }
|
|
|
|
fixedStack:
|
|
|
|
- { id: 0, offset: 4, size: 4, alignment: 4, isImmutable: true, isAliased: false }
|
|
|
|
- { id: 1, offset: 0, size: 4, alignment: 16, isImmutable: true, isAliased: false }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2017-10-19 07:33:31 +08:00
|
|
|
; ALL-LABEL: name: test_store_i32
|
2019-01-31 07:09:28 +08:00
|
|
|
; ALL: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.0, align 16)
|
|
|
|
; ALL: [[MOV32rm1:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.1, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.1)
|
2018-02-01 06:04:26 +08:00
|
|
|
; ALL: MOV32mr [[MOV32rm1]], 1, $noreg, 0, $noreg, [[MOV32rm]] :: (store 4 into %ir.p1)
|
|
|
|
; ALL: $eax = COPY [[MOV32rm1]]
|
|
|
|
; ALL: RET 0, implicit $eax
|
2017-05-01 14:08:32 +08:00
|
|
|
%2(p0) = G_FRAME_INDEX %fixed-stack.1
|
2019-01-31 07:09:28 +08:00
|
|
|
%0(s32) = G_LOAD %2(p0) :: (invariant load 4 from %fixed-stack.1, align 16)
|
2017-05-01 14:08:32 +08:00
|
|
|
%3(p0) = G_FRAME_INDEX %fixed-stack.0
|
2019-01-31 07:09:28 +08:00
|
|
|
%1(p0) = G_LOAD %3(p0) :: (invariant load 4 from %fixed-stack.0, align 4)
|
2017-05-01 14:08:32 +08:00
|
|
|
G_STORE %0(s32), %1(p0) :: (store 4 into %ir.p1)
|
2018-02-01 06:04:26 +08:00
|
|
|
$eax = COPY %1(p0)
|
|
|
|
RET 0, implicit $eax
|
2017-05-01 14:08:32 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_load_ptr
|
[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: 16
|
2017-05-01 14:08:32 +08:00
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
- { id: 2, class: gpr }
|
|
|
|
fixedStack:
|
|
|
|
- { id: 0, offset: 0, size: 4, alignment: 16, isImmutable: true, isAliased: false }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2017-10-19 07:33:31 +08:00
|
|
|
; ALL-LABEL: name: test_load_ptr
|
2019-01-31 07:09:28 +08:00
|
|
|
; ALL: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.0, align 16)
|
2018-02-01 06:04:26 +08:00
|
|
|
; ALL: [[MOV32rm1:%[0-9]+]]:gr32 = MOV32rm [[MOV32rm]], 1, $noreg, 0, $noreg :: (load 4 from %ir.ptr1)
|
|
|
|
; ALL: $eax = COPY [[MOV32rm1]]
|
|
|
|
; ALL: RET 0, implicit $eax
|
2017-05-01 14:08:32 +08:00
|
|
|
%1(p0) = G_FRAME_INDEX %fixed-stack.0
|
2019-01-31 07:09:28 +08:00
|
|
|
%0(p0) = G_LOAD %1(p0) :: (invariant load 4 from %fixed-stack.0, align 16)
|
2017-05-01 14:08:32 +08:00
|
|
|
%2(p0) = G_LOAD %0(p0) :: (load 4 from %ir.ptr1)
|
2018-02-01 06:04:26 +08:00
|
|
|
$eax = COPY %2(p0)
|
|
|
|
RET 0, implicit $eax
|
2017-05-01 14:08:32 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_store_ptr
|
[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: 16
|
2017-05-01 14:08:32 +08:00
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
- { id: 2, class: gpr }
|
|
|
|
- { id: 3, class: gpr }
|
|
|
|
fixedStack:
|
|
|
|
- { id: 0, offset: 4, size: 4, alignment: 4, isImmutable: true, isAliased: false }
|
|
|
|
- { id: 1, offset: 0, size: 4, alignment: 16, isImmutable: true, isAliased: false }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2017-10-19 07:33:31 +08:00
|
|
|
; ALL-LABEL: name: test_store_ptr
|
2019-01-31 07:09:28 +08:00
|
|
|
; ALL: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.0, align 16)
|
|
|
|
; ALL: [[MOV32rm1:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.1, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.1)
|
2018-02-01 06:04:26 +08:00
|
|
|
; ALL: MOV32mr [[MOV32rm]], 1, $noreg, 0, $noreg, [[MOV32rm1]] :: (store 4 into %ir.ptr1)
|
2017-10-19 07:33:31 +08:00
|
|
|
; ALL: RET 0
|
2017-05-01 14:08:32 +08:00
|
|
|
%2(p0) = G_FRAME_INDEX %fixed-stack.1
|
2019-01-31 07:09:28 +08:00
|
|
|
%0(p0) = G_LOAD %2(p0) :: (invariant load 4 from %fixed-stack.1, align 16)
|
2017-05-01 14:08:32 +08:00
|
|
|
%3(p0) = G_FRAME_INDEX %fixed-stack.0
|
2019-01-31 07:09:28 +08:00
|
|
|
%1(p0) = G_LOAD %3(p0) :: (invariant load 4 from %fixed-stack.0, align 4)
|
2017-05-01 14:08:32 +08:00
|
|
|
G_STORE %1(p0), %0(p0) :: (store 4 into %ir.ptr1)
|
|
|
|
RET 0
|
|
|
|
|
|
|
|
...
|