[all-commits] [llvm/llvm-project] 311faf: [BasicAA] Fix -basicaa-recphi for geps with negati...

David Green via All-commits all-commits at lists.llvm.org
Thu Jul 16 09:23:20 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 311fafd2c90aed5b3fed9566503eebe629f1e979
      https://github.com/llvm/llvm-project/commit/311fafd2c90aed5b3fed9566503eebe629f1e979
  Author: David Green <david.green at arm.com>
  Date:   2020-07-16 (Thu, 16 Jul 2020)

  Changed paths:
    M llvm/lib/Analysis/BasicAliasAnalysis.cpp
    M llvm/test/Analysis/BasicAA/recphi.ll

  Log Message:
  -----------
  [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




More information about the All-commits mailing list