HomePhabricator

[BasicAA] Fix -basicaa-recphi for geps with negative offsets

Authored by dmgreen on Thu, Jul 16, 7:42 AM.

Description

[BasicAA] Fix -basicaa-recphi for geps with negative offsets

As shown in D82998, the basic-aa-recphi option can cause miscompiles for
gep's with negative constants. The option checks for recursive phi, that
recurse through a contant gep. If it finds one, it performs aliasing
calculations using the other phi operands with an unknown size, to
specify that an unknown number of elements after the initial value are
potentially accessed. This works fine expect where the constant is
negative, as the size is still considered to be positive. So this patch
expands the check to make sure that the constant is also positive.

Differential Revision: https://reviews.llvm.org/D83576

Details

Committed
dmgreenThu, Jul 16, 9:22 AM
Differential Revision
D83576: [BasicAA] Fix -basicaa-recphi for geps with negative offsets
Parents
rGc74cfd40452d: [gn build] Port 1360e140cc7
Branches
Unknown
Tags
Unknown