HomePhabricator

[X86] Enable -x86-experimental-vector-widening-legalization by default.

Description

[X86] Enable -x86-experimental-vector-widening-legalization by default.

This patch changes our defualt legalization behavior for 16, 32, and
64 bit vectors with i8/i16/i32/i64 scalar types from promotion to
widening. For example, v8i8 will now be widened to v16i8 instead of
promoted to v8i16. This keeps the elements widths the same and pads
with undef elements. We believe this is a better legalization strategy.
But it carries some issues due to the fragmented vector ISA. For
example, i8 shifts and multiplies get widened and then later have
to be promoted/split into vXi16 vectors.

This has the potential to cause regressions so we wanted to get
it in early in the 10.0 cycle so we have plenty of time to
address them.

Next steps will be to merge tests that explicitly test the command
line option. And then we can remove the option and its associated
code.

Details

Committed
ctopperAug 5 2019, 11:25 AM
Parents
rL367900: Robustify update_test_checks.py to non-autogened tests, and add a mode to skip…
Branches
Unknown
Tags
Unknown

Event Timeline

hctim added a subscriber: hctim.Aug 6 2019, 3:31 PM

It looks like this commit has broken the sanitizer-x86_64-linux-bootstrap-msan bot with the error below. Unfortunately this was fairly hidden over the last few days as there's been a cascading set of failures on the sanitizer bots that has occluded this error from the limelight.

