brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 24b0e96 Raw
68 lines · plain
1; This testcase consists of alias relations on 128-bit pointers that2; should be completely resolvable by basicaa.3 4; RUN: opt < %s -aa-pipeline=basic-aa -passes=aa-eval -print-no-aliases -print-may-aliases -print-must-aliases -disable-output 2>&1 | FileCheck %s5 6target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-i128:128:128-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128-p100:128:64:64-p101:128:64:64"7 8 9; test0 is similar to SimpleCases.ll10 11%T = type { i32, [10 x i8] }12 13; CHECK:     Function: test014; CHECK-NOT:   MayAlias:15define void @test0(ptr addrspace(100) %P) {16  %C = getelementptr %T, ptr addrspace(100) %P, i64 0, i32 117  %D = getelementptr %T, ptr addrspace(100) %P, i64 0, i32 1, i64 018  %E = getelementptr %T, ptr addrspace(100) %P, i64 0, i32 1, i64 519  load %T, ptr addrspace(100) %P20  load i32, ptr addrspace(100) %P21  load [10 x i8], ptr addrspace(100) %C22  load i8, ptr addrspace(100) %D23  load i8, ptr addrspace(100) %E24  ret void25}26 27; test1 checks that >64 bits of index can be considered.28; If BasicAA is truncating the arithmetic, it will conclude29; that %A and %B must alias when in fact they must not.30 31; CHECK:     Function: test132; CHECK-NOT:   MustAlias:33; CHECK:       NoAlias:34; CHECK-SAME:  %A35; CHECK-SAME:  %B36define void @test1(ptr addrspace(100) %P, i128 %i) {37  ; 1180591620717411303424 is 2**7038  ;  590295810358705651712 is 2**6939  %i70 = add i128 %i, 1180591620717411303424 40  %i69 = add i128 %i, 59029581035870565171241  %A = getelementptr double, ptr addrspace(100) %P, i128 %i7042  %B = getelementptr double, ptr addrspace(100) %P, i128 %i6943  load double, ptr addrspace(100) %A44  load double, ptr addrspace(100) %B45  ret void46}47 48; test2 checks that >64 bits of index can be considered49; and computes the same address in two ways to ensure that50; they are considered equivalent.51 52; CHECK: Function: test253; CHECK: MustAlias:54; CHECK-SAME: %A55; CHECK-SAME: %C56define void @test2(ptr addrspace(100) %P, i128 %i) {57  ; 1180591620717411303424 is 2**7058  ;  590295810358705651712 is 2**6959  %i70 = add i128 %i, 1180591620717411303424 60  %i69 = add i128 %i, 59029581035870565171261  %j70 = add i128 %i69, 590295810358705651712 62  %A = getelementptr double, ptr addrspace(100) %P, i128 %i7063  %C = getelementptr double, ptr addrspace(100) %P, i128 %j7064  load double, ptr addrspace(100) %A65  load double, ptr addrspace(100) %C66  ret void67}68