- Dec 03, 2020
-
-
Sergey Dmitriev authored
llvm-link should not rely on the '.a' file extension when deciding if input file should be loaded as archive. Archives may have other extensions (f.e. .lib) or no extensions at all. This patch changes llvm-link to use llvm::file_magic to check if input file is an archive. Reviewed By: RaviNarayanaswamy Differential Revision: https://reviews.llvm.org/D92376
-
Duncan P. N. Exon Smith authored
As part of reducing use of PreprocessorOptions::RemappedFileBuffers, stop abusing it to pass information around remapped files in `ARCMigrate`. This simplifies an eventual follow-up to switch to using an `InMemoryFileSystem` for this. Differential Revision: https://reviews.llvm.org/D90887
-
Kostya Kortchinsky authored
In ScopedString::append va_list ArgsCopy is created but never cleanuped which can lead to undefined behaviour, like stack corruption. Reviewed By: cryptoad Differential Revision: https://reviews.llvm.org/D92383
-
Yaxun (Sam) Liu authored
due to cd95338e Need to check if result is LValue before getLValueBase.
-
Jonas Devlieghere authored
Differential revision: https://reviews.llvm.org/D92513
-
Nico Weber authored
This reverts commit 542d3b60. Seems to break check-lld. Reverting while I take a look.
-
Duncan P. N. Exon Smith authored
Instead of computing the alignment and size of the `char` buffer in `AlignedCharArrayUnion`, rely on the math in `std::aligned_union_t`. Because some users of this rely on the `buffer` field existing with a type convertible to `char *`, we can't change the field type, but we can still avoid duplicating the logic. A potential follow up would be to delete `AlignedCharArrayUnion` after updating its users to use `std::aligned_union_t` directly; or if we like our template parameters better, could update users to stop peeking inside and then replace the definition with: ``` template <class T, class... Ts> using AlignedCharArrayUnion = std::aligned_union_t<1, T, Ts...>; ``` Differential Revision: https://reviews.llvm.org/D92500
-
Mircea Trofin authored
Typing the API appropriately. Differential Revision: https://reviews.llvm.org/D92341
-
Raphael Isemann authored
Both seem to fail to read values from the non-running target.
-
Nico Weber authored
This is useful for debugging why lld loads .o files it shouldn't load. It's also useful for users of lld -- I've used ld64's version of this a few times. Differential Revision: https://reviews.llvm.org/D92496
-
Tim Keith authored
When the same generic name is use-associated from two modules, the generics are merged into a single one in the current scope. This change fixes some bugs in that process. When a generic is merged, it can have two specific procedures with the same name as the generic (c.f. module m7c in modfile07.f90). We were disallowing that by checking for duplicate names in the generic rather than duplicate symbols. Changing `namesSeen` to `symbolsSeen` in `ResolveSpecificsInGeneric` fixes that. We weren't including each USE of those generics in the .mod file so in some cases they were incorrect. Extend GenericDetails to specify all use-associated symbols that are merged into the generic. This is used to write out .mod files correctly. The distinguishability check for specific procedures of a generic sometimes have to refer to procedures from a use-associated generic in error messages. In that case we don't have the source location of the procedure so adapt the message to say where is was use-associated from. This requires passing the scope through the checks to make that determination. Differential Revision: https://reviews.llvm.org/D92492
-
Raphael Isemann authored
-
Duncan P. N. Exon Smith authored
`AlignedArrayCharUnion` is now using `alignas`, which is properly supported now by all the host toolchains we support. As a result, the extra `alignas` on `IntervalMap` isn't needed anymore. This is effectively a revert of 379daa29. Differential Revision: https://reviews.llvm.org/D92509
-
Reid Kleckner authored
Revert "Delete llvm::is_trivially_copyable and CMake variable HAVE_STD_IS_TRIVIALLY_COPYABLE" This reverts commit 4d4bd40b. This reverts commit 557b00e0.
-
Florian Hahn authored
This should fix a build failure on some systems, e.g. solaris11-sparcv9 http://lab.llvm.org:8014/#/builders/22
-
Harald van Dijk authored
LLVM has TLS_(base_)addr32 for 32-bit TLS addresses in 32-bit mode, and TLS_(base_)addr64 for 64-bit TLS addresses in 64-bit mode. x32 mode wants 32-bit TLS addresses in 64-bit mode, which were not yet handled. This adds TLS_(base_)addrX32 as copies of TLS_(base_)addr64, except that they use tls32(base)addr rather than tls64(base)addr, and then restricts TLS_(base_)addr64 to 64-bit LP64 mode, TLS_(base_)addrX32 to 64-bit ILP32 mode. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D92346
-
H.J. Lu authored
Since x32 supports PC-relative address, it shouldn't use EBX for TLS address. Instead of checking N.getValueType(), we should check Subtarget->is32Bit(). This fixes PR 22676. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D16474
-
Duncan P. N. Exon Smith authored
Push `FileEntryRef` and `DirectoryEntryRef` further, using it them `Module::Umbrella`, `Module::Header::Entry`, and `Module::DirectoryName::Entry`. - Add `DirectoryEntryRef::operator const DirectoryEntry *` and `OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr`, to get the same "degrades to `DirectoryEntry*` behaviour `FileEntryRef` enjoys (this avoids a bunch of churn in various clang tools). - Fix the `DirectoryEntryRef` constructor from `MapEntry` to take it by `const&`. Note that we cannot get rid of the `...AsWritten` names leveraging the new classes, since these need to be as written in the `ModuleMap` file and the module directory path is preprended for the lookup in the `FileManager`. Differential Revision: https://reviews.llvm.org/D90497
-
LLVM GN Syncbot authored
-
Louis Dionne authored
-
Hongtao Yu authored
An indirect call site needs to be probed for its potential call targets. With CSSPGO a direct call also needs a probe so that a calling context can be represented by a stack of callsite probes. Unlike pseudo probes for basic blocks that are in form of standalone intrinsic call instructions, pseudo probes for callsites have to be attached to the call instruction, thus a separate instruction would not work. One possible way of attaching a probe to a call instruction is to use a special metadata that carries information about the probe. The special metadata will have to make its way through the optimization pipeline down to object emission. This requires additional efforts to maintain the metadata in various places. Given that the `!dbg` metadata is a first-class metadata and has all essential support in place , leveraging the `!dbg` metadata as a channel to encode pseudo probe information is probably the easiest solution. With the requirement of not inflating `!dbg` metadata that is allocated for almost every instruction, we found that the 32-bit DWARF discriminator field which mainly serves AutoFDO can be reused for pseudo probes. DWARF discriminators distinguish identical source locations between instructions and with pseudo probes such support is not required. In this change we are using the discriminator field to encode the ID and type of a callsite probe and the encoded value will be unpacked and consumed right before object emission. When a callsite is inlined, the callsite discriminator field will go with the inlined instructions. The `!dbg` metadata of an inlined instruction is in form of a scope stack. The top of the stack is the instruction's original `!dbg` metadata and the bottom of the stack is for the original callsite of the top-level inliner. Except for the top of the stack, all other elements of the stack actually refer to the nested inlined callsites whose discriminator field (which actually represents a calliste probe) can be used together to represent the inline context of an inlined PseudoProbeInst or CallInst. To avoid collision with the baseline AutoFDO in various places that handles dwarf discriminators where a check against the `-pseudo-probe-for-profiling` switch is not available, a special encoding scheme is used to tell apart a pseudo probe discriminator from a regular discriminator. For the regular discriminator, if all lowest 3 bits are non-zero, it means the discriminator is basically empty and all higher 29 bits can be reversed for pseudo probe use. Callsite pseudo probes are inserted in `SampleProfileProbePass` and a target-independent MIR pass `PseudoProbeInserter` is added to unpack the probe ID/type from `!dbg`. Note that with this work the switch -debug-info-for-profiling will not work with -pseudo-probe-for-profiling anymore. They cannot be used at the same time. Reviewed By: wmi Differential Revision: https://reviews.llvm.org/D91756
-
Jianzhou Zhao authored
At D92261, this type will be used to cache both combined shadow and converted shadow values. Reviewed-by: morehouse Differential Revision: https://reviews.llvm.org/D92458
-
Jianzhou Zhao authored
This covers a branch in the loadShadow method. Reviewed-by: morehouse Differential Revision: https://reviews.llvm.org/D92460
-
Yaxun (Sam) Liu authored
This patch implements correct hostness based overloading resolution in isBetterOverloadCandidate. Based on hostness, if one candidate is emittable whereas the other candidate is not emittable, the emittable candidate is better. If both candidates are emittable, or neither is emittable based on hostness, then other rules should be used to determine which is better. This is because hostness based overloading resolution is mostly for determining viability of a function. If two functions are both viable, other factors should take precedence in preference. If other rules cannot determine which is better, CUDA preference will be used again to determine which is better. However, correct hostness based overloading resolution requires overloading resolution diagnostics to be deferred, which is not on by default. The rationale is that deferring overloading resolution diagnostics may hide overloading reslolutions issues in header files. An option -fgpu-exclude-wrong-side-overloads is added, which is off by default. When -fgpu-exclude-wrong-side-overloads is off, keep the original behavior, that is, exclude wrong side overloads only if there are same side overloads. This may result in incorrect overloading resolution when there are no same side candates, but is sufficient for most CUDA/HIP applications. When -fgpu-exclude-wrong-side-overloads is on, enable deferring overloading resolution diagnostics and enable correct hostness based overloading resolution, i.e., always exclude wrong side overloads. Differential Revision: https://reviews.llvm.org/D80450
-
Jianzhou Zhao authored
-
Dan Albert authored
Android has a handful of API levels relevant to developers described here: https://developer.android.com/studio/build#module-level. `__ANDROID_API__` is too vague and confuses a lot of people. Introduce a new macro name that is explicit about which one it represents. Keep the old name around because code has been using it for a decade.
-
Jianzhou Zhao authored
This is a child diff of D92261. This locks down the behavior before the change.
-
Fangrui Song authored
-
Uday Bondhugula authored
Clear up documentation on dialect attribute values. Fix/improve ModuleOp verifier error message on dialect prefixed attribute names. Additional discussion is here: https://llvm.discourse.group/t/moduleop-attributes/2325 Differential Revision: https://reviews.llvm.org/D92502
-
Richard Smith authored
Jon Caves.
-
Pavel Iliin authored
Out-of-line helper functions to support LSE deployment added. This is a port of libgcc implementation: https://gcc.gnu.org/git/?p=gcc.git;h=33befddcb849235353dc263db1c7d07dc15c9faa Differential Revision: https://reviews.llvm.org/D91156
-
jasonliu authored
Summary: Not all system assembler supports `.uleb128 label2 - label1` form. When the target do not support this form, we have to take alternative manual calculation to get the offsets from them. Reviewed By: hubert.reinterpretcast Diffierential Revision: https://reviews.llvm.org/D92058
-
Roland McGrath authored
The canonical Fuchsia toolchain configuration installs llvm-elfabi. Reviewed By: haowei Differential Revision: https://reviews.llvm.org/D92444
-
Roland McGrath authored
This is consistent with other platforms' versions and eliminates a compiler warning. Reviewed By: leonardchan Differential Revision: https://reviews.llvm.org/D92442
-
Siva Chandra Reddy authored
These two cases are fixed: 1. If numerator is not zero and denominator is infinity, then the numerator is returned as the remainder. 2. If numerator and denominator are equal in magnitude, then quotient with the right sign is returned. The differet tests of remquo, remquof and remquol have been unified into a single file to avoid duplication. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D92353
-
Nick Desaulniers authored
It's common for code that manipulates the stack via inline assembly or that has to set up its own stack canary (such as the Linux kernel) would like to avoid stack protectors in certain functions. In this case, we've been bitten by numerous bugs where a callee with a stack protector is inlined into an attribute((no_stack_protector)) caller, which generally breaks the caller's assumptions about not having a stack protector. LTO exacerbates the issue. While developers can avoid this by putting all no_stack_protector functions in one translation unit together and compiling those with -fno-stack-protector, it's generally not very ergonomic or as ergonomic as a function attribute, and still doesn't work for LTO. See also: https://lore.kernel.org/linux-pm/20200915172658.1432732-1-rkir@google.com/ https://lore.kernel.org/lkml/20200918201436.2932360-30-samitolvanen@google.com/T/#u SSP attributes can be ordered by strength. Weakest to strongest, they are: ssp, sspstrong, sspreq. Callees with differing SSP attributes may be inlined into each other, and the strongest attribute will be applied to the caller. (No change) After this change: * A callee with no SSP attributes will no longer be inlined into a caller with SSP attributes. * The reverse is also true: a callee with an SSP attribute will not be inlined into a caller with no SSP attributes. * The alwaysinline attribute overrides these rules. Functions that get synthesized by the compiler may not get inlined as a result if they are not created with the same stack protector function attribute as their callers. Alternative approach to https://reviews.llvm.org/D87956 . Fixes pr/47479. Signed-off-by:
Nick Desaulniers <ndesaulniers@google.com> Reviewed By: rnk, MaskRay Differential Revision: https://reviews.llvm.org/D91816
-
LLVM GN Syncbot authored
-
zoecarver authored
Add the slice_array::operator=(const std::valarray<T>& val_arr) overload. Fixes https://llvm.org/PR40792. Differential Revision: https://reviews.llvm.org/D58735
-
River Riddle authored
-
jasonliu authored
Summary: AIX uses the existing EH infrastructure in clang and llvm. The major differences would be 1. AIX do not have CFI instructions. 2. AIX uses a new personality routine, named __xlcxx_personality_v1. It doesn't use the GCC personality rountine, because the interoperability is not there yet on AIX. 3. AIX do not use eh_frame sections. Instead, it would use a eh_info section (compat unwind section) to store the information about personality routine and LSDA data address. Reviewed By: daltenty, hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D91455
-