[all-commits] [llvm/llvm-project] 4df8ef: [AA] Split up LocationSize::unknown()

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Nov 26 09:40:19 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4df8efce80e373dd1e05bd4910c796a0c91383e7
      https://github.com/llvm/llvm-project/commit/4df8efce80e373dd1e05bd4910c796a0c91383e7
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-11-26 (Thu, 26 Nov 2020)

  Changed paths:
    M llvm/include/llvm/Analysis/AliasAnalysis.h
    M llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
    M llvm/include/llvm/Analysis/MemoryLocation.h
    M llvm/include/llvm/Analysis/MemorySSA.h
    M llvm/include/llvm/LinkAllPasses.h
    M llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
    M llvm/lib/Analysis/AliasSetTracker.cpp
    M llvm/lib/Analysis/BasicAliasAnalysis.cpp
    M llvm/lib/Analysis/DependenceAnalysis.cpp
    M llvm/lib/Analysis/GlobalsModRef.cpp
    M llvm/lib/Analysis/Lint.cpp
    M llvm/lib/Analysis/LoopAccessAnalysis.cpp
    M llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
    M llvm/lib/Analysis/MemoryLocation.cpp
    M llvm/lib/Analysis/MemorySSA.cpp
    M llvm/lib/Analysis/ObjCARCAliasAnalysis.cpp
    M llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp
    M llvm/lib/CodeGen/ImplicitNullChecks.cpp
    M llvm/lib/CodeGen/MachinePipeliner.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp
    M llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
    M llvm/lib/Target/ARM/ARMParallelDSP.cpp
    M llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
    M llvm/lib/Transforms/IPO/FunctionAttrs.cpp
    M llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
    M llvm/lib/Transforms/Scalar/LICM.cpp
    M llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
    M llvm/test/Analysis/AliasSet/argmemonly.ll
    M llvm/test/Analysis/AliasSet/memset.ll
    M llvm/test/Analysis/AliasSet/memtransfer.ll
    M llvm/test/Analysis/BasicAA/cs-cs.ll
    M llvm/test/CodeGen/AMDGPU/global_smrd_cfg.ll
    M llvm/unittests/Analysis/AliasAnalysisTest.cpp
    M llvm/unittests/Analysis/MemorySSATest.cpp
    M polly/lib/Analysis/ScopDetection.cpp

  Log Message:
  -----------
  [AA] Split up LocationSize::unknown()

Currently, we have some confusion in the codebase regarding the
meaning of LocationSize::unknown(): Some parts (including most of
BasicAA) assume that LocationSize::unknown() only allows accesses
after the base pointer. Some parts (various callers of AA) assume
that LocationSize::unknown() allows accesses both before and after
the base pointer (but within the underlying object).

This patch splits up LocationSize::unknown() into
LocationSize::afterPointer() and LocationSize::beforeOrAfterPointer()
to make this completely unambiguous. I tried my best to determine
which one is appropriate for all the existing uses.

The test changes in cs-cs.ll in particular illustrate a previously
clearly incorrect AA result: We were effectively assuming that
argmemonly functions were only allowed to access their arguments
after the passed pointer, but not before it. I'm pretty sure that
this was not intentional, and it's certainly not specified by
LangRef that way.

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




More information about the All-commits mailing list