[llvm-bugs] [Bug 33384] New: getBasicBlockIndex() returns -1. [LoopUnroller, LoopPeel]

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 9 07:20:19 PDT 2017


            Bug ID: 33384
           Summary: getBasicBlockIndex() returns -1. [LoopUnroller,
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: paulsson at linux.vnet.ibm.com
                CC: llvm-bugs at 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

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



p Preheader->dump()

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

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

entry.peel.newph:                                 ; preds =
  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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170609/7bec003f/attachment.html>

More information about the llvm-bugs mailing list