llvm-6502/test/Analysis/GlobalsModRef/aliastest.ll
Arnold Schwaighofer 3036182e99 BasicAA: Use reachabilty instead of dominance for checking value equality in phi
cycles

This allows the value equality check to work even if we don't have a dominator
tree. Also add some more comments.

I was worried about compile time impacts and did not implement reachability but
used the dominance check in the initial patch. The trade-off was that the
dominator tree was required.
The llvm utility function isPotentiallyReachable cuts off the recursive search
after 32 visits. Testing did not show any compile time regressions showing my
worries unjustfied.

No compile time or performance regressions at O3 -flto -mavx on test-suite +
externals.

Addresses review comments from r198290.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198400 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-03 05:47:03 +00:00

15 lines
355 B
LLVM

; RUN: opt < %s -basicaa -globalsmodref-aa -gvn -S | FileCheck %s
@X = internal global i32 4 ; <i32*> [#uses=1]
define i32 @test(i32* %P) {
; CHECK: @test
; CHECK-NEXT: store i32 7, i32* %P
; CHECK-NEXT: store i32 12, i32* @X
; CHECK-NEXT: ret i32 7
store i32 7, i32* %P
store i32 12, i32* @X
%V = load i32* %P ; <i32> [#uses=1]
ret i32 %V
}