File: non-byte-size.ll

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2~deb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 995,836 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 (31 lines) | stat: -rw-r--r-- 1,464 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
20
21
22
23
24
25
26
27
28
29
30
31
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -load-store-vectorizer -S -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
; RUN: opt < %s -aa-pipeline=basic-aa -passes='function(load-store-vectorizer)' -S -mtriple=x86_64-unknown-linux-gnu | FileCheck %s

%rec = type { i32, i28 }

; We currently do not optimize this scenario.
; But we verify that we no longer crash when compiling this.
define void @test1(%rec* %out, %rec* %in) {
; CHECK-LABEL: @test1(
; CHECK-NEXT:    [[IN1:%.*]] = getelementptr [[REC:%.*]], %rec* [[IN:%.*]], i16 0, i32 0
; CHECK-NEXT:    [[IN2:%.*]] = getelementptr [[REC]], %rec* [[IN]], i16 0, i32 1
; CHECK-NEXT:    [[VAL1:%.*]] = load i32, i32* [[IN1]], align 8
; CHECK-NEXT:    [[VAL2:%.*]] = load i28, i28* [[IN2]]
; CHECK-NEXT:    [[OUT1:%.*]] = getelementptr [[REC]], %rec* [[OUT:%.*]], i16 0, i32 0
; CHECK-NEXT:    [[OUT2:%.*]] = getelementptr [[REC]], %rec* [[OUT]], i16 0, i32 1
; CHECK-NEXT:    store i32 [[VAL1]], i32* [[OUT1]], align 8
; CHECK-NEXT:    store i28 [[VAL2]], i28* [[OUT2]]
; CHECK-NEXT:    ret void
;
  %in1 = getelementptr %rec, %rec* %in, i16 0, i32 0
  %in2 = getelementptr %rec, %rec* %in, i16 0, i32 1
  %val1 = load i32, i32* %in1, align 8
  %val2 = load i28, i28* %in2
  %out1 = getelementptr %rec, %rec* %out, i16 0, i32 0
  %out2 = getelementptr %rec, %rec* %out, i16 0, i32 1
  store i32 %val1, i32* %out1, align 8
  store i28 %val2, i28* %out2
  ret void
}