[llvm-bugs] [Bug 24823] New: Infinite loop in Shrink Wrapping

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 15 09:47:20 PDT 2015


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

            Bug ID: 24823
           Summary: Infinite loop in Shrink Wrapping
           Product: libraries
           Version: trunk
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: kbarton at ca.ibm.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 14880
  --> https://llvm.org/bugs/attachment.cgi?id=14880&action=edit
ll file that exposes an infinite loop in shrink wrapping code

There is an infinite loop at compile time, in the shrink wrapping code when
compiling the attached test case.
The problem appears at -O3, -O2 compiled fine (I did not try other options). I
can reproduce the hang with simply: llc shrink.ll

The traceback from GDB contains:

(gdb) where
#0  0x0000000011c45eb0 in
llvm::DenseMapBase<llvm::DenseMap<llvm::MachineBasicBlock*,
std::unique_ptr<llvm::DomTreeNodeBase<llvm::MachineBasicBlock>,
std::default_delete<llvm::DomTreeNodeBase<llvm::MachineBasicBlock> > >,
llvm::DenseMapInfo<llvm::MachineBasicBlock*>,
llvm::detail::DenseMapPair<llvm::MachineBasicBlock*,
std::unique_ptr<llvm::DomTreeNodeBase<llvm::MachineBasicBlock>,
std::default_delete<llvm::DomTreeNodeBase<llvm::MachineBasicBlock> > > > >,
llvm::MachineBasicBlock*,
std::unique_ptr<llvm::DomTreeNodeBase<llvm::MachineBasicBlock>,
std::default_delete<llvm::DomTreeNodeBase<llvm::MachineBasicBlock> > >,
llvm::DenseMapInfo<llvm::MachineBasicBlock*>,
llvm::detail::DenseMapPair<llvm::MachineBasicBlock*,
std::unique_ptr<llvm::DomTreeNodeBase<llvm::MachineBasicBlock>,
std::default_delete<llvm::DomTreeNodeBase<llvm::MachineBasicBlock> > > >
>::LookupBucketFor<llvm::MachineBasicBlock*> (
    this=0x100208d0030, Val=@0x3fffd4805f80: 0x10020ab9678,
FoundBucket=@0x3fffd4805f48: 0x10020aa42e8) at
/home/kbarton/llvm/src/dev.git/include/llvm/ADT/DenseMap.h:471
#1  0x0000000011c40314 in
llvm::DenseMapBase<llvm::DenseMap<llvm::MachineBasicBlock*,
std::unique_ptr<llvm::DomTreeNodeBase<llvm::MachineBasicBlock>,
std::default_delete<llvm::DomTreeNodeBase<llvm::MachineBasicBlock> > >,
llvm::DenseMapInfo<llvm::MachineBasicBlock*>,
llvm::detail::DenseMapPair<llvm::MachineBasicBlock*,
std::unique_ptr<llvm::DomTreeNodeBase<llvm::MachineBasicBlock>,
std::default_delete<llvm::DomTreeNodeBase<llvm::MachineBasicBlock> > > > >,
llvm::MachineBasicBlock*,
std::unique_ptr<llvm::DomTreeNodeBase<llvm::MachineBasicBlock>,
std::default_delete<llvm::DomTreeNodeBase<llvm::MachineBasicBlock> > >,
llvm::DenseMapInfo<llvm::MachineBasicBlock*>,
llvm::detail::DenseMapPair<llvm::MachineBasicBlock*,
std::unique_ptr<llvm::DomTreeNodeBase<llvm::MachineBasicBlock>,
std::default_delete<llvm::DomTreeNodeBase<llvm::MachineBasicBlock> > > >
>::find (this=0x100208d0030, Val=@0x3fffd4805f80: 0x10020ab9678)
    at /home/kbarton/llvm/src/dev.git/include/llvm/ADT/DenseMap.h:132
#2  0x0000000011c3d4e8 in
llvm::DominatorTreeBase<llvm::MachineBasicBlock>::getNode (this=0x100208d0010,
BB=0x10020ab9678) at
/home/kbarton/llvm/src/dev.git/include/llvm/Support/GenericDomTree.h:377
#3  0x0000000011c3f198 in
llvm::DominatorTreeBase<llvm::MachineBasicBlock>::dominates
(this=0x100208d0010, A=0x10020ab9678, B=0x10020ab9518) at
/home/kbarton/llvm/src/dev.git/include/llvm/Support/GenericDomTree.h:759
#4  0x0000000010c7ecd0 in llvm::MachinePostDominatorTree::dominates
(this=0x100208ada80, A=0x10020ab9678, B=0x10020ab9518) at
/home/kbarton/llvm/src/dev.git/include/llvm/CodeGen/MachinePostDominators.h:62
#5  0x0000000011e00aa8 in (anonymous
namespace)::ShrinkWrap::updateSaveRestorePoints (this=0x100208adb20, MBB=...)
at /home/kbarton/llvm/src/dev.git/lib/CodeGen/ShrinkWrap.cpp:285
#6  0x0000000011e00df8 in (anonymous
namespace)::ShrinkWrap::runOnMachineFunction (this=0x100208adb20, MF=...) at
/home/kbarton/llvm/src/dev.git/lib/CodeGen/ShrinkWrap.cpp:345
#7  0x0000000011c68130 in llvm::MachineFunctionPass::runOnFunction
(this=0x100208adb20, F=...) at
/home/kbarton/llvm/src/dev.git/lib/CodeGen/MachineFunctionPass.cpp:43
#8  0x00000000121fcdac in llvm::FPPassManager::runOnFunction
(this=0x100208c5170, F=...) at
/home/kbarton/llvm/src/dev.git/lib/IR/LegacyPassManager.cpp:1528
#9  0x00000000121fd010 in llvm::FPPassManager::runOnModule (this=0x100208c5170,
M=...) at /home/kbarton/llvm/src/dev.git/lib/IR/LegacyPassManager.cpp:1549
#10 0x00000000121fd59c in (anonymous namespace)::MPPassManager::runOnModule
(this=0x100208ad5b0, M=...) at
/home/kbarton/llvm/src/dev.git/lib/IR/LegacyPassManager.cpp:1605
#11 0x00000000121fdf34 in llvm::legacy::PassManagerImpl::run
(this=0x100208ad170, M=...) at
/home/kbarton/llvm/src/dev.git/lib/IR/LegacyPassManager.cpp:1708
#12 0x00000000121fe310 in llvm::legacy::PassManager::run (this=0x3fffd4806610,
M=...) at /home/kbarton/llvm/src/dev.git/lib/IR/LegacyPassManager.cpp:1739
#13 0x00000000108bb9b4 in compileModule (argv=0x3fffd4806e78, Context=...) at
/home/kbarton/llvm/src/dev.git/tools/llc/llc.cpp:381
#14 0x00000000108ba5e4 in main (argc=2, argv=0x3fffd4806e78) at
/home/kbarton/llvm/src/dev.git/tools/llc/llc.cpp:204

-- 
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/20150915/1ee84247/attachment-0001.html>


More information about the llvm-bugs mailing list