https://bugs.llvm.org/show_bug.cgi?id=51811

            Bug ID: 51811
           Summary: [ConstFold] Assertion failure folding
                    llvm.vector.reduce on bitcast
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
            Blocks: 51236

; 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.


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=51236
[Bug 51236] [meta] 13.0.0 Release Blockers
-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to