From 90fe2c51ce60358409948eb2f5d3b7b82328a786 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 7 Jun 2016 18:35:37 +0000 Subject: [CFLAA] Add AttrEscaped, remove bit twiddling functions. This patch does a few things: - Unifies AttrAll and AttrUnknown (since they were used for more or less the same purpose anyway). - Introduces AttrEscaped, an attribute that notes that a value escapes our analysis for a given set, but not that an unknown value flows into said set. - Removes functions that take bit indices, since we also had functions that took bitsets, and the use of both (with similar names) was unclear and bug-prone. Patch by Jia Chen. Differential Revision: http://reviews.llvm.org/D21000 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272040 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Analysis/CFLAliasAnalysis/attr-escape.ll | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/Analysis/CFLAliasAnalysis/attr-escape.ll (limited to 'test/Analysis/CFLAliasAnalysis') diff --git a/test/Analysis/CFLAliasAnalysis/attr-escape.ll b/test/Analysis/CFLAliasAnalysis/attr-escape.ll new file mode 100644 index 00000000000..6e366d5560f --- /dev/null +++ b/test/Analysis/CFLAliasAnalysis/attr-escape.ll @@ -0,0 +1,18 @@ +; This testcase ensures that CFL AA handles escaped values no more conservative than it should + +; RUN: opt < %s -disable-basicaa -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -aa-pipeline=cfl-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s + +; CHECK: Function: escape_ptrtoint +; CHECK: NoAlias: i32* %a, i32* %x +; CHECK: NoAlias: i32* %b, i32* %x +; CHECK: NoAlias: i32* %a, i32* %b +; CHECK: MayAlias: i32* %a, i32* %aAlias +; CHECK: NoAlias: i32* %aAlias, i32* %b +define void @escape_ptrtoint(i32* %x) { + %a = alloca i32, align 4 + %b = alloca i32, align 4 + %aint = ptrtoint i32* %a to i64 + %aAlias = inttoptr i64 %aint to i32* + ret void +} -- cgit v1.2.3