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

            Bug ID: 33384
           Summary: getBasicBlockIndex() returns -1. [LoopUnroller,
                    LoopPeel]
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: pauls...@linux.vnet.ibm.com
                CC: llvm-bugs@lists.llvm.org

Created attachment 18603
  --> https://bugs.llvm.org/attachment.cgi?id=18603&action=edit
reduced testcase

bin/opt -S -mtriple=s390x-unknown-linux -mcpu=z13 -O3 -o out.opt.ll
unroller_assert.ll

include/llvm/IR/Instructions.h:2764: llvm::Value*
llvm::PHINode::getIncomingValueForBlock(const llvm::BasicBlock*) const:
Assertion `Idx >= 0 && "Invalid basic block argument!"' failed.

  Value *getIncomingValueForBlock(const BasicBlock *BB) const {
    int Idx = getBasicBlockIndex(BB);
    assert(Idx >= 0 && "Invalid basic block argument!");
    return getIncomingValue(Idx);
  }

p Idx
$184 = -1

[UP]
LoopUnroll.cpp:

      PN->replaceAllUsesWith(PN->getIncomingValueForBlock(Preheader));

p Preheader->dump()

entry:
  %l_869 = alloca [8 x i32], align 4
  br label %for.cond1128.preheader.peel.begin

p L->getLoopPreheader()->dump()

entry.peel.newph:                                 ; preds =
%for.cond1128.preheader.peel.next9
  br label %for.cond1128.preheader

Why is Preheader != L->getLoopPreheader() ?
Why is the index for the entry block -1?
Related to peeling?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to