<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 - X86AvoidStoreForwardingBlocks reaches assertion error"
   href="https://bugs.llvm.org/show_bug.cgi?id=41629">41629</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>X86AvoidStoreForwardingBlocks reaches assertion error
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </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>vtjnash@gmail.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=21830" name="attach_21830" title="broken.ll">attachment 21830</a> <a href="attachment.cgi?id=21830&action=edit" title="broken.ll">[details]</a></span>
broken.ll

For load:
  %45:vr128x = VMOVDQU64Z128rm %stack.3, 1, $noreg, 0, $noreg ::
(dereferenceable load 16 from %ir.18, align 8)

The X86AvoidSFBPass pass fails when it runs into the following store:
  MOV64mr %stack.3, 1, $noreg, 8, $noreg, killed %33:gr64

To reproduce, run the attached script with llc version 7/8/master (e.g. any
version since X86AvoidSFBPass was introduced):

$ llc -fast-isel -O1 -mcpu=skylake-avx512 print_to_string.ll -o /dev/null #
-start-before=isel

llc:
/data/vtjnash/julia/deps/srccache/llvm-svn/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp:690:
virtual bool
{anonymous}::X86AvoidSFBPass::runOnMachineFunction(llvm::MachineFunction&):
Assertion `PBInst->hasOneMemOperand() && "Expected One Memory Operand"' failed.

Stack dump:
0.      Program arguments:
../deps/scratch/llvm-svn/build_Release+Asserts/bin/llc -fast-isel -O1
-mcpu=skylake-avx512 print_to_string.ll -o /dev/null 
1.      Running pass 'Function Pass Manager' on module 'print_to_string.ll'.
2.      Running pass 'X86 Avoid Store Forwarding Blocks' on function
'@julia_print_to_string_15938'
 #0 0x00007f9c3390118a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/data/vtjnash/julia/deps/scratch/llvm-svn/build_Release+Asserts/bin/../lib/libLLVM-9svn.so+0x85f18a)
 #1 0x00007f9c338ff014 llvm::sys::RunSignalHandlers()
(/data/vtjnash/julia/deps/scratch/llvm-svn/build_Release+Asserts/bin/../lib/libLLVM-9svn.so+0x85d014)
 #2 0x00007f9c338ff152 SignalHandler(int)
(/data/vtjnash/julia/deps/scratch/llvm-svn/build_Release+Asserts/bin/../lib/libLLVM-9svn.so+0x85d152)
 #3 0x00007f9c32973140 (/lib/x86_64-linux-gnu/libc.so.6+0x37140)
 #4 0x00007f9c329730bb raise
/build/glibc-itYbWN/glibc-2.26/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #5 0x00007f9c32974f5d abort /build/glibc-itYbWN/glibc-2.26/stdlib/abort.c:92:0
 #6 0x00007f9c3296af17 __assert_fail_base
/build/glibc-itYbWN/glibc-2.26/assert/assert.c:92:0
 #7 0x00007f9c3296afc2 (/lib/x86_64-linux-gnu/libc.so.6+0x2efc2)
 #8 0x00007f9c353f1aa7 (anonymous
namespace)::X86AvoidSFBPass::runOnMachineFunction(llvm::MachineFunction&)
(/data/vtjnash/julia/deps/scratch/llvm-svn/build_Release+Asserts/bin/../lib/libLLVM-9svn.so+0x234faa7)
 #9 0x00007f9c33c71c1e
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/data/vtjnash/julia/deps/scratch/llvm-svn/build_Release+Asserts/bin/../lib/libLLVM-9svn.so+0xbcfc1e)
#10 0x00007f9c33a2d649 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/data/vtjnash/julia/deps/scratch/llvm-svn/build_Release+Asserts/bin/../lib/libLLVM-9svn.so+0x98b649)
#11 0x00007f9c33a2d741 llvm::FPPassManager::runOnModule(llvm::Module&)
(/data/vtjnash/julia/deps/scratch/llvm-svn/build_Release+Asserts/bin/../lib/libLLVM-9svn.so+0x98b741)
#12 0x00007f9c33a2c8a1 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/data/vtjnash/julia/deps/scratch/llvm-svn/build_Release+Asserts/bin/../lib/libLLVM-9svn.so+0x98a8a1)
#13 0x000055fd959425eb main
(../deps/scratch/llvm-svn/build_Release+Asserts/bin/llc+0xf5eb)
#14 0x00007f9c3295d1c1 __libc_start_main
/build/glibc-itYbWN/glibc-2.26/csu/../csu/libc-start.c:342:0
#15 0x000055fd9594305a _start
(../deps/scratch/llvm-svn/build_Release+Asserts/bin/llc+0x1005a)
Aborted

(these files and steps are also at
<a href="https://gist.github.com/vtjnash/192cab72a6cfc00256ff118238163b55">https://gist.github.com/vtjnash/192cab72a6cfc00256ff118238163b55</a>)</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>