[LLVMbugs] [Bug 17894] New: AsmPrinter::isBlockOnlyReachableByFallthrough() only checks register operands of a bundle instruction

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 12 03:48:24 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=17894

            Bug ID: 17894
           Summary: AsmPrinter::isBlockOnlyReachableByFallthrough() only
                    checks register operands of a bundle instruction
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: llc
          Assignee: unassignedbugs at nondot.org
          Reporter: triple.yang at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Since llvm::finalizeBundle() only collect register operands in
lib/CodeGen/MachineInstrBundle.cpp,
AsmPrinter::isBlockOnlyReachableByFallthrough() can only check its collected
register operands, and thus miss MachineOperand like MO_MachineBasicBlock,
which will lead to to errors.

For example, instruction sequence:
########## s1 start #######
  ...
  insn1
  ...
  jump LBB0
  ...
LBB0:
  ...
########## s1 end  ########

is packetized, insn1 and "jump LBB0" is bundled, we expect:

########### s2 start #######
  ...
  { insn1; jump LBB0 }
  ...
  LBB0:
  ...
########### s2 end  ########

Instead, lcc will generate:

########### s2' start  ########
  ...
  { insn1; jump LBB0 }
  ...
  #LBB0:
  ...
########### s2' end  ########

which results in linking error saying undefined reference to LBB0 if LBB0 has
no other predecessors.

This is because AsmPrinter::isBlockOnlyReachableByFallthrough() forgets to
check MachineOperand LBB0.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131112/fa059d35/attachment.html>


More information about the llvm-bugs mailing list