Skip to content

aarch64 llvm 14 regression with vectors: Assertion `mutationIsSane(Rule, Query, Mutation) && "legality mutation invalid for match"' failed #56398

Closed
llvm/llvm-project-release-prs
#25
@andrewrk

Description

@andrewrk

Does not affect LLVM 13.0.1.
Tested with LLVM 14.0.6. Have not yet confirmed whether it affects trunk.

Reduced LLVM IR:

define internal fastcc i16 @testOneCtzVector.2() {
Entry:
  %0 = call <64 x i16> @llvm.cttz.v64i16(<64 x i16> zeroinitializer, i1 false)
  %1 = trunc <64 x i16> %0 to <64 x i5>
  store <64 x i5> %1, <64 x i5>* null, align 64
  ret i16 0
}

; Function Attrs: nofree nosync nounwind readnone speculatable willreturn
declare <64 x i16> @llvm.cttz.v64i16(<64 x i16>, i1 immarg) #0

attributes #0 = { nofree nosync nounwind readnone speculatable willreturn }

Reproduction:

$ ~/local/llvm14-debug/bin/clang -c reduced.ll -target aarch64-linux-unknown
warning: overriding the module target triple with aarch64-unknown-linux-unknown [-Woverride-module]
clang: /home/andy/Downloads/llvm-project-14/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp:198: llvm::LegalizeActionStep llvm::LegalizeRuleSet::apply(const llvm::LegalityQuery&) const: Assertion `mutationIsSane(Rule, Query, Mutation) && "legality mutation invalid for match"' failed.

Downstream issue: ziglang/zig#12013

Apologies for not catching this during the RC phase.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions