@@ -1672,6 +1672,7 @@ static bool SpeculativelyExecuteBB(BranchInst *BI, BasicBlock *ThenBB,
16721672 return true ;
16731673}
16741674
1675+ #if 0 // HLSL Change - Unused function
16751676/// \returns True if this block contains a CallInst with the NoDuplicate
16761677/// attribute.
16771678static bool HasNoDuplicateCall(const BasicBlock *BB) {
@@ -1684,6 +1685,7 @@ static bool HasNoDuplicateCall(const BasicBlock *BB) {
16841685 }
16851686 return false;
16861687}
1688+ #endif
16871689
16881690// / Return true if we can thread a branch across this block.
16891691static bool BlockIsSimpleEnoughToThreadThrough (BasicBlock *BB) {
@@ -1709,6 +1711,7 @@ static bool BlockIsSimpleEnoughToThreadThrough(BasicBlock *BB) {
17091711 return true ;
17101712}
17111713
1714+ #if 0 // HLSL Change - Unused function
17121715/// If we have a conditional branch on a PHI node value that is defined in the
17131716/// same block as the branch and if any PHI entries are constants, thread edges
17141717/// corresponding to that entry to be branches to their ultimate destination.
@@ -1807,6 +1810,7 @@ static bool FoldCondBranchOnPHI(BranchInst *BI, const DataLayout &DL) {
18071810
18081811 return false;
18091812}
1813+ #endif
18101814
18111815// / Given a BB that starts with the specified two-entry PHI node,
18121816// / see if we can eliminate it.
@@ -4573,12 +4577,14 @@ bool SimplifyCFGOpt::SimplifyCondBranch(BranchInst *BI, IRBuilder<> &Builder) {
45734577 return SimplifyCFG (BB, TTI, BonusInstThreshold, AC) | true ;
45744578 }
45754579
4580+ #if 0 // HLSL Change - this transformation creates unstructured flow
45764581 // If this is a branch on a phi node in the current block, thread control
45774582 // through this block if any PHI node entries are constants.
45784583 if (PHINode *PN = dyn_cast<PHINode>(BI->getCondition()))
45794584 if (PN->getParent() == BI->getParent())
45804585 if (FoldCondBranchOnPHI(BI, DL))
45814586 return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
4587+ #endif // HLSL Change
45824588
45834589 // Scan predecessor blocks for conditional branches.
45844590 for (pred_iterator PI = pred_begin (BB), E = pred_end (BB); PI != E; ++PI)
0 commit comments