<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - Segfault in SelectionDAG for <1 x half>"
   href="https://llvm.org/bugs/show_bug.cgi?id=31088">31088</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Segfault in SelectionDAG for <1 x half>
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.9
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>Backend: X86
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jonathanchesterfield@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Example input:

define <1 x half> @ir_fadd_v1f16(<1 x half> %arg0, <1 x half> %arg1) {
  %retval = fadd <1 x half> %arg0, %arg1
  ret <1 x half> %retval
}

llc -version
LLVM version 3.9.1
Optimised build.
Default target: x86_64-unknown-linux-gnu

llc tmp.ll

#0 0x00000000014a9995 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/bin/llc+0x14a9995)
#1 0x00000000014aa006 SignalHandler(int) (/usr/local/bin/llc+0x14aa006)
#2 0x00007f975eb1c8d0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0xf8d0)
#3 0x00000000013836ea llvm::SelectionDAG::getNode(unsigned int, llvm::SDLoc
const&, llvm::EVT, llvm::SDValue) (/usr/local/bin/llc+0x13836ea)
#4 0x000000000141e46a
llvm::DAGTypeLegalizer::PromoteFloatRes_UnaryOp(llvm::SDNode*)
(/usr/local/bin/llc+0x141e46a)
#5 0x000000000141d97e llvm::DAGTypeLegalizer::PromoteFloatResult(llvm::SDNode*,
unsigned int) (/usr/local/bin/llc+0x141d97e)
#6 0x00000000013e83ff llvm::DAGTypeLegalizer::run()
(/usr/local/bin/llc+0x13e83ff)
#7 0x00000000013ed336 llvm::SelectionDAG::LegalizeTypes()
(/usr/local/bin/llc+0x13ed336)
#8 0x00000000013b44b5 llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(/usr/local/bin/llc+0x13b44b5)
#9 0x00000000013b426f
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/usr/local/bin/llc+0x13b426f)
#10 0x00000000013b1bdc
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/usr/local/bin/llc+0x13b1bdc)
#11 0x0000000000cb4541 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/usr/local/bin/llc+0xcb4541)
#12 0x0000000000fb5ccb
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/usr/local/bin/llc+0xfb5ccb)
#13 0x00000000011843af llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/local/bin/llc+0x11843af)
#14 0x000000000118459b llvm::FPPassManager::runOnModule(llvm::Module&)
(/usr/local/bin/llc+0x118459b)
#15 0x0000000001184997 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/local/bin/llc+0x1184997)
#16 0x000000000063be5a compileModule(char**, llvm::LLVMContext&)
(/usr/local/bin/llc+0x63be5a)
#17 0x000000000063966b main (/usr/local/bin/llc+0x63966b)
#18 0x00007f975d92bb45 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b45)
#19 0x0000000000638953 _start (/usr/local/bin/llc+0x638953)
Stack dump:
0.      Program arguments: /usr/local/bin/llc tmp.ll
1.      Running pass 'Function Pass Manager' on module 'tmp.ll'.
2.      Running pass 'X86 DAG->DAG Instruction Selection' on function
'@ir_fadd_v1f16'
Segmentation fault


I've checked similar functions and they're fine - half, <2 x half>, <1 x
float>, float are OK. I haven't checked whether this reproduces on trunk.

Expected behaviour was no segfault, codegen broadly equivalent to a scalar
half.

Cheers</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>