[PATCH] D24805: [GVNSink] Initial GVNSink prototype

James Molloy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 22 06:41:24 PDT 2017


jmolloy updated this revision to Diff 99753.
jmolloy added a comment.

Hi Danny,

Thanks for making me think more about the iteration order. Regardless of the difficulties of forming inverse RPO, I now think I was completely wrong about the preferred iteration order.

For a sinking pass, surely a *forward* walk (preds before succs) is more optimal than a backward walk. Pushing instructions down the graph exposes more opportunities for sinking later on. Also, a forward walk wouldn't have to worry about recalculating value numbers when changing the CFG as we're only changing parts of the CFG that we'll never inspect again.

So I think a single pass, RPO walk of the CFG is sufficient (and indeed passes all my testcases and all the internal testing I can throw at it).

Cheers,

James


Repository:
  rL LLVM

https://reviews.llvm.org/D24805

Files:
  include/llvm/InitializePasses.h
  include/llvm/Transforms/Scalar.h
  include/llvm/Transforms/Scalar/GVN.h
  include/llvm/Transforms/Utils/Local.h
  lib/Transforms/IPO/PassManagerBuilder.cpp
  lib/Transforms/Scalar/CMakeLists.txt
  lib/Transforms/Scalar/GVNSink.cpp
  lib/Transforms/Scalar/Scalar.cpp
  lib/Transforms/Utils/Local.cpp
  lib/Transforms/Utils/SimplifyCFG.cpp
  test/Transforms/GVNSink/dither.ll
  test/Transforms/GVNSink/indirect-call.ll
  test/Transforms/GVNSink/sink-common-code.ll
  test/Transforms/GVNSink/struct.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24805.99753.patch
Type: text/x-patch
Size: 60514 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170522/c76c1b68/attachment.bin>


More information about the llvm-commits mailing list