[llvm] r373031 - [X86] Remove CodeGenOnly instructions added in r373021, but keep the isel patterns and add COPY_TO_REGCLASS to them.

David Zarzycki via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 23:46:32 PDT 2019


FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o
/p/tllvm/bin/clang++  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Support -I/home/dave/s/lp/llvm/lib/Support -I/usr/include/libxml2 -Iinclude -I/home/dave/s/lp/llvm/include -isystem /usr/include/z3 -Werror=switch -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++14 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -O2    -UNDEBUG  -march=knl -mno-avx512er -mno-avx512pf -fno-vectorize -fno-slp-vectorize -fno-tree-slp-vectorize -fno-exceptions -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o -c /home/dave/s/lp/llvm/lib/Support/APInt.cpp
Stack dump:
0.  Program arguments: /p/tllvm/bin/clang-10 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name APInt.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=none -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu knl -target-feature -avx512er -target-feature -avx512pf -dwarf-column-info -debugger-tuning=gdb -ffunction-sections -fdata-sections -resource-dir /p/tllvm/lib64/clang/10.0.0 -dependency-file lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o.d -MT lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o -sys-header-deps -isystem /usr/include/z3 -D GTEST_HAS_RTTI=0 -D _DEBUG -D _GNU_SOURCE -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -I lib/Support -I /home/dave/s/lp/llvm/lib/Support -I /usr/include/libxml2 -I include -I /home/dave/s/lp/llvm/include -U NDEBUG -internal-isystem /p/tllvm/bin/../include/c++/v1 -internal-isystem /usr/local/include -internal-isystem /p/tllvm/lib64/clang/10.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Werror=switch -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-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -pedantic -std=c++14 -fdeprecated-macro -fdebug-compilation-dir /tmp/_update_lc/t -ferror-limit 19 -fmessage-length 0 -fvisibility-inlines-hidden -fno-rtti -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -faddrsig -o lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o -x c++ /home/dave/s/lp/llvm/lib/Support/APInt.cpp
1.  <eof> parser at end of file
2.  Code generation
3.  Running pass 'Function Pass Manager' on module '/home/dave/s/lp/llvm/lib/Support/APInt.cpp'.
4.  Running pass 'X86 Assembly Printer' on function '@_ZNK4llvm5APInt13roundToDoubleEb'
 #0 0x0000000001f2b628 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/p/tllvm/bin/clang-10+0x1f2b628)
 #1 0x0000000001f29ad8 llvm::sys::RunSignalHandlers() (/p/tllvm/bin/clang-10+0x1f29ad8)
 #2 0x0000000001f2bb48 SignalHandler(int) (/p/tllvm/bin/clang-10+0x1f2bb48)
 #3 0x00007ffff7fa9b20 __restore_rt (/lib64/libpthread.so.0+0x14b20)
 #4 0x0000000001570678 (anonymous namespace)::X86MCCodeEmitter::EmitImmediate(llvm::MCOperand const&, llvm::SMLoc, unsigned int, llvm::MCFixupKind, unsigned int&, llvm::raw_ostream&, llvm::SmallVectorImpl<llvm::MCFixup>&, int) const (/p/tllvm/bin/clang-10+0x1570678)
 #5 0x0000000001570b88 (anonymous namespace)::X86MCCodeEmitter::emitMemModRMByte(llvm::MCInst const&, unsigned int, unsigned int, unsigned long, bool, unsigned int&, llvm::raw_ostream&, llvm::SmallVectorImpl<llvm::MCFixup>&, llvm::MCSubtargetInfo const&) const (/p/tllvm/bin/clang-10+0x1570b88)
 #6 0x000000000156fdad (anonymous namespace)::X86MCCodeEmitter::encodeInstruction(llvm::MCInst const&, llvm::raw_ostream&, llvm::SmallVectorImpl<llvm::MCFixup>&, llvm::MCSubtargetInfo const&) const (/p/tllvm/bin/clang-10+0x156fdad)
 #7 0x0000000001cc7d9f llvm::MCELFStreamer::EmitInstToData(llvm::MCInst const&, llvm::MCSubtargetInfo const&) (/p/tllvm/bin/clang-10+0x1cc7d9f)
 #8 0x0000000001cd3a4c llvm::MCObjectStreamer::EmitInstruction(llvm::MCInst const&, llvm::MCSubtargetInfo const&) (/p/tllvm/bin/clang-10+0x1cd3a4c)
 #9 0x0000000001379931 llvm::X86AsmPrinter::EmitInstruction(llvm::MachineInstr const*) (/p/tllvm/bin/clang-10+0x1379931)
