<html>
    <head>
      <base href="http://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 --- - TypeBasedAliasAnalysis::PathAliases crashes when processing 'distinct' MDNode"
   href="http://llvm.org/bugs/show_bug.cgi?id=22180">22180</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>TypeBasedAliasAnalysis::PathAliases crashes  when processing 'distinct' MDNode
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>llc
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>apazos@codeaurora.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=13659" name="attach_13659" title="reduced test case">attachment 13659</a> <a href="attachment.cgi?id=13659&action=edit" title="reduced test case">[details]</a></span>
reduced test case

Find attached a bugpoint reduced test case for the issue.

TypeBasedAliasAnalysis::PathAliases at line 409 assumes the MD node has offset
fields which are constants, so it crashes when it processes a node like !9:

!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.vectorize.width", i32 1}
!11 = !{!"llvm.loop.interleave.count", i32 1}


How to reproduce:
llc -O3 test.ll

llc: ../include/llvm/Support/Casting.h:223: typename std::enable_if<(!
llvm::is_simple_type<Y>::value), typename llvm::cast_retty<X, const
Y>::ret_type>::type llvm::cast(const Y&) [with X = llvm::ConstantAsMetadata; Y
= llvm::MDOperand; typename std::enable_if<(! llvm::is_simple_type<Y>::value),
typename llvm::cast_retty<X, const Y>::ret_type>::type =
llvm::ConstantAsMetadata*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of
incompatible type!"' failed.</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>