<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 - Crash in SelectionDAG LegalizeOp - Unexpected illegal type! (llvm/trunk 312389)"
   href="https://bugs.llvm.org/show_bug.cgi?id=34421">34421</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash in SelectionDAG LegalizeOp - Unexpected illegal type! (llvm/trunk 312389)
          </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>vsk@apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=19077" name="attach_19077" title="Reduced test case (bitcode, just pass to llc)">attachment 19077</a> <a href="attachment.cgi?id=19077&action=edit" title="Reduced test case (bitcode, just pass to llc)">[details]</a></span>
Reduced test case (bitcode, just pass to llc)

I see an assertion failure after running llc on a test.

This is the failure:

Assertion failed: ((TLI.getTypeAction(*DAG.getContext(), Node->getValueType(i))
== TargetLowering::TypeLegal || TLI.isTypeLegal(Node->getValueType(i))) &&
"Unexpected illegal type!"), function LegalizeOp, file
/Users/vk/src/llvm.org-ubsan-feopt/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp,
line 944.
6  libLLVMSelectionDAG.dylib 0x0000000106e367a0 (anonymous
namespace)::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*) + 10848
7  libLLVMSelectionDAG.dylib 0x0000000106e36ffb
llvm::SelectionDAG::LegalizeOp(llvm::SDNode*,
llvm::SmallSetVector<llvm::SDNode*, 16u>&) + 123
8  libLLVMSelectionDAG.dylib 0x0000000106d9786d
llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::AAResults*,
llvm::CodeGenOpt::Level) + 1325
9  libLLVMSelectionDAG.dylib 0x0000000106f8e878
llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 5112
10 libLLVMSelectionDAG.dylib 0x0000000106f8c180
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 9504
11 libLLVMSelectionDAG.dylib 0x0000000106f88a76
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 2070
12 libLLVMX86CodeGen.dylib   0x0000000105722024 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 20

Here is a reduced test (I've attached the bitcode as
bugpoint-reducued-simplified.bc):

source_filename = "bugpoint-output-c1714d5.bc"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.13.0"

; Function Attrs: noimplicitfloat noredzone nounwind
define void @thread_selfcounts() local_unnamed_addr #0 {
entry:
  %counts = alloca [2 x i64], align 16
  %thread_counts = alloca [3 x i64], align 16
  %arraydecay = getelementptr inbounds [3 x i64], [3 x i64]* %thread_counts,
i64 0, i64 0
  %0 = load i64, i64* %arraydecay, align 16, !tbaa !1
  %arrayidx3 = getelementptr inbounds [2 x i64], [2 x i64]* %counts, i64 0, i64
0
  store i64 %0, i64* %arrayidx3, align 16, !tbaa !1
  %arrayidx6 = getelementptr inbounds [3 x i64], [3 x i64]* %thread_counts, i64
0, i64 1
  %1 = load i64, i64* %arrayidx6, align 8, !tbaa !1
  %arrayidx10 = getelementptr inbounds [2 x i64], [2 x i64]* %counts, i64 0,
i64 1
  store i64 %1, i64* %arrayidx10, align 8, !tbaa !1
  unreachable
}

attributes #0 = { noimplicitfloat noredzone nounwind
"correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false"
"less-precise-fpmad"="false" "no-frame-pointer-elim"="true"
"no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false"
"no-jump-tables"="false" "no-nans-fp-math"="false"
"no-signed-zeros-fp-math"="false" "no-trapping-math"="false"
"stack-protector-buffer-size"="8" "target-cpu"="penryn"
"target-features"="+cx16,+fxsr,+mmx,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87"
"unsafe-fp-math"="false" "use-soft-float"="false" }

!llvm.ident = !{!0}

!0 = !{!"clang version 6.0.0 (trunk 312392) (llvm/trunk 312389)"}
!1 = !{!2, !2, i64 0}
!2 = !{!"long long", !3, i64 0}
!3 = !{!"omnipotent char", !4, i64 0}
!4 = !{!"Simple C/C++ TBAA"}</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>