1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 21:42:54 +02:00
llvm-mirror/test/Analysis/CFLAliasAnalysis/Steensgaard/malloc-and-free.ll
George Burgess IV 9f9488ba33 [CFLAA] Split into Anders+Steens analysis.
StratifiedSets (as implemented) is very fast, but its accuracy is also
limited. If we take a more aggressive andersens-like approach, we can be
way more accurate, but we'll also end up being slower.

So, we've decided to split CFLAA into CFLSteensAA and CFLAndersAA.

Long-term, we want to end up in a place where CFLSteens is queried
first; if it can provide an answer, great (since queries are basically
map lookups). Otherwise, we'll fall back to CFLAnders, BasicAA, etc.

This patch splits everything out so we can try to do something like
that when we get a reasonable CFLAnders implementation.

Patch by Jia Chen.

Differential Revision: http://reviews.llvm.org/D21910

llvm-svn: 274589
2016-07-06 00:26:41 +00:00

31 lines
870 B
LLVM

; This testcase ensures that CFL AA handles malloc and free in a sound and precise manner
; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-no-aliases -disable-output 2>&1 | FileCheck %s
; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-no-aliases -disable-output 2>&1 | FileCheck %s
declare noalias i8* @malloc(i64)
declare noalias i8* @calloc(i64, i64)
declare void @free(i8* nocapture)
; CHECK: Function: test_malloc
; CHECK: NoAlias: i8* %p, i8* %q
define void @test_malloc(i8* %p) {
%q = call i8* @malloc(i64 4)
ret void
}
; CHECK: Function: test_calloc
; CHECK: NoAlias: i8* %p, i8* %q
define void @test_calloc(i8* %p) {
%q = call i8* @calloc(i64 2, i64 4)
ret void
}
; CHECK: Function: test_free
; CHECK: NoAlias: i8* %p, i8* %q
define void @test_free(i8* %p) {
%q = alloca i8, align 4
call void @free(i8* %q)
ret void
}