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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to