[PATCH] [PM/AA] Hoist the AliasResult enum out of the AliasAnalysis class.

Chandler Carruth chandlerc at gmail.com
Wed Jun 17 02:08:34 PDT 2015


This will allow classes to implement the AA interface without deriving
from the class or referencing an internal enum of some other class as
their return types.

Also, to a pretty fundamental extent, concepts such as 'NoAlias',
'MayAlias', and 'MustAlias' are first class concepts in LLVM and we
aren't saving anything by scoping them heavily.

My mild preference would have been to use a scoped enum, but that
feature is essentially completely broken AFAICT. I'm extremely
disappointed. For example, we cannot through any reasonable[1] means
construct an enum class (or analog) which has scoped names but converts
to a boolean in order to test for the possibility of aliasing.

[1]: Richard Smith came up with a "solution", but it requires class
templates, and lots of boilerplate setting up the enumeration multiple
times. Something like Boost.PP could potentially bundle this up, but
even that would be quite painful and it doesn't seem realistically worth
it. The enum class solution would probably work without the need for
a bool conversion.

Depends on D10494

http://reviews.llvm.org/D10495

Files:
  docs/AliasAnalysis.rst
  include/llvm/Analysis/AliasAnalysis.h
  lib/Analysis/AliasAnalysis.cpp
  lib/Analysis/AliasAnalysisCounter.cpp
  lib/Analysis/AliasAnalysisEvaluator.cpp
  lib/Analysis/AliasSetTracker.cpp
  lib/Analysis/BasicAliasAnalysis.cpp
  lib/Analysis/CFLAliasAnalysis.cpp
  lib/Analysis/DependenceAnalysis.cpp
  lib/Analysis/IPA/GlobalsModRef.cpp
  lib/Analysis/Lint.cpp
  lib/Analysis/MemoryDependenceAnalysis.cpp
  lib/Analysis/ScalarEvolutionAliasAnalysis.cpp
  lib/Analysis/ScopedNoAliasAA.cpp
  lib/Analysis/TypeBasedAliasAnalysis.cpp
  lib/CodeGen/ScheduleDAGInstrs.cpp
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/Transforms/ObjCARC/ObjCARCAliasAnalysis.cpp
  lib/Transforms/ObjCARC/ObjCARCOpts.cpp
  lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10495.27816.patch
Type: text/x-patch
Size: 31809 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150617/092ca55d/attachment.bin>


More information about the llvm-commits mailing list