<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 - [ConstFold] Assertion failure folding llvm.vector.reduce on bitcast"
   href="https://bugs.llvm.org/show_bug.cgi?id=51811">51811</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[ConstFold] Assertion failure folding llvm.vector.reduce on bitcast
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>nikita.ppv@gmail.com
          </td>
        </tr>

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

        <tr>
          <th>Blocks</th>
          <td>51236
          </td>
        </tr></table>
      <p>
        <div>
        <pre>; RUN: opt -S -instsimplify < %s
define i8 @test() {
  %r = call i8 @llvm.vector.reduce.mul.v16i8(<16 x i8> bitcast (<1 x i128>
<i128 20011376718272490338853433276725592320> to <16 x i8>))
  ret i8 %r
}   

declare i8 @llvm.vector.reduce.mul.v16i8(<16 x i8>)

opt: /home/nikic/llvm-project/llvm/include/llvm/Support/Casting.h:104: static
bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To =
llvm::PoisonValue; From = llvm::Constant]: Assertion `Val && "isa<> used on a
null pointer"' failed.
[...]
 #9 0x0000564c89438b9d llvm::Constant::containsPoisonElement() const
(build/bin/opt+0x28bfb9d)
#10 0x0000564c88b69eaa (anonymous
namespace)::ConstantFoldScalarCall1(llvm::StringRef, unsigned int, llvm::Type*,
llvm::ArrayRef<llvm::Constant*>, llvm::TargetLibraryInfo const*, llvm::CallBase
const*) ConstantFolding.cpp:0:0

containsPoisonElement() does not account for the possibility of constant
expressions, in which case getAggregateElement() may return null.</pre>
        </div>
      </p>

        <div id="referenced">
          <hr style="border: 1px dashed #969696">
          <b>Referenced Bugs:</b>
          <ul>
              <li>
                [<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [meta] 13.0.0 Release Blockers"
   href="https://bugs.llvm.org/show_bug.cgi?id=51236">Bug 51236</a>] [meta] 13.0.0 Release Blockers
              </li>
          </ul>
        </div>
        <br>

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

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