- Dec 03, 2020
-
-
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
-
Sanjay Patel authored
https://llvm.org/PR48362 It's possible that we could stub this out sooner somewhere within JumpThreading, but I'm not sure how to do that, and then we would still have potential danger in other callers. I can't find a way to trigger this using 'instsimplify', however, because that already has a bailout on unreachable blocks.
-
Tim Keith authored
`GetTopLevelUnitContaining` returns the Scope nested in the global scope that contains the given Scope or Symbol. Use "Get" rather than "Find" in the name because "Find" implies it might not be found, which can't happen. Following that logic, rename `FindProgramUnitContaining` to `GetProgramUnitContaining` and have it also return a reference rather that a pointer. Note that the use of "ProgramUnit" is slightly confusing. In the Fortran standard, "program-unit" refers to what is called a "TopLevelUnit" here. What we are calling a "ProgramUnit" (here and in `ProgramTree`) includes internal subprograms while "TopLevelUnit" does not. Differential Revision: https://reviews.llvm.org/D92491
-
Raphael Isemann authored
-
Simon Pilgrim authored
Add "REQUIRES: asserts" as the test uses the "--debug-only" switch Should fix the clang-with-thin-lto-ubuntu buildbot failure
-
Simon Pilgrim authored
Helps to reduce diff in D90113
-
Simon Pilgrim authored
Helps to reduce diff in D90113
-
Fangrui Song authored
GCC<5 did not support std::is_trivially_copyable. Now LLVM builds require 5.1 we can delete llvm::is_trivially_copyable after the users have been migrated to std::is_trivially_copyable.
-
Fangrui Song authored
GCC<5 did not support std::is_trivially_copyable. Now LLVM builds require 5.1 we can migrate to std::is_trivially_copyable.
-
Arthur Eubanks authored
-
Simon Pilgrim authored
Its unlikely an undef element in a zero vector will be any use.
-
Simon Pilgrim authored
Fixes build on gnux32 hosts
-
Kostya Kortchinsky authored
The LateInit test might be reusing some already initialized thread specific data if run within the main thread. This means that there is a chance that the current value will not be enough for the 100 iterations, hence the test flaking. Fix this by making the test run in its own thread. Differential Revision: https://reviews.llvm.org/D92415
-
Gabor Marton authored
Differential Revision: https://reviews.llvm.org/D92474
-
Simon Pilgrim authored
Its unlikely an undef element in a zero vector will be any use, and SimplifyDemandedVectorElts now calls combineX86ShufflesRecursively so its unlikely we actually have a dependency on these specific elements.
-
Simon Pilgrim authored
Avoid use of X32 check prefix - we try to only use that for gnux32 triple tests
-
Simon Pilgrim authored
-
- Dec 02, 2020
-
-
Michael Liao authored
-