[llvm-bugs] [Bug 41064] New: CGP causes assert after r354298

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 13 21:46:30 PDT 2019


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

            Bug ID: 41064
           Summary: CGP causes assert after r354298
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: tejohnson at google.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 21593
  --> https://bugs.llvm.org/attachment.cgi?id=21593&action=edit
bugpoint-reduced-simplified.ll

We started getting an assert in MachineLICM that was tracked down to starting
with r354298. It recently was hidden by 355823 although since that patch just
added a heuristic stop to the transformation it is certainly not fixing the
underlying bug). I used bugpoint to reduce to the attached test case
(unfortunately still a bit large).

To reproduce the assert, do:

llc bugpoint-reduced-simplified.ll -disable-verify

I get:
llc: lib/CodeGen/MachineLICM.cpp:1043: bool (anonymous
namespace)::MachineLICMBase::IsLoopInvariantInst(llvm::MachineInstr &):
Assertion `MRI->getVRegDef(Reg) && "Machine instr not mapped for this vreg?!"'
failed.
Stack dump:
0.      Program arguments: bin/llc bugpoint-reduced-simplified.ll
-disable-verify
1.      Running pass 'Function Pass Manager' on module
'bugpoint-reduced-simplified.ll'.
2.      Running pass 'Early Machine Loop Invariant Code Motion' on function
'@func1'
 #0 0x0000000003545b79 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
lib/Support/Unix/Signals.inc:494:11
 #1 0x0000000003545d29 PrintStackTraceSignalHandler(void*)
lib/Support/Unix/Signals.inc:558:1
 #2 0x0000000003544636 llvm::sys::RunSignalHandlers()
lib/Support/Signals.cpp:67:5
 #3 0x000000000354639b SignalHandler(int) lib/Support/Unix/Signals.inc:357:1
 #4 0x00007fa57ba000c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x110c0)
 #5 0x00007fa57a9d5fcf gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x32fcf)
 #6 0x00007fa57a9d73fa abort (/lib/x86_64-linux-gnu/libc.so.6+0x343fa)
 #7 0x00007fa57a9cee37 (/lib/x86_64-linux-gnu/libc.so.6+0x2be37)
 #8 0x00007fa57a9ceee2 (/lib/x86_64-linux-gnu/libc.so.6+0x2bee2)
 #9 0x00000000027b7bc7 (anonymous
namespace)::MachineLICMBase::IsLoopInvariantInst(llvm::MachineInstr&)
lib/CodeGen/MachineLICM.cpp:1047:9
#10 0x00000000027b722e (anonymous
namespace)::MachineLICMBase::Hoist(llvm::MachineInstr*,
llvm::MachineBasicBlock*) lib/CodeGen/MachineLICM.cpp:1438:33
#11 0x00000000027b5468 (anonymous
namespace)::MachineLICMBase::HoistOutOfLoop(llvm::DomTreeNodeBase<llvm::MachineBasicBlock>*)
lib/CodeGen/MachineLICM.cpp:739:11
#12 0x00000000027b463c (anonymous
namespace)::MachineLICMBase::runOnMachineFunction(llvm::MachineFunction&)
lib/CodeGen/MachineLICM.cpp:364:7
#13 0x00000000027a555a
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
lib/CodeGen/MachineFunctionPass.cpp:73:8
#14 0x0000000002c74f17 llvm::FPPassManager::runOnFunction(llvm::Function&)
lib/IR/LegacyPassManager.cpp:1643:23
#15 0x0000000002c752f5 llvm::FPPassManager::runOnModule(llvm::Module&)
lib/IR/LegacyPassManager.cpp:1678:16
#16 0x0000000002c759f4 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
lib/IR/LegacyPassManager.cpp:1743:23
#17 0x0000000002c75588 llvm::legacy::PassManagerImpl::run(llvm::Module&)
lib/IR/LegacyPassManager.cpp:1856:16
#18 0x0000000002c75f41 llvm::legacy::PassManager::run(llvm::Module&)
lib/IR/LegacyPassManager.cpp:1887:3
#19 0x0000000000c53562 compileModule(char**, llvm::LLVMContext&)
tools/llc/llc.cpp:599:41
#20 0x0000000000c51cbc main tools/llc/llc.cpp:350:13
#21 0x00007fa57a9c32b1 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x202b1)
#22 0x0000000000c514aa _start (bin/llc+0xc514aa)


If you run without -disable-verify, you get an earlier error that might be the
cause of the later assert:

Instruction does not dominate all uses!
  %ov = extractvalue { i32, i1 } %22, 1
  br i1 %ov, label %57, label %58
in function func1
LLVM ERROR: Broken function found, compilation aborted!

-- 
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/20190314/d729605c/attachment.html>


More information about the llvm-bugs mailing list