[llvm-bugs] [Bug 30929] New: LibCallsShrinkWrap falsely claims to preserve CFG

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 7 02:05:14 PST 2016


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

            Bug ID: 30929
           Summary: LibCallsShrinkWrap falsely claims to preserve CFG
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: opt
          Assignee: unassignedbugs at nondot.org
          Reporter: jesper.antonsson at ericsson.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

We get multiple different fails in our randomized testing using the
LibCallsShrinkWrap pass. The problem is that this pass claims to preserve the
CFG, but it actually doesn't, which (at least) gives problems with the domtree.

The problem can be replicated with this tiny program:

define void @TEST__MAIN() {
  %_tmp31 = call float @acosf(float 2.000000e+00)
  ret void
}
declare float @acosf(float)

It fails in gvn using the following opt call:

 opt -instcombine -libcalls-shrinkwrap -gvn ./shrink.ll

Failing assert:

opt: ../include/llvm/Support/GenericDomTree.h:591: void
llvm::DominatorTreeBase<llvm::BasicBlock>::changeImmediateDominator(DomTreeNodeBase<NodeT>
*, DomTreeNodeBase<NodeT> *) [N = llvm::BasicBlock]: Assertion `N && NewIDom &&
"Cannot change null node pointers!"' failed.

One can also insert a -verify-dom-info after the -libcalls-shrinkwrap option,
and that will report the problem as well:
DominatorTree for function: TEST__MAIN is not up to date!

-- 
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/20161107/2bef47d1/attachment-0001.html>


More information about the llvm-bugs mailing list