diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2014-12-01 04:27:03 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2014-12-01 04:27:03 +0000 |
commit | b9991a265642cea3c544fe407cbb5eb300582f43 (patch) | |
tree | a0bf852deabdc99009879a35744edcc18b180473 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h | |
parent | 04a74af73479477f2e866719f9b773c4da648872 (diff) | |
download | bcm5719-llvm-b9991a265642cea3c544fe407cbb5eb300582f43.tar.gz bcm5719-llvm-b9991a265642cea3c544fe407cbb5eb300582f43.zip |
[stack protector] Set edge weights for newly created basic blocks.
This commit fixes a bug in stack protector pass where edge weights were not set
when new basic blocks were added to lists of successor basic blocks.
Differential Revision: http://reviews.llvm.org/D5766
llvm-svn: 222987
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h index f74e6525b0c..b2215f22ab1 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h @@ -417,8 +417,8 @@ private: assert(!shouldEmitStackProtector() && "Stack Protector Descriptor is " "already initialized!"); ParentMBB = MBB; - SuccessMBB = AddSuccessorMBB(BB, MBB); - FailureMBB = AddSuccessorMBB(BB, MBB, FailureMBB); + SuccessMBB = AddSuccessorMBB(BB, MBB, /* IsLikely */ true); + FailureMBB = AddSuccessorMBB(BB, MBB, /* IsLikely */ false, FailureMBB); if (!Guard) Guard = StackProtCheckCall.getArgOperand(0); } @@ -487,9 +487,10 @@ private: /// Add a successor machine basic block to ParentMBB. If the successor mbb /// has not been created yet (i.e. if SuccMBB = 0), then the machine basic - /// block will be created. + /// block will be created. Assign a large weight if IsLikely is true. MachineBasicBlock *AddSuccessorMBB(const BasicBlock *BB, MachineBasicBlock *ParentMBB, + bool IsLikely, MachineBasicBlock *SuccMBB = nullptr); }; |