File: irtranslator-weird-alloca-size.ll

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (19 lines) | stat: -rw-r--r-- 800 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
; RUN: llc -global-isel -stop-after irtranslator -mtriple aarch64-apple-ios %s -o - | FileCheck %s

; We use to incorrectly use the store size instead of the alloc size when
; creating the stack slot for allocas. This shows on aarch64 only when
; we allocated weirdly sized type. For instance, in that case, we used
; to allocate a slot of size 24-bit (19 rounded up to the next byte),
; whereas we really want to use a full 32-bit slot for this type.
; CHECK-LABEL: foo
; Check that the stack slot is 4-byte wide instead of the previously
; wrongly 3-byte sized slot.
; CHECK: stack:
; CHECK-NEXT: - { id: 0, name: stack_slot, type: default, offset: 0, size: 4, alignment: 4
define void @foo() {
  %stack_slot = alloca i19
  call void @bar(i19* %stack_slot)
  ret void
}

declare void @bar(i19* %a)