[PATCH] [SimplifyCFG] threshold for folding branches with common destination

Jingyue Wu jingyue at google.com
Mon Sep 29 14:33:50 PDT 2014


Hi Owen,

I made the threshold a pass paramter in this patch. However, it doesn't look
pretty because there are several layers between createCFGSimplificationPass and
the actual use of this threshold (e.g. CFGSimplifyPass and SimplifyCFGOpt).

What are the benefits of having these pass parameters? I saw other passes such
as JumpThreading and LoopUnroll have such pass parameters too, but none of them
seem actually used. One way I can think of using that is target-specific code
can create these passes with a customized threshold, but in that case, I feel
TargetTransformInfo would be a better home.

Jingyue

http://reviews.llvm.org/D5529

Files:
  include/llvm/Transforms/Scalar.h
  include/llvm/Transforms/Utils/Local.h
  lib/Transforms/Scalar/SimplifyCFGPass.cpp
  lib/Transforms/Utils/SimplifyCFG.cpp
  test/Transforms/SimplifyCFG/branch-fold-threshold.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5529.14187.patch
Type: text/x-patch
Size: 20566 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140929/3e99fa1a/attachment.bin>


More information about the llvm-commits mailing list