File: full-store-partial-alias.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 (37 lines) | stat: -rw-r--r-- 1,322 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
; RUN: opt -S -tbaa -gvn < %s | FileCheck -check-prefix=BASICAA %s
; RUN: opt -S -tbaa -disable-basic-aa -gvn < %s | FileCheck %s
; rdar://8875631, rdar://8875069

; BasicAA should notice that the store stores to the entire %u object,
; so the %tmp5 load is PartialAlias with the store and suppress TBAA.
; Without BasicAA, TBAA should say that %tmp5 is NoAlias with the store.

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

%union.anon = type { double }

@u = global %union.anon { double -2.500000e-01 }, align 8
@endianness_test = global i64 1, align 8

define i32 @signbit(double %x) nounwind {
; BASICAA: ret i32 %tmp5.lobit
; CHECK:   ret i32 0
entry:
  %u = alloca %union.anon, align 8
  %tmp9 = getelementptr inbounds %union.anon, %union.anon* %u, i64 0, i32 0
  store double %x, double* %tmp9, align 8, !tbaa !0
  %tmp2 = load i32, i32* bitcast (i64* @endianness_test to i32*), align 8, !tbaa !3
  %idxprom = sext i32 %tmp2 to i64
  %tmp4 = bitcast %union.anon* %u to [2 x i32]*
  %arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* %tmp4, i64 0, i64 %idxprom
  %tmp5 = load i32, i32* %arrayidx, align 4, !tbaa !3
  %tmp5.lobit = lshr i32 %tmp5, 31
  ret i32 %tmp5.lobit
}

!0 = !{!4, !4, i64 0}
!1 = !{!"omnipotent char", !2}
!2 = !{!"Simple C/C++ TBAA"}
!3 = !{!5, !5, i64 0}
!4 = !{!"double", !1}
!5 = !{!"int", !1}