[llvm-bugs] [Bug 46877] New: Infinite loop in DAGCombiner::Run

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 28 13:31:50 PDT 2020


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

            Bug ID: 46877
           Summary: Infinite loop in DAGCombiner::Run
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: ruhler at google.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, qshanz at cn.ibm.com,
                    ruhler at google.com, spatel+llvm at rotateright.com

Created attachment 23783
  --> https://bugs.llvm.org/attachment.cgi?id=23783&action=edit
The program and DAG that hangs.

For the program hangs.ll in the attached hangs.tar.gz, the following command
hangs:

  llc -O3 -mcpu=haswell hangs.ll

Debugging shows it is stuck in an infinite while loop processing the worklist
in the function DAGCombiner::Run in
llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp.

Debug logging suggests it is repeatedly trying to combine the same node without
making any progress:

Combining: t2747: f32 = fmul nsz contract reassoc t2742, t2746
Combining: t2604: f32 = fmul nsz contract reassoc t2594, t2636
Combining: t2746: f32 = fmul nsz contract reassoc t2744, t36
Combining: t2747: f32 = fmul nsz contract reassoc t2742, t2746
Combining: t2689: f32 = fmul nsz contract reassoc t52, t2726
Combining: t2746: f32 = fmul nsz contract reassoc t2744, t36
Combining: t2747: f32 = fmul nsz contract reassoc t2742, t2746
...

See dag.txt in the attached hangs.tar.gz for a dump of the DAG in question and
additional debug logs.

The infinite loop reproduces on trunk today (git revision
3fac05e49fe3eb4d6becf1761b4df01dbd871aa4).

git bisect shows the infinite loop first started appearing at:

commit 2b59e9f1bdd8d0f8a315f9ddba2cdc87a3e682fb
Author: QingShan Zhang <qshanz at cn.ibm.com>
Date:   Wed May 20 02:11:16 2020 +0000

    [DAGCombine] Remove the getNegatibleCost to avoid the out of sync with
getNegatedExpression

-- 
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/20200728/a369018e/attachment-0001.html>


More information about the llvm-bugs mailing list