diff options
| author | James Molloy <james.molloy@arm.com> | 2015-02-13 10:48:30 +0000 |
|---|---|---|
| committer | James Molloy <james.molloy@arm.com> | 2015-02-13 10:48:30 +0000 |
| commit | 1b6207e6eb5330265b2e435e5061b3c55b78cb69 (patch) | |
| tree | 443a216bc213e7f31e6d57c8b9643db8df9b4cf5 /llvm/lib/Transforms/Utils/SimplifyCFG.cpp | |
| parent | e3c31354633564bf2113a3fb889fe91968235ecd (diff) | |
| download | bcm5719-llvm-1b6207e6eb5330265b2e435e5061b3c55b78cb69.tar.gz bcm5719-llvm-1b6207e6eb5330265b2e435e5061b3c55b78cb69.zip | |
[SimplifyCFG] Be more aggressive
Up the phi node folding threshold from a cheap "1" to a meagre "2".
Update tests for extra added selects and slight code churn.
llvm-svn: 229099
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index b65fd38b836..6717be15db9 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -53,9 +53,13 @@ using namespace PatternMatch; #define DEBUG_TYPE "simplifycfg" +// Chosen as 2 so as to be cheap, but still to have enough power to fold +// a select, so the "clamp" idiom (of a min followed by a max) will be caught. +// To catch this, we need to fold a compare and a select, hence '2' being the +// minimum reasonable default. static cl::opt<unsigned> -PHINodeFoldingThreshold("phi-node-folding-threshold", cl::Hidden, cl::init(1), - cl::desc("Control the amount of phi node folding to perform (default = 1)")); +PHINodeFoldingThreshold("phi-node-folding-threshold", cl::Hidden, cl::init(2), + cl::desc("Control the amount of phi node folding to perform (default = 2)")); static cl::opt<bool> DupRet("simplifycfg-dup-ret", cl::Hidden, cl::init(false), |

