Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ConstFold] Assertion failure folding llvm.vector.reduce on bitcast #51153

Closed
nikic opened this issue Sep 9, 2021 · 2 comments
Closed

[ConstFold] Assertion failure folding llvm.vector.reduce on bitcast #51153

nikic opened this issue Sep 9, 2021 · 2 comments
Labels
bugzilla Issues migrated from bugzilla

Comments

@nikic
Copy link
Contributor

nikic commented Sep 9, 2021

Bugzilla Link 51811
Resolution FIXED
Resolved on Sep 10, 2021 09:27
Version trunk
OS Linux
Blocks #50580
Fixed by commit(s) af382b9 1ff9aa2

Extended Description

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

@nikic
Copy link
Contributor Author

nikic commented Sep 9, 2021

Fixed by af382b9.

@tstellar
Copy link
Collaborator

Merged: 1ff9aa2

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

2 participants