[PATCH] D18019: [PM] Port GVN to the new pass manager, wire it up, and teach a couple of tests to run GVN in both modes.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 9 17:10:23 PST 2016


chandlerc created this revision.
chandlerc added a subscriber: llvm-commits.
Herald added subscribers: mcrosier, joker.eph, jholewinski.

This is mostly the boring refactoring just like SROA and other complex
transformation passes. There is some trickiness in that GVN's
ValueNumber class requires hand holding to get to compile cleanly. I'm
open to suggestions about a better pattern there, but I tried several
before settling on this. I was trying to balance my desire to sink as
much implementation detail into the source file as possible without
introducing overly many layers of abstraction.

Much like with SROA, the design of this system is made somewhat more
cumbersome by the need to support both pass managers without duplicating
the significant state and logic of the pass. The same compromise is
struck here.

I've also left a FIXME in a doxygen comment as the GVN pass seems to
have pretty woeful documentation within it. I'd like to submit this with
the FIXME and let those more deeply familiar backfill the information
here now that we have a nice place in an interface to put that kind of
documentaiton.

http://reviews.llvm.org/D18019

Files:
  include/llvm/InitializePasses.h
  include/llvm/LinkAllPasses.h
  include/llvm/Transforms/Scalar.h
  include/llvm/Transforms/Scalar/GVN.h
  lib/LTO/LTOCodeGenerator.cpp
  lib/Passes/PassBuilder.cpp
  lib/Passes/PassRegistry.def
  lib/Target/NVPTX/NVPTXTargetMachine.cpp
  lib/Transforms/IPO/PassManagerBuilder.cpp
  lib/Transforms/Scalar/GVN.cpp
  lib/Transforms/Scalar/Scalar.cpp
  test/Transforms/GVN/basic.ll
  test/Transforms/GVN/pre-gep-load.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18019.50217.patch
Type: text/x-patch
Size: 39413 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160310/ac3d1bdc/attachment.bin>


More information about the llvm-commits mailing list