[all-commits] [llvm/llvm-project] 91fa35: [BasicAA] Be more careful with modulo ops on Varia...

Florian Hahn via All-commits all-commits at lists.llvm.org
Tue Jun 29 01:24:27 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 91fa3565da16f77e07270e5323874abc22661cb0
      https://github.com/llvm/llvm-project/commit/91fa3565da16f77e07270e5323874abc22661cb0
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M llvm/include/llvm/Analysis/BasicAliasAnalysis.h
    M llvm/lib/Analysis/BasicAliasAnalysis.cpp
    M llvm/test/Analysis/BasicAA/gep-modulo.ll

  Log Message:
  -----------
  [BasicAA] Be more careful with modulo ops on VariableGEPIndex.

(V * Scale) % X may not produce the same result for any possible value
of V, e.g. if the multiplication overflows. This means we currently
incorrectly determine NoAlias in some cases.

This patch updates LinearExpression to track whether the expression
has NSW and uses that to adjust the scale used for alias checks.

Reviewed By: nikic

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




More information about the All-commits mailing list