#10 0x00000000027d4da7 llvm::AsmPrinter::EmitFunctionBody() (/p/tllvm/bin/clang-10+0x27d4da7)
#11 0x0000000001372f18 llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) (/p/tllvm/bin/clang-10+0x1372f18)
#12 0x00000000017c554d llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/p/tllvm/bin/clang-10+0x17c554d)
#13 0x0000000001aa1101 llvm::FPPassManager::runOnFunction(llvm::Function&) (/p/tllvm/bin/clang-10+0x1aa1101)
#14 0x0000000001aa13e3 llvm::FPPassManager::runOnModule(llvm::Module&) (/p/tllvm/bin/clang-10+0x1aa13e3)
#15 0x0000000001aa17dc llvm::legacy::PassManagerImpl::run(llvm::Module&) (/p/tllvm/bin/clang-10+0x1aa17dc)
#16 0x0000000002099d54 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> >) (/p/tllvm/bin/clang-10+0x2099d54)
#17 0x0000000002690d0d clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/p/tllvm/bin/clang-10+0x2690d0d)
#18 0x00000000031ef10b clang::ParseAST(clang::Sema&, bool, bool) (/p/tllvm/bin/clang-10+0x31ef10b)
#19 0x00000000025fb0ae clang::FrontendAction::Execute() (/p/tllvm/bin/clang-10+0x25fb0ae)
#20 0x0000000002582ed2 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/p/tllvm/bin/clang-10+0x2582ed2)
#21 0x000000000268c06d clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/p/tllvm/bin/clang-10+0x268c06d)
#22 0x0000000001369524 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/p/tllvm/bin/clang-10+0x1369524)
#23 0x0000000001367886 main (/p/tllvm/bin/clang-10+0x1367886)
#24 0x00007ffff60ce1a3 __libc_start_main (/lib64/libc.so.6+0x271a3)
#25 0x000000000136502e _start (/p/tllvm/bin/clang-10+0x136502e)
clang-10: error: unable to execute command: Segmentation fault
clang-10: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 10.0.0 (/home/dave/s/lp/clang c89872497457676bbbb564155cc669d587614d00)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /p/tllvm/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:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-10: note: diagnostic msg: /tmp/APInt-53e48c.cpp
clang-10: note: diagnostic msg: /tmp/APInt-53e48c.sh
clang-10: note: diagnostic msg:

********************



# Crash reproducer for clang version 10.0.0 (/home/dave/s/lp/clang c89872497457676bbbb564155cc669d587614d00)
# Driver args: "--driver-mode=g++" "-D" "GTEST_HAS_RTTI=0" "-D" "_DEBUG" "-D" "_GNU_SOURCE" "-D" "__STDC_CONSTANT_MACROS" "-D" "__STDC_FORMAT_MACROS" "-D" "__STDC_LIMIT_MACROS" "-I" "lib/Support" "-I" "/home/dave/s/lp/llvm/lib/Support" "-I" "/usr/include/libxml2" "-I" "include" "-I" "/home/dave/s/lp/llvm/include" "-isystem" "/usr/include/z3" "-Werror=switch" "-fPIC" "-fvisibility-inlines-hidden" "-Werror=date-time" "-Werror=unguarded-availability-new" "-std=c++14" "-Wall" "-Wextra" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wmissing-field-initializers" "-pedantic" "-Wno-long-long" "-Wimplicit-fallthrough" "-Wcovered-switch-default" "-Wno-noexcept-type" "-Wnon-virtual-dtor" "-Wdelete-non-virtual-dtor" "-Wstring-conversion" "-fdiagnostics-color" "-ffunction-sections" "-fdata-sections" "-O2" "-U" "NDEBUG" "-march=knl" "-mno-avx512er" "-mno-avx512pf" "-fno-vectorize" "-fno-slp-vectorize" "-fno-slp-vectorize" "-fno-exceptions" "-fno-rtti" "-MD" "-MT" "lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o" "-MF" "lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o.d" "-o" "lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o" "-c" "/home/dave/s/lp/llvm/lib/Support/APInt.cpp"
# Original command:  "/p/tllvm/bin/clang-10" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "APInt.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mthread-model" "posix" "-mframe-pointer=none" "-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-fuse-init-array" "-target-cpu" "knl" "-target-feature" "-avx512er" "-target-feature" "-avx512pf" "-dwarf-column-info" "-debugger-tuning=gdb" "-ffunction-sections" "-fdata-sections" "-resource-dir" "/p/tllvm/lib64/clang/10.0.0" "-dependency-file" "lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o.d" "-MT" "lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o" "-sys-header-deps" "-isystem" "/usr/include/z3" "-D" "GTEST_HAS_RTTI=0" "-D" "_DEBUG" "-D" "_GNU_SOURCE" "-D" "__STDC_CONSTANT_MACROS" "-D" "__STDC_FORMAT_MACROS" "-D" "__STDC_LIMIT_MACROS" "-I" "lib/Support" "-I" "/home/dave/s/lp/llvm/lib/Support" "-I" "/usr/include/libxml2" "-I" "include" "-I" "/home/dave/s/lp/llvm/include" "-U" "NDEBUG" "-internal-isystem" "/p/tllvm/bin/../include/c++/v1" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/p/tllvm/lib64/clang/10.0.0/include" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-O2" "-Werror=switch" "-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-noexcept-type" "-Wnon-virtual-dtor" "-Wdelete-non-virtual-dtor" "-Wstring-conversion" "-pedantic" "-std=c++14" "-fdeprecated-macro" "-fdebug-compilation-dir" "/tmp/_update_lc/t" "-ferror-limit" "19" "-fmessage-length" "0" "-fvisibility-inlines-hidden" "-fno-rtti" "-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-faddrsig" "-o" "lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o" "-x" "c++" "/home/dave/s/lp/llvm/lib/Support/APInt.cpp"
 "/p/tllvm/bin/clang-10" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "APInt.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mthread-model" "posix" "-mframe-pointer=none" "-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-fuse-init-array" "-target-cpu" "knl" "-target-feature" "-avx512er" "-target-feature" "-avx512pf" "-dwarf-column-info" "-debugger-tuning=gdb" "-ffunction-sections" "-fdata-sections" "-sys-header-deps" "-D" "GTEST_HAS_RTTI=0" "-D" "_DEBUG" "-D" "_GNU_SOURCE" "-D" "__STDC_CONSTANT_MACROS" "-D" "__STDC_FORMAT_MACROS" "-D" "__STDC_LIMIT_MACROS" "-U" "NDEBUG" "-O2" "-Werror=switch" "-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-noexcept-type" "-Wnon-virtual-dtor" "-Wdelete-non-virtual-dtor" "-Wstring-conversion" "-pedantic" "-std=c++14" "-fdeprecated-macro" "-ferror-limit" "19" "-fmessage-length" "0" "-fvisibility-inlines-hidden" "-fno-rtti" "-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-faddrsig" "-x" "c++" "APInt-53e48c.cpp"




> On Sep 27, 2019, at 9:32 AM, Craig Topper <craig.topper at gmail.com> wrote:
> 
> I didn't know there was a stage-two build failure. If the original patch is bad, I don't expect this to fix it. Do you have any additional information that can help me narrow down the problem?
> 
> ~Craig
> 
> 
> On Thu, Sep 26, 2019 at 9:46 PM David Zarzycki via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> Hi Craig,
> 
> A locale bisect just finished. Does this fix the stage-two build failure introduced by r373021?
> 
> Dave
> 
> > On Sep 27, 2019, at 2:22 AM, Craig Topper via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> > 
> > Author: ctopper
> > Date: Thu Sep 26 16:22:15 2019
> > New Revision: 373031
> > 
> > URL: http://llvm.org/viewvc/llvm-project?rev=373031&view=rev
> > Log:
> > [X86] Remove CodeGenOnly instructions added in r373021, but keep the isel patterns and add COPY_TO_REGCLASS to them.
> > 
> > Modified:
> >    llvm/trunk/lib/Target/X86/X86InstrAVX512.td
> > 
> > Modified: llvm/trunk/lib/Target/X86/X86InstrAVX512.td
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrAVX512.td?rev=373031&r1=373030&r2=373031&view=diff
> > ==============================================================================
> > --- llvm/trunk/lib/Target/X86/X86InstrAVX512.td (original)
> > +++ llvm/trunk/lib/Target/X86/X86InstrAVX512.td Thu Sep 26 16:22:15 2019
> > @@ -3958,18 +3958,6 @@ multiclass avx512_move_scalar<string asm
> >                !strconcat(asm, "\t{$src, $dst {${mask}} {z}|",
> >                "$dst {${mask}} {z}, $src}"),
> >                [], _.ExeDomain>, EVEX, EVEX_KZ, Sched<[WriteFLoad]>;
> > -    let isCodeGenOnly = 1 in {
> > -    def rmk_alt : AVX512PI<0x10, MRMSrcMem, (outs _.FRC:$dst),
> > -                  (ins _.FRC:$src0, _.KRCWM:$mask, _.ScalarMemOp:$src),
> > -                  !strconcat(asm, "\t{$src, $dst {${mask}}|",
> > -                  "$dst {${mask}}, $src}"),
> > -                  [], _.ExeDomain>, EVEX, EVEX_K, Sched<[WriteFLoad]>;
> > -    def rmkz_alt : AVX512PI<0x10, MRMSrcMem, (outs _.FRC:$dst),
> > -                   (ins _.KRCWM:$mask, _.ScalarMemOp:$src),
> > -                   !strconcat(asm, "\t{$src, $dst {${mask}} {z}|",
> > -                   "$dst {${mask}} {z}, $src}"),
> > -                   [], _.ExeDomain>, EVEX, EVEX_KZ, Sched<[WriteFLoad]>;
> > -    }
> >   }
> >   def mr: AVX512PI<0x11, MRMDestMem, (outs), (ins _.ScalarMemOp:$dst, _.FRC:$src),
> >              !strconcat(asm, "\t{$src, $dst|$dst, $src}"),
> > @@ -4235,9 +4223,12 @@ def : Pat<(f32 (X86selects VK1WM:$mask,
> >            (v4f32 (COPY_TO_REGCLASS FR32X:$src1, VR128X)))), FR32X)>;
> > 
> > def : Pat<(f32 (X86selects VK1WM:$mask, (loadf32 addr:$src), (f32 FR32X:$src0))),
> > -          (VMOVSSZrmk_alt FR32X:$src0, VK1WM:$mask, addr:$src)>;
> > +          (COPY_TO_REGCLASS
> > +           (v4f32 (VMOVSSZrmk (v4f32 (COPY_TO_REGCLASS FR32X:$src0, VR128X)),
> > +                                                       VK1WM:$mask, addr:$src)),
> > +           FR32X)>;
> > def : Pat<(f32 (X86selects VK1WM:$mask, (loadf32 addr:$src), fp32imm0)),
> > -          (VMOVSSZrmkz_alt VK1WM:$mask, addr:$src)>;
> > +          (COPY_TO_REGCLASS (v4f32 (VMOVSSZrmkz VK1WM:$mask, addr:$src)), FR32X)>;
> > 
> > def : Pat<(f64 (X86selects VK1WM:$mask, (f64 FR64X:$src1), (f64 FR64X:$src2))),
> >           (COPY_TO_REGCLASS (v2f64 (VMOVSDZrrk
> > @@ -4250,9 +4241,12 @@ def : Pat<(f64 (X86selects VK1WM:$mask,
> >            (v2f64 (COPY_TO_REGCLASS FR64X:$src1, VR128X)))), FR64X)>;
> > 
> > def : Pat<(f64 (X86selects VK1WM:$mask, (loadf64 addr:$src), (f64 FR64X:$src0))),
> > -          (VMOVSDZrmk_alt FR64X:$src0, VK1WM:$mask, addr:$src)>;
> > +          (COPY_TO_REGCLASS
> > +           (v2f64 (VMOVSDZrmk (v2f64 (COPY_TO_REGCLASS FR64X:$src0, VR128X)),
> > +                                                       VK1WM:$mask, addr:$src)),
> > +           FR64X)>;
> > def : Pat<(f64 (X86selects VK1WM:$mask, (loadf64 addr:$src), fp64imm0)),
> > -          (VMOVSDZrmkz_alt VK1WM:$mask, addr:$src)>;
> > +          (COPY_TO_REGCLASS (v2f64 (VMOVSDZrmkz VK1WM:$mask, addr:$src)), FR64X)>;
> > 
> > let hasSideEffects = 0, isCodeGenOnly = 1, ForceDisassemble = 1 in {
> >   def VMOVSSZrr_REV: AVX512<0x11, MRMDestReg, (outs VR128X:$dst),
> > 
> > 
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list