[LLVMdev] RegisterCoalescing pass crashes with ImplicitDef registers

Vincent Lejeune vljn at ovi.com
Sat Oct 20 15:37:30 PDT 2012

Here it is : 

Starting program: /home/vlj/llvmbin/bin/llc -march=r600 -mcpu=cayman /home/vlj/shader
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
llc: /home/vlj/llvm/include/llvm/ADT/SmallVector.h:143: const T& llvm::SmallVectorTemplateCommon<T, <template-parameter-1-2> >::operator[](unsigned int) const [with T = int; <template-parameter-1-2> = void; llvm::SmallVectorTemplateCommon<T, <template-parameter-1-2> >::const_reference = const int&]: Assertion `begin() + idx < end()' failed.

Program received signal SIGABRT, Aborted.
0x0000003dd7e35925 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.15-57.fc17.x86_64 libgcc-4.7.2-2.fc17.x86_64 libstdc++-4.7.2-2.fc17.x86_64
(gdb) bt
#0  0x0000003dd7e35925 in raise () from /lib64/libc.so.6
#1  0x0000003dd7e370d8 in abort () from /lib64/libc.so.6
#2  0x0000003dd7e2e6a2 in __assert_fail_base () from /lib64/libc.so.6
#3  0x0000003dd7e2e752 in __assert_fail () from /lib64/libc.so.6
#4  0x000000000094760b in llvm::SmallVectorTemplateCommon<int, void>::operator[] (this=0x7fffffffd268, idx=0) at /home/vlj/llvm/include/llvm/ADT/SmallVector.h:143
#5  0x00000000010c8e83 in (anonymous namespace)::JoinVals::getAssignments (this=0x7fffffffd230) at RegisterCoalescer.cpp:1305
#6  0x00000000010cb459 in (anonymous namespace)::RegisterCoalescer::joinVirtRegs (this=0x21b62b0, CP=...) at RegisterCoalescer.cpp:1861
#7  0x00000000010cb646 in (anonymous namespace)::RegisterCoalescer::joinIntervals (this=0x21b62b0, CP=...) at RegisterCoalescer.cpp:1883
#8  0x00000000010c84b4 in (anonymous namespace)::RegisterCoalescer::joinCopy (this=0x21b62b0, CopyMI=0x21e8cf8, Again=@0x7fffffffd7a2: false) at RegisterCoalescer.cpp:1002
#9  0x00000000010cb830 in (anonymous namespace)::RegisterCoalescer::copyCoalesceWorkList (this=0x21b62b0, From=0) at RegisterCoalescer.cpp:1924
#10 0x00000000010cb9f7 in (anonymous namespace)::RegisterCoalescer::copyCoalesceInMBB (this=0x21b62b0, MBB=0x21e88e0) at RegisterCoalescer.cpp:1947
#11 0x00000000010cbb78 in (anonymous namespace)::RegisterCoalescer::joinAllIntervals (this=0x21b62b0) at RegisterCoalescer.cpp:1960
#12 0x00000000010cbf9d in (anonymous namespace)::RegisterCoalescer::runOnMachineFunction (this=0x21b62b0, fn=...) at RegisterCoalescer.cpp:2016
#13 0x000000000102ee6d in llvm::MachineFunctionPass::runOnFunction (this=0x21b62b0, F=...) at MachineFunctionPass.cpp:33
#14 0x00000000013eaa81 in llvm::FPPassManager::runOnFunction (this=0x21b5b80, F=...) at PassManager.cpp:1498
#15 0x00000000013eac94 in llvm::FPPassManager::runOnModule (this=0x21b5b80, M=...) at PassManager.cpp:1518
#16 0x00000000013eafbc in llvm::MPPassManager::runOnModule (this=0x21b0e70, M=...) at PassManager.cpp:1572
#17 0x00000000013eb4d4 in llvm::PassManagerImpl::run (this=0x21b0b60, M=...) at PassManager.cpp:1655
#18 0x00000000013eb687 in llvm::PassManager::run (this=0x7fffffffdd60, M=...) at PassManager.cpp:1684
#19 0x0000000000816ff3 in main (argc=4, argv=0x7fffffffe108) at llc.cpp:362

Thank for your fast answer


> De : Jakob Stoklund Olesen <stoklund at 2pi.dk>
>À : Vincent Lejeune <vljn at ovi.com> 
>Cc : "llvmdev at cs.uiuc.edu" <llvmdev at cs.uiuc.edu> 
>Envoyé le : Dimanche 21 octobre 2012 0h05
>Objet : Re: [LLVMdev] RegisterCoalescing pass crashes with ImplicitDef registers
>On Oct 20, 2012, at 1:23 PM, Vincent Lejeune <vljn at ovi.com> wrote:
>below is an output of "llc -march=r600 -mcpu=cayman -print-before-all -debug-only=regalloc file.shader" command from llvm3.2svn.
>>The register coalescing pass crashes when joining vreg12:sel_z with vreg13 registers, because it tries to access the interval liveness of vreg13... which is undefined.
>>I don't know if it's a bug of the pass, or if my backend should do something specific before calling the pass.
>>It worked with llvm 3.1, I don't know if there was a requirement introduced between 3.1 and current trunk related to register coalescing.
>It's probably a simple bug in the new coalescing algorithm. Could you get me a better stack trace from a debug build?

More information about the llvm-dev mailing list