Puyan Lotfi [Tue, 19 Nov 2019 07:08:22 +0000 (02:08 -0500)]
Revert "[clang][IFS] Driver pipeline: generate interface stubs after standard pipeline."
This reverts commit
58ea00b51fe9b011301484957556872fced7dd08.
Test for .o + .ifs sidecar files is brittle and failing on bots.
Reverting to unblock.
Puyan Lotfi [Sat, 16 Nov 2019 16:41:01 +0000 (11:41 -0500)]
[clang][IFS] Driver pipeline: generate interface stubs after standard pipeline.
Up until now, clang interface stubs has replaced the standard
PP -> C -> BE -> ASM -> LNK pipeline. With this change, it will happen in
conjunction with it. So what when you build your code you will get an
a.out or lib.so as well as an interface stub file.
Example:
clang -shared -o libfoo.so -emit-interface-stubs ...
will generate both a libfoo.so and a libfoo.ifso. The .so file will
contain the code from the standard compilation pipeline and the .ifso
file will contain the ELF stub library.
Differential Revision: https://reviews.llvm.org/D70274
Matt Arsenault [Mon, 18 Nov 2019 06:54:31 +0000 (12:24 +0530)]
AMDGPU: Split test functions to avoid dependency on subtarget
Prepare this test for moving tthe denormal setting out of the
subtarget features.
Matt Arsenault [Fri, 17 May 2019 20:42:52 +0000 (16:42 -0400)]
bugpoint: Add option to disable attribute removal
This takes a long time and never reduces anything useful for me
(e.g. I've been waiting for 3 hours on a testcase and it hasn't found
any attributes to remove yet). This should probably start by assuming
no attributes matter, and adding back.
Craig Topper [Tue, 19 Nov 2019 03:13:06 +0000 (19:13 -0800)]
[SelectionDAG] Merge the two identical ExpandChainLibCall methods from LegalizeTypes and LegalizeDAG to one version in TaretLowering.
Reviewers: RKSimon, efriedma, spatel
Reviewed By: efriedma
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70354
Leonard Chan [Tue, 19 Nov 2019 04:05:57 +0000 (20:05 -0800)]
Revert "implement printing out raw section data of xcoff objectfile for llvm-objdump"
This reverts commit
8f8a9f3437d4517f674395da30edb59d5514f7bc.
Reverting since this patch seems to break a lot of llvm buildbots.
Rui Ueyama [Tue, 19 Nov 2019 03:05:16 +0000 (12:05 +0900)]
Revert "Fix shared lib build."
This reverts commit
17e37ba57a696198c9744eeba4f8f293f155587a
because it introduced a circular dependency between Core and Common.
Because
d0371f473675ede1d79a615ec4fdf0cf5368944c fixed a build issue,
we no longer need that dependency.
Rui Ueyama [Tue, 19 Nov 2019 02:16:59 +0000 (11:16 +0900)]
Fix component build
b11386f9be9b2dc7276a758d64f66833da10bdea broke lld build
if `-DBUILD_SHARED_LIBS=ON` is passed to CMake.
Kai Luo [Tue, 19 Nov 2019 01:57:23 +0000 (09:57 +0800)]
Revert "[Bindings][Go] Fix go.test failure due to missing argument"
This reverts commit
88235812a71d99c082e7aa2ef9356d43d1f83a80 due to
d27a16eb392f39f9ee04ff5194b1eff3e189e6f8.
Kai Luo [Sun, 17 Nov 2019 01:58:42 +0000 (09:58 +0800)]
[Bindings][Go] Fix go.test failure due to missing argument
go.test failed with error
```
/tmp/gopath431502532/src/llvm.org/llvm/bindings/go/llvm/dibuilder.go:514:40: not enough arguments in call to _Cfunc_LLVMDIBuilderCreateTypedef
have (_Ctype_LLVMDIBuilderRef, _Ctype_LLVMMetadataRef, *_Ctype_char, _Ctype_ulong, _Ctype_LLVMMetadataRef, _Ctype_uint, _Ctype_LLVMMetadataRef)
want (*_Ctype_struct_LLVMOpaqueDIBuilder, *_Ctype_struct_LLVMOpaqueMetadata, *_Ctype_char, _Ctype_ulong, *_Ctype_struct_LLVMOpaqueMetadata, _Ctype_uint, *_Ctype_struct_LLVMOpaqueMetadata, _Ctype_uint)
```
This patch fixes above error.
Differential Revision: https://reviews.llvm.org/D70360
Jonas Devlieghere [Tue, 19 Nov 2019 01:00:03 +0000 (17:00 -0800)]
Revert "[CMake] Re-enable -Wno-gnu-anonymous-struct & -Wno-nested-anon-types."
Whoops, they should be enabled, not disabled.
Jonas Devlieghere [Tue, 19 Nov 2019 00:45:55 +0000 (16:45 -0800)]
[CMake] Re-enable -Wno-gnu-anonymous-struct & -Wno-nested-anon-types.
We're checking for support but we're discarding the result. My best
guess is that these warnings were disabled in the past. However, I don't
see a reason to keep it that way.
Andrew Browne [Mon, 18 Nov 2019 23:04:56 +0000 (15:04 -0800)]
Fix error message missed in commit
dde589389fcb8b5098f7a47f1b781b27d29a0cac.
Patch by Andrew Browne <browneee@google.com>
Reviewers: tejohnson, evgeny777
Reviewed By: tejohnson
Subscribers: arphaman, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70195
Jonas Devlieghere [Tue, 19 Nov 2019 00:02:12 +0000 (16:02 -0800)]
[Docs] Add reproducer documentation
This adds a page about LLDB reproducers. It describes how to use the
reproducers on the command line and lists some of the known
issues/limitations.
Differential revision: https://reviews.llvm.org/D70409
Aaron Puchert [Mon, 18 Nov 2019 23:54:02 +0000 (00:54 +0100)]
[OpenMP] Remove -Wl,-fini=__kmp_internal_end_fini
Summary:
The termination function duplicated the functionality of the
__attribute((destructor))-annotated function __kmp_internal_end_fini,
and we have no indication that this doesn't work.
The function might cause issues with link-time optimization turned on:
until very recently, none of the usual linkers was reporting functions
named in -Wl,-fini as used to the LTO plugin, so it might be dropped.
If the function is dropped, -Wl,-fini=__kmp_internal_end_fini doesn't
do what we want: with ld.bfd and lld it drops the FINI attribute from
.dynamic and with gold we get FINI = 0x0, which leads to a crash on
cleanup. This can be reproduced by building with
-DLLVM_ENABLE_PROJECTS="clang;openmp" \
-DLLVM_ENABLE_LTO=Thin \
-DLLVM_USE_LINKER=gold
The issue in lld has been fixed in
f95273f75aa, but gold remains without
fix so far.
Fixes PR43927.
Reviewers: JonChesterfield, jdoerfert, AndreyChurbanov
Reviewed By: AndreyChurbanov
Differential Revision: https://reviews.llvm.org/D69927
Wolfgang Pieb [Mon, 18 Nov 2019 20:28:04 +0000 (12:28 -0800)]
Revert "[clangd] Implement rename by using SelectionTree and findExplicitReferences."
This reverts commit
4f80fc2491cc35730a9a84b86975278b7daa8522.
Caused buildbot failure at
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/58251
LLVM GN Syncbot [Mon, 18 Nov 2019 23:33:25 +0000 (23:33 +0000)]
gn build: Merge
30e7ee3c4ba
Nico Weber [Mon, 18 Nov 2019 23:33:04 +0000 (18:33 -0500)]
gn build: (manually) try to merge
1689ad27af
Vedant Kumar [Mon, 18 Nov 2019 22:16:08 +0000 (14:16 -0800)]
[CodeGen] Assign locations to calls to special struct helpers
Assign artificial locations to calls to special struct-related helper
functions.
Such calls may not inherit a location if emitted within FinishFunction,
at which point the lexical scope stack may be empty, causing CGDebugInfo
to report the current DebugLoc as empty.
Fixes an IR verifier complaint about a call to '__destructor_8_s0' not
having a !dbg location attached.
rdar://
57293361
Steven Wu [Mon, 18 Nov 2019 22:51:41 +0000 (14:51 -0800)]
[llvm-cxxfilt] Improve strip-underscore behavior
Summary:
For platform that uses macho format, c++filt should be stripping the
leading underscore by default. Introduce the binutil compatible "-n"
option to control strip-undercore behaivor together with the existing
"-_" option and fallback to system default if none of them are set.
rdar://problem/
57173514
Reviewers: compnerd, erik.pilkington, dexonsmith, mattd
Reviewed By: compnerd, erik.pilkington
Subscribers: jkorous, ributzka, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70250
Teresa Johnson [Mon, 18 Nov 2019 21:55:52 +0000 (13:55 -0800)]
ThinLTO: Fix assembler to emit alwaysInline in the summary
Summary: The earlier commit (https://reviews.llvm.org/D70014) missed this one : If Always_Inline happens to be the only entry in FuncFlags, then the assembler will not print it in the summary.
Patch by Bharathi Seshadri <bseshadr@cisco.com>
Reviewers: tejohnson
Reviewed By: tejohnson
Subscribers: mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70323
Eric Christopher [Mon, 18 Nov 2019 22:41:37 +0000 (14:41 -0800)]
Temporarily revert "[SLP] fix miscompile on min/max reductions with extra uses (PR43948)"
as it causes an ICE on valid. A testcase was followed up on the original thread.
This reverts commit
a3e61946c5bd7bdfab15af76b292e52d6ffa27f7.
diggerlin [Mon, 18 Nov 2019 22:06:25 +0000 (17:06 -0500)]
Adding a test case for read-only data assembly writing for aix
SUMMARY:
Adding a test case for read-only data assembly writing for aix
Reviewers: daltenty,Xiangling_Liao
Subscribers: rupprecht, seiyai,hiraditya
Differential Revision: https://reviews.llvm.org/D70182
Sanjay Patel [Mon, 18 Nov 2019 21:23:55 +0000 (16:23 -0500)]
[SLP] reduce duplicated check lines in tests; NFC
Stefan Pintilie [Mon, 18 Nov 2019 21:50:44 +0000 (15:50 -0600)]
[PowerPC] Improve float vector gather codegen
This patch aims to improve the code generation for float vector gather on POWER9.
Patterns have been implemented to utilize instructions that deliver improved
performance.
Patch by: Kamau Bridgeman
Differential Revision: https://reviews.llvm.org/D62908
Erich Keane [Mon, 18 Nov 2019 21:38:56 +0000 (13:38 -0800)]
[NFC] Fix 'target' condition in checkTargetFeatures
checkTargetFeatures was incorrectly checking for cpu_specific instead of
just 'target'. While this function was never called in that situation,
it seemed correct to fix the condition. Additionally, multiversion
functions can never be always_inline, but if any function accidentially
ended up here we shouldn't diagnose.
Note that the adding of target-features to the list is unnecessary since
the getFunctionFeatureMap actually considers attribute target,
however adding it results in significantly better error messages by
putting the 'target' features first (and thus first to fail).
Otherwise, the error message would be the first feature 'implied' by the
target attribute, and not necessarily the feature listed in the
attribute itself.
Michał Górny [Mon, 18 Nov 2019 21:07:02 +0000 (22:07 +0100)]
[lldb] [test] XFAIL more lldb-server tests on NetBSD
Michał Górny [Mon, 18 Nov 2019 20:56:56 +0000 (21:56 +0100)]
[lldb] [test] Mark segv-related tests XFAIL on NetBSD
There seems to be a regression in the kernel causing those tests
to fail. Mark them XFAIL, to be addressed later.
Michał Górny [Mon, 18 Nov 2019 20:53:56 +0000 (21:53 +0100)]
[lldb] [unittest] Skip TestStopReplyContainsThreadPcs on NetBSD
Michał Górny [Mon, 18 Nov 2019 20:47:21 +0000 (21:47 +0100)]
[lldb] [unittest] Reenable MainLoopTest.DetectsEOF on NetBSD
The underlying issue is already fixed in the NetBSD kernel for some
time, so we can finally reenable the test.
Louis Dionne [Mon, 18 Nov 2019 21:27:42 +0000 (16:27 -0500)]
[libc++] Separate -include and path to the site config file
This apparently breaks weird use cases where the build directory is on
a separate drive. Someone reported that failure to me privately.
I can't remember of a reason for collating the two arguments in the
first place, so I don't think this should break anything.
Cyndy Ishida [Mon, 18 Nov 2019 21:13:40 +0000 (13:13 -0800)]
Fix iOSDarwin()'s doc comment.
Summary:
I saw the doc comment using the Option + Click in Xcode and I was
confused by the fact that tvOS wasn't listed. The method definition
also doesn't make it clear that the check for tvOS is taking place as
the tvOS check is hidden in the isiOS() check.
Reviewers: rjmccall
Reviewed By: rjmccall
Subscribers: dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70364
This patch is from Varun Gandhi <varun_gandhi@apple.com>
Daniel Sanders [Fri, 15 Nov 2019 23:08:34 +0000 (15:08 -0800)]
[macho] Allow CPUSubtype to contribute to architecture identification
Summary:
Sometimes the CPUSubtype determines the Triple::ArchType that must be used.
Add the subtype to the API's to allow targets that need this to correctly
identify the contents of the binary.
Reviewers: pete
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70345
Daniel Sanders [Fri, 15 Nov 2019 22:58:57 +0000 (14:58 -0800)]
[macho] Allow CPUSubtype to be adjusted before writing it to a file
Summary:
It's not always possible for a target to provide a MachO CPUSubtype up
front as is required by the current implementation. Sometimes you need more
information like the particular CPU implementation you are targeting.
Give MCMachObjectTargetWriter subclasses the opportunity to modify the
CPUSubtype after the MCMachObjectTargetWriter is created but before the
object starts being written. Typically this would be done in response to
instructions from a TargetStreamer.
Reviewers: pete
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70344
Vedant Kumar [Tue, 12 Nov 2019 18:24:23 +0000 (10:24 -0800)]
[profile] Support online merging with continuous sync mode
Make it possible to use online profile merging ("%m" mode) with
continuous sync ("%c" mode).
To implement this, the merged profile is locked in the runtime
initialization step and either a) filled out for the first time or b)
checked for compatibility. Then, the profile can simply be mmap()'d with
MAP_SHARED set. With the mmap() in place, counter updates from every
process which uses an image are mapped onto the same set of physical
pages assigned by the filesystem cache. After the mmap() is set up, the
profile is unlocked.
Differential Revision: https://reviews.llvm.org/D69586
Teresa Johnson [Mon, 18 Nov 2019 20:03:58 +0000 (12:03 -0800)]
[ThinLTO] Avoid extra index lookup during promotion
Summary:
Pass down the already accessed ValueInfo to shouldPromoteLocalToGlobal,
to avoid an unnecessary extra index lookup.
Add some assertion checking to confirm we have a non-empty VI when
expected.
Also some misc cleanup, merging the two versions of
doImportAsDefinition, since one was only called by the other, and
unnecessarily passed in a member variable.
Reviewers: steven_wu, pcc, evgeny777
Reviewed By: evgeny777
Subscribers: mehdi_amini, inglorion, hiraditya, dexonsmith, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70337
Dimitry Andric [Mon, 18 Nov 2019 19:02:45 +0000 (20:02 +0100)]
Populate CUDA flags on FreeBSD too, as many other toolchains do.
Summary:
This allows `clang` to be used to compile CUDA programs. Compiled
simple helloworld.cu with this.
Reviewers: dim, emaste, tra, yaxunl, ABataev
Reviewed By: tra
Subscribers: dim, emaste, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69990
diggerlin [Mon, 18 Nov 2019 20:24:55 +0000 (15:24 -0500)]
implement printing out raw section data of xcoff objectfile for llvm-objdump
SUMMARY:
implement printing out raw section data of xcoff objectfile for llvm-objdump
and option -D --disassemble-all option for llvm-objdump
Reviewers: Sean Fertile
Subscribers: rupprecht, seiyai,hiraditya
Differential Revision: https://reviews.llvm.org/D70255
Dan Albert [Mon, 18 Nov 2019 20:16:45 +0000 (12:16 -0800)]
Fix _LIBCPP_HAS_ definitions for Android.
Summary:
Android added quick_exit()/at_quick_exit() in API level 21,
aligned_alloc() in API level 28, and timespec_get() in API level 29,
but has the other C11 features at all API levels (since they're basically
just coming from clang directly).
_LIBCPP_HAS_QUICK_EXIT and _LIBCPP_HAS_TIMESPEC_GET already existed,
so we can reuse them. (And use _LIBCPP_HAS_TIMESPEC_GET in a few more
places where _LIBCPP_HAS_C11_FEATURES has been used as a proxy. This
isn't correct for Android.)
_LIBCPP_HAS_ALIGNED_ALLOC is added, to cover aligned_alloc() (obviously).
Add a missing std:: before aligned_alloc in a cstdlib test, and remove a
couple of !defined(_WIN32)s now that we're explicitly testing
TEST_HAS_ALIGNED_ALLOC rather than TEST_HAS_C11_FEATURES.
Reviewers: danalbert, EricWF, mclow.lists
Reviewed By: danalbert
Subscribers: srhines, christof, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D69929
Craig Topper [Mon, 18 Nov 2019 20:17:49 +0000 (12:17 -0800)]
[X86] Add a 'break;' to the end of the last case in a switch to avoid surprising the next person to add a case after this one. NFC
Erik Pilkington [Mon, 18 Nov 2019 18:56:05 +0000 (10:56 -0800)]
[Sema] Fix a -Wobjc-signed-char-bool false-positive
Unsigned bit-field flags can only have boolean values, so handle that case in
Expr::isKnownToHaveBooleanValue.
rdar://
56256999
Dan Albert [Thu, 7 Nov 2019 20:40:05 +0000 (12:40 -0800)]
Update the docs for building libc++.
Summary:
Rewrite the in-tree build to be a clearer tl;dr like we have for the
out-of-tree build.
Reviewers: EricWF, mclow.lists, ldionne
Reviewed By: ldionne
Subscribers: dexonsmith, christof, ldionne, enh, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D69917
Teresa Johnson [Mon, 18 Nov 2019 15:05:05 +0000 (07:05 -0800)]
[ThinLTO] Promotion handling cleanup (NFC)
Summary:
Clean up the code that does GV promotion in the ThinLTO backends.
Specifically, we don't need to check whether we are importing since that
is already checked and handled correctly in shouldPromoteLocalToGlobal.
Simply call shouldPromoteLocalToGlobal, and if it returns true we are
guaranteed that we are promoting, whether or not we are importing (or in
the exporting module). This also makes the handling in getName()
consistent with that in getLinkage(), which checks the DoPromote parameter
regardless of whether we are importing or exporting.
Reviewers: steven_wu, pcc, evgeny777
Subscribers: mehdi_amini, inglorion, hiraditya, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70327
Craig Topper [Mon, 18 Nov 2019 19:31:17 +0000 (11:31 -0800)]
[X86] Add AMD Matisse (znver2) model number to getHostCPUName and compiler-rt's getAMDProcessorTypeAndSubtype.
This is the CPUID model used on Ryzen 3000 series (Zen 2/Matisse) CPUs.
Patch by Alex James
Differential Revision: https://reviews.llvm.org/D70279
Pierre Habouzit [Fri, 8 Nov 2019 07:14:58 +0000 (23:14 -0800)]
Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))
__attribute__((objc_direct)) is an attribute on methods declaration, and
__attribute__((objc_direct_members)) on implementation, categories or
extensions.
A `direct` property specifier is added (@property(direct) type name)
These attributes / specifiers cause the method to have no associated
Objective-C metadata (for the property or the method itself), and the
calling convention to be a direct C function call.
The symbol for the method has enforced hidden visibility and such direct
calls are hence unreachable cross image. An explicit C function must be
made if so desired to wrap them.
The implicit `self` and `_cmd` arguments are preserved, however to
maintain compatibility with the usual `objc_msgSend` semantics,
3 fundamental precautions are taken:
1) for instance methods, `self` is nil-checked. On arm64 backends this
typically adds a single instruction (cbz x0, <closest-ret>) to the
codegen, for the vast majority of the cases when the return type is a
scalar.
2) for class methods, because the class may not be realized/initialized
yet, a call to `[self self]` is emitted. When the proper deployment
target is used, this is optimized to `objc_opt_self(self)`.
However, long term we might want to emit something better that the
optimizer can reason about. When inlining kicks in, these calls
aren't optimized away as the optimizer has no idea that a single call
is really necessary.
3) the calling convention for the `_cmd` argument is changed: the caller
leaves the second argument to the call undefined, and the selector is
loaded inside the body when it's referenced only.
As far as error reporting goes, the compiler refuses:
- making any overloads direct,
- making an overload of a direct method,
- implementations marked as direct when the declaration in the
interface isn't (the other way around is allowed, as the direct
attribute is inherited from the declaration),
- marking methods required for protocol conformance as direct,
- messaging an unqualified `id` with a direct method,
- forming any @selector() expression with only direct selectors.
As warnings:
- any inconsistency of direct-related calling convention when
@selector() or messaging is used,
- forming any @selector() expression with a possibly direct selector.
Lastly an `objc_direct_members` attribute is added that can decorate
`@implementation` blocks and causes methods only declared there (and in
no `@interface`) to be automatically direct. When decorating an
`@interface` then all methods and properties declared in this block are
marked direct.
Radar-ID: rdar://problem/
2684889
Differential Revision: https://reviews.llvm.org/D69991
Reviewed-By: John McCall
Craig Topper [Mon, 18 Nov 2019 19:14:13 +0000 (11:14 -0800)]
[LegalizeDAG] Convert strict fp nodes to libcalls without losing the chain.
Previously we mutated the node and then converted it to a libcall. But this loses the chain information.
This patch keeps the chain, but unfortunately breaks tail call optimization as the functions involved in deciding if a node is in tail call position can't handle the chain. But correct ordering seems more important to be right.
Somehow the SystemZ tests improved. I looked at one of them and it seemed that we're handling the split vector elements in a different order and that made the copies work better.
Differential Revision: https://reviews.llvm.org/D70334
Philip Reames [Mon, 18 Nov 2019 19:21:53 +0000 (11:21 -0800)]
[LoopPred/WC] Use a dominating widenable condition to remove analyze loop exits
This implements a version of the predicateLoopExits transform from IndVarSimplify extended to exploit widenable conditions - and thus be much wider in scope of legality. The code structure ends up being almost entirely different, so I chose to duplicate this into the LoopPredication pass instead of trying to reuse the code in the IndVars.
The core notions of the transform are as follows:
If we have a widenable condition which controls entry into the loop, we're allowed to widen it arbitrarily. Given that, it's simply a *profitability* question as to what conditions to fold into the widenable branch.
To avoid pass ordering issues, we want to avoid widening cases that would otherwise be dischargeable. Or... widen in a form which can still be discharged. Thus, we phrase the transform as selecting one analyzeable exit from the set of analyzeable exits to keep. This avoids creating pass ordering complexities.
Since none of the above proves that we actually exit through our analyzeable exits - we might exit through something else entirely - we limit ourselves to cases where a) the latch is analyzeable and b) the latch is predicted taken, and c) the exit being removed is statically cold.
Differential Revision: https://reviews.llvm.org/D69830
Francis Visoiu Mistrih [Mon, 18 Nov 2019 18:09:31 +0000 (10:09 -0800)]
Reland: [Remarks][Driver] Use different remark files when targeting multiple architectures
When the driver is targeting multiple architectures at once, for things
like Universal Mach-Os, we need to emit different remark files for each
cc1 invocation to avoid overwriting the files from a different
invocation.
For example:
$ clang -c -o foo.o -fsave-optimization-record -arch x86_64 -arch x86_64h
will create two remark files:
* foo-x86_64.opt.yaml
* foo-x86_64h.opt.yaml
Stefan Pintilie [Mon, 18 Nov 2019 19:08:22 +0000 (13:08 -0600)]
[PowerPC] Test case for vector float gather on ppc64le and ppc64
Test case to verify that the expected code is generated for a
vector float gather based on the patterns in tablegen for big
and little endian cases.
Patch by: Kamau Bridgeman
Differential Revision: https://reviews.llvm.org/D69443
Reid Kleckner [Mon, 18 Nov 2019 18:52:10 +0000 (10:52 -0800)]
Revert "[Remarks][Driver] Use different remark files when targeting multiple architectures"
This reverts commit
b4e2b112b58154a89171df39dae80044865ff4ff.
Test doesn't appear to pass on Windows, maybe all non-Mac.
Eric Christopher [Mon, 18 Nov 2019 18:45:23 +0000 (10:45 -0800)]
Temporarily Revert "Add support for options -frounding-math, ftrapping-math, -ffp-model=, and -ffp-exception-behavior="
and a follow-up NFC rearrangement as it's causing a crash on valid. Testcase is on the original review thread.
This reverts commits
af57dbf12e54f3a8ff48534bf1078f4de104c1cd and
e6584b2b7b2de06f1e59aac41971760cac1e1b79
Reid Kleckner [Mon, 18 Nov 2019 18:37:54 +0000 (10:37 -0800)]
Allocate builtins table earlier to fix bug found by ubsan
Follow up to
979da9a4c3ba
Francis Visoiu Mistrih [Mon, 18 Nov 2019 18:09:31 +0000 (10:09 -0800)]
[Remarks][Driver] Use different remark files when targeting multiple architectures
When the driver is targeting multiple architectures at once, for things
like Universal Mach-Os, we need to emit different remark files for each
cc1 invocation to avoid overwriting the files from a different
invocation.
For example:
$ clang -c -o foo.o -fsave-optimization-record -arch x86_64 -arch x86_64h
will create two remark files:
* foo-x86_64.opt.yaml
* foo-x86_64h.opt.yaml
Yi Kong [Thu, 26 Sep 2019 21:45:09 +0000 (14:45 -0700)]
[builtins] Implement rounding mode support for i386/x86_64
Differential Revision: https://reviews.llvm.org/D69870
Vedant Kumar [Thu, 14 Nov 2019 22:30:56 +0000 (14:30 -0800)]
[Signal] Allow llvm clients to opt into one-shot SIGPIPE handling
Allow clients of the llvm library to opt-in to one-shot SIGPIPE
handling, instead of forcing them to undo llvm's SIGPIPE handler
registration (which is brittle).
The current behavior is preserved for all llvm-derived tools (except
lldb) by means of a default-`true` flag in the InitLLVM constructor.
This prevents "IO error" crashes in long-lived processes (lldb is the
motivating example) which both a) load llvm as a dynamic library and b)
*really* need to ignore SIGPIPE.
As llvm signal handlers can be installed when calling into libclang
(say, via RemoveFileOnSignal), thereby overriding a previous SIG_IGN for
SIGPIPE, there is no clean way to opt-out of "exit-on-SIGPIPE" in the
current model.
Differential Revision: https://reviews.llvm.org/D70277
Jon Chesterfield [Mon, 18 Nov 2019 18:16:35 +0000 (18:16 +0000)]
[libomptarget][nfc] Move some source into common from nvptx
Summary:
[libomptarget][nfc] Move some source into common from nvptx
Moves some source that compiles cleanly under amdgcn into a common subdirectory
Includes some non-trivial files and some headers. Keeps the cuda file extension.
The build systems for different architectures seem unlikely to have much in
common. The idea is therefore to set include paths such that files under
common/src compile as if they were under arch/src as the mechanism for sharing.
In particular, files under common/src need to be able to include target_impl.h.
The corresponding -Icommon is left out in favour of explicit includes on the
basis that the it makes it clearer which files under common are used by a given
architecture.
Reviewers: jdoerfert, ABataev, grokos
Reviewed By: ABataev
Subscribers: jfb, mgorny, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D70328
Michael Liao [Mon, 18 Nov 2019 18:07:08 +0000 (13:07 -0500)]
Fix shared lib build.
Adrian Prantl [Mon, 18 Nov 2019 17:58:16 +0000 (09:58 -0800)]
Replace bitfield in lldb::Type with byte-sized members. (NFC)
Due to alginment and packing using separate members takes up the same
amount of space, but makes it far less cumbersome to deal with it in
constructors etc.
Julian Lettner [Mon, 18 Nov 2019 17:37:40 +0000 (09:37 -0800)]
[cmake] Factor out DEFAULT_SANITIZER_MIN_OSX_VERSION
Julian Lettner [Thu, 7 Nov 2019 00:41:40 +0000 (16:41 -0800)]
Bump sanitizer iOS deployment target to 9.0
Bump default value for `-miphoneos-version-min=x` to 9.0 (from 8.0).
TSan tests that use thread local storage `__thread` (e.g., tls_race.cpp)
are failing to link for the iOS simulator (arch=x86_64 and
-miphoneos-version-min=8.0) on internal/master (will be submitted to
Glacier train):
```
ld: targeted OS version does not support use of thread local variables in _main for architecture x86_64
```
iOS 9.0 was released 2015.
Julian Lettner [Thu, 7 Nov 2019 00:32:05 +0000 (16:32 -0800)]
Bump sanitizer macOS deployment target to 10.10
Bump default value for `SANITIZER_MIN_OSX_VERSION` to 10.10 (from 10.9).
TSan does not work on macOS 10.9 and a nice error message is preferable
to an "unreferenced symbol" error when loading the TSan runtime.
We could try to only bump the deployment target for TSan, but we would
have to invest into adding support for this to our CMake build and it
does not seem worth it. macOS 10.10 was released in 2014.
rdar://
31335781
Jonas Devlieghere [Mon, 18 Nov 2019 17:14:14 +0000 (09:14 -0800)]
[Docs] Add Python caveats under the development section
This adds a page named Caveats with a section on some of the things to
be aware of related to Python. It's a question we've seen more than once
pop up and I think it's good to have it documentation on the website.
Even though some of it might be useful to users, I still put it under
"development" because it requires some understanding of how LLDB is
built.
Differential revision: https://reviews.llvm.org/D70252
Fangrui Song [Mon, 18 Nov 2019 17:06:14 +0000 (09:06 -0800)]
[yaml2obj][test] Move tests to binary format specific subdirectories
Create COFF/, ELF/, and Minidump and move tests there.
Also
* Rename `*.test` to `*.yaml`
* For yaml2obj RUN lines, use `-o %t` instead of `> %t` for consistency.
We still have tests that check stdout is the default output, e.g.
multi-doc.test
* Update tests to consistently use `##` for comments.
`#` is for RUN and CHECK lines.
* Merge symboless-relocation.yaml and invalid-symboless-relocation.yaml to ELF/relocation-implicit-symbol-index.test
Reviewed By: grimar, jhenderson
Differential Revision: https://reviews.llvm.org/D70264
Joel E. Denny [Mon, 18 Nov 2019 15:22:14 +0000 (10:22 -0500)]
[Attr] Fix `-ast-print` for `asm` attribute
Without this fix, the tests introduced here produce the following
assert fail:
```
clang: /home/jdenny/llvm/clang/include/clang/Basic/AttributeCommonInfo.h:163: unsigned int clang::AttributeCommonInfo::getAttributeSpellingListIndex() const: Assertion `(isAttributeSpellingListCalculated() || AttrName) && "Spelling cannot be found"' failed.
```
The bug was introduced by D67368, which caused `AsmLabelAttr`'s
spelling index to be set to `SpellingNotCalculated`.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D70349
Francesco Petrogalli [Mon, 18 Nov 2019 16:41:03 +0000 (16:41 +0000)]
[dwarfgen] Fix initialization order error. [NFCI]
This commit fixes the `-Werror=reorder` builds.
Alexey Bataev [Mon, 18 Nov 2019 16:13:08 +0000 (11:13 -0500)]
[OPENMP50]Fix PR44024: runtime assert in distribute construct.
If the code is emitted for distribute construct, the nonmonotonic
modifier should not be added.
Julian Lettner [Mon, 18 Nov 2019 16:00:46 +0000 (08:00 -0800)]
[ASan] Mark test as UNSUPPORTED for iOS simulator
coverage-fork.cpp uses `fork()` which requires additional permissions
in the iOS simulator sandbox. We cannot use `sandbox-exec` to grant
these permissions since this is a Posix (not Darwin) test.
LLVM GN Syncbot [Mon, 18 Nov 2019 15:48:35 +0000 (15:48 +0000)]
gn build: Merge
2054ed052f1
Utkarsh Saxena [Thu, 7 Nov 2019 11:14:38 +0000 (12:14 +0100)]
[clangd] Store xref for Macros in ParsedAST.
This patch adds the cross references for Macros in the MainFile.
We add references for the main file to the ParsedAST. We query the
references from it using the SymbolID.
Xref outside main file will be added to the index in a separate patch.
Pavel Labath [Mon, 18 Nov 2019 15:15:02 +0000 (16:15 +0100)]
[NFC] Clean up debug-names-verify-completeness.s test
This patch replaces the tabs by spaces and avoid the need for a
debug_str section by moving all strings inline. It also removes the
hardcoded DIE offsets in the test, which will simplify a follow-up
patch.
Haojian Wu [Wed, 6 Nov 2019 14:04:48 +0000 (15:04 +0100)]
[clangd] Implement rename by using SelectionTree and findExplicitReferences.
Summary:
With the new implemenation, we will have better coverage of various AST
nodes, and fix some known/potential bugs.
Also added the existing clang-renamae tests. Known changed behavior:
- "~Fo^o()" will not trigger the rename, will fix afterwards
- references in macro bodies are not renamed now
This fixes:
- https://github.com/clangd/clangd/issues/167
- https://github.com/clangd/clangd/issues/169
- https://github.com/clangd/clangd/issues/171
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69934
Russell Gallop [Mon, 18 Nov 2019 15:03:14 +0000 (15:03 +0000)]
[NFC] Fix test reserve_global_reg.ll after
2d739f9
Sam McCall [Mon, 18 Nov 2019 14:53:22 +0000 (15:53 +0100)]
Revert "[DWARF5]Addition of alignment atrribute in typedef DIE."
This reverts commit
423f541c1a322963cf482683fe9777ef0692082d, which
breaks llvm-c ABI.
Tim Northover [Mon, 24 Sep 2018 13:07:59 +0000 (14:07 +0100)]
arm64_32: support function return in FastISel.
Pavel Labath [Thu, 14 Nov 2019 10:22:00 +0000 (11:22 +0100)]
Re-commit "DWARF location lists: Add section index dumping"
This reapplies
c0f6ad7d1f3ccb9d0b9ce9ef8dfa06409ccf1b3e with an
additional fix in test/DebugInfo/X86/constant-loclist.ll, which had a
slightly different output on windows targets. The test now accounts for
this difference.
The original commit message follows.
Summary:
As discussed in D70081, this adds the ability to dump section
names/indices to the location list dumper. It does this by moving the
range specific logic from DWARFDie.cpp:dumpRanges into the
DWARFAddressRange class.
The trickiest part of this patch is the backflip in the meanings of the
two dump flags for the location list sections.
The dumping of "raw" location list data is now controlled by
"DisplayRawContents" flag. This frees up the "Verbose" flag to be used
to control whether we print the section index. Additionally, the
DisplayRawContents flag is set for section-based dumps whenever the
--verbose option is passed, but this is not done for the "inline" dumps.
Also note that the index dumping currently does not work for the DWARF
v5 location lists, as the parser does not fill out the appropriate
fields. This will be done in a separate patch.
Reviewers: dblaikie, probinson, JDevlieghere, SouraVX
Subscribers: sdardis, hiraditya, jrtc27, atanasyan, arphaman, aprantl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70227
Dmitry Preobrazhensky [Mon, 18 Nov 2019 14:23:40 +0000 (17:23 +0300)]
[AMDGPU][MC][GFX10] Enabled v_movrel*[sdwa|dpp|dpp8] opcodes
See https://bugs.llvm.org/show_bug.cgi?id=43712
Reviewers: arsenm, rampitec
Differential Revision: https://reviews.llvm.org/D70170
Haojian Wu [Mon, 18 Nov 2019 14:17:50 +0000 (15:17 +0100)]
[clangd] Fix some clang-tidy warnings on SourceCodeTests.cpp, NFC.
Alex Cameron [Mon, 18 Nov 2019 14:11:29 +0000 (15:11 +0100)]
[lldb] Fix JSON parser to allow empty arrays
Summary:
Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=39405
```
alexc@kitty:~/work/wiredtiger/build_posix$ cat breakpoint.json
[{"Breakpoint" : {"BKPTOptions" : {"AutoContinue" : false,"ConditionText" : "","EnabledState" : true,"IgnoreCount" : 0,"OneShotState" : false},"BKPTResolver" : {"Options" : {"NameMask" : [56],"Offset" : 0,"SkipPrologue" : true,"SymbolNames" : ["__wt_btcur_search"]},"Type" : "SymbolName"},"Hardware" : false,"SearchFilter" : {"Options" : {},"Type" : "Unconstrained","Foo" : []}}}]
```
**Before**
```
(lldb) breakpoint read --file breakpoint.json
error: Invalid JSON from input file: /home/alexc/work/wiredtiger/build_posix/breakpoint.json.
```
**After**
```
(lldb) breakpoint read --file breakpoint.json
New breakpoints:
Breakpoint 1: where = libwiredtiger-3.2.2.so`__wt_btcur_search + 15 at bt_cursor.c:522:5, address = 0x00007ffff576ab2f
```
Reviewers: xbolva00, davide, labath
Reviewed By: davide, labath
Subscribers: mgorny, jingham, labath, davide, JDevlieghere, lldb-commits
Tags: #llvm, #lldb
Differential Revision: https://reviews.llvm.org/D68179
Simon Pilgrim [Mon, 18 Nov 2019 14:08:46 +0000 (14:08 +0000)]
Remove useless param tag to fix Wdocumentation warning. NFCI.
Haojian Wu [Mon, 18 Nov 2019 13:56:59 +0000 (14:56 +0100)]
[clangd] Fix diagnostic warnings in the RenameTests, NFC.
Simon Pilgrim [Mon, 18 Nov 2019 13:57:20 +0000 (13:57 +0000)]
Fix cppcheck shadow variable warning. NFC.
Simon Pilgrim [Mon, 18 Nov 2019 13:56:21 +0000 (13:56 +0000)]
llvm-objcopy - fix uninitialized variable warnings. NFC.
Ed Maste [Mon, 18 Nov 2019 13:49:55 +0000 (08:49 -0500)]
Avoid duplicate exe_path definition on recent FreeBSD
protze@itc.rwth-aachen.de [Mon, 18 Nov 2019 00:23:31 +0000 (01:23 +0100)]
[OpenMP] Add implementation and tests of Archer tool
The tool provides TSAN annotations for OpenMP synchronization. The tool
is activated if no other OMPT tool is loaded.
The tool detects whether the application was built with TSan and rejects
activation according to the OMPT protocol if there is no TSan-rt.
Differential Revision: https://reviews.llvm.org/D45890
Simon Pilgrim [Mon, 18 Nov 2019 13:26:32 +0000 (13:26 +0000)]
Revert rGc0f6ad7d1f3c : "DWARF location lists: Add section index dumping"
This reverts commit
c0f6ad7d1f3ccb9d0b9ce9ef8dfa06409ccf1b3e to fix the buildbots.
Simon Pilgrim [Mon, 18 Nov 2019 12:06:13 +0000 (12:06 +0000)]
DwarfGenerator - fix uninitialized variable warnings. NFC.
Simon Pilgrim [Mon, 18 Nov 2019 12:05:40 +0000 (12:05 +0000)]
Fix uninitialized variable warning. NFC.
Simon Pilgrim [Mon, 18 Nov 2019 12:04:48 +0000 (12:04 +0000)]
llvm-rc - fix uninitialized variable warnings. NFC.
Simon Pilgrim [Mon, 18 Nov 2019 11:55:30 +0000 (11:55 +0000)]
Fix uninitialized variable warning. NFC.
Raphael Isemann [Mon, 18 Nov 2019 13:14:52 +0000 (14:14 +0100)]
[lldb][NFC] Cleanup comments in ClangASTSource.h
The current file doesn't follow the 80 character limit and uses this
cramped comment style that is hard to read.
Aaron Smith [Mon, 18 Nov 2019 13:07:35 +0000 (13:07 +0000)]
Fix a print error found while testing llvm-objcopy
A value was not printed as hex. This updates the output and test cases.
czhengsz [Mon, 18 Nov 2019 12:43:30 +0000 (07:43 -0500)]
[PowerPC] [NFC] add IR testcases for folding rlwinma.
Graham Hunter [Wed, 14 Aug 2019 10:48:39 +0000 (11:48 +0100)]
[SVE][CodeGen] Scalable vector MVT size queries
* Implements scalable size queries for MVTs, split out from D53137.
* Contains a fix for FindMemType to avoid using scalable vector type
to contain non-scalable types.
* Explicit casts for several places where implicit integer sign
changes or promotion from 32 to 64 bits caused problems.
* CodeGenDAGPatterns will treat scalable and non-scalable vector types
as different.
Reviewers: greened, cameron.mcinally, sdesmalen, rovka
Reviewed By: rovka
Differential Revision: https://reviews.llvm.org/D66871
Haojian Wu [Mon, 18 Nov 2019 10:35:00 +0000 (11:35 +0100)]
[clangd] Expose the xref's incomplete flag to clangdServer API.
Summary: so that clangd C++ API users (via ClangdServer) can access it.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70380
Simon Pilgrim [Mon, 18 Nov 2019 11:42:14 +0000 (11:42 +0000)]
Fix "not all control paths return a value" warning. NFCI.
Simon Pilgrim [Mon, 18 Nov 2019 11:36:14 +0000 (11:36 +0000)]
[X86][SSE] Add test for extractelement with multiple uses
Mentioned in D70267
Simon Pilgrim [Mon, 18 Nov 2019 11:34:34 +0000 (11:34 +0000)]
Fix signed/unsigned comparison warning. NFCI.
Simon Cook [Mon, 18 Nov 2019 10:58:00 +0000 (10:58 +0000)]
[RISCV] Add assembly mnemonic spell checking
Summary:
This allows the assembler to suggest alternative assembly mnemonics when
an invalid one has been provided.
Reviewers: asb, lenary, lewis-revill
Reviewed By: asb
Subscribers: hiraditya, rbar, johnrusso, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, pzheng, sameer.abuasal, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69894
Simon Cook [Mon, 18 Nov 2019 10:44:13 +0000 (10:44 +0000)]
[RISCV] Set triple based on -march flag
For RISC-V the value provided to -march should determine whether to
compile for 32- or 64-bit RISC-V irrespective of the target provided to
the Clang driver. This adds a test for this flag for RISC-V and sets the
Target architecture correctly in these cases.
Differential Revision: https://reviews.llvm.org/D54214
QingShan Zhang [Mon, 18 Nov 2019 10:13:21 +0000 (10:13 +0000)]
[NFC][Test] Add the vavg test for PowerPC