OSDN Git Service
Mauro Rossi [Fri, 24 Jul 2020 23:02:49 +0000 (01:02 +0200)]
android: AMDGPU/GlobalISel: Introduce post-legalize combiner
android: AMDGPU/GlobalISel: Introduce post-legalize combiner
Port to Android.bp of commit
fee41517fe0 ("AMDGPU/GlobalISel: Introduce post-legalize combiner")
Fixes the following build error:
external/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp:229:10:
fatal error: 'AMDGPUGenPostLegalizeGICombiner.inc' file not found
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Mauro Rossi [Fri, 24 Jul 2020 22:23:10 +0000 (00:23 +0200)]
android: AMDGPU/GlobalISel: Add pre-legalize combiner pass
Port to Android.bp of commit
a174f0da62f ("AMDGPU/GlobalISel: Add pre-legalize combiner pass")
Fixes the following build error:
external/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUPreLegalizerCombiner.cpp:32:10:
fatal error: 'AMDGPUGenPreLegalizeGICombiner.inc' file not found
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Mauro Rossi [Sat, 25 Jul 2020 11:57:22 +0000 (13:57 +0200)]
android: [AArch64][GlobalISel] Move GlobalISel source files to a dedicated subdir.
Port to Android.bp of commit
e53f5580578 ("[AArch64][GlobalISel] Move GlobalISel source files to a dedicated subdir.")
Fixes the following building errors:
FAILED: out/soong/.intermediates/external/llvm-project/llvm/libLLVM10/android_x86_64_core_shared/unstripped/libLLVM10.so
ld.lld: error: undefined symbol: llvm::AArch64CallLowering::AArch64CallLowering(llvm::AArch64TargetLowering const&)
...
ld.lld: error: undefined symbol: llvm::AArch64LegalizerInfo::AArch64LegalizerInfo(llvm::AArch64Subtarget const&)
...
ld.lld: error: undefined symbol: llvm::AArch64RegisterBankInfo::AArch64RegisterBankInfo(llvm::TargetRegisterInfo const&)
...
ld.lld: error: undefined symbol: llvm::createAArch64InstructionSelector(llvm::AArch64TargetMachine const&, llvm::AArch64Subtarget&, llvm::AArch64RegisterBankInfo&)
...
ld.lld: error: undefined symbol: llvm::initializeAArch64PreLegalizerCombinerPass(llvm::PassRegistry&)
...
ld.lld: error: undefined symbol: llvm::initializeAArch64PostLegalizerCombinerPass(llvm::PassRegistry&)
...
ld.lld: error: undefined symbol: llvm::createAArch64PreLegalizeCombiner(bool)
...
ld.lld: error: undefined symbol: llvm::createAArch64PostLegalizeCombiner(bool)
...
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Mauro Rossi [Fri, 24 Jul 2020 22:20:20 +0000 (00:20 +0200)]
android: [AArch64][GlobalISel] Add a post-legalizer combiner with a very simple combine.
Port to Android.bp of commit
49a4f3f7d88f61a81279de3d4e1c734ab0363228
"[AArch64][GlobalISel] Add a post-legalizer combiner with a very simple combine."
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Mauro Rossi [Fri, 24 Jul 2020 19:37:07 +0000 (21:37 +0200)]
android: [openmp] add support for tablegen generated sources
Porting to Android.bp of the following commits:
d90443b1d93 "[openmp] Base of tablegen generated OpenMP common declaration"
1a70077b5a6 "[openmp] Move Directive and Clause helper function to tablegen"
943660fd15f "[openmp] Remove OMPConstants.cpp and replace it by OMP.cpp generated by tablegen"
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Mauro Rossi [Fri, 24 Jul 2020 00:30:35 +0000 (02:30 +0200)]
android: add genrule "llvm-gen-extension" for llvm/Support/Extension.def
Based on llvm/utils/gn/secondary/llvm/include/llvm/Support/BUILD.gn rules
Fixes the following building error:
external/llvm-project/llvm/lib/LTO/LTOBackend.cpp:134:10:
fatal error: 'llvm/Support/Extension.def' file not found
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Mauro Rossi [Thu, 23 Jul 2020 23:28:05 +0000 (01:28 +0200)]
android: lib/Analysis: add explicit list of sources
After commit
bdceefe95ba ("[llvm] Release-mode ML InlineAdvisor")
some sources are built conditionally based on LLVM_HAVE_TF_AOT
To make it simple the explict list of source is expanded
and Release-mode ML InlineAdvisor is kept disable (i.e. not built)
to avoid the following building error:
external/llvm-project/llvm/lib/Analysis/ReleaseModeModelRunner.cpp:18:10:
fatal error: 'InlinerSizeModel.h' file not found
^~~~~~~~~~~~~~~~~~~~
1 error generated.
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Mauro Rossi [Thu, 23 Jul 2020 22:18:48 +0000 (00:18 +0200)]
android: [NFC] Refactor TableGen for attributes
Changes due to commit
cfe87a4a16b ("[NFC] Refactor TableGen for attributes")
Fixes the following buiding error:
error: external/llvm-project/llvm/lib/IR/Android.bp:10:1: module "llvm-gen-core":
module source path "external/llvm-project/llvm/lib/IR/AttributesCompatFunc.td" does not exist
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Mauro Rossi [Sun, 3 Feb 2019 07:28:46 +0000 (08:28 +0100)]
android: update version in {config,llvm-config}.h headers
Version information is set to 11.0.0
Mauro Rossi [Fri, 24 Jul 2020 23:06:37 +0000 (01:06 +0200)]
android: AMDGPU/GlobalISel: fix tablegen rules
AMDGPU/GlobalISel requires separated "llvm-gen-amdgpuisel" llvm_tblgen rules
and the file "AMDGPUGISel.td" is used to generate "AMDGPUGenGlobalISel.inc"
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Mauro Rossi [Fri, 13 Mar 2020 20:00:52 +0000 (21:00 +0100)]
android: llvm/soong: update pkgPath
With llvm-project monorepo 'external/llvm-project/llvm' replaces 'external/llvm'
pkgPath is updated to "android/soong/external/llvm-project/llvm"
Mauro Rossi [Fri, 21 Feb 2020 23:52:42 +0000 (00:52 +0100)]
android: add support for libLLVMOrcError
Fixes the following building errors:
ld.lld: error: undefined symbol: llvm::orc::orcError(llvm::orc::OrcErrorCode)
...
ld.lld: error: undefined symbol: llvm::orc::DuplicateDefinition::DuplicateDefinition(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
Mauro Rossi [Fri, 21 Feb 2020 23:50:29 +0000 (00:50 +0100)]
android: add support for libLLVMCFGuard
Fixes the following building error:
ld.lld: error: undefined symbol: llvm::createCFGuardDispatchPass()
Mauro Rossi [Fri, 21 Feb 2020 23:46:54 +0000 (00:46 +0100)]
android: [IR] Split out target specific intrinsic enums into separate headers
Changes due to commit
5d986953c8b9
("[IR] Split out target specific intrinsic enums into separate headers")
Mauro Rossi [Wed, 21 Feb 2018 17:53:12 +0000 (19:53 +0200)]
android: [TableGen] Remove unused target intrinsic generation logic
Changes due to commit
72c68f1352ba
("[TableGen] Remove unused target intrinsic generation logic")
Mauro Rossi [Wed, 21 Feb 2018 17:50:12 +0000 (19:50 +0200)]
android: llvm/tblgen: update include paths for llvm-project
With llvm-project monorepo 'external/llvm-project/llvm' replaces 'external/llvm'
Mauro Rossi [Fri, 21 Feb 2020 23:37:30 +0000 (00:37 +0100)]
android: add Android.bp for llvm-project
A root Android.bp file is needed to build llvm sub-project
Mauro Rossi [Sun, 9 Feb 2020 19:49:28 +0000 (20:49 +0100)]
android: add support for libLLVMTextAPI
Fixes the following building errors:
external/llvm/include/llvm/TextAPI/MachO/Symbol.h:66: error: undefined reference to
'llvm::MachO::mapToArchitectureSet(llvm::ArrayRef<llvm::MachO::Target>)'
external/llvm/include/llvm/TextAPI/MachO/InterfaceFile.h:191: error: undefined reference to
'llvm::MachO::mapToPlatformSet(llvm::ArrayRef<llvm::MachO::Target>)'
external/llvm/lib/Object/TapiUniversal.cpp:25: error: undefined reference to
'llvm::MachO::TextAPIReader::get(llvm::MemoryBufferRef)'
external/llvm/include/llvm/TextAPI/MachO/InterfaceFile.h:185: error: undefined reference to
'llvm::MachO::mapToArchitectureSet(llvm::ArrayRef<llvm::MachO::Target>)'
Mauro Rossi [Sun, 9 Feb 2020 19:44:13 +0000 (20:44 +0100)]
android: tblgen: generate AArch64GenGICombiner.inc
Fixes the following building error:
external/llvm/lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp:31:10:
fatal error: 'AArch64GenGICombiner.inc' file not found
^~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Mauro Rossi [Sun, 9 Feb 2020 19:40:44 +0000 (20:40 +0100)]
android: add support for libLLVMTableGenGlobalISel
Fixes the following building error:
external/llvm/utils/TableGen/GlobalISel/CodeExpander.h:50:
error: undefined reference to 'llvm::CodeExpander::emit(llvm::raw_ostream&) const'
Mauro Rossi [Sun, 9 Feb 2020 12:46:34 +0000 (13:46 +0100)]
android: build with C++14 support
Fixes the following building errors:
In file included from external/llvm10/lib/Support/AArch64TargetParser.cpp:14:
In file included from external/llvm10/include/llvm/Support/AArch64TargetParser.h:17:
In file included from external/llvm10/include/llvm/ADT/StringRef.h:12:
external/llvm10/include/llvm/ADT/STLExtras.h:555:49: error: no template named 'index_sequence' in namespace 'std'
template <size_t... Ns> value_type deref(std::index_sequence<Ns...>) const {
~~~~~^
external/llvm10/include/llvm/ADT/STLExtras.h:560:36: error: no template named 'index_sequence' in namespace 'std'
decltype(iterators) tup_inc(std::index_sequence<Ns...>) const {
~~~~~^
external/llvm10/include/llvm/ADT/STLExtras.h:565:36: error: no template named 'index_sequence' in namespace 'std'
decltype(iterators) tup_dec(std::index_sequence<Ns...>) const {
~~~~~^
external/llvm10/include/llvm/ADT/STLExtras.h:572:46: error: no member named 'index_sequence_for' in namespace 'std'
value_type operator*() { return deref(std::index_sequence_for<Iters...>{}); }
~~~~~^
external/llvm10/include/llvm/ADT/STLExtras.h:572:65: error: 'Iters' does not refer to a value
value_type operator*() { return deref(std::index_sequence_for<Iters...>{}); }
^
external/llvm10/include/llvm/ADT/STLExtras.h:547:41: note: declared here
template <typename ZipType, typename... Iters>
^
external/llvm10/include/llvm/ADT/STLExtras.h:575:23: error: no member named 'index_sequence_for' in namespace 'std'
return deref(std::index_sequence_for<Iters...>{});
~~~~~^
external/llvm10/include/llvm/ADT/STLExtras.h:575:42: error: 'Iters' does not refer to a value
return deref(std::index_sequence_for<Iters...>{});
^
external/llvm10/include/llvm/ADT/STLExtras.h:547:41: note: declared here
template <typename ZipType, typename... Iters>
^
external/llvm10/include/llvm/ADT/STLExtras.h:579:30: error: no member named 'index_sequence_for' in namespace 'std'
iterators = tup_inc(std::index_sequence_for<Iters...>{});
~~~~~^
external/llvm10/include/llvm/ADT/STLExtras.h:579:49: error: 'Iters' does not refer to a value
iterators = tup_inc(std::index_sequence_for<Iters...>{});
^
external/llvm10/include/llvm/ADT/STLExtras.h:547:41: note: declared here
template <typename ZipType, typename... Iters>
^
external/llvm10/include/llvm/ADT/STLExtras.h:586:30: error: no member named 'index_sequence_for' in namespace 'std'
iterators = tup_dec(std::index_sequence_for<Iters...>{});
~~~~~^
external/llvm10/include/llvm/ADT/STLExtras.h:586:49: error: 'Iters' does not refer to a value
iterators = tup_dec(std::index_sequence_for<Iters...>{});
^
external/llvm10/include/llvm/ADT/STLExtras.h:547:41: note: declared here
template <typename ZipType, typename... Iters>
^
external/llvm10/include/llvm/ADT/STLExtras.h:606:18: error: no template named 'index_sequence' in namespace 'std'
std::index_sequence<Ns...>) const {
~~~~~^
external/llvm10/include/llvm/ADT/STLExtras.h:618:30: error: no member named 'index_sequence_for' in namespace 'std'
return !test(other, std::index_sequence_for<Iters...>{});
~~~~~^
external/llvm10/include/llvm/ADT/STLExtras.h:618:49: error: 'Iters' does not refer to a value
return !test(other, std::index_sequence_for<Iters...>{});
^
external/llvm10/include/llvm/ADT/STLExtras.h:602:23: note: declared here
template <typename... Iters>
^
external/llvm10/include/llvm/ADT/STLExtras.h:635:28: error: no template named 'index_sequence' in namespace 'std'
iterator begin_impl(std::index_sequence<Ns...>) const {
~~~~~^
external/llvm10/include/llvm/ADT/STLExtras.h:638:50: error: no template named 'index_sequence' in namespace 'std'
template <size_t... Ns> iterator end_impl(std::index_sequence<Ns...>) const {
~~~~~^
external/llvm10/include/llvm/ADT/STLExtras.h:646:28: error: no member named 'index_sequence_for' in namespace 'std'
return begin_impl(std::index_sequence_for<Args...>{});
~~~~~^
external/llvm10/include/llvm/ADT/STLExtras.h:646:47: error: 'Args' does not refer to a value
return begin_impl(std::index_sequence_for<Args...>{});
^
external/llvm10/include/llvm/ADT/STLExtras.h:622:60: note: declared here
template <template <typename...> class ItType, typename... Args> class zippy {
^
external/llvm10/include/llvm/ADT/STLExtras.h:648:47: error: no member named 'index_sequence_for' in namespace 'std'
iterator end() const { return end_impl(std::index_sequence_for<Args...>{}); }
~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Mauro Rossi [Sun, 3 Feb 2019 07:28:46 +0000 (08:28 +0100)]
android: update version in {config,llvm-config}.h headers
Version information is set to 10.0.0
Mauro Rossi [Sun, 9 Feb 2020 10:23:43 +0000 (11:23 +0100)]
android: add 'Restat: true' to tblgenRule definition
Based on suggestion by Colin Cross, to avoid unnecessary rebuild of llvm
in case of *.inc generated sources older than llvm-tblgen binary.
When llvm-tblgen binary is compiled and for some reason the build is interrupted,
the generated *.inc files will have a timestamp older than llvm-tblgen binary,
at this point all libLLVM* targets depending on the *.inc files are always rebuilt.
'NINJA_ARGS="-d explain" make iso_img' command revealed the cause of the problem:
ninja explain: output out/soong/.intermediates/external/llvm/llvm-gen-attributes/gen/llvm/IR/Attributes.inc
older than most recent input out/soong/host/linux-x86/bin/llvm-tblgen (
1570914978 vs
1575285173)
ninja explain: out/soong/.intermediates/external/llvm/llvm-gen-attributes/gen/llvm/IR/Attributes.inc is dirty
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Mauro Rossi [Sun, 3 Feb 2019 07:28:46 +0000 (08:28 +0100)]
android: update version in {config,llvm-config}.h headers
Version information is set to 9.0.0
Mauro Rossi [Sat, 5 Oct 2019 06:58:42 +0000 (08:58 +0200)]
android: Bitstream: add support for libLLVMBitstreamReader
To avoid following building errors:
external/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp:570: error: undefined reference to 'llvm::BitstreamCursor::ReadBlockInfoBlock(bool)'
external/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp:747: error: undefined reference to 'llvm::BitstreamCursor::EnterSubBlock(unsigned int, unsigned int*)'
...
external/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp:974: error: undefined reference to 'llvm::BitstreamCursor::skipRecord(unsigned int)'
external/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp:819: error: undefined reference to 'llvm::BitstreamCursor::ReadAbbrevRecord()'
external/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp:831: error: undefined reference to 'llvm::BitstreamCursor::readRecord(unsigned int, llvm::SmallVectorImpl<unsigned long long>&, llvm::StringRef*)'
...
external/llvm/lib/Bitcode/Reader/BitcodeReader.cpp:6402: error: undefined reference to 'llvm::BitstreamCursor::skipRecord(unsigned int)'
external/llvm/lib/Bitcode/Reader/BitcodeReader.cpp:6252: error: undefined reference to 'llvm::BitstreamCursor::EnterSubBlock(unsigned int, unsigned int*)'
external/llvm/lib/Bitcode/Reader/BitcodeReader.cpp:6278: error: undefined reference to 'llvm::BitstreamCursor::readRecord(unsigned int, llvm::SmallVectorImpl<unsigned long long>&, llvm::StringRef*)'
...
external/llvm/lib/Bitcode/Reader/BitcodeReader.cpp:3041: error: undefined reference to 'llvm::BitstreamCursor::ReadBlockInfoBlock(bool)'
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)
Mauro Rossi [Sun, 22 Sep 2019 17:52:06 +0000 (19:52 +0200)]
android: Coroutines: add support for libLLVMCoroutines
Fixes the following building error with mesa 19.3 branch:
FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so
...
external/mesa/src/gallium/auxiliary/gallivm/lp_bld_init.c:137: error: undefined reference to 'LLVMAddCoroEarlyPass'
external/mesa/src/gallium/auxiliary/gallivm/lp_bld_init.c:138: error: undefined reference to 'LLVMAddCoroSplitPass'
external/mesa/src/gallium/auxiliary/gallivm/lp_bld_init.c:139: error: undefined reference to 'LLVMAddCoroElidePass'
external/mesa/src/gallium/auxiliary/gallivm/lp_bld_init.c:169: error: undefined reference to 'LLVMAddCoroCleanupPass'
clang.real: error: linker command failed with exit code 1 (use -v to see invocation)
Mauro Rossi [Fri, 20 Sep 2019 19:54:52 +0000 (21:54 +0200)]
android: AMDGPU: add support for Disassembler target
Necessary for the new Valve ACO compiler in mesa 19.3
LLVMInitializeAMDGPUDisassembler() function exposed conditionally
to FORCE_BUILD_AMDGPU macro definition in mesa src/amd/Android.compiler.mk
as per other AMDGPU targets
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Mauro Rossi [Sun, 21 Jul 2019 15:41:25 +0000 (17:41 +0200)]
Android: Fix soong building rules for llvm 9.0
The necessary static dependencies are added for Android blueprint build.
Changelog:
Build libLLVMJITLink static by adding lib/ExecutionEngine/JITLink/Android.bp
Build libLLVMRemarks static by adding lib/Remarks/Android.bp
Add libLLVMMIRParser, libLLVMJITLink and libLLVMRemarks dependencies in ./Android.bp
Fixes the following building errors at linking:
FAILED: out/soong/.intermediates/external/llvm/libLLVM/android_x86_core_shared/libLLVM.so
...
external/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp:1005: error: undefined reference to 'llvm::parseNamedRegisterReference(llvm::PerFunctionMIParsingState&, unsigned int&, llvm::StringRef, llvm::SMDiagnostic&)'
external/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp:1005: error: undefined reference to 'llvm::parseNamedRegisterReference(llvm::PerFunctionMIParsingState&, unsigned int&, llvm::StringRef, llvm::SMDiagnostic&)'
external/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp:1005: error: undefined reference to 'llvm::parseNamedRegisterReference(llvm::PerFunctionMIParsingState&, unsigned int&, llvm::StringRef, llvm::SMDiagnostic&)'
external/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp:1005: error: undefined reference to 'llvm::parseNamedRegisterReference(llvm::PerFunctionMIParsingState&, unsigned int&, llvm::StringRef, llvm::SMDiagnostic&)'
...
external/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1371: error: undefined reference to 'llvm::remarks::StringTable::serialize() const'
external/llvm/lib/IR/DiagnosticInfo.cpp:435: error: undefined reference to 'llvm::remarks::StringTable::add(llvm::StringRef)'
external/llvm/lib/IR/DiagnosticInfo.cpp:436: error: undefined reference to 'llvm::remarks::StringTable::add(llvm::StringRef)'
external/llvm/lib/IR/DiagnosticInfo.cpp:437: error: undefined reference to 'llvm::remarks::StringTable::add(llvm::StringRef)'
external/llvm/lib/IR/DiagnosticInfo.cpp:457: error: undefined reference to 'llvm::remarks::StringTable::add(llvm::StringRef)'
...
external/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp:337: error: undefined reference to 'llvm::jitlink::jitLink(std::__1::unique_ptr<llvm::jitlink::JITLinkContext, std::__1::default_delete<llvm::jitlink::JITLinkContext> >)'
external/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp:422: error: undefined reference to 'llvm::jitlink::createEHFrameRecorderPass(llvm::Triple const&, std::__1::function<void (unsigned long long)>)'
external/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp:444: error: undefined reference to 'llvm::jitlink::registerEHFrameSection(void const*)'
external/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp:457: error: undefined reference to 'llvm::jitlink::deregisterEHFrameSection(void const*)'
external/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp:476: error: undefined reference to 'llvm::jitlink::deregisterEHFrameSection(void const*)'
external/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp:25: error: undefined reference to 'llvm::jitlink::JITLinkContext::~JITLinkContext()'
external/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp:25: error: undefined reference to 'llvm::jitlink::JITLinkContext::~JITLinkContext()'
out/soong/.intermediates/external/llvm/lib/ExecutionEngine/Orc/libLLVMOrcJIT/android_x86_core_static/libLLVMOrcJIT.a(ObjectLinkingLayer.o):ObjectLinkingLayer.cpp:vtable for llvm::orc::ObjectLinkingLayerJITLinkContext: error: undefined reference to 'llvm::jitlink::JITLinkContext::shouldAddDefaultTargetPasses(llvm::Triple const&) const'
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Dan Willemsen [Thu, 22 Feb 2018 02:47:18 +0000 (18:47 -0800)]
Add SourceFileGenerator.GeneratedDeps()
To clean up unnecessary dependencies when using generated headers,
GeneratedDeps() should return a single file from every build entry.
GeneratedSourceFiles() used to be used from this, but now if you create
one build rule with multiple outputs, it's valid to only return a single
output file.
In this case, ModuleBuild is called once per source file, each
outputing a single output file, so all of them still need to be listed.
Bug:
73745773
Test: diff out/soong/build.ninja
Test: diff out/soong/Android-aosp_arm.mk
Test: rm -rf out; m
Change-Id: I073e3be7ecd9545f4002ad94d3da44f1a6652baa
Mauro Rossi [Sat, 23 Feb 2019 12:19:34 +0000 (13:19 +0100)]
android: utils: remove redundant Android.bp
To avoid build errors with pie-x86
Implemented via following commands:
rm utils/count/Android.bp
rm utils/FileCheck/Android.bp
rm utils/yaml-bench/Android.bp
rm utils/not/Android.bp
Mauro Rossi [Sat, 23 Feb 2019 12:16:35 +0000 (13:16 +0100)]
android: tools: remove redundant Android.bp
To avoid build errors in pie-x86 due to collision with external/llvm ones
Implemented via following commands:
cd tools
find . -type f -name 'Android.bp' -exec rm {} +
Mauro Rossi [Sun, 3 Feb 2019 08:16:44 +0000 (09:16 +0100)]
android: config.h: Add option to disable minidumps, default it to off
Porting of commit
7e4b0fae ("Add cmake option to disable minidumps, default it to off")
plus some other options that are to be set on (1) or off (0)
Fixes the following building error:
external/llvm80/lib/Support/Process.cpp:88:35:
error: use of undeclared identifier 'LLVM_ENABLE_CRASH_DUMPS'
static bool coreFilesPrevented = !LLVM_ENABLE_CRASH_DUMPS;
^
1 error generated.
Mauro Rossi [Sun, 3 Feb 2019 07:28:46 +0000 (08:28 +0100)]
android: update version in {config,llvm-config}.h headers
Version information is set to 8.0.0
Chih-Wei Huang [Wed, 12 Sep 2018 11:01:54 +0000 (19:01 +0800)]
Android: fix a possible building error
The .git/logs/HEAD doesn't always exist. In a new created repo, it may
cause the error:
error: external/llvm/Android.bp:157:1: module "llvm-gen-revision": source path external/llvm/.git/logs/HEAD does not exist
Use wildcard to avoid that.
Mauro Rossi [Sat, 8 Sep 2018 16:32:44 +0000 (18:32 +0200)]
android: Support: add genrule for VCSRevision.h header
Cmake build generates the header, in Android blueprint we need to add
a new "llvm-gen-revision" genrule to launch command script that will
generate "llvm/Support/VCSRevision.h" header.
For simplification the new genrule is added to "llvm-headers" library
which is already used to generate attributes and intrinsics headers.
Mesa python script git_sha1_gen.py is added to external/llvm top path,
with the only changes being the relative git_dir path at line 16 that
is changed from '..' to '.' and the content of generated header.
Mauro Rossi [Sat, 1 Sep 2018 16:36:23 +0000 (18:36 +0200)]
android: AMDGPU: Make getTgtMemIntrinsic table-driven for resource-based intrinsics
Reference:
e821893513
("AMDGPU: Make getTgtMemIntrinsic table-driven for resource-based intrinsics")
Mauro Rossi [Sat, 1 Sep 2018 15:52:18 +0000 (17:52 +0200)]
android: Add a Microsoft Demangler.
Reference:
42e40ea33e ("Add a Microsoft Demangler.")
Mauro Rossi [Sat, 1 Sep 2018 15:43:50 +0000 (17:43 +0200)]
android: [InstCombine] Introducing Aggressive Instruction Combine pass
Reference:
594d89a614
[InstCombine] Introducing Aggressive Instruction Combine pass (-aggressive-instcombine).
Mauro Rossi [Sat, 1 Sep 2018 15:24:18 +0000 (17:24 +0200)]
android: InstCombine: add support for InstCombineTable.inc TableGen rules
Reference:
commit
7f7cea5306
("InstCombine/AMDGPU: Add dimension-aware image intrinsics to SimplifyDemanded")
Mauro Rossi [Sat, 1 Sep 2018 16:27:47 +0000 (18:27 +0200)]
android: AMDGPU: Separate R600 and GCN TableGen files
Reference:
cba2181e77 ("AMDGPU: Separate R600 and GCN TableGen files")
Mauro Rossi [Sat, 1 Sep 2018 14:24:14 +0000 (16:24 +0200)]
android: [IR] Split Intrinsics.inc into enums and implementations
Reference:
af7c445 ("[IR] Split Intrinsics.inc into enums and implementations")
Mauro Rossi [Sat, 1 Sep 2018 14:10:24 +0000 (16:10 +0200)]
android: Rename {Attributes,Intrinsics}.gen to {Attributes,Intrinsics}.inc
Reference:
ea0775ec4a ("Rename Attributes.gen, Intrinsics.gen to Attributes.inc, Intrinsics.inc")
Mauro Rossi [Sat, 1 Sep 2018 11:25:45 +0000 (13:25 +0200)]
android: [ARM] Unify handling of M-Class system registers
Reference:
683224ecbd ("[ARM] Unify handling of M-Class system registers")
Mauro Rossi [Sat, 1 Sep 2018 02:03:27 +0000 (04:03 +0200)]
android: [mips][rtdyld] Move MIPS relocation resolution to a subclass
Reference:
2762dbad70
"[mips][rtdyld] Move MIPS relocation resolution to a subclass and implment N32 relocations"
Mauro Rossi [Sat, 1 Sep 2018 01:49:03 +0000 (03:49 +0200)]
android: [PM] Create a separate library for high-level pass management code.
Reference:
2349136630 ("[PM] Create a separate library for high-level pass management code.")
Mauro Rossi [Sat, 1 Sep 2018 01:24:26 +0000 (03:24 +0200)]
android: [MSF] add support for libLLVMDebugInfoMSF
Reference:
5e117855c3 ([msf] Resubmit "Rename Msf -> MSF".)
Mauro Rossi [Sat, 1 Sep 2018 01:22:37 +0000 (03:22 +0200)]
android: NFC: Rename (PDB) RawSession to NativeSession
Reference:
11e1d83ce5 ("NFC: Rename (PDB) RawSession to NativeSession")
Mauro Rossi [Sat, 1 Sep 2018 00:36:45 +0000 (02:36 +0200)]
android: Move Object format code to lib/BinaryFormat.
Reference:
19ca2b0f9d ("Move Object format code to lib/BinaryFormat.")
Mauro Rossi [Fri, 31 Aug 2018 23:48:08 +0000 (01:48 +0200)]
android: [X86][GlobalISel] Initial implementation , select G_ADD gpr, gpr
Reference:
8ae3570fa804
("[X86][GlobalISel] Initial implementation , select G_ADD gpr, gpr")
Mauro Rossi [Fri, 31 Aug 2018 23:45:32 +0000 (01:45 +0200)]
android: [X86][AVX512] Adding new LLVM TableGen for EVEX2VEX tables
Reference:
b59d8041db [X86][AVX512] Adding new LLVM TableGen backend which
generates the EVEX2VEX compressing tables.
Mauro Rossi [Fri, 31 Aug 2018 23:23:04 +0000 (01:23 +0200)]
android: [X86][GlobalISel] Add general-purpose Register Bank
Reference:
f4df3d44a5 ("[X86][GlobalISel] Add general-purpose Register Bank")
Mauro Rossi [Fri, 31 Aug 2018 23:11:05 +0000 (01:11 +0200)]
android: [ARM] GlobalISel: Use TableGen instruction selector
Reference:
33dd8eaf5d ("[ARM] GlobalISel: Use TableGen instruction selector")
Mauro Rossi [Fri, 31 Aug 2018 22:51:14 +0000 (00:51 +0200)]
android: [ARM] Tablegen-erate current Register Bank Information.
Reference:
e0fd89875d
("[globalisel][arm] Tablegen-erate current Register Bank Information.")
Mauro Rossi [Fri, 31 Aug 2018 22:47:29 +0000 (00:47 +0200)]
android: AMDGPU: Support using tablegened MC pseudo expansions
Reference:
5991ecc3e6 ("AMDGPU: Support using tablegened MC pseudo expansions")
Mauro Rossi [Fri, 31 Aug 2018 20:55:52 +0000 (22:55 +0200)]
android: IR: Rename the tablegen'd Attributes file to .gen
Reference:
e255157a48 ("IR: Rename the tablegen'd Attributes file to .gen")
Mauro Rossi [Sat, 25 Aug 2018 21:45:24 +0000 (23:45 +0200)]
android: Aarch64,AMDGPU: enable GlobalISel
Reference commits:
8097fcb40b ("[GlobalISel] Add basic Selector-emitter tblgen backend.")
ca24065b98 ("[globalisel] Tablegen-erate current Register Bank Information")
945c85d877 ("AMDGPU/GlobalISel: Add support for simple shaders")
Mauro Rossi [Sat, 25 Aug 2018 18:03:29 +0000 (20:03 +0200)]
android: add llvm/Config/abi-breaking.h header for host and device
Fixes the following building error:
external/llvm/include/llvm/Support/Error.h:21:10:
fatal error: 'llvm/Config/abi-breaking.h' file not found
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Mauro Rossi [Sat, 25 Aug 2018 17:59:34 +0000 (19:59 +0200)]
android: add llvm/Config/llvm-platform-config.h header
Fixes the following building error:
In file included from external/llvm70bp/lib/Support/LockFileManager.cpp:10:
In file included from external/llvm/include/llvm/Support/LockFileManager.h:12:
In file included from external/llvm/include/llvm/ADT/Optional.h:20:
In file included from external/llvm/include/llvm/Support/AlignOf.h:17:
In file included from external/llvm/include/llvm/Support/Compiler.h:18:
external/llvm/device/include/llvm/Config/llvm-config.h:98:10:
fatal error: 'llvm/Config/llvm-platform-config.h' file not found
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Mauro Rossi [Sat, 25 Aug 2018 14:50:30 +0000 (16:50 +0200)]
android: Moving libFuzzer from LLVM to compiler-rt.
Reference:
ec925a2578 ("Moving libFuzzer from LLVM to compiler-rt.")
Mauro Rossi [Sat, 25 Aug 2018 17:58:03 +0000 (19:58 +0200)]
android: Move lib/LibDriver -> lib/ToolDrivers/llvm-lib. NFCI.
Reference:
a844915ce0 ("Move lib/LibDriver -> lib/ToolDrivers/llvm-lib. NFCI.")
Mauro Rossi [Sat, 25 Aug 2018 11:23:34 +0000 (13:23 +0200)]
DO NOT MERGE: util: build only TableGen
Necessary to avoid collisions with external/llvm utils
Mauro Rossi [Sat, 25 Aug 2018 10:59:12 +0000 (12:59 +0200)]
DO NOT MERGE: android: avoid re-building tools
Necessary to avoid Android Build System targets conflicts with external/llvm
Mauro Rossi [Sat, 25 Aug 2018 10:50:12 +0000 (12:50 +0200)]
android: update version in {config,llvm-config}.h headers
Version information is set to 7.0.0
Mauro Rossi [Sat, 25 Aug 2018 10:44:44 +0000 (12:44 +0200)]
android: add soong building rules
Android.bp and building rules including Android specific .go files
are imported from oreo-x86 llvm 3.9 branch to the release_70 branch
cd ~/oreo-x86_kernel/external
git clone https://github.com/llvm-mirror/llvm llvm70
cd ~/oreo-x86_kernel/external/llvm70
git reset --hard
git fetch llvm-mirror release_70
git checkout FETCH_HEAD
git clean -dxf
cd ~/oreo-x86_kernel/external/llvm
find . -name 'Android.bp' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'Android.bp' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;
find . -name 'llvm.go' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'llvm.go' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;
find . -name 'tblgen.go' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'tblgen.go' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;
find . -name 'android_test.sh' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'android_test.sh' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;
find . -name 'AsmParsers.def' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'AsmParsers.def' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;
find . -name 'AsmPrinters.def' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'AsmPrinters.def' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;
find . -name 'Disassemblers.def' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'Disassemblers.def' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;
find . -name 'Targets.def' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'Targets.def' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;
find . -name 'config.h' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'config.h' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;
find . -name 'llvm-config.h' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'llvm-config.h' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;
cd ~/oreo-x86_kernel/external/llvm70
Tim Northover [Mon, 1 Feb 2021 12:43:33 +0000 (12:43 +0000)]
GlobalISel: check type size before getZExtValue()ing it.
Otherwise getZExtValue() asserts.
(cherry picked from commit
c2b322fc19e829162ed4c7dcd04d9e9b2cd4e66c)
Luboš Luňák [Tue, 6 Apr 2021 16:38:18 +0000 (18:38 +0200)]
remove -fpch-codegen and -fpch-debuginfo from Clang 12.0 release notes
These were new in 11.0. The commit adding the options landed after
11.x branch had already been branched off from master, and only
then backported to 11.x, so the release notes change stayed for 12.0.
Lang Hames [Sun, 28 Mar 2021 23:30:47 +0000 (16:30 -0700)]
[ORC][C-bindings] Fix some ORC C bindings function names and signatures.
LLVMOrcDisposeObjectLayer and LLVMOrcExecutionSessionGetJITDylibByName did not
have matching signatures between the C-API header and binding implementations.
Fixes http://llvm.org/PR49745.
Patch by Mats Larsen. Thanks Mats!
Reviewed by: lhames
Differential Revision: https://reviews.llvm.org/D99478
(cherry picked from commit
666df2e2cbe9fc252d3b2d6cbb214c2c2f6afc65)
LemonBoy [Wed, 17 Mar 2021 15:59:55 +0000 (16:59 +0100)]
[LoopVectorize] Refine hasIrregularType predicate
The `hasIrregularType` predicate checks whether an array of N values of type Ty is "bitcast-compatible" with a <N x Ty> vector.
The previous check returned invalid results in some cases where there's some padding between the array elements: eg. a 4-element array of u7 values is considered as compatible with <4 x u7>, even though the vector is only loading/storing 28 bits instead of 32.
The problem causes LLVM to generate incorrect code for some targets: for AArch64 the vector loads/stores are lowered in terms of ubfx/bfi, effectively losing the top (N * padding bits).
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D97465
(cherry picked from commit
4f024938e4c932feba4d28573ec4522106f8d879)
ShihPo Hung [Tue, 30 Mar 2021 21:30:15 +0000 (14:30 -0700)]
[RISCV][MC] Fix nf encoding for vector ld/st whole register
The three bit nf is one less than the number of NFIELDS,
so we manually decrement 1 for VS1/2/4/8R & VL1/2/4/8R.
Differential revision: https://reviews.llvm.org/D98185
(cherry picked from commit rG5cdb2e98608bf57c216ee7067e8a12d070c9e2bd)
Sanjay Patel [Sat, 13 Mar 2021 13:26:27 +0000 (08:26 -0500)]
[InstCombine] avoid creating an extra instruction in zext fold and possible inf-loop
The structure of this fold is suspect vs. most of instcombine
because it creates instructions and tries to delete them
immediately after.
If we don't have the operand types for the icmps, then we are
not behaving as assumed. And as shown in PR49475, we can inf-loop.
(cherry picked from commit
4224a36957420744756d6a6450eb6502a1bfadc3)
Sanjay Patel [Fri, 12 Mar 2021 19:15:27 +0000 (14:15 -0500)]
[InstCombine] add test for zext-of-icmps; NFC
PR49475 shows an infinite loop outcome, but this
tries to show the root cause with a minimal test.
(cherry picked from commit
579b8fc2e97c489308f97b01d13d894c03c0a16c)
Nikita Popov [Sun, 14 Mar 2021 15:47:41 +0000 (16:47 +0100)]
[X86][FastISel] Fix with.overflow eflags clobber (PR49587)
If the successor block has a phi node, then additional moves may
be inserted into predecessors, which may clobber eflags. Don't try
to fold the with.overflow result into the branch in that case.
This is done by explicitly checking for any phis in successor
blocks, not sure if there's some more principled way to address
this. Other fused compare and branch patterns avoid the issue by
emitting the comparison when handling the branch, so that no
instructions may be inserted in between. In this case, the
with.overflow call is emitted separately (and I don't think this
is avoidable, as it will generally have at least two users).
Fixes https://bugs.llvm.org/show_bug.cgi?id=49587.
Differential Revision: https://reviews.llvm.org/D98600
(cherry picked from commit
7669455df49e6fc8ae7d9f4bd4ee95bb20e7eb6e)
Nikita Popov [Sun, 14 Mar 2021 15:39:03 +0000 (16:39 +0100)]
[X86] Add test for PR49587 (NFC)
Shows a miscompile with FastISel.
(cherry picked from commit
0d814ca0f02733d6581bf209fadbebf3035380e0)
Nikita Popov [Sun, 7 Mar 2021 16:27:22 +0000 (17:27 +0100)]
[FastISel] Don't trivially kill extractvalues (PR49467)
All extractvalues of the same value at the same index will map to
the same register, so even if one specific extractvalue only has
one use, we should not mark it as a trivial kill, as there may be
more extractvalues later.
Fixes https://bugs.llvm.org/show_bug.cgi?id=49467.
Differential Revision: https://reviews.llvm.org/D98145
(cherry picked from commit
55ae279ba7a5905f39ce3ae79eac7834a4a134cc)
Joseph Huber [Wed, 10 Mar 2021 18:25:33 +0000 (13:25 -0500)]
[OpenMP] Restore backwards compatibility for libomptarget
Summary:
The changes introduced in D87946 changed the API for libomptarget
functions. `__kmpc_push_target_tripcount` was a function in Clang 11.x
but was not given a backward-compatible interface. This change will
require people using Clang 13.x or 12.x to recompile their offloading
programs.
Reviewed By: jdoerfert cchen
Differential Revision: https://reviews.llvm.org/D98358
(cherry picked from commit
807466ef28125cf7268c860b09d5563c9c93602a)
Nikita Popov [Wed, 10 Mar 2021 13:37:09 +0000 (14:37 +0100)]
[PowerPC] Fix infinite loop in peephole CR optimization (PR49509)
If we encounter a degenerate select node where both operands are
the same, then we can continue negating the condition while swapping
operands, resulting in an infinite loop. Avoid this by bailing out
if both operands are the same.
Fixes https://bugs.llvm.org/show_bug.cgi?id=49509.
Differential Revision: https://reviews.llvm.org/D98340
(cherry picked from commit
2489cbaa8057c736475fd88990f4f6dbf022873d)
Shilei Tian [Thu, 18 Mar 2021 22:25:21 +0000 (18:25 -0400)]
[OpenMP] Fixed a crash in hidden helper thread
It is reported that after enabling hidden helper thread, the program
can hit the assertion `new_gtid < __kmp_threads_capacity` sometimes. The root
cause is explained as follows. Let's say the default `__kmp_threads_capacity` is
`N`. If hidden helper thread is enabled, `__kmp_threads_capacity` will be offset
to `N+8` by default. If the number of threads we need exceeds `N+8`, e.g. via
`num_threads` clause, we need to expand `__kmp_threads`. In
`__kmp_expand_threads`, the expansion starts from `__kmp_threads_capacity`, and
repeatedly doubling it until the new capacity meets the requirement. Let's
assume the new requirement is `Y`. If `Y` happens to meet the constraint
`(N+8)*2^X=Y` where `X` is the number of iterations, the new capacity is not
enough because we have 8 slots for hidden helper threads.
Here is an example.
```
#include <vector>
int main(int argc, char *argv[]) {
constexpr const size_t N = 1344;
std::vector<int> data(N);
#pragma omp parallel for
for (unsigned i = 0; i < N; ++i) {
data[i] = i;
}
#pragma omp parallel for num_threads(N)
for (unsigned i = 0; i < N; ++i) {
data[i] += i;
}
return 0;
}
```
My CPU is 20C40T, then `__kmp_threads_capacity` is 160. After offset,
`__kmp_threads_capacity` becomes 168. `1344 = (160+8)*2^3`, then the assertions
hit.
Reviewed By: protze.joachim
Differential Revision: https://reviews.llvm.org/D98838
(cherry picked from commit
2df65f87c1ea81008768e14522e5d9277234ba70)
Sanjay Patel [Fri, 12 Mar 2021 12:56:54 +0000 (07:56 -0500)]
[SimplifyCFG] avoid sinking insts within an infinite-loop
The test is reduced from a C source example in:
https://llvm.org/PR49541
It's possible that the test could be reduced further or
the predicate generalized further, but it seems to require
a few ingredients (including the "late" SimplifyCFG options
on the RUN line) to fall into the infinite-loop trap.
(cherry picked from commit
bd197ed0a57a82187ed3c6265ca811d412acfaef)
Alexandre Ganea [Wed, 24 Mar 2021 16:28:00 +0000 (12:28 -0400)]
[Support] Fix 'keeping' temporary files on Windows 7
As reported here: https://bugs.llvm.org/show_bug.cgi?id=48378#c0
and here: https://github.com/rust-lang/rust/issues/81051
since
79657e2339b58bc01fe1b85a448bb073d57d90bb, some programs such as llvm-ar
don't work properly on Windows 7.
The issue is shown in the snippet by Oleksandr Prodan:
https://pastebin.com/v51m3uBU
In essence, once the 'DeleteFile' flag has been set on FILE_DISPOSITION_INFO,
the file path can't be queried anymore with GetFinalPathNameByHandleW. This
however works on Windows 10, GetFinalPathNameByHandleW would return sucessfully.
To workaround the issue, we simply reset the 'DeleteFile' flag before even
checking if we're dealing with a network file.
Tested with `llvm-ar r empty.a a.obj` ran on a network mount. At the moment, we
cannot specifically add a test coverage for this, since it requres mounting a
network drive.
(cherry picked from commit
64ab2b6825c5aeae6e4afa7ef0829b89a6828102)
Maxim Kuvyrkov [Fri, 19 Mar 2021 13:37:19 +0000 (13:37 +0000)]
[WoA][MSVC] Use default linker setting in MSVC-compatible driver [take 2]
At the moment "link.exe" is hard-coded as default linker in MSVC.cpp,
so there's no way to use LLD as default linker for MSVC driver.
This patch adds checking of CLANG_DEFAULT_LINKER to MSVC.cpp and
updates unit-tests that expect link.exe linker to explicitly select it
via -fuse-ld=link, so that buildbots and other builds that set
-DCLANG_DEFAULT_LINKER=foobar don't fail these tests.
This is a squash of
- https://reviews.llvm.org/D98493 (MSVC.cpp change) and
- https://reviews.llvm.org/D98862 (unit-tests change)
Fixes https://bugs.llvm.org/show_bug.cgi?id=49624
Reviewed By: maxim-kuvyrkov
Differential Revision: https://reviews.llvm.org/D98935
(cherry-picked from commit
2049fe58903b68f66872a18e608f40e5233b55fb)
Maxim Kuvyrkov [Thu, 18 Mar 2021 16:08:58 +0000 (16:08 +0000)]
[aarch64][WOA64][docs] Release note for WoA-hosted LLVM 12 binary
Reviewed By: peterwaller-arm
Differential Revision: https://reviews.llvm.org/D98415
Anastasia Stulova [Tue, 16 Mar 2021 12:07:15 +0000 (12:07 +0000)]
[OpenCL][Docs] Release notes
Differential Revision: https://reviews.llvm.org/D98076
Amilendra Kodithuwakku [Fri, 12 Mar 2021 20:03:23 +0000 (20:03 +0000)]
[release][docs] List all cores Arm has added support for in LLVM 12.
Add new-line before sub-list for proper rendering.
Differential Revision: https://reviews.llvm.org/D98277
Amilendra Kodithuwakku [Fri, 12 Mar 2021 19:19:29 +0000 (19:19 +0000)]
[release][docs] List all cores Arm has added support for in LLVM 12.
Reviewed By: kristof.beyls
Differential Revision: https://reviews.llvm.org/D98277
Raul Tambre [Sat, 6 Mar 2021 09:45:57 +0000 (11:45 +0200)]
[CMake][compiler-rt] Use copying instead of symlinking for LSE builtins on non-Unix-likes
As reported in D93278 post-review symlinking requires privilege escalation on Windows.
Copying is functionally same, so fallback to it for systems that aren't Unix-like.
This is similar to the solution in AddLLVM.cmake.
Reviewed By: ikudrin
Differential Revision: https://reviews.llvm.org/D98111
(cherry picked from commit
ba860963b156db3b653c67ef044df877f3cea9cc)
Craig Topper [Fri, 5 Mar 2021 06:30:38 +0000 (22:30 -0800)]
[TargetLowering] Use HandleSDNodes to prevent nodes from being deleted by recursive calls in getNegatedExpression.
For binary or ternary ops we call getNegatedExpression multiple
times and then compare costs. While we're doing this we need to
hold a node from the first call across the second call, but its
not yet attached to the DAG. Its possible the second call creates
an identical node and then decides it didn't need it so will try
to delete it if it has no uses. This can cause a reference to the
node we're holding further up the call stack to become invalidated.
To prevent this, we can use a HandleSDNode to artifically give
the node a use without connecting it to the DAG.
I've used a std::list of HandleSDNodes so we can create handles
only when we have a node to hold. HandleSDNode does not have
default constructor and cannot be copied or moved.
Fixes PR49393.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D97914
(cherry picked from commit
74e6030bcbcc8e628f9a99a424342a0c656456f9)
Juneyoung Lee [Tue, 9 Feb 2021 05:06:17 +0000 (14:06 +0900)]
[LoopVectorize] Fix VPRecipeBuilder::createEdgeMask to correctly generate the mask
This patch fixes pr48832 by correctly generating the mask when a poison value is involved.
Consider this CFG (which is a part of the input):
```
for.body: ; preds = %for.cond
br i1 true, label %cond.false, label %land.rhs
land.rhs: ; preds = %for.body
br i1 poison, label %cond.end, label %cond.false
cond.false: ; preds = %for.body, %land.rhs
br label %cond.end
cond.end: ; preds = %land.rhs, %cond.false
%cond = phi i32 [ 0, %cond.false ], [ 1, %land.rhs ]
```
The path for.body -> land.rhs -> cond.end should be taken when 'select i1 false, i1 poison, i1 false' holds (which means it's never taken); but VPRecipeBuilder::createEdgeMask was emitting 'and i1 false, poison' instead.
The former one successfully blocks poison propagation whereas the latter one doesn't, making the condition poison and thus causing the miscompilation.
SimplifyCFG has a similar bug (which didn't expose a real-world bug yet), and a patch for this is also ongoing (see https://reviews.llvm.org/D95026).
Reviewed By: bjope
Differential Revision: https://reviews.llvm.org/D95217
(cherry picked from commit
ed253ef77248d91a15b3a1aa36c0b74bed8ec8af)
Nathan James [Wed, 3 Mar 2021 16:01:12 +0000 (16:01 +0000)]
[clang-tidy] Deprecate readability-deleted-default check
... For removal in next release cycle.
The clang warning that does the same thing is enabled by default and typically emits better diagnostics making this check surplus to requirements.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D97491
(cherry picked from commit
19aefd2d5dc3a8d3b8e81219973828170b7fcd2c)
LemonBoy [Fri, 5 Mar 2021 15:01:45 +0000 (16:01 +0100)]
[AArch64] Legalize horizontal fmax/fmin reductions on f16 vectors
Expand the horizontal reduction during the instruction selection phase, but only if the target doesn't support the full fp16 instruction set.
Fixes https://bugs.llvm.org/show_bug.cgi?id=49401
Reviewed By: aemerson
Differential Revision: https://reviews.llvm.org/D97840
(cherry picked from commit
8725b24c6d4abaa97425e704652a13dacb35fe3f)
Shilei Tian [Wed, 24 Feb 2021 17:37:22 +0000 (12:37 -0500)]
[OpenMP] Fixed a crash when offloading to x86_64 with target nowait
PR#49334 reports a crash when offloading to x86_64 with `target nowait`,
which is caused by referencing a nullptr. The root cause of the issue is, when
pushing a hidden helper task in `__kmp_push_task`, it also maps the gtid to its
shadow gtid, which is wrong.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D97329
(cherry picked from commit
e5da63d5a9ede1fb6d8aa18cfd44533ead128738)
Nikita Popov [Mon, 1 Mar 2021 20:37:26 +0000 (21:37 +0100)]
[GlobalISel] Bail on G_PHI narrowing of odd types (PR48188)
The current narrowing code for G_PHI can only handle the case
where the size is a multiple of the narrow size. If this is not
the case, fall back to SDAG instead of asserting.
Original patch by shepmaster.
Differential Revision: https://reviews.llvm.org/D92446
(cherry picked from commit
c35761db0f078f74550ef56bfc0745c162d76967)
Peyton, Jonathan L [Tue, 2 Mar 2021 13:44:15 +0000 (07:44 -0600)]
[OpenMP] Fix clang-cl build error regarding TSX intrinsics
Fix for https://bugs.llvm.org/show_bug.cgi?id=49339
The CMake check for the RTM intrinsics needs the -mrtm flag to be set
during the test. This way clang-cl correctly detects it has the
_xbegin() intrinsic. Otherwise, the CMake check fails.
Differential Revision: https://reviews.llvm.org/D97413
(cherry picked from commit
e83380fccc2cc9842bdcfd268efddf6fce90544d)
Kirstóf Umann [Fri, 5 Feb 2021 18:57:09 +0000 (19:57 +0100)]
[analyzer] Add 12.0.0 release notes
Differential Revision: https://reviews.llvm.org/D96163
Craig Topper [Sun, 28 Feb 2021 19:23:46 +0000 (11:23 -0800)]
[DAGCombiner][X86] Don't peek through ANDs on the shift amount in matchRotateSub when called from MatchFunnelPosNeg.
Peeking through AND is only valid if the input to both shifts is
the same. If the inputs are different, then the original pattern
ORs the two values when the masked shift amount is 0. This is ok
if the values are the same since the OR would be a NOP which is
why its ok for rotate.
Fixes PR49365 and reverts PR34641
Differential Revision: https://reviews.llvm.org/D97637
(cherry picked from commit
5de09ef02e24d234d9fc0cd1c6dfe18a1bb784b0)
Richard Smith [Mon, 1 Mar 2021 20:17:10 +0000 (12:17 -0800)]
Revert "[c++20] Mark class type NTTPs as done and start defining the feature test macro."
Some of the parts of this work were reverted; stop defining the feature
test macro for now.
This reverts commit
b4c63ef6dd90dba9af26a111c9a78b121c5284b1.
(cherry picked from commit
564f5b0734bd5d265a0046e5ca9d08ae5bc303eb)
Sanjay Patel [Sat, 27 Feb 2021 14:09:03 +0000 (09:09 -0500)]
[SimplifyCFG] avoid illegal phi with both poison and undef
In the example based on:
https://llvm.org/PR49218
...we are crashing because poison is a subclass of undef, so we merge blocks and create:
PHI node has multiple entries for the same basic block with different incoming values!
%k3 = phi i64 [ poison, %entry ], [ %k3, %g ], [ undef, %entry ]
If both poison and undef values are incoming, we soften the poison values to undef.
Differential Revision: https://reviews.llvm.org/D97495
(cherry picked from commit
356cdabd3a9e0ff919ea2c1a35c8706ecb915297)
Sanjay Patel [Sun, 28 Feb 2021 15:17:10 +0000 (10:17 -0500)]
[InstCombine] avoid infinite loop in demanded bits for select
https://llvm.org/PR49205
(cherry picked from commit
9502061bcc86982641772f45b7e7a0eb7437f054)
Shilei Tian [Tue, 23 Feb 2021 18:20:13 +0000 (13:20 -0500)]
[OpenMP][NVPTX] Fixed a compilation error in deviceRTLs caused by unsupported feature in release verion of LLVM
`ptx71` is not supported in release version of LLVM yet. As a result,
the support of CUDA 11.2 and CUDA 11.1 caused a compilation error as mentioned
in D97004. Since the support in D97004 is just a WA for releease, and we'll not
use it in the near future, using `ptx70` for CUDA 11 is feasible.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D97195
(cherry picked from commit
f6c2984a090e78947f75e096d43b476bf2ae73eb)
Pavel Iliin [Thu, 25 Feb 2021 22:51:09 +0000 (22:51 +0000)]
[AArch64][Docs] Release notes 12.x on outline atomics
Description for AArch64 -moutline-atomics, -mno-outline-atomics
options added to release notes.
Differential Revision: https://reviews.llvm.org/D97510
Fangrui Song [Wed, 24 Feb 2021 17:19:23 +0000 (09:19 -0800)]
ReleaseNotes: add lld/ELF notes
Differential Revision: https://reviews.llvm.org/D97113