[all-commits] [llvm/llvm-project] 60f3e8: [BasicAA] Clarify entry values of GetLinearExpress...

Nikita Popov via All-commits all-commits at lists.llvm.org
Sat Mar 27 07:22:33 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 60f3e8fbe44f12ea28760c2771f8bf48dc08abe8
      https://github.com/llvm/llvm-project/commit/60f3e8fbe44f12ea28760c2771f8bf48dc08abe8
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-03-27 (Sat, 27 Mar 2021)

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

  Log Message:
  -----------
  [BasicAA] Clarify entry values of GetLinearExpression() (NFC)

A number of variables need to be correctly initialized on entry
to GetLinearExpression() for the implementation to behave reasonably.

The fact that SExtBits can currenlty be non-zero on entry is a bug,
as demonstrated by the added test: For implicit sexts by the GEP,
we do currently skip legality checks.


  Commit: b981bc30bf1a21c753a07bbb6f4e40140cdec3c4
      https://github.com/llvm/llvm-project/commit/b981bc30bf1a21c753a07bbb6f4e40140cdec3c4
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-03-27 (Sat, 27 Mar 2021)

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

  Log Message:
  -----------
  [BasicAA] Correct handle implicit sext in decomposition

While explicit sext instructions were handled correctly, the
implicit sext that occurs if the offset is smaller than the
pointer size blindly assumed that sext(X * Scale + Offset) is the
same as sext(X) * Scale + Offset, which is obviously not correct.

Fix this by extracting the code that handles linear expression
extension and reusing it for the implicit sext as well.


Compare: https://github.com/llvm/llvm-project/compare/ad9dad93ff12...b981bc30bf1a


More information about the All-commits mailing list