<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - CGP causes assert after r354298"
   href="https://bugs.llvm.org/show_bug.cgi?id=41064">41064</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>CGP causes assert after r354298
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>tejohnson@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21593" name="attach_21593" title="bugpoint-reduced-simplified.ll">attachment 21593</a> <a href="attachment.cgi?id=21593&action=edit" title="bugpoint-reduced-simplified.ll">[details]</a></span>
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!</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>