[3072/3116] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86ISelLowering.cpp.o
FAILED: lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86ISelLowering.cpp.o 
/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang++   -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Target/X86 -I/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm/lib/Target/X86 -Iinclude -I/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm/include -nostdinc++ -isystem /b/sanitizer-x86_64-linux-bootstrap-msan/build/libcxx_build_msan/include -isystem /b/sanitizer-x86_64-linux-bootstrap-msan/build/libcxx_build_msan/include/c++/v1  -lc++abi -Wl,--rpath=/b/sanitizer-x86_64-linux-bootstrap-msan/build/libcxx_build_msan/lib -L/b/sanitizer-x86_64-linux-bootstrap-msan/build/libcxx_build_msan/lib -fsanitize=memory -w -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-class-memaccess -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fno-omit-frame-pointer -gline-tables-only -fsanitize=memory -fdiagnostics-color -ffunction-sections -fdata-sections -O3    -UNDEBUG  -fno-exceptions -fno-rtti -MD -MT lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86ISelLowering.cpp.o -MF lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86ISelLowering.cpp.o.d -o lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86ISelLowering.cpp.o -c /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm/lib/Target/X86/X86ISelLowering.cpp
clang-10: /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm/lib/Target/X86/X86ISelLowering.cpp:7692: llvm::SDValue EltsFromConsecutiveLoads(llvm::EVT, llvm::ArrayRef<llvm::SDValue>, const llvm::SDLoc&, llvm::SelectionDAG&, const llvm::X86Subtarget&, bool): Assertion `EltBaseVT.getSizeInBits() == EltBaseVT.getStoreSizeInBits() && "Register/Memory size mismatch"' failed.
Stack dump:
0.	Program arguments: /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name X86ISelLowering.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debug-info-kind=line-tables-only -dwarf-version=4 -debugger-tuning=gdb -ffunction-sections -fdata-sections -coverage-notes-file /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86ISelLowering.cpp.gcno -nostdinc++ -resource-dir /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/lib/clang/10.0.0 -dependency-file lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86ISelLowering.cpp.o.d -sys-header-deps -MT lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86ISelLowering.cpp.o -isystem /b/sanitizer-x86_64-linux-bootstrap-msan/build/libcxx_build_msan/include -isystem /b/sanitizer-x86_64-linux-bootstrap-msan/build/libcxx_build_msan/include/c++/v1 -D GTEST_HAS_RTTI=0 -D _DEBUG -D _GNU_SOURCE -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -I lib/Target/X86 -I /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm/lib/Target/X86 -I include -I /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm/include -U NDEBUG -internal-isystem /usr/local/include -internal-isystem /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/lib/clang/10.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-class-memaccess -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -pedantic -w -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan -ferror-limit 19 -fmessage-length 0 -fvisibility-inlines-hidden -fsanitize=memory -fsanitize-blacklist=/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/lib/clang/10.0.0/share/msan_blacklist.txt -fsanitize-memory-use-after-dtor -fno-assume-sane-operator-new -fno-rtti -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -o lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86ISelLowering.cpp.o -x c++ /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm/lib/Target/X86/X86ISelLowering.cpp 
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module '/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm/lib/Target/X86/X86ISelLowering.cpp'.
4.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@_ZL22lowerShuffleWithSHUFPSRKN4llvm5SDLocENS_3MVTENS_8ArrayRefIiEENS_7SDValueES6_RNS_12SelectionDAGE'
 #0 0x0000563c2801120a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x2bbe20a)
 #1 0x0000563c2800ef95 llvm::sys::RunSignalHandlers() (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x2bbbf95)
 #2 0x0000563c2800f0ac SignalHandler(int) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x2bbc0ac)
 #3 0x00007f563c01f0e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x110e0)
 #4 0x00007f563addefff raise (/lib/x86_64-linux-gnu/libc.so.6+0x32fff)
 #5 0x00007f563ade042a abort (/lib/x86_64-linux-gnu/libc.so.6+0x3442a)
 #6 0x00007f563add7e67 (/lib/x86_64-linux-gnu/libc.so.6+0x2be67)
 #7 0x00007f563add7f12 (/lib/x86_64-linux-gnu/libc.so.6+0x2bf12)
 #8 0x0000563c271ef1c1 EltsFromConsecutiveLoads(llvm::EVT, llvm::ArrayRef<llvm::SDValue>, llvm::SDLoc const&, llvm::SelectionDAG&, llvm::X86Subtarget const&, bool) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x1d9c1c1)
 #9 0x0000563c2725532c combineShuffle(llvm::SDNode*, llvm::SelectionDAG&, llvm::TargetLowering::DAGCombinerInfo&, llvm::X86Subtarget const&) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x1e0232c)
#10 0x0000563c27257de5 llvm::X86TargetLowering::PerformDAGCombine(llvm::SDNode*, llvm::TargetLowering::DAGCombinerInfo&) const (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x1e04de5)
#11 0x0000563c28a75e54 (anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x3622e54)
#12 0x0000563c28a77b58 llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::AAResults*, llvm::CodeGenOpt::Level) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x3624b58)
#13 0x0000563c28b48a93 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x36f5a93)
#14 0x0000563c28b4cef4 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x36f9ef4)
#15 0x0000563c28b4e9eb llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.821) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x36fb9eb)
#16 0x0000563c2717593f (anonymous namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x1d2293f)
#17 0x0000563c276ca949 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.39) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x2277949)
#18 0x0000563c27a4e560 llvm::FPPassManager::runOnFunction(llvm::Function&) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x25fb560)
#19 0x0000563c27a4e77c llvm::FPPassManager::runOnModule(llvm::Module&) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x25fb77c)
#20 0x0000563c27a4f2a4 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x25fc2a4)
#21 0x0000563c28210336 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x2dbd336)
#22 0x0000563c28211bf8 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x2dbebf8)
#23 0x0000563c28c31efa clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x37deefa)
#24 0x0000563c294c8ca9 clang::ParseAST(clang::Sema&, bool, bool) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x4075ca9)
#25 0x0000563c28c2f994 clang::CodeGenAction::ExecuteAction() (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x37dc994)
#26 0x0000563c286be7d1 clang::FrontendAction::Execute() (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x326b7d1)
#27 0x0000563c28685330 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x3232330)
#28 0x0000563c287649f2 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0x33119f2)
#29 0x0000563c263caef6 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0xf77ef6)
#30 0x0000563c2633e54d main (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0xeeb54d)
#31 0x00007f563adcc2e1 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e1)
#32 0x0000563c263c709a _start (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin/clang-10+0xf7409a)
clang-10: error: unable to execute command: Aborted
clang-10: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 10.0.0 (trunk 367999)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build0/bin
clang-10: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang-10: note: diagnostic msg: 
********************