Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

TwoAddressInstructionPass assertion #45925

Open Quuxplusone opened 4 years ago

Quuxplusone commented 4 years ago
Bugzilla Link PR46956
Status NEW
Importance P release blocker
Reported by Uday Bondhugula (uday@polymagelabs.com)
Reported on 2020-08-02 00:20:48 -0700
Last modified on 2020-08-12 12:47:10 -0700
Version 11.0
Hardware PC Linux
CC blitzrakete@gmail.com, craig.topper@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, richard-llvm@metafoo.co.uk, spatel+llvm@rotateright.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
This build crashes with an assert. The file in question being built has inline
ASM.

To reproduce:

1) Obtain tensorflow commit c6023a81d4976f6ff79f957925364d21d7884004 (Jul 30)
from https://github.com/tensorflow/tensorflow.git

2) To build, run:

(Use the default options with ./configure; shouldn't make a difference anyway.)

CXX=/opt/clang-11.0rc1/bin/clang++ CC=/opt/clang-11.0rc1/bin/clang bazel build -
-config=monolithic  --copt=-UNDEBUG --linkopt='-fuse-ld=lld'
tensorflow/compiler/mlir:tf-opt

This yields the assertion appended below.

clang was built from sources with the following configuration:

cmake -G Ninja ../llvm -DCMAKE_INSTALL_PREFIX=/opt/clang-11.0rc1      -
DLLVM_ENABLE_PROJECTS="clang"    -DLLVM_TARGETS_TO_BUILD="X86"    -
DCMAKE_BUILD_TYPE=Release  -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++ -DLLVM_ENABLE_LLD=ON -DLLVM_CCACHE_BUILD=ON

The version of clang/clang++ used to build clang/llvm itself was clang version
9.0.1 (Red Hat 9.0.1-2.module_el8.2.0+309+0c7b6b03) on CentOS Linux release
8.2.2004 (Core).

bazel --version (3.4.1) <-- shouldn't make a difference.

========================
...
clang: /ws/uday/llvm-project-
11.0.0rc1/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1396: void (anonymous
namespace)::TwoAddressInstructionPass::processTiedPairs(llvm::MachineInstr *,
(anonymous namespace)::TwoAddressInstructionPass::TiedPairList &, unsigned int
&): Assertion `i == DstIdx || !MI->getOperand(i).isReg() || MI-
>getOperand(i).getReg() != RegA' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments: /opt/clang-11.0rc1/bin/clang -U_FORTIFY_SOURCE -fstack-
protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-
frame-pointer -g0 -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-
sections -MD -MF bazel-out/k8-opt/bin/external/aws-checksums/_objs/aws-
checksums/crc32c_sse42_asm.d -frandom-seed=bazel-out/k8-opt/bin/external/aws-
checksums/_objs/aws-checksums/crc32c_sse42_asm.o -iquote external/aws-checksums
-iquote bazel-out/k8-opt/bin/external/aws-checksums -iquote external/aws-c-
common -iquote bazel-out/k8-opt/bin/external/aws-c-common -isystem external/aws-
checksums/include -isystem bazel-out/k8-opt/bin/external/aws-checksums/include -
isystem external/aws-c-common/include -isystem bazel-out/k8-
opt/bin/external/aws-c-common/include -w -DAUTOLOAD_DYNAMIC_KERNELS -UNDEBUG -
no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -
D__TIMESTAMP__="redacted" -D__TIME__="redacted" -c external/aws-
checksums/source/intel/crc32c_sse42_asm.c -o bazel-out/k8-opt/bin/external/aws-
checksums/_objs/aws-checksums/crc32c_sse42_asm.o
1.  <eof> parser at end of file
2.  Code generation
3.  Running pass 'Function Pass Manager' on module 'external/aws-
checksums/source/intel/crc32c_sse42_asm.c'.
4.  Running pass 'Two-Address instruction pass' on function
'@aws_checksums_crc32c_hw'
 #0 0x0000000002fc7944 PrintStackTraceSignalHandler(void*) (/opt/clang-11.0rc1/bin/clang+0x2fc7944)
 #1 0x0000000002fc547e llvm::sys::RunSignalHandlers() (/opt/clang-11.0rc1/bin/clang+0x2fc547e)
 #2 0x0000000002fc6ab4 llvm::sys::CleanupOnSignal(unsigned long) (/opt/clang-11.0rc1/bin/clang+0x2fc6ab4)
 #3 0x0000000002f455e3 (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) (/opt/clang-11.0rc1/bin/clang+0x2f455e3)
 #4 0x0000000002f4571c CrashRecoverySignalHandler(int) (/opt/clang-11.0rc1/bin/clang+0x2f4571c)
 #5 0x00007f51c33b3dd0 __restore_rt (/lib64/libpthread.so.0+0x12dd0)
 #6 0x00007f51c20c370f raise (/lib64/libc.so.6+0x3770f)
 #7 0x00007f51c20adb25 abort (/lib64/libc.so.6+0x21b25)
 #8 0x00007f51c20ad9f9 _nl_load_domain.cold.0 (/lib64/libc.so.6+0x219f9)
 #9 0x00007f51c20bbcc6 (/lib64/libc.so.6+0x2fcc6)
#10 0x00000000027cca9c (anonymous
namespace)::TwoAddressInstructionPass::runOnMachineFunction(llvm::MachineFunction&)
(/opt/clang-11.0rc1/bin/clang+0x27cca9c)
#11 0x00000000024ac14e
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/clang-
11.0rc1/bin/clang+0x24ac14e)
#12 0x0000000002914d91 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/opt/clang-11.0rc1/bin/clang+0x2914d91)
#13 0x000000000291b778 llvm::FPPassManager::runOnModule(llvm::Module&)
(/opt/clang-11.0rc1/bin/clang+0x291b778)
#14 0x0000000002915620 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/opt/clang-11.0rc1/bin/clang+0x2915620)
#15 0x00000000031e79dd 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> >) (/opt/clang-
11.0rc1/bin/clang+0x31e79dd)
#16 0x0000000003a30b2f
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/clang-
11.0rc1/bin/clang+0x3a30b2f)
#17 0x00000000049479a3 clang::ParseAST(clang::Sema&, bool, bool) (/opt/clang-
11.0rc1/bin/clang+0x49479a3)
#18 0x00000000039771cb clang::FrontendAction::Execute() (/opt/clang-
11.0rc1/bin/clang+0x39771cb)
#19 0x00000000038d1b23
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/clang-
11.0rc1/bin/clang+0x38d1b23)
#20 0x0000000003a2ae82
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/clang-
11.0rc1/bin/clang+0x3a2ae82)
#21 0x0000000001e873c1 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/opt/clang-11.0rc1/bin/clang+0x1e873c1)
#22 0x0000000001e8550c ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/opt/clang-11.0rc1/bin/clang+0x1e8550c)
#23 0x000000000378cfa2 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const::$_1>(long) (/opt/clang-
11.0rc1/bin/clang+0x378cfa2)
#24 0x0000000002f45501
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/clang-
11.0rc1/bin/clang+0x2f45501)
#25 0x000000000378c40e
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const (/opt/clang-11.0rc1/bin/clang+0x378c40e)
#26 0x0000000003757b6b
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const (/opt/clang-11.0rc1/bin/clang+0x3757b6b)
#27 0x0000000003757f87
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/opt/clang-11.0rc1/bin/clang+0x3757f87)
#28 0x0000000003770678
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/opt/clang-11.0rc1/bin/clang+0x3770678)
#29 0x0000000001e84d09 main (/opt/clang-11.0rc1/bin/clang+0x1e84d09)
#30 0x00007f51c20af6a3 __libc_start_main (/lib64/libc.so.6+0x236a3)
#31 0x0000000001e8202e _start (/opt/clang-11.0rc1/bin/clang+0x1e8202e)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 11.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/clang-11.0rc1/bin
clang: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/crc32c_sse42_asm-13afbd.c
clang: note: diagnostic msg: /tmp/crc32c_sse42_asm-13afbd.sh
clang: note: diagnostic msg:

********************
Quuxplusone commented 4 years ago

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:

Please can you attach the files mentioned to this bug report?