[LLVMbugs] [Bug 3490] New: (Partial) Loop unrolling calls setSuccessor with NULL

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Feb 5 05:29:06 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=3490

           Summary: (Partial) Loop unrolling calls setSuccessor with NULL
           Product: libraries
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core LLVM classes
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: ggreif at gmail.com
                CC: ggreif at gmail.com, llvmbugs at cs.uiuc.edu


There seem to be a bug with partial loop unrolling. I have patched

BranchInst::setSuccessor(indx, NewSucc) to assert if NewSucc is NULL:

assert(NewSucc && "setting NULL successor?")

When running

Release/bin/opt -debug -loop-unroll llvm/test/Transforms/LoopUnroll/partial.bc
-o llvm/test/Transforms/LoopUnroll/partial.bc2 -f -unroll-allow-partial

I get:

Loop Unroll: F[main] Loop %no_exit
  Loop Size = 2
  Too large to fully unroll with count: 100 because size: 200>100
  partially unrolling with count: 50
  Trip Count = 100
UNROLLING loop %no_exit by 50 with a breakout at trip 0!
/Users/ggreif/llvm/include/llvm/Instructions.h:2194: failed assertion `NewSucc
&& "setting NULL successor?"'

Program received signal SIGABRT, Aborted.
0x9003d1ac in kill ()
(gdb) bt
#0  0x9003d1ac in kill ()
#1  0x9010e8cf in raise ()
#2  0x9010d422 in abort ()
#3  0x002a3cfa in __eprintf () at ValueSymbolTable.cpp:83
#4  0x00228e30 in llvm::BranchInst::setSuccessorV () at InlineAsm.cpp:44
#5  0x0011e0a2 in llvm::UnrollLoop () at TailRecursionElimination.cpp:86
#6  0x000b7189 in (anonymous namespace)::LoopUnroll::runOnLoop (this=0x2b03330,
L=0x2b04f40, LPM=@0x2b042a0) at LoopUnroll.cpp:169
#7  0x001631a4 in llvm::LPPassManager::runOnFunction () at
TailRecursionElimination.cpp:86
#8  0x0023e84d in llvm::FPPassManager::runOnFunction () at Pass.cpp:256
#9  0x0023ebc9 in llvm::FPPassManager::runOnModule () at Pass.cpp:256
#10 0x0023f24d in llvm::MPPassManager::runOnModule () at Pass.cpp:256
#11 0x0023f55d in llvm::PassManagerImpl::run () at Pass.cpp:256
#12 0x0023f5f7 in llvm::PassManager::run () at Pass.cpp:256
#13 0x00004dbf in main ()

I do not think that calling setSuccessor with NULL is permissible.

I can dive into this, but it is not my area of experience.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list