[PATCH] D31642: [CodeGen] Add a 'NoAAResultsWrapperPass', and use it in SDAG/2Addr.

Ahmed Bougacha via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 19:26:18 PDT 2017


ab created this revision.
Herald added a subscriber: jholewinski.

Before r247167, the pass manager builder controlled which AA
implementations were used, exporting them all in the AliasAnalysis
analysis group.

Now, AAResultsWrapperPass always uses BasicAA, but still uses other
AA implementations if made available in the pass pipeline.

IIUC, one of the many quirks of the legacy pass manager is that we
never actually recomputed BasicAA's dependencies, even though it
requires DT.  I'm not sure how that never caused a problem in practice.

But regardless, both SDAG and TwoAddress are required at O0, and really
don't need to be doing fancy optimizations based on useful AA results.

Add a 'NoAAResultsWrapperPass', which just wraps an empty AAResults.
This lets us always provide conservative answers.

Ideally, the decision to use this instead of AAResultsWrapperPass
should live at a higher level, in TargetPassConfig.  However, these
passes are already opt-level-aware, and untangling the legacy pass
manager to support adding arbitrary AA passes if the AAResultsWrapper
was required is a huge undertaking (and would basically undo a few
of Chandler's cleanups).

I'm really not sure this is the right approach. WDYT?


https://reviews.llvm.org/D31642

Files:
  include/llvm/Analysis/AliasAnalysis.h
  include/llvm/CodeGen/Passes.h
  include/llvm/InitializePasses.h
  lib/Analysis/AliasAnalysis.cpp
  lib/Analysis/Analysis.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
  lib/CodeGen/TargetPassConfig.cpp
  lib/CodeGen/TwoAddressInstructionPass.cpp
  lib/Target/NVPTX/NVPTXTargetMachine.cpp
  test/CodeGen/X86/O0-pipeline.ll
  test/CodeGen/X86/pr32284.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31642.93990.patch
Type: text/x-patch
Size: 14984 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170404/de1f37f6/attachment.bin>


More information about the llvm-commits mailing list