[llvm-bugs] [Bug 32721] New: IfConversion creating bad CFG when merging triangle
llvm-bugs at lists.llvm.org
Thu Apr 20 06:40:46 PDT 2017
Bug ID: 32721
Summary: IfConversion creating bad CFG when merging triangle
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: mikael.holmen at ericsson.com
CC: llvm-bugs at lists.llvm.org
Created attachment 18319
llc -mtriple thumbv7-apple-ios ifcvt_triangle_false_return.mir
-run-pass=if-converter -o - -debug
successors: %bb.2(0x40000000), %bb.1(0x00000000)
BX_RET 14, _, implicit killed %r0
Looking at bb.1, we have a single unconditional return, but bb.1 still has two
successors? This seems wrong to me.
The situation occurs since BX_RET is a return instruction that ARM's
implementation returns true for so the IfConversion call to
won't do anything, and thus leave the CFG is a bad state.
There are some calls to removeSuccessor() here and there in IfConversion.cpp:
// RemoveExtraEdges won't work if the block has an unanalyzable branch, so
// explicitly remove CvtBBI as a successor.
but none of them catch this case.
(Originally found when compiling for my out-of-tree backend, so I created a MIR
test case and modified it to expose the problem also on ARM.)
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs