Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BasicAA] Add tests for constant memory with loop phi (NFC)
- Loading branch information
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
; RUN: opt < %s -passes=aa-eval -print-all-alias-modref-info 2>&1 | FileCheck %s | ||
|
||
@c = constant [8 x i32] zeroinitializer | ||
|
||
declare void @dummy() | ||
|
||
; FIXME: This could be NoModRef | ||
; CHECK-LABEL: Function: basic | ||
; CHECK: Just Ref: Ptr: i32* @c <-> call void @dummy() | ||
define void @basic(ptr %p) { | ||
call void @dummy() | ||
load i32, ptr @c | ||
ret void | ||
} | ||
|
||
; FIXME: This should be at least only Ref. | ||
; CHECK-LABEL: Function: recphi | ||
; Both ModRef: Ptr: i32* %p <-> call void @dummy() | ||
define void @recphi() { | ||
entry: | ||
br label %loop | ||
|
||
loop: | ||
%p = phi ptr [ @c, %entry ], [ %p.next, %loop ] | ||
call void @dummy() | ||
load i32, ptr %p | ||
%p.next = getelementptr i32, ptr %p, i64 1 | ||
%c = icmp ne ptr %p.next, getelementptr (i32, ptr @c, i64 8) | ||
br i1 %c, label %loop, label %exit | ||
|
||
exit: | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters