LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 24581 - optnone function results in MachineBasicBlocks with duplicated predecessors
Summary: optnone function results in MachineBasicBlocks with duplicated predecessors
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Common Code Generator Code (show other bugs)
Version: trunk
Hardware: PC All
: P normal
Assignee: Matthias Braun
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-25 19:28 PDT by Matthias Braun
Modified: 2015-08-26 15:47 PDT (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Braun 2015-08-25 19:28:02 PDT
The machine verifier enforces the property that no block is listed twice in the successor or predecessor list. For a function with the optnone function this is not always true after instruction selection. Example:

> cat test.ll
define void @bar() #0 {
entry:
  br i1 undef, label %exit, label %exit

exit:
  ret void
}

attributes #0 = { noinline optnone }
> llc -verify-machineinstrs test.ll
...
*** Bad machine code: MBB has duplicate entries in its successor list. ***
...

I'm not sure why the machine verifier enforces this property, without the optnone attribute the codegenprepare appears to remove those pointless jumps though I am not sure yet whether this is on purpose to avoid the verification problems.
Comment 1 Matthias Braun 2015-08-25 21:54:21 PDT
http://reviews.llvm.org/D12350 fixes this.
Comment 2 Matthias Braun 2015-08-26 15:47:43 PDT
Fixed in r246074.