<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/90698>90698</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm 18 regression: LegalizerInfo.cpp:199: llvm::LegalizeActionStep llvm::LegalizeRuleSet::apply(const llvm::LegalityQuery&) const: Assertion `mutationIsSane(Rule, Query, Mutation) && "legality mutation invalid for match"' failed
</td>
</tr>
<tr>
<th>Labels</th>
<td>
bug,
backend:AArch64,
regression,
platform:windows
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
andrewrk
</td>
</tr>
</table>
<pre>
version: release/18.x, commit 78b99c73ee4b96fe9ce0e294d4632326afb2db42
reduced.ll
```llvm
target datalayout = "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-unknown-windows-gnu"
define fastcc i16 @"behavior.cast.test.@intFromBool on vector.S.doTheTest"() {
Entry:
%0 = insertelement <3 x i1> zeroinitializer, i1 false, i32 0
%1 = call fastcc i16 null(ptr null, <3 x i1> zeroinitializer, <3 x i1> %0)
ret i16 0
}
```
```console
[nix-shell:~/src/zig/build-llvm18]$ ~/local/llvm18-assert/bin/clang -c reduced.ll -target aarch64-windows-gnu
clang: /home/andy/dev/llvm-project-18/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp:199: llvm::LegalizeActionStep llvm::LegalizeRuleSet::apply(const llvm::LegalityQuery&) const: Assertion `mutationIsSane(Rule, Query, Mutation) && "legality mutation invalid for match"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /home/andy/local/llvm18-assert/bin/clang -c reduced.ll -target aarch64-windows-gnu
1. Code generation
2. Running pass 'Function Pass Manager' on module 'reduced.ll'.
3. Running pass 'Legalizer' on function '@"behavior.cast.test.@intFromBool on vector.S.doTheTest"'
#0 0x000000000387f4db llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/andy/local/llvm18-assert/bin/clang+0x387f4db)
#1 0x000000000387c83b llvm::sys::RunSignalHandlers() (/home/andy/local/llvm18-assert/bin/clang+0x387c83b)
#2 0x00000000037c1508 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007f5bd1254a70 __restore_rt (/nix/store/anlf335xlh41yjhm114swi87406mq5pw-glibc-2.38-44/lib/libc.so.6+0x3da70)
#4 0x00007f5bd12a3ddc __pthread_kill_implementation (/nix/store/anlf335xlh41yjhm114swi87406mq5pw-glibc-2.38-44/lib/libc.so.6+0x8cddc)
#5 0x00007f5bd12549c6 gsignal (/nix/store/anlf335xlh41yjhm114swi87406mq5pw-glibc-2.38-44/lib/libc.so.6+0x3d9c6)
#6 0x00007f5bd123d8fa abort (/nix/store/anlf335xlh41yjhm114swi87406mq5pw-glibc-2.38-44/lib/libc.so.6+0x268fa)
#7 0x00007f5bd123d819 _nl_load_domain.cold (/nix/store/anlf335xlh41yjhm114swi87406mq5pw-glibc-2.38-44/lib/libc.so.6+0x26819)
#8 0x00007f5bd124d3c6 (/nix/store/anlf335xlh41yjhm114swi87406mq5pw-glibc-2.38-44/lib/libc.so.6+0x363c6)
#9 0x0000000004690593 llvm::LegalizeRuleSet::apply(llvm::LegalityQuery const&) const (/home/andy/local/llvm18-assert/bin/clang+0x4690593)
#10 0x0000000004692066 llvm::LegalizerInfo::getAction(llvm::LegalityQuery const&) const (/home/andy/local/llvm18-assert/bin/clang+0x4692066)
#11 0x00000000046924e6 llvm::LegalizerInfo::getAction(llvm::MachineInstr const&, llvm::MachineRegisterInfo const&) const (/home/andy/local/llvm18-assert/bin/clang+0x46924e6)
#12 0x000000000468f688 llvm::LegalizerHelper::legalizeInstrStep(llvm::MachineInstr&, llvm::LostDebugLocObserver&) (/home/andy/local/llvm18-assert/bin/clang+0x468f688)
#13 0x000000000464b138 llvm::Legalizer::legalizeMachineFunction(llvm::MachineFunction&, llvm::LegalizerInfo const&, llvm::ArrayRef<llvm::GISelChangeObserver*>, llvm::LostDebugLocObserver&, llvm::MachineIRBuilder&, llvm::GISelKnownBits*) (/home/andy/local/llvm18-assert/bin/clang+0x464b138)
#14 0x000000000464ca37 llvm::Legalizer::runOnMachineFunction(llvm::MachineFunction&) (.part.0) Legalizer.cpp:0:0
#15 0x0000000002c30325 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#16 0x0000000003213619 llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/andy/local/llvm18-assert/bin/clang+0x3213619)
#17 0x0000000003213751 llvm::FPPassManager::runOnModule(llvm::Module&) (/home/andy/local/llvm18-assert/bin/clang+0x3213751)
#18 0x0000000003214057 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/andy/local/llvm18-assert/bin/clang+0x3214057)
#19 0x0000000003aedb33 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/home/andy/local/llvm18-assert/bin/clang+0x3aedb33)
#20 0x00000000040cd0fa clang::CodeGenAction::ExecuteAction() (/home/andy/local/llvm18-assert/bin/clang+0x40cd0fa)
#21 0x000000000434b2c9 clang::FrontendAction::Execute() (/home/andy/local/llvm18-assert/bin/clang+0x434b2c9)
#22 0x00000000042d0c02 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/andy/local/llvm18-assert/bin/clang+0x42d0c02)
#23 0x000000000441906f clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/andy/local/llvm18-assert/bin/clang+0x441906f)
#24 0x0000000000b7b6ca cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/andy/local/llvm18-assert/bin/clang+0xb7b6ca)
#25 0x0000000000b736a7 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#26 0x000000000410e509 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#27 0x00000000037c1962 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/home/andy/local/llvm18-assert/bin/clang+0x37c1962)
#28 0x000000000410fbf4 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#29 0x00000000040d6ae5 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/home/andy/local/llvm18-assert/bin/clang+0x40d6ae5)
#30 0x00000000040d75dd clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/home/andy/local/llvm18-assert/bin/clang+0x40d75dd)
#31 0x00000000040e1bb4 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/home/andy/local/llvm18-assert/bin/clang+0x40e1bb4)
#32 0x0000000000b78d69 clang_main(int, char**, llvm::ToolContext const&) (/home/andy/local/llvm18-assert/bin/clang+0xb78d69)
#33 0x0000000000a6feb3 main (/home/andy/local/llvm18-assert/bin/clang+0xa6feb3)
#34 0x00007f5bd123efce __libc_start_call_main (/nix/store/anlf335xlh41yjhm114swi87406mq5pw-glibc-2.38-44/lib/libc.so.6+0x27fce)
#35 0x00007f5bd123f089 __libc_start_main@GLIBC_2.2.5 (/nix/store/anlf335xlh41yjhm114swi87406mq5pw-glibc-2.38-44/lib/libc.so.6+0x28089)
#36 0x0000000000b72315 _start (/home/andy/local/llvm18-assert/bin/clang+0xb72315)
clang: error: clang frontend command failed with exit code 134 (use -v to see invocation)
clang version 18.1.5 (https://github.com/llvm/llvm-project 78b99c73ee4b96fe9ce0e294d4632326afb2db42)
Target: aarch64-unknown-windows-gnu
Thread model: posix
InstalledDir: /home/andy/local/llvm18-assert/bin
clang: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWltz46qy_jXKC2WXBLo-5MFx4rWyzkzNnGTqvLoQIJk9CLQB5bIezm_fBZJt4Thzy2S_rNSM43Dp_vrrpmmQsDG8lYxdRtlVlF1f4MHulL7Ekmr2qL9e1Io-Xz4wbbiSEVoBzQTDhkVwk5TLpwiuAVFdxy0oyrqqSIEYS-sqb1hFWMxgldI0RxDBHDc1pHUKo_g6ilfjp2Z0IIwuhZha83j8J8RDNzZZrFtmAcUWC_ysBgsidA0iCNmii9DqcdFHaJWn_mPBEYzQCsEFP7QksIzQKoHlQvrOPF3cuzYIA_lW816wvWyMNdnl6WKQX6V6lItHLql6NItWDoeJ4ydlDZcMNNhYQgBPchClcQRhzXb4gSu9JNjYpWXGLqM05tJutOqulBJASfDAiFV6eb-k6suOfWHGOukOXAWi4mrUcCOtfo7QpA9EMIs9TC4N05YJ1jHpSFkj8AR4EqEb8DfTiktuORb8b6adk3gCGiyc39aAIwjiSZyTl3h5BAsxt0MOQkSw7K2evq6_qyTod0AjWO31aGa92ElxVFyfuHzO6qGRKGmUYFNrdiX508LsmBARWv1_BDdGkwhu_uZtBDf1wAVduMhJyii7jmAK3BChCBbut-9YYONoc8O5jOCGCCxbsCDgGIpgMcXEPgrm3vdA_CS3GCK42anOLQYs6XMEN5Q9TKoWvVb_YsQuknJqcb94HcHNWlH2B3Pa_xCqxuL2njmAH1g7UnkrG7UkvQvspKqcHj8drSK02g9aEcuVvLesP9N5Nwh2z-zYiPtePEewdFTaF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