File: precedence.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (50 lines) | stat: -rw-r--r-- 1,340 bytes parent folder | download | duplicates (8)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
; RUN: opt -tbaa -disable-basic-aa -gvn -instcombine -S < %s | FileCheck %s --check-prefix=TBAA
; RUN: opt -tbaa -gvn -instcombine -S < %s | FileCheck %s --check-prefix=BASICAA

; According to the TBAA metadata the load and store don't alias. However,
; according to the actual code, they do. Disabling basicaa shows the raw TBAA
; results.

target datalayout = "e-p:64:64:64"

; Test for simple MustAlias aliasing.

; TBAA:    @trouble
; TBAA:      ret i32 0
; BASICAA: @trouble
; BASICAA:   ret i32 1075000115
define i32 @trouble(i32* %x) nounwind {
entry:
  store i32 0, i32* %x, !tbaa !0
  %0 = bitcast i32* %x to float*
  store float 0x4002666660000000, float* %0, !tbaa !3
  %tmp3 = load i32, i32* %x, !tbaa !0
  ret i32 %tmp3
}

; Test for PartialAlias aliasing. GVN doesn't yet eliminate the load
; in the BasicAA case.

; TBAA:    @offset
; TBAA:      ret i64 0
; BASICAA: @offset
; BASICAA:   ret i64 %tmp3
define i64 @offset(i64* %x) nounwind {
entry:
  store i64 0, i64* %x, !tbaa !4
  %0 = bitcast i64* %x to i8*
  %1 = getelementptr i8, i8* %0, i64 1
  store i8 1, i8* %1, !tbaa !5
  %tmp3 = load i64, i64* %x, !tbaa !4
  ret i64 %tmp3
}

!0 = !{!2, !2, i64 0}
!1 = !{!"simple"}
!2 = !{!"int", !1}
!3 = !{!6, !6, i64 0}
!4 = !{!7, !7, i64 0}
!5 = !{!8, !8, i64 0}
!6 = !{!"float", !1}
!7 = !{!"long", !1}
!8 = !{!"small", !1}