summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorHsiangkai Wang <hsiangkai@gmail.com>2018-11-30 08:07:29 +0000
committerHsiangkai Wang <hsiangkai@gmail.com>2018-11-30 08:07:29 +0000
commit957578ddf71db9efedf9c7ca8a802e6bba3c90eb (patch)
tree3acd8b2e5a843cca2e305d8fabbff6bb2b3072db /llvm/lib/CodeGen
parentd72f6f133a53c241ac44d30ba99ce36eed36933d (diff)
downloadbcm5719-llvm-957578ddf71db9efedf9c7ca8a802e6bba3c90eb.tar.gz
bcm5719-llvm-957578ddf71db9efedf9c7ca8a802e6bba3c90eb.zip
[CodeGen] Fix bugs in BranchFolderPass when debug labels are generated.
Skip DBG_VALUE and DBG_LABEL in branch folding algorithms. The bug is reported in https://bugs.chromium.org/p/chromium/issues/detail?id=898160. Differential Revision: https://reviews.llvm.org/D54199 llvm-svn: 347964
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index fa027eedd4d..efbfd5f4ab2 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/lib/CodeGen/BranchFolding.cpp
@@ -298,7 +298,7 @@ static unsigned HashEndOfMBB(const MachineBasicBlock &MBB) {
/// Whether MI should be counted as an instruction when calculating common tail.
static bool countsAsInstruction(const MachineInstr &MI) {
- return !(MI.isDebugValue() || MI.isCFIInstruction());
+ return !(MI.isDebugInstr() || MI.isCFIInstruction());
}
/// ComputeCommonTailLength - Given two machine basic blocks, compute the number
@@ -1363,9 +1363,9 @@ static void copyDebugInfoToPredecessor(const TargetInstrInfo *TII,
MachineBasicBlock &PredMBB) {
auto InsertBefore = PredMBB.getFirstTerminator();
for (MachineInstr &MI : MBB.instrs())
- if (MI.isDebugValue()) {
+ if (MI.isDebugInstr()) {
TII->duplicate(PredMBB, InsertBefore, MI);
- LLVM_DEBUG(dbgs() << "Copied debug value from empty block to pred: "
+ LLVM_DEBUG(dbgs() << "Copied debug entity from empty block to pred: "
<< MI);
}
}
@@ -1375,9 +1375,9 @@ static void copyDebugInfoToSuccessor(const TargetInstrInfo *TII,
MachineBasicBlock &SuccMBB) {
auto InsertBefore = SuccMBB.SkipPHIsAndLabels(SuccMBB.begin());
for (MachineInstr &MI : MBB.instrs())
- if (MI.isDebugValue()) {
+ if (MI.isDebugInstr()) {
TII->duplicate(SuccMBB, InsertBefore, MI);
- LLVM_DEBUG(dbgs() << "Copied debug value from empty block to succ: "
+ LLVM_DEBUG(dbgs() << "Copied debug entity from empty block to succ: "
<< MI);
}
}
OpenPOWER on IntegriCloud