mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
SimplifyCFG: Expose phi node folding cost threshold as command line parameter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130528 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -37,6 +37,10 @@
|
||||
#include <map>
|
||||
using namespace llvm;
|
||||
|
||||
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)"));
|
||||
|
||||
static cl::opt<bool>
|
||||
DupRet("simplifycfg-dup-ret", cl::Hidden, cl::init(false),
|
||||
cl::desc("Duplicate return instructions into unconditional branches"));
|
||||
@@ -1246,7 +1250,8 @@ static bool FoldTwoEntryPHINode(PHINode *PN, const TargetData *TD) {
|
||||
// instructions. While we are at it, keep track of the instructions
|
||||
// that need to be moved to the dominating block.
|
||||
SmallPtrSet<Instruction*, 4> AggressiveInsts;
|
||||
unsigned MaxCostVal0 = 1, MaxCostVal1 = 1;
|
||||
unsigned MaxCostVal0 = PHINodeFoldingThreshold,
|
||||
MaxCostVal1 = PHINodeFoldingThreshold;
|
||||
|
||||
for (BasicBlock::iterator II = BB->begin(); isa<PHINode>(II);) {
|
||||
PHINode *PN = cast<PHINode>(II++);
|
||||
|
Reference in New Issue
Block a user