[llvm-bugs] [Bug 27705] New: [regression] Assertion `(I.atEnd() || std::next(I) == def_instr_end()) && "getVRegDef assumes a single definition or no definition"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 10 14:28:38 PDT 2016


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

            Bug ID: 27705
           Summary: [regression] Assertion `(I.atEnd() || std::next(I) ==
                    def_instr_end()) && "getVRegDef assumes a single
                    definition or no definition"' failed
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: rivanvx at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Compiling https://gist.github.com/vedranmiletic/3a836854abdf13c60db4 like

$ llc -march=amdgcn -mcpu=bonaire < gmx-OpenCL-kernel-AMD.ll

gives

; Kernel info:
; codeLenInByte = 76
; NumSgprs: 14
; NumVgprs: 4
; FloatMode: 192
; IeeeMode: 0
; ScratchSize: 0
; LDSByteSize: 0 bytes/workgroup (compile time only)
; ReservedVGPRFirst: 0
; ReservedVGPRCount: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 2
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
llc: /home/vedranm/workspace/llvm/lib/CodeGen/MachineRegisterInfo.cpp:339:
llvm::MachineInstr* llvm::MachineRegisterInfo::getVRegDef(unsigned int) const:
Assertion `(I.atEnd() || std::next(I) == def_instr_end()) && "getVRegDef
assumes a single definition or no definition"' failed.
#0 0x00007ff7d25d97c8 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/vedranm/workspace/llvm/lib/Support/Unix/Signals.inc:322:0
#1 0x00007ff7d25d9b3f PrintStackTraceSignalHandler(void*)
/home/vedranm/workspace/llvm/lib/Support/Unix/Signals.inc:380:0
#2 0x00007ff7d25d82a8 llvm::sys::RunSignalHandlers()
/home/vedranm/workspace/llvm/lib/Support/Signals.cpp:44:0
#3 0x00007ff7d25d92ca SignalHandler(int)
/home/vedranm/workspace/llvm/lib/Support/Unix/Signals.inc:210:0
#4 0x00007ff7d0fdc180 __restore_rt (/lib64/libc.so.6+0x36180)
#5 0x00007ff7d0fdc0f8 __GI_raise (/lib64/libc.so.6+0x360f8)
#6 0x00007ff7d0fddd0a __GI_abort (/lib64/libc.so.6+0x37d0a)
#7 0x00007ff7d0fd4967 __assert_fail_base (/lib64/libc.so.6+0x2e967)
#8 0x00007ff7d0fd4a12 (/lib64/libc.so.6+0x2ea12)
#9 0x00007ff7d4c6568f llvm::MachineRegisterInfo::getVRegDef(unsigned int) const
/home/vedranm/workspace/llvm/lib/CodeGen/MachineRegisterInfo.cpp:338:0
#10 0x00007ff7d4cad20d (anonymous
namespace)::MachineVerifier::visitMachineFunctionAfter()
/home/vedranm/workspace/llvm/lib/CodeGen/MachineVerifier.cpp:1518:0
#11 0x00007ff7d4ca73b9 (anonymous
namespace)::MachineVerifier::verify(llvm::MachineFunction&)
/home/vedranm/workspace/llvm/lib/CodeGen/MachineVerifier.cpp:412:0
#12 0x00007ff7d4ca6bb5 llvm::MachineFunction::verify(llvm::Pass*, char const*,
bool) const /home/vedranm/workspace/llvm/lib/CodeGen/MachineVerifier.cpp:292:0
#13 0x00007ff7d4b96b6c llvm::LiveRangeCalc::findReachingDefs(llvm::LiveRange&,
llvm::MachineBasicBlock&, llvm::SlotIndex, unsigned int)
/home/vedranm/workspace/llvm/lib/CodeGen/LiveRangeCalc.cpp:292:0
#14 0x00007ff7d4b96930 llvm::LiveRangeCalc::extend(llvm::LiveRange&,
llvm::SlotIndex, unsigned int)
/home/vedranm/workspace/llvm/lib/CodeGen/LiveRangeCalc.cpp:255:0
#15 0x00007ff7d4b9656b llvm::LiveRangeCalc::extendToUses(llvm::LiveRange&,
unsigned int, unsigned int)
/home/vedranm/workspace/llvm/lib/CodeGen/LiveRangeCalc.cpp:208:0
#16 0x00007ff7d4b7a659 llvm::LiveRangeCalc::extendToUses(llvm::LiveRange&,
unsigned int) /home/vedranm/workspace/llvm/lib/CodeGen/LiveRangeCalc.h:185:0
#17 0x00007ff7d4b961ca
llvm::LiveRangeCalc::constructMainRangeFromSubranges(llvm::LiveInterval&)
/home/vedranm/workspace/llvm/lib/CodeGen/LiveRangeCalc.cpp:145:0
#18 0x00007ff7d4b79c9a
llvm::LiveIntervals::constructMainRangeFromSubranges(llvm::LiveInterval&)
/home/vedranm/workspace/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1593:0
#19 0x00007ff7d4b87e2f
llvm::ConnectedSubRegClasses::computeMainRangesFixFlags(llvm::IntEqClasses
const&, llvm::SmallVectorImpl<llvm::ConnectedSubRegClasses::SubRangeInfo>
const&, llvm::SmallVectorImpl<llvm::LiveInterval*> const&) const
/home/vedranm/workspace/llvm/lib/CodeGen/LiveInterval.cpp:1436:0
#20 0x00007ff7d4b86c6d
llvm::ConnectedSubRegClasses::renameComponents(llvm::LiveInterval&) const
/home/vedranm/workspace/llvm/lib/CodeGen/LiveInterval.cpp:1289:0
#21 0x00007ff7d4b79be7 llvm::LiveIntervals::renameDisconnectedComponents()
/home/vedranm/workspace/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1585:0
#22 0x00007ff7d4c6bada
llvm::ScheduleDAGMILive::enterRegion(llvm::MachineBasicBlock*,
llvm::MachineInstrBundleIterator<llvm::MachineInstr>,
llvm::MachineInstrBundleIterator<llvm::MachineInstr>, unsigned int)
/home/vedranm/workspace/llvm/lib/CodeGen/MachineScheduler.cpp:900:0
#23 0x00007ff7d4c69c51 (anonymous
namespace)::MachineSchedulerBase::scheduleRegions(llvm::ScheduleDAGInstrs&,
bool) /home/vedranm/workspace/llvm/lib/CodeGen/MachineScheduler.cpp:474:0
#24 0x00007ff7d4c69348 (anonymous
namespace)::MachineScheduler::runOnMachineFunction(llvm::MachineFunction&)
/home/vedranm/workspace/llvm/lib/CodeGen/MachineScheduler.cpp:359:0
#25 0x00007ff7d4c16cac
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/home/vedranm/workspace/llvm/lib/CodeGen/MachineFunctionPass.cpp:60:0
#26 0x00007ff7d4225159 llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/vedranm/workspace/llvm/lib/IR/LegacyPassManager.cpp:1526:0
#27 0x00007ff7d42252d0 llvm::FPPassManager::runOnModule(llvm::Module&)
/home/vedranm/workspace/llvm/lib/IR/LegacyPassManager.cpp:1547:0
#28 0x00007ff7d422561d (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/vedranm/workspace/llvm/lib/IR/LegacyPassManager.cpp:1603:0
#29 0x00007ff7d4225cd1 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/vedranm/workspace/llvm/lib/IR/LegacyPassManager.cpp:1706:0
#30 0x00007ff7d4225ec9 llvm::legacy::PassManager::run(llvm::Module&)
/home/vedranm/workspace/llvm/lib/IR/LegacyPassManager.cpp:1738:0
#31 0x000000000041d8da compileModule(char**, llvm::LLVMContext&)
/home/vedranm/workspace/llvm/tools/llc/llc.cpp:445:0
#32 0x000000000041c3f1 main
/home/vedranm/workspace/llvm/tools/llc/llc.cpp:221:0
#33 0x00007ff7d0fc6721 __libc_start_main (/lib64/libc.so.6+0x20721)
#34 0x000000000041ac09 _start
(/home/vedranm/workspace/llvm/build/bin/llc+0x41ac09)
Stack dump:
0.    Program arguments: ./bin/llc -march=amdgcn -mcpu=bonaire 
1.    Running pass 'Function Pass Manager' on module '<stdin>'.
2.    Running pass 'Machine Instruction Scheduler' on function
'@nbnxn_kernel_ElecEw_VdwLJ_F_opencl'
Aborted (core dumped)

The revision which broke this is:

commit e607e016641f83ef920aaeadfb34606a6e5f2587
Author: Matthias Braun <matze at braunis.de>
Date:   Tue May 10 04:51:14 2016 +0000

    LiveIntervalAnalysis: Rework constructMainRangeFromSubranges()

    We now use LiveRangeCalc::extendToUses() instead of a specially designed
    algorithm in constructMainRangeFromSubranges():
    - The original motivation for constructMainRangeFromSubranges() were
      differences between the main liverange and subranges because of hidden
      dead definitions. This case however cannot happen anymore with the
      DetectDeadLaneMasks pass in place.
    - It simplifies the code.
    - This fixes a longstanding bug where we did not properly create new SSA
      values on merging control flow (the MachineVerifier missed most of
      these cases).
    - Move constructMainRangeFromSubranges() to LiveIntervalAnalysis and
      LiveRangeCalc to better match the implementation/available helper
      functions.

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269016
91177308-0d34-0410-b5e6-96231b3b80d8

-- 
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/20160510/256518f5/attachment-0001.html>


More information about the llvm-bugs mailing list