diff options
author | Dan Gohman <gohman@apple.com> | 2009-03-30 22:55:17 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-03-30 22:55:17 +0000 |
commit | 80c93e7442f89f4a0565258c56dca446e1574f9b (patch) | |
tree | cd69d75690264b462458cee101819ad0caaf4413 /lib | |
parent | b23c232fc8a0777145480cf3ccc58f5b61e0c277 (diff) |
Except in asm-verbose mode, avoid printing labels for blocks that are
only reachable via fall-through edges. This dramatically reduces the
number of labels printed, and thus also the number of labels the
assembler must parse and remember.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp index 3bdcf88365..d8a33957d5 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp @@ -238,7 +238,12 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) { for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); I != E; ++I) { // Print a label for the basic block. - if (!I->pred_empty()) { + if (!VerboseAsm && (I->pred_empty() || I->isOnlyReachableByFallthrough())) { + // This is an entry block or a block that's only reachable via a + // fallthrough edge. In non-VerboseAsm mode, don't print the label. + assert((I->pred_empty() || (*I->pred_begin())->isLayoutSuccessor(I)) && + "Fall-through predecessor not adjacent to its successor!"); + } else { printBasicBlockLabel(I, true, true, VerboseAsm); O << '\n'; } |