]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/commit
BasicAA: Fix value equality and phi cycles
authorArnold Schwaighofer <aschwaighofer@apple.com>
Thu, 2 Jan 2014 03:31:36 +0000 (03:31 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Thu, 2 Jan 2014 03:31:36 +0000 (03:31 +0000)
commit1bdb320daea95b65bf5a5293132a8911ca1a7524
treecddcf3638496f46dbc431c7b4afda26e49958ac8
parentf8735544dc5c75a0b0de7ff13e130ad93d9a1ac1
BasicAA: Fix value equality and phi cycles

When there are cycles in the value graph we have to be careful interpreting
"Value*" identity as "value" equivalence. We interpret the value of a phi node
as the value of its operands.
When we check for value equivalence now we make sure that the "Value*" dominates
all cycles (phis).

%0 = phi [%noaliasval, %addr2]
%l = load %ptr
%addr1 = gep @a, 0, %l
%addr2 = gep @a, 0, (%l + 1)
store %ptr ...

Before this patch we would return NoAlias for (%0, %addr1) which is wrong
because the value of the load is from different iterations of the loop.

Tested on x86_64 -mavx at O3 and O3 -flto with no performance or compile time
regressions.

PR18068
radar://15653794

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198290 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/BasicAliasAnalysis.cpp
test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll
test/Analysis/BasicAA/phi-aa.ll
test/Analysis/BasicAA/phi-spec-order.ll
test/Analysis/GlobalsModRef/aliastest.ll
test/Transforms/ObjCARC/weak-copies.ll
test/Transforms/ObjCARC/weak-dce.ll