-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
This is using the splicer build.
I tried running a very simple function, and supervec exits gracefully if the function is compiled with -O1, -O2, or -O3, but crashes when compiled with -O0.
Source file:
#include <immintrin.h>
__m256i function(__m256i a, __m256i b)
{
return _mm256_avg_epu16(a, b);
}
Compiled using:
clang++ -I -march=native -mavx2 -O0 -Werror -S -emit-llvm function.cpp -o function.ll
Called supervec using:
$HOME/llvm/build/bin/opt -enable-new-pm=0 -load $HOME/minotaur/build/minotaur.so -so -S function.ll
Sketches Output:
---------Sketches------------
(copy reservedconst)
-----------------------------
----------------------------------------
define <4 x i64> @_Z8functionDv4_xS_.233.234(<4 x i64> %a, <4 x i64> %b, * %_reservedc_0) {
%entry:
%__a.addr.i = alloca i64 32, align 32
%__b.addr.i = alloca i64 32, align 32
%a.addr = alloca i64 32, align 32
%b.addr = alloca i64 32, align 32
store <4 x i64> %a, * %a.addr, align 32
store <4 x i64> %b, * %b.addr, align 32
%0 = load <4 x i64>, * %a.addr, align 32
%1 = load <4 x i64>, * %b.addr, align 32
store <4 x i64> %0, * %__a.addr.i, align 32
store <4 x i64> %1, * %__b.addr.i, align 32
%2 = load <4 x i64>, * %__a.addr.i, align 32
%3 = bitcast <4 x i64> %2 to <16 x i16>
%4 = load <4 x i64>, * %__b.addr.i, align 32
%5 = bitcast <4 x i64> %4 to <16 x i16>
%6 = x86.avx2.pavg.w <16 x i16> %3, <16 x i16> %5
%7 = bitcast <16 x i16> %6 to <4 x i64>
ret <4 x i64> %7
}
=>
define <4 x i64> @_Z8functionDv4_xS_.233(<4 x i64> %a, <4 x i64> %b, * %_reservedc_0) {
%entry:
%__a.addr.i = alloca i64 32, align 32
%__b.addr.i = alloca i64 32, align 32
%a.addr = alloca i64 32, align 32
store <4 x i64> %a, * %a.addr, align 32
store <4 x i64> %b, * %_reservedc_0, align 32
%0 = load <4 x i64>, * %a.addr, align 32
%1 = load <4 x i64>, * %_reservedc_0, align 32
store <4 x i64> %0, * %__a.addr.i, align 32
store <4 x i64> %1, * %__b.addr.i, align 32
%2 = load <4 x i64>, * %__a.addr.i, align 32
%3 = bitcast <4 x i64> %2 to <16 x i16>
%4 = load <4 x i64>, * %__b.addr.i, align 32
%5 = bitcast <4 x i64> %4 to <16 x i16>
%6 = x86.avx2.pavg.w <16 x i16> %3, <16 x i16> %5
%7 = bitcast <16 x i16> %6 to <4 x i64>
ret <4 x i64> %7
}
;result
* %_reservedc_0 = pointer(non-local, block_id=1, offset=64)
opt: /home/stefan/llvm/llvm/lib/IR/Value.cpp:502: void llvm::Value::doRAUW(llvm::Value*, llvm::Value::ReplaceMetadataUses): Assertion `New && "Value::replaceAllUsesWith(<null>) is invalid!"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: /home/stefan/llvm/build/bin/opt -enable-new-pm=0 -load /home/stefan/minotaur/build/minotaur.so -so -S function.ll
1. Running pass 'Function Pass Manager' on module 'function.ll'.
2. Running pass 'Superoptimizer' on function '@_Z8functionDv4_xS_'
#0 0x00007f87e6d3f5e1 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/stefan/llvm/llvm/lib/Support/Unix/Signals.inc:569:3
#1 0x00007f87e6d3ced4 llvm::sys::RunSignalHandlers() /home/stefan/llvm/llvm/lib/Support/Signals.cpp:97:20
#2 0x00007f87e6d3dd05 SignalHandler(int) /home/stefan/llvm/llvm/lib/Support/Unix/Signals.inc:397:31
#3 0x00007f87e6794210 (/lib/x86_64-linux-gnu/libc.so.6+0x46210)
#4 0x00007f87e679418b raise /build/glibc-eX1tMB/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f87e6773859 abort /build/glibc-eX1tMB/glibc-2.31/stdlib/abort.c:81:7
#6 0x00007f87e6773729 get_sysdep_segment_value /build/glibc-eX1tMB/glibc-2.31/intl/loadmsgcat.c:509:8
#7 0x00007f87e6773729 _nl_load_domain /build/glibc-eX1tMB/glibc-2.31/intl/loadmsgcat.c:970:34
#8 0x00007f87e6784f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
#9 0x00007f87e70ae403 (/home/stefan/llvm/build/bin/../lib/libLLVMCore.so.14git+0x2dc403)
#10 0x00007f87e55623e2 minotaur::synthesize(llvm::Function&, llvm::TargetLibraryInfo*) /home/stefan/minotaur/build/../lib/EnumerativeSynthesis.cpp:601:16
#11 0x00007f87e703d3f5 llvm::FPPassManager::runOnFunction(llvm::Function&) /home/stefan/llvm/llvm/lib/IR/LegacyPassManager.cpp:1449:7
#12 0x00007f87e703d639 llvm::ilist_node_impl<llvm::ilist_detail::node_options<llvm::Function, true, false, void> >::getNext() /home/stefan/llvm/llvm/include/llvm/ADT/ilist_node.h:66:66
#13 0x00007f87e703d639 llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Function, true, false, void>, false, false>::operator++() /home/stefan/llvm/llvm/include/llvm/ADT/ilist_iterator.h:157:25
#14 0x00007f87e703d639 llvm::FPPassManager::runOnModule(llvm::Module&) /home/stefan/llvm/llvm/lib/IR/LegacyPassManager.cpp:1484:22
#15 0x00007f87e703e8c1 runOnModule /home/stefan/llvm/llvm/lib/IR/LegacyPassManager.cpp:1561:7
#16 0x00007f87e703e8c1 llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/stefan/llvm/llvm/lib/IR/LegacyPassManager.cpp:542:55
#17 0x0000562d903a64dc main /home/stefan/llvm/llvm/tools/opt/opt.cpp:1076:20
#18 0x00007f87e67750b3 __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:342:3
#19 0x0000562d903a73be _start (/home/stefan/llvm/build/bin/opt+0x293be)
Aborted (core dumped)
Metadata
Metadata
Assignees
Labels
No labels