[llvm-commits] [poolalloc] r116900 - in /poolalloc/trunk/test/dsa: extern/extern.ll extern/extern3.ll extern/extern_global_escape.ll td/call1.ll td/call2.ll td/params.ll td/params1.ll td/recur.ll

Will Dietz wdietz2 at illinois.edu
Tue Oct 19 18:31:24 PDT 2010


Author: wdietz2
Date: Tue Oct 19 20:31:24 2010
New Revision: 116900

URL: http://llvm.org/viewvc/llvm-project?rev=116900&view=rev
Log:
Test fixes for External.

Added:
    poolalloc/trunk/test/dsa/extern/extern_global_escape.ll
Modified:
    poolalloc/trunk/test/dsa/extern/extern.ll
    poolalloc/trunk/test/dsa/extern/extern3.ll
    poolalloc/trunk/test/dsa/td/call1.ll
    poolalloc/trunk/test/dsa/td/call2.ll
    poolalloc/trunk/test/dsa/td/params.ll
    poolalloc/trunk/test/dsa/td/params1.ll
    poolalloc/trunk/test/dsa/td/recur.ll

Modified: poolalloc/trunk/test/dsa/extern/extern.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/extern/extern.ll?rev=116900&r1=116899&r2=116900&view=diff
==============================================================================
--- poolalloc/trunk/test/dsa/extern/extern.ll (original)
+++ poolalloc/trunk/test/dsa/extern/extern.ll Tue Oct 19 20:31:24 2010
@@ -7,7 +7,7 @@
 ;  Should be incomplete, tests very basic tracking.
 ;RUN: dsaopt %s -dsa-local -analyze -verify-flags "main:ptrExtern+IE"
 ;RUN: dsaopt %s -dsa-local -analyze -verify-flags "main:ptr+I-E"
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "main:ptrViaExtern+IE"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "main:ptrViaExtern+I-E"
 
 ;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "main:ptrExtern+IE"
 ;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "main:ptr-IE"
@@ -32,10 +32,11 @@
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-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"
 target triple = "x86_64-unknown-linux-gnu"
 
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "getPointerViaExtern:ptr+E"
 define i32* @getPointerViaExtern() nounwind {
 entry:
-  %0 = tail call i32* (...)* @getPointerExtern() nounwind ; <i32*> [#uses=1]
-  ret i32* %0
+  %ptr = tail call i32* (...)* @getPointerExtern() nounwind ; <i32*> [#uses=1]
+  ret i32* %ptr
 }
 
 declare i32* @getPointerExtern(...)

Modified: poolalloc/trunk/test/dsa/extern/extern3.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/extern/extern3.ll?rev=116900&r1=116899&r2=116900&view=diff
==============================================================================
--- poolalloc/trunk/test/dsa/extern/extern3.ll (original)
+++ poolalloc/trunk/test/dsa/extern/extern3.ll Tue Oct 19 20:31:24 2010
@@ -10,9 +10,10 @@
 declare noalias i8* @malloc(i64) nounwind
 declare void @free(i8*) nounwind
 
-;This should be marked external due to the
-;unification-based nature of DSA.
-;(this function does not have internal linkage)
+;This function is in theory externally callable (not internal linkage)
+;so it's parameters/ret val should be marked external in TD.
+;RUN: dsaopt %s -dsa-stdlib -analyze -verify-flags "getPointer:ptr+I-E"
+;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "getPointer:ptr+I-E"
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "getPointer:ptr+E-I"
 define i32* @getPointer() nounwind {
 entry:
@@ -21,8 +22,9 @@
   ret i32* %ptr
 }
 
-;This should be marked incomplete and external due to the
-;unification-based nature of DSA.
+;Since this isn't internal, should have external arguments in TD
+;RUN: dsaopt %s -dsa-stdlib -analyze -verify-flags "takesPointer:ptr+I-E"
+;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "takesPointer:ptr+I-E"
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "takesPointer:ptr+E-I"
 define i32 @takesPointer(i32* %ptr) nounwind {
 entry:
@@ -30,7 +32,8 @@
   ret i32 %0
 }
 
-;RUN: dsaopt %s -dsa-td -analyze -verify-flags "getPointerInternal:ptr-IE"
+;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "getPointerInternal:ptr+I-E"
+;RUN: dsaopt %s -dsa-td -analyze -verify-flags "getPointerInternal:ptr-I-E"
 define internal i32* @getPointerInternal() nounwind {
 entry:
   %0 = tail call noalias i8* @malloc(i64 4) nounwind ; <i8*> [#uses=1]
@@ -38,6 +41,7 @@
   ret i32* %ptr
 }
 
+;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "takesPointerInternal:ptr+I-E"
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "takesPointerInternal:ptr-IE"
 define internal i32 @takesPointerInternal(i32* %ptr) nounwind {
 entry:
@@ -53,6 +57,8 @@
   ret i32 0
 }
 
+;RUN: dsaopt %s -dsa-stdlib -analyze -verify-flags "checkExterns:get+EI"
+;RUN: dsaopt %s -dsa-stdlib -analyze -verify-flags "checkExterns:take+EI"
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "checkExterns:get+E-I"
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "checkExterns:take+E-I"
 define void @checkExterns() nounwind {
@@ -64,8 +70,10 @@
   ret void
 }
 
-;RUN: dsaopt %s -dsa-td -analyze -verify-flags "checkExternals:get+E-I"
-;RUN: dsaopt %s -dsa-td -analyze -verify-flags "checkExternals:take+E-I"
+;RUN: dsaopt %s -dsa-stdlib -analyze -verify-flags "checkExternals:get+I-E"
+;RUN: dsaopt %s -dsa-stdlib -analyze -verify-flags "checkExternals:take+I-E"
+;RUN: dsaopt %s -dsa-td -analyze -verify-flags "checkExternals:get-IE"
+;RUN: dsaopt %s -dsa-td -analyze -verify-flags "checkExternals:take-IE"
 define void @checkExternals() nounwind {
 entry:
   %get = tail call i32* ()* @getPointer() nounwind ; <i32*> [#uses=0]
@@ -76,6 +84,8 @@
   ret void
 }
 
+;RUN: dsaopt %s -dsa-stdlib -analyze -verify-flags "checkInternals:get+I-E"
+;RUN: dsaopt %s -dsa-stdlib -analyze -verify-flags "checkInternals:take+I-E"
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "checkInternals:get-IE"
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "checkInternals:take-IE"
 define void @checkInternals() nounwind {

Added: poolalloc/trunk/test/dsa/extern/extern_global_escape.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/extern/extern_global_escape.ll?rev=116900&view=auto
==============================================================================
--- poolalloc/trunk/test/dsa/extern/extern_global_escape.ll (added)
+++ poolalloc/trunk/test/dsa/extern/extern_global_escape.ll Tue Oct 19 20:31:24 2010
@@ -0,0 +1,52 @@
+; Here we have an externally visible function 'externallyVisible', such that it's possible
+; for some outside code to use it to change the value of 'globalptr'.  As such, the pointer loaded
+; from it in 'usesGlobalPtr' should be marked external.
+; ModuleID = 'extern_global_escape.c'
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-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"
+target triple = "x86_64-unknown-linux-gnu"
+; RUN: dsaopt %s -dsa-local -analyze
+; RUN: dsaopt %s -dsa-bu -analyze
+; RUN: dsaopt %s -dsa-td -analyze
+
+; This global itself isn't externally accessible, only via 'externallyVisible'
+; RUN: dsaopt %s -dsa-local -analyze -verify-flags "globalptr+G-E"
+; RUN: dsaopt %s -dsa-bu -analyze -verify-flags "globalptr+G-E"
+; RUN: dsaopt %s -dsa-bu -analyze -verify-flags "globalptr:0+E"
+; RUN: dsaopt %s -dsa-td -analyze -verify-flags "globalptr+G-E"
+; RUN: dsaopt %s -dsa-td -analyze -verify-flags "globalptr:0+E"
+ at globalptr = internal global i32* null                     ; <i32**> [#uses=2]
+
+; RUN: dsaopt %s -dsa-local -analyze -verify-flags "externallyVisible:ptr+I"
+; RUN: dsaopt %s -dsa-bu -analyze -verify-flags "externallyVisible:ptr+I-E"
+; RUN: dsaopt %s -dsa-bu -analyze -verify-flags "externallyVisible:ptr:0+IE"
+; RUN: dsaopt %s -dsa-td -analyze -verify-flags "externallyVisible:ptr+E-I"
+; RUN: dsaopt %s -dsa-td -analyze -verify-flags "externallyVisible:ptr+E-I"
+define void @externallyVisible(i32** %ptr) nounwind {
+entry:
+  %0 = load i32** %ptr, align 8
+  store i32* %0, i32** @globalptr, align 8
+  ret void
+}
+
+; RUN: dsaopt %s -dsa-bu -analyze -verify-flags "usesGlobalPtr:ptr-IE"
+; RUN: dsaopt %s -dsa-bu -analyze -verify-flags "usesGlobalPtr:ptr:0+E-I"
+; RUN: dsaopt %s -dsa-td -analyze -verify-flags "usesGlobalPtr:ptr-E"
+; RUN: dsaopt %s -dsa-td -analyze -verify-flags "usesGlobalPtr:ptr:0+E"
+define void @usesGlobalPtr() nounwind {
+entry:
+  %ptr = alloca i32*                              ; <i32**> [#uses=1]
+  %0 = load i32** @globalptr, align 8             ; <i32*> [#uses=1]
+  store i32* %0, i32** %ptr, align 8
+  ret void
+}
+
+define i32 @main() nounwind {
+entry:
+  %stack = alloca i32, align 4                    ; <i32*> [#uses=2]
+  %stackptr = alloca i32*, align 4                ; <i32*> [#uses=2]
+  store i32 1, i32* %stack, align 4
+  store i32 * %stack, i32** %stackptr, align 4
+  call void @externallyVisible(i32** %stackptr) nounwind ; <i32> [#uses=0]
+  call void @usesGlobalPtr() nounwind
+  ret i32 0
+}

Modified: poolalloc/trunk/test/dsa/td/call1.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/td/call1.ll?rev=116900&r1=116899&r2=116900&view=diff
==============================================================================
--- poolalloc/trunk/test/dsa/td/call1.ll (original)
+++ poolalloc/trunk/test/dsa/td/call1.ll Tue Oct 19 20:31:24 2010
@@ -2,24 +2,24 @@
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "test:b2:0+HM-I"
 ;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:a2:0+I"
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "test:a2:0+HM-I"
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:a2+IMRE"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:a2+IMR-E"
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "test:a2+SMRE-I"
 
 
 ;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:a1+SM-IE"
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:a1:0+IE"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:a1:0+I-E"
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:a1+SM-IE"
-;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:a1:0+HME-I"
+;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:a1:0+HM-EI"
 
 ;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:b1+SM-IE"
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:b1:0+IE"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:b1:0+I-E"
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:b1+SM-IE"
-;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:b1:0+HME-I"
+;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:b1:0+HM-EI"
 
 ;RUN: dsaopt %s -dsa-td -analyze -check-same-node=func:mem1,func:mem2
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:mem1:0+HIE"
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:mem2:0+HIE"
-;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:mem1:0+HME-I"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:mem1:0+HI-E"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:mem2:0+HI-E"
+;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:mem1:0+HM-IE"
 
 ; ModuleID = 'call1.bc'
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-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"

Modified: poolalloc/trunk/test/dsa/td/call2.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/td/call2.ll?rev=116900&r1=116899&r2=116900&view=diff
==============================================================================
--- poolalloc/trunk/test/dsa/td/call2.ll (original)
+++ poolalloc/trunk/test/dsa/td/call2.ll Tue Oct 19 20:31:24 2010
@@ -2,24 +2,24 @@
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "test:b2:0+HM-I"
 ;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:a2:0+I"
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "test:a2:0+HM-I"
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:a2+IMRE"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:a2+IMR-E"
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "test:a2+SMRE-I"
 
 
 ;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:a1+SM-IE"
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:a1:0+IE"
-;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:a1+SM-IE"
-;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:a1:0+HME-I"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:a1:0+I-E"
+;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:a1+SM-I-E"
+;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:a1:0+HM-IE"
 
 ;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:b1+SM-IE"
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:b1:0+IE"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:b1:0+I-E"
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:b1+SM-IE"
-;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:b1:0+HME-I"
+;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:b1:0+HM-IE"
 
 ;RUN: dsaopt %s -dsa-td -analyze -check-same-node=func:mem1,func:mem2
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:mem1:0+HIE"
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:mem2:0+HIE"
-;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:mem1:0+HME-I"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:mem1:0+HI-E"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "func:mem2:0+HI-E"
+;RUN: dsaopt %s -dsa-td -analyze -verify-flags "func:mem1:0+HM-IE"
 
 ; ModuleID = 'call2.bc'
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-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"

Modified: poolalloc/trunk/test/dsa/td/params.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/td/params.ll?rev=116900&r1=116899&r2=116900&view=diff
==============================================================================
--- poolalloc/trunk/test/dsa/td/params.ll (original)
+++ poolalloc/trunk/test/dsa/td/params.ll Tue Oct 19 20:31:24 2010
@@ -17,18 +17,18 @@
 
 ;RUN: dsaopt %s -dsa-td -analyze -check-same-node=func:a1:0,func:b1:0,func:mem2:0,func:mem1:0,func:r1,func:r2
 
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:b2:0+HIRE"
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:a2:0+HIRE"
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:a2+SIMRE"
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:temp:0+HIRE"
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:temp1:0+HIRE"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:b2:0+HIR-E"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:a2:0+HIR-E"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:a2+SIMR-E"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:temp:0+HIR-E"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:temp1:0+HIR-E"
 ;RUN: dsaopt %s -dsa-local -analyze -check-same-node=test:temp2:0,test:a2:0,test:temp1:0,test:temp:0,test:b2:0
 
-;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "test:b2:0+HIMRE"
-;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "test:a2:0+HIMRE"
-;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "test:a2+SIMRE"
-;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "test:temp+SMR-E,test:temp:0+E"
-;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "test:temp1+SMR-E,test:temp1:0+E"
+;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "test:b2:0+HIMR-E"
+;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "test:a2:0+HIMR-E"
+;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "test:a2+SIMR-E"
+;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "test:temp+SMR-IE,test:temp:0+I-E"
+;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "test:temp1+SMR-IE,test:temp1:0+I-E"
 ;RUN: dsaopt %s -dsa-bu -analyze -check-same-node=test:temp2:0,test:a2:0,test:temp1:0,test:temp:0,test:b2:0
 ;RUN: dsaopt %s -dsa-bu -analyze -check-same-node=test:a2,test:temp2
 

Modified: poolalloc/trunk/test/dsa/td/params1.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/td/params1.ll?rev=116900&r1=116899&r2=116900&view=diff
==============================================================================
--- poolalloc/trunk/test/dsa/td/params1.ll (original)
+++ poolalloc/trunk/test/dsa/td/params1.ll Tue Oct 19 20:31:24 2010
@@ -1,10 +1,10 @@
 ;RUN: dsaopt %s -dsa-local -analyze -check-same-node=initialize:temp:0,initialize:arr:0
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "initialize:temp:0+IRE"
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "initialize:arr+IRE"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "initialize:temp:0+IR-E"
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "initialize:arr+IR-E"
 
 ;RUN: dsaopt %s -dsa-bu -analyze -check-same-node=initialize:temp:0,initialize:arr:0
-;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "initialize:temp:0+IRE"
-;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "initialize:arr+IRE"
+;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "initialize:temp:0+IR-E"
+;RUN: dsaopt %s -dsa-bu -analyze -verify-flags "initialize:arr+IR-E"
 
 ;RUN: dsaopt %s -dsa-td -analyze -check-same-node=initialize:temp:0,initialize:arr:0
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "initialize:temp:0+HMRE-I"

Modified: poolalloc/trunk/test/dsa/td/recur.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/td/recur.ll?rev=116900&r1=116899&r2=116900&view=diff
==============================================================================
--- poolalloc/trunk/test/dsa/td/recur.ll (original)
+++ poolalloc/trunk/test/dsa/td/recur.ll Tue Oct 19 20:31:24 2010
@@ -1,4 +1,7 @@
-;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:b2:0+HIE"
+; b2 isn't exposed to external in any code we look at, but at the end of td
+; we mark it external because there exists a (potential) caller context
+; (externally) in which b2 would be external.
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "test:b2:0+HI-E"
 ;RUN: dsaopt %s -dsa-td -analyze -verify-flags "test:b2:0+HME-I"
 
 ; ModuleID = 'recur.bc'





More information about the llvm-commits mailing list