[llvm-bugs] [Bug 36105] New: Infinite loop in -callsite-splitting

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jan 26 01:11:00 PST 2018


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

            Bug ID: 36105
           Summary: Infinite loop in -callsite-splitting
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: mikael.holmen at ericsson.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 19755
  --> https://bugs.llvm.org/attachment.cgi?id=19755&action=edit
reproducer

Running

 opt -S -o - foo.ll -callsite-splitting

we get stuck and loop forever in function recordConditions in
CallSitesplitting.cpp:

/// Record ICmp conditions relevant to any argument in CS following Pred's
/// single successors. If there are conflicting conditions along a path, like
/// x == 1 and x == 0, the first condition will be used.
static void recordConditions(CallSite CS, BasicBlock *Pred,
                             ConditionsTy &Conditions) {
  recordCondition(CS, Pred, CS.getInstruction()->getParent(), Conditions);
  BasicBlock *From = Pred;
  BasicBlock *To = Pred;
  SmallPtrSet<BasicBlock *, 4> Visited = {From};
  while (!Visited.count(From->getSinglePredecessor()) &&
         (From = From->getSinglePredecessor())) {
    recordCondition(CS, From, To, Conditions);
    To = From;
  }
}

It looks suspicious to me that Visited isn't updated in the loop.

-- 
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/20180126/c918cd0e/attachment-0001.html>


More information about the llvm-bugs mailing list