llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.62k stars 11.83k forks source link

assertion in register coalescer #14579

Closed llvmbot closed 11 years ago

llvmbot commented 11 years ago
Bugzilla Link 14207
Resolution FIXED
Resolved on Oct 30, 2012 21:45
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @stoklund

Extended Description

The assertion that fires is:

llc: RegisterCoalescer.cpp:1675: bool::JoinVals::resolveConflicts(::JoinVals&): Assertion `!SlotIndex::isSameInstr(VNI->def, TaintExtent.front().first) && "Interference ends on VNI->def. Should have been handled earlier"' failed.

Testcase:

target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu"

define void @​test() nounwind { entry: %tmp = load i64* undef, align 16 %tmp1 = trunc i64 %tmp to i32 %tmp2 = lshr i64 %tmp, 32 %tmp3 = trunc i64 %tmp2 to i32 %tmp4 = tail call { i32, i32 } asm sideeffect "", "=&r,=&r,r,r,0,1,~{dirflag},~{fpsr},~{flags}"(i32 %tmp3, i32 undef, i32 %tmp3, i32 %tmp1) nounwind unreachable }

Build with "llc -O2". Here's the stack trace:

Program received signal SIGABRT, Aborted. 0x00007ffff6ebba75 in *__GI_raise (sig=) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt

​0 0x00007ffff6ebba75 in *__GI_raise (sig=) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64

​1 0x00007ffff6ebf5c0 in *__GI_abort () at abort.c:92

​2 0x00007ffff6eb4941 in *__GI___assert_fail (

assertion=0x18bb038 "!SlotIndex::isSameInstr(VNI->def, TaintExtent.front().first) && \"Interference ends on VNI->def. Should have been handled earlier\"", file=<optimized out>, line=1675, 
function=0x18bd400 <(anonymous namespace)::JoinVals::resolveConflicts((anonymous namespace)::JoinVals&)::__PRETTY_FUNCTION__> "bool<unnamed>::JoinVals::resolveConflicts(<unnamed>::JoinVals&)") at assert.c:81

​3 0x000000000105af0f in (anonymous namespace)::JoinVals::resolveConflicts (this=0x7fffffffd730, Other=...)

at RegisterCoalescer.cpp:1675

​4 0x000000000105bd37 in (anonymous namespace)::RegisterCoalescer::joinVirtRegs (this=0x1ec6ca0, CP=...)

at RegisterCoalescer.cpp:1838

​5 0x000000000105c08a in (anonymous namespace)::RegisterCoalescer::joinIntervals (this=0x1ec6ca0, CP=...)

at RegisterCoalescer.cpp:1883

​6 0x0000000001058dad in (anonymous namespace)::RegisterCoalescer::joinCopy (this=0x1ec6ca0, CopyMI=0x1ed88c8,

Again=@0x7fffffffdbae: false) at RegisterCoalescer.cpp:1002

​7 0x000000000105c276 in (anonymous namespace)::RegisterCoalescer::copyCoalesceWorkList (this=0x1ec6ca0, From=0)

at RegisterCoalescer.cpp:1924

​8 0x000000000105c43d in (anonymous namespace)::RegisterCoalescer::copyCoalesceInMBB (this=0x1ec6ca0, MBB=0x1ed85c0)

at RegisterCoalescer.cpp:1947

​9 0x000000000105c5c3 in (anonymous namespace)::RegisterCoalescer::joinAllIntervals (this=0x1ec6ca0)

at RegisterCoalescer.cpp:1960

​10 0x000000000105c9bd in (anonymous namespace)::RegisterCoalescer::runOnMachineFunction (this=0x1ec6ca0, fn=...)

at RegisterCoalescer.cpp:2016

​11 0x0000000000fba0b5 in llvm::MachineFunctionPass::runOnFunction (this=0x1ec6ca0, F=...) at MachineFunctionPass.cpp:33

​12 0x0000000001418813 in llvm::FPPassManager::runOnFunction (this=0x1eaeda0, F=...) at PassManager.cpp:1498

​13 0x0000000001418a35 in llvm::FPPassManager::runOnModule (this=0x1eaeda0, M=...) at PassManager.cpp:1518

​14 0x0000000001418d7b in llvm::MPPassManager::runOnModule (this=0x1ea3300, M=...) at PassManager.cpp:1572

​15 0x00000000014192bb in llvm::PassManagerImpl::run (this=0x1e97870, M=...) at PassManager.cpp:1655

​16 0x00000000014195b7 in llvm::PassManager::run (this=0x7fffffffe110, M=...) at PassManager.cpp:1684

​17 0x000000000078b05a in main (argc=4, argv=0x7fffffffe488) at llc.cpp:362

llvmbot commented 11 years ago

It was failing as of:

nlewycky@ducttape:~$ llvm/Debug+Asserts/bin/llc --version LLVM (http://llvm.org/): LLVM version 3.2svn DEBUG build with assertions. Built Oct 26 2012 (12:49:01). Default target: x86_64-unknown-linux-gnu Host CPU: corei7

...but is passing on trunk now. Okay then!

1ba3d143-a64b-4671-82b2-0b31cfb91709 commented 11 years ago

Which revision are you on? I can't reproduce on trunk.