[llvm-bugs] [Bug 50876] New: [BranchFolding] Removing a block as dead while still used by branch instruction

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 25 17:34:45 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50876

            Bug ID: 50876
           Summary: [BranchFolding] Removing a block as dead while still
                    used by branch instruction
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: paulsson at linux.vnet.ibm.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 24982
  --> https://bugs.llvm.org/attachment.cgi?id=24982&action=edit
reduced testcase

It seems that BranchFolder::OptimizeBranches() is finding an MBB to have no
predecessors and therefore calls RemoveDeadBlock(). There is however still a
branch instruction branching to that target. As a result that instruction gets
a target '%bb.-1', since the block no longer exists.

llc -mcpu=arch13 -O3 -enable-tail-merge=false tc_ifconv.ll -o -

...
# %bb.5:                                # %bb13
        blhr    %r14
        j       ".LBB0_-1"
...

(j .LBB0_-1 since the block has been removed)

-- 
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/20210626/839a70e2/attachment-0001.html>


More information about the llvm-bugs mailing list