Revision tags: llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init |
|
#
34b60d8a |
| 26-Jan-2021 |
Fangrui Song <maskray@google.com> |
Add -fbinutils-version= to gate ELF features on the specified binutils version
There are two use cases.
Assembler We have accrued some code gated on MCAsmInfo::useIntegratedAssembler(). Some featu
Add -fbinutils-version= to gate ELF features on the specified binutils version
There are two use cases.
Assembler We have accrued some code gated on MCAsmInfo::useIntegratedAssembler(). Some features are supported by latest GNU as, but we have to use MCAsmInfo::useIntegratedAs() because the newer versions have not been widely adopted (e.g. SHF_LINK_ORDER 'o' and 'unique' linkage in 2.35, --compress-debug-sections= in 2.26).
Linker We want to use features supported only by LLD or very new GNU ld, or don't want to work around older GNU ld. We currently can't represent that "we don't care about old GNU ld". You can find such workarounds in a few other places, e.g. Mips/MipsAsmprinter.cpp PowerPC/PPCTOCRegDeps.cpp X86/X86MCInstrLower.cpp AArch64 TLS workaround for R_AARCH64_TLSLD_MOVW_DTPREL_* (PR ld/18276), R_AARCH64_TLSLE_LDST8_TPREL_LO12 (https://bugs.llvm.org/show_bug.cgi?id=36727 https://sourceware.org/bugzilla/show_bug.cgi?id=22969)
Mixed SHF_LINK_ORDER and non-SHF_LINK_ORDER components (supported by LLD in D84001; GNU ld feature request https://sourceware.org/bugzilla/show_bug.cgi?id=16833 may take a while before available). This feature allows to garbage collect some unused sections (e.g. fragmented .gcc_except_table).
This patch adds `-fbinutils-version=` to clang and `-binutils-version` to llc. It changes one codegen place in SHF_MERGE to demonstrate its usage. `-fbinutils-version=2.35` means the produced object file does not care about GNU ld<2.35 compatibility. When `-fno-integrated-as` is specified, the produced assembly can be consumed by GNU as>=2.35, but older versions may not work.
`-fbinutils-version=none` means that we can use all ELF features, regardless of GNU as/ld support.
Both clang and llc need `parseBinutilsVersion`. Such command line parsing is usually implemented in `llvm/lib/CodeGen/CommandFlags.cpp` (LLVMCodeGen), however, ClangCodeGen does not depend on LLVMCodeGen. So I add `parseBinutilsVersion` to `llvm/lib/Target/TargetMachine.cpp` (LLVMTarget).
Differential Revision: https://reviews.llvm.org/D85474
show more ...
|
Revision tags: llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1 |
|
#
2047c10c |
| 31-Dec-2020 |
Fangrui Song <i@maskray.me> |
[TargetMachine] Drop implied dso_local for definitions in ELF static relocation model/PIE
TargetMachine::shouldAssumeDSOLocal currently implies dso_local for such definitions.
Since clang -fno-pic
[TargetMachine] Drop implied dso_local for definitions in ELF static relocation model/PIE
TargetMachine::shouldAssumeDSOLocal currently implies dso_local for such definitions.
Since clang -fno-pic add the dso_local specifier, we don't need to special case.
show more ...
|
#
2820a2ca |
| 30-Dec-2020 |
Fangrui Song <i@maskray.me> |
Move -fno-semantic-interposition dso_local logic from TargetMachine to Clang CodeGenModule
This simplifies TargetMachine::shouldAssumeDSOLocal and and gives frontend the decision to use dso_local. F
Move -fno-semantic-interposition dso_local logic from TargetMachine to Clang CodeGenModule
This simplifies TargetMachine::shouldAssumeDSOLocal and and gives frontend the decision to use dso_local. For LLVM synthesized functions/globals, they may lose inferred dso_local but such optimizations are probably not very useful.
Note: the hasComdat() condition in canBenefitFromLocalAlias (D77429) may be dead now. (llvm/CodeGen/X86/semantic-interposition-comdat.ll) (Investigate whether we need test coverage when Fuchsia C++ ABI is clearer)
show more ...
|
Revision tags: llvmorg-11.0.1, llvmorg-11.0.1-rc2 |
|
#
467b6699 |
| 06-Dec-2020 |
Fangrui Song <i@maskray.me> |
[TargetMachine] Delete asan workaround
687b83ceabafe81970cd4639e7f0c89036402081 has fixed the X86FastISel bug. We can revert the workaround now. Actually, the commit introduced a bug that ppc64 shou
[TargetMachine] Delete asan workaround
687b83ceabafe81970cd4639e7f0c89036402081 has fixed the X86FastISel bug. We can revert the workaround now. Actually, the commit introduced a bug that ppc64 should be excluded.
show more ...
|
#
a4cadc2d |
| 06-Dec-2020 |
Fangrui Song <i@maskray.me> |
[TargetMachine] Don't imply dso_local for memprof in static relocation model
The workaround is no longer needed with my previous commit to MemProfiler.cpp
|
#
19e7741f |
| 06-Dec-2020 |
Vitaly Buka <vitalybuka@google.com> |
[TargetMachine] Set dso_local for memprof
Similar to 5582a7987662a92eda5d883b88fc4586e755acf5
|
#
5582a798 |
| 06-Dec-2020 |
Fangrui Song <i@maskray.me> |
[TargetMachine] Set dso_local if asan is detected
AddressSanitizer instrumentation does not set dso_local on non-thread-local global variables in -fno-pic and it seems to rely on implied dso_local t
[TargetMachine] Set dso_local if asan is detected
AddressSanitizer instrumentation does not set dso_local on non-thread-local global variables in -fno-pic and it seems to rely on implied dso_local to work. Add a hack until we have fixed AddressSanitizer to call setDSOLocal() as appropriate.
Thanks to Vitaly Buka for reporting the issue and suggesting the way to detect asan.
show more ...
|
#
109e70d3 |
| 05-Dec-2020 |
Fangrui Song <i@maskray.me> |
[TargetMachine] Drop implied dso_local for an edge case (extern_weak + non-pic + hidden)
This does not deserve special handling. The code should be added to Clang instead if deemed useful. With this
[TargetMachine] Drop implied dso_local for an edge case (extern_weak + non-pic + hidden)
This does not deserve special handling. The code should be added to Clang instead if deemed useful. With this simplification, we can additionally delete the PIC extern_weak special case.
show more ...
|
#
930b3398 |
| 05-Dec-2020 |
Fangrui Song <i@maskray.me> |
[TargetMachine] Clean up TargetMachine::shouldAssumeDSOLocal after x86-32 specific hack is moved to X86Subtarget
With my previous commit, X86Subtarget::classifyGlobalReference has learned to use MO_
[TargetMachine] Clean up TargetMachine::shouldAssumeDSOLocal after x86-32 specific hack is moved to X86Subtarget
With my previous commit, X86Subtarget::classifyGlobalReference has learned to use MO_NO_FLAG for 32-bit ELF -fno-pic code, the x86-32 special case in TargetMachine::shouldAssumeDSOLocal can be removed. Since we no longer imply dso_local for function declarations, we can drop the ppc64 special case as well.
This is NFC in terms of Clang emitted assembly.
show more ...
|
#
a084c038 |
| 05-Dec-2020 |
Fangrui Song <i@maskray.me> |
[TargetMachine] Don't imply dso_local on function declarations in Reloc::Static model for ELF/wasm
clang/lib/CodeGen/CodeGenModule sets dso_local on applicable function declarations, we don't need t
[TargetMachine] Don't imply dso_local on function declarations in Reloc::Static model for ELF/wasm
clang/lib/CodeGen/CodeGenModule sets dso_local on applicable function declarations, we don't need to duplicate the work in TargetMachine:shouldAssumeDSOLocal. (Actually the long-term goal (started by r324535) is to drop TargetMachine::shouldAssumeDSOLocal.)
By not implying dso_local, we will respect dso_local/dso_preemptable specifiers set by the frontend. This allows the proposed -fno-direct-access-external-data option to work with -fno-pic and prevent a canonical PLT entry (SHN_UNDEF with non-zero st_value) when taking the address of a function symbol.
This patch should be NFC in terms of the Clang emitted assembly because the case we don't set dso_local is a case Clang sets dso_local. However, some tests don't set dso_local on some function declarations and expose some differences. Most tests have been fixed to be more robust in the previous commit.
show more ...
|
#
db13a138 |
| 05-Dec-2020 |
Fangrui Song <i@maskray.me> |
[TargetMachine] Move X86 specific shouldAssumeDSOLocal logic to X86Subtarget::classifyGlobalFunctionReference
|
#
68edf39e |
| 05-Dec-2020 |
Fangrui Song <i@maskray.me> |
[TargetMachine] Simplify shouldAssumeDSOLocal by processing ExternalSymbolSDNode early
The function accrues many `GV` nullness checks. Process `!GV` (ExternalSymbolSDNode) early to simplify code.
A
[TargetMachine] Simplify shouldAssumeDSOLocal by processing ExternalSymbolSDNode early
The function accrues many `GV` nullness checks. Process `!GV` (ExternalSymbolSDNode) early to simplify code.
Also improve a comment added in r327198 (intrinsics is a subset of ExternalSymbolSDNode).
Intended to be NFC.
show more ...
|
#
1ab9327d |
| 05-Dec-2020 |
Fangrui Song <i@maskray.me> |
[TargetMachine][CodeGenModule] Delete unneeded ppc32 special case from shouldAssumeDSOLocal
PPCMCInstLower does not actually call shouldAssumeDSOLocal for ppc32 so this is dead. Actually Clang ppc32
[TargetMachine][CodeGenModule] Delete unneeded ppc32 special case from shouldAssumeDSOLocal
PPCMCInstLower does not actually call shouldAssumeDSOLocal for ppc32 so this is dead. Actually Clang ppc32 does produce a pair of absolute relocations which match GCC.
This also fixes a comment (R_PPC_COPY and R_PPC64_COPY do exist).
show more ...
|
#
2ec43a7b |
| 05-Dec-2020 |
Fangrui Song <i@maskray.me> |
[TargetMachine] Delete wasm special case from shouldAssumeDSOLocal
|
#
961f31d8 |
| 05-Dec-2020 |
Fangrui Song <i@maskray.me> |
[TargetMachine] Don't imply dso_local on global variable declarations in Reloc::Static model
clang/lib/CodeGen/CodeGenModule sets dso_local on applicable global variables, we don't need to duplicate
[TargetMachine] Don't imply dso_local on global variable declarations in Reloc::Static model
clang/lib/CodeGen/CodeGenModule sets dso_local on applicable global variables, we don't need to duplicate the work in TargetMachine:shouldAssumeDSOLocal. (Actually the long-term goal (started by r324535) is to remove as much additional implied dso_local in TargetMachine:shouldAssumeDSOLocal as possible.)
By not implying dso_local, we will respect dso_local/dso_preemptable specifiers set by the frontend. This allows the proposed -fno-direct-access-external-data option to work with -fno-pic and prevent copy relocations.
This patch should be NFC in terms of the Clang behavior because the case we don't set dso_local is a case Clang sets dso_local. However, some tests don't set dso_local on some `external global` and expose some differences. Most tests have been fixed to be more robust in previous commits.
show more ...
|
Revision tags: llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1 |
|
#
0128b950 |
| 24-Jul-2020 |
Simon Pilgrim <llvm-dev@redking.me.uk> |
Revert rG5dd566b7c7b78bd- "PassManager.h - remove unnecessary Function.h/Module.h includes. NFCI."
This reverts commit 5dd566b7c7b78bd385418c72d63c79895be9ae97.
Causing some buildbot failures that
Revert rG5dd566b7c7b78bd- "PassManager.h - remove unnecessary Function.h/Module.h includes. NFCI."
This reverts commit 5dd566b7c7b78bd385418c72d63c79895be9ae97.
Causing some buildbot failures that I'm not seeing on MSVC builds.
show more ...
|
#
5dd566b7 |
| 24-Jul-2020 |
Simon Pilgrim <llvm-dev@redking.me.uk> |
PassManager.h - remove unnecessary Function.h/Module.h includes. NFCI.
PassManager.h is one of the top headers in the ClangBuildAnalyzer frontend worst offenders list.
This exposes a large number o
PassManager.h - remove unnecessary Function.h/Module.h includes. NFCI.
PassManager.h is one of the top headers in the ClangBuildAnalyzer frontend worst offenders list.
This exposes a large number of implicit dependencies on various forward declarations/includes in other headers that need addressing.
show more ...
|
Revision tags: llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2 |
|
#
9d55e4ee |
| 25-May-2020 |
Fangrui Song <maskray@google.com> |
Make explicit -fno-semantic-interposition (in -fpic mode) infer dso_local
-fno-semantic-interposition is currently the CC1 default. (The opposite disables some interprocedural optimizations.) Howeve
Make explicit -fno-semantic-interposition (in -fpic mode) infer dso_local
-fno-semantic-interposition is currently the CC1 default. (The opposite disables some interprocedural optimizations.) However, it does not infer dso_local: on most targets accesses to ExternalLinkage functions/variables defined in the current module still need PLT/GOT.
This patch makes explicit -fno-semantic-interposition infer dso_local, so that PLT/GOT can be eliminated if targets implement local aliases for AsmPrinter::getSymbolPreferLocal (currently only x86).
Currently we check whether the module flag "SemanticInterposition" is 0. If yes, infer dso_local. In the future, we can infer dso_local unless "SemanticInterposition" is 1: frontends other than clang will also benefit from the optimization if they don't bother setting the flag. (There will be risks if they do want ELF interposition: they need to set "SemanticInterposition" to 1.)
show more ...
|
Revision tags: llvmorg-10.0.1-rc1 |
|
#
77618cc2 |
| 16-Apr-2020 |
jasonliu <jasonliu.development@gmail.com> |
[XCOFF][AIX] Fix getSymbol to return the correct qualname when necessary
Summary: AIX symbol have qualname and unqualified name. The stock getSymbol could only return unqualified name, which leads u
[XCOFF][AIX] Fix getSymbol to return the correct qualname when necessary
Summary: AIX symbol have qualname and unqualified name. The stock getSymbol could only return unqualified name, which leads us to patch many caller side(lowerConstant, getMCSymbolForTOCPseudoMO). So we should try to address this problem in the callee side(getSymbol) and clean up the caller side instead.
Note: this is a "mostly" NFC patch, with a fix for the original lowerConstant behavior.
Differential Revision: https://reviews.llvm.org/D78045
show more ...
|
Revision tags: llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1 |
|
#
adcd0268 |
| 28-Jan-2020 |
Benjamin Kramer <benny.kra@googlemail.com> |
Make llvm::StringRef to std::string conversions explicit.
This is how it should've been and brings it more in line with std::string_view. There should be no functional change here.
This is mostly m
Make llvm::StringRef to std::string conversions explicit.
This is how it should've been and brings it more in line with std::string_view. There should be no functional change here.
This is mostly mechanical from a custom clang-tidy check, with a lot of manual fixups. It uncovers a lot of minor inefficiencies.
This doesn't actually modify StringRef yet, I'll do that in a follow-up.
show more ...
|
Revision tags: llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2 |
|
#
c378e52c |
| 05-Dec-2019 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
Set some fast math attributes in setFunctionAttributes
This will provide a more consistent view to codegen for these attributes. The current system is somewhat awkward, and the fields in TargetOptio
Set some fast math attributes in setFunctionAttributes
This will provide a more consistent view to codegen for these attributes. The current system is somewhat awkward, and the fields in TargetOptions are reset based on the command line flag if the attribute isn't set. By forcing these attributes with the flag, there can never be an inconsistency in the behavior if code directly inspects the attribute on the function without considering the command line flags.
show more ...
|
#
cfd84984 |
| 10-Jan-2020 |
Peng Guo <peng_guo@apple.com> |
[MIR] Fix cyclic dependency of MIR formatter
Summary: Move MIR formatter pointer from TargetMachine to TargetInstrInfo to avoid cyclic dependency between target & codegen.
Reviewers: dsanders, bkra
[MIR] Fix cyclic dependency of MIR formatter
Summary: Move MIR formatter pointer from TargetMachine to TargetInstrInfo to avoid cyclic dependency between target & codegen.
Reviewers: dsanders, bkramer, arsenm
Subscribers: wdng, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72485
show more ...
|
#
de3d0ee0 |
| 09-Jan-2020 |
Daniel Sanders <daniel_l_sanders@apple.com> |
Revert "Revert "[MIR] Target specific MIR formating and parsing""
There was an unguarded dereference of MF in a function that permitted nullptr. Fixed
This reverts commit 71d64f72f934631aa2f12b9542
Revert "Revert "[MIR] Target specific MIR formating and parsing""
There was an unguarded dereference of MF in a function that permitted nullptr. Fixed
This reverts commit 71d64f72f934631aa2f12b9542c23f74f256f494.
show more ...
|
#
71d64f72 |
| 09-Jan-2020 |
Nico Weber <thakis@chromium.org> |
Revert "[MIR] Target specific MIR formating and parsing"
This reverts commit 3ef05d85be8c3666ebfa3ad986eb334da5195a47. It broke check-llvm on many bots, see comments on D69836.
|
#
3ef05d85 |
| 09-Jan-2020 |
Peng Guo <peng_guo@apple.com> |
[MIR] Target specific MIR formating and parsing
Summary: Added MIRFormatter for target specific MIR formating and parsing with immediate and custom pseudo source values. Target machine can subclass
[MIR] Target specific MIR formating and parsing
Summary: Added MIRFormatter for target specific MIR formating and parsing with immediate and custom pseudo source values. Target machine can subclass MIRFormatter and implement custom logic for printing and parsing immediate and custom pseudo source values for better readability.
* Target specific immediate mnemonic need to start with "." follows by identifier string. When MIR parser sees immediate it will call target specific parsing function.
* Custom pseudo source value need to start with custom follows by double-quoted string. MIR parser will pass the quoted string to target specific PSV parsing function.
* MIRFormatter have 2 helper functions to facilitate LLVM value printing and parsing for custom PSV if they refers LLVM values.
Patch by Peng Guo
Reviewers: dsanders, arsenm
Reviewed By: dsanders
Subscribers: wdng, jvesely, nhaehnle, hiraditya, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69836
show more ...
|