[llvm] [LLVM] Make -use-constant-fp-for-fixed-length-splat the default. (PR #193264)

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 06:31:53 PDT 2026


zmodem wrote:

Here is an llvm-reduced repro:

```
$ cat reduced.ll
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: null_pointer_is_valid
define void @_ZN3hwy6N_AVX2L10IfThenElseENS0_7Mask256IdEENS0_6Vec256IdEES4_() #0 {
entry:
  %__b.i = load <4 x double>, ptr null, align 32
  %0 = call <4 x double> @llvm.x86.avx.blendv.pd.256(<4 x double> zeroinitializer, <4 x double> %__b.i, <4 x double> splat (double 1.000000e+00))
  store <4 x double> %0, ptr null, align 32
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare <4 x double> @llvm.x86.avx.blendv.pd.256(<4 x double>, <4 x double>, <4 x double>) #1

define void @_ZN3hwy6N_AVX212_GLOBAL__N_114TestMaskedSqrtclIdNS0_4SimdIdLm4ELi0EEEEEvT_T0_() {
entry:
  call void @_ZN3hwy6N_AVX2L10IfThenElseENS0_7Mask256IdEENS0_6Vec256IdEES4_()
  call void @_ZN3hwy6N_AVX2L10IfThenElseENS0_7Mask256IdEENS0_6Vec256IdEES4_()
  ret void
}

attributes #0 = { null_pointer_is_valid }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(none) }

$ build/bin/opt -passes='default<O2>,module(msan)' -o /dev/null reduced.ll
opt.bad: /work/llvm-project/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:2005: void (anonymous namespace)::MemorySanitizerVisitor::setShadow(Value *, Value *): Assertion `!ShadowMap.count(V) && "Values may only have one shadow"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.      Program arguments: build/bin/opt.bad -passes=default<O2>,module(msan) -o /dev/null reduced.ll
1.      Running pass "msan<track-origins=0>" on module "reduced.ll"
 #0 0x000055de8c9401b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (build/bin/opt.bad+0x2fbf1b8)
 #1 0x000055de8c93d0b1 llvm::sys::RunSignalHandlers() (build/bin/opt.bad+0x2fbc0b1)
 #2 0x000055de8c941001 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007f9a5a640a70 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x40a70)
 #4 0x00007f9a5a6973dc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007f9a5a640942 raise ./signal/../sysdeps/posix/raise.c:27:6
 #6 0x00007f9a5a6284ac abort ./stdlib/abort.c:85:3
 #7 0x00007f9a5a628420 __assert_perror_fail ./assert/assert-perr.c:31:1
 #8 0x000055de8a90092e (build/bin/opt.bad+0xf7f92e)
 #9 0x000055de8a90bd86 (anonymous namespace)::MemorySanitizerVisitor::handleBlendvIntrinsic(llvm::IntrinsicInst&) MemorySanitizer.cpp:0:0
#10 0x000055de8a908f40 (anonymous namespace)::MemorySanitizerVisitor::maybeHandleX86SIMDIntrinsic(llvm::IntrinsicInst&) MemorySanitizer.cpp:0:0
#11 0x000055de8a905bab (anonymous namespace)::MemorySanitizerVisitor::visitIntrinsicInst(llvm::IntrinsicInst&) MemorySanitizer.cpp:0:0
#12 0x000055de8a8f29f1 (anonymous namespace)::MemorySanitizerVisitor::runOnFunction() MemorySanitizer.cpp:0:0
#13 0x000055de8a8ec60e llvm::MemorySanitizerPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build/bin/opt.bad+0xf6b60e)
#14 0x000055de8a426a1d llvm::detail::PassModel<llvm::Module, llvm::MemorySanitizerPass, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build/bin/opt.bad+0xaa5a1d)
#15 0x000055de8c70407a llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build/bin/opt.bad+0x2d8307a)
#16 0x000055de89ea4182 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool, bool) (build/bin/opt.bad+0x523182)
#17 0x000055de89e97219 optMain (build/bin/opt.bad+0x516219)
#18 0x00007f9a5a629f75 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#19 0x00007f9a5a62a027 call_init ./csu/../csu/libc-start.c:128:20
#20 0x00007f9a5a62a027 __libc_start_main ./csu/../csu/libc-start.c:347:5
#21 0x000055de89e90821 _start (build/bin/opt.bad+0x50f821)
```

https://github.com/llvm/llvm-project/pull/193264


More information about the llvm-commits mailing list