Commit Graph

374002 Commits

Author SHA1 Message Date
Philip Reames bfda69416c [BasicAA] Fix a bug with relational reasoning across iterations
Due to the recursion through phis basicaa does, the code needs to be extremely careful not to reason about equality between values which might represent distinct iterations. I'm generally skeptical of the correctness of the whole scheme, but this particular patch fixes one particular instance which is demonstrateable incorrect.

Interestingly, this appears to be the second attempted fix for the same issue. The former fix is incomplete and doesn't address the actual issue.

Differential Revision: https://reviews.llvm.org/D92694
2020-12-05 14:10:21 -08:00
Jonas Devlieghere 13ee00d0c9 [debugserver] Use dlsym for posix_spawnattr_setarchpref_np
The @available check did not work as I thought it did. Use good old
dlsym instead.
2020-12-05 14:06:45 -08:00
Fangrui Song 37f0c8df47 [X86] Emit @PLT for x86-64 and keep unadorned symbols for x86-32
This essentially reverts the x86-64 side effect of r327198.

For x86-32, @PLT (R_386_PLT32) is not suitable in -fno-pic mode so the
code forces MO_NO_FLAG (like a forced dso_local) (https://bugs.llvm.org//show_bug.cgi?id=36674#c6).

For x86-64, both `call/jmp foo` and `call/jmp foo@PLT` emit R_X86_64_PLT32
(https://sourceware.org/bugzilla/show_bug.cgi?id=22791) so there is no
difference using @PLT. Using @PLT is actually favorable because this drops
a difference with -fpie/-fpic code and makes it possible to avoid a canonical
PLT entry when taking the address of an undefined function symbol.
2020-12-05 13:17:47 -08:00
Chris Sears 9737c128f1 [llvmbuildectomy] removed vestigial LLVMBuild.txt files
LLVMBuild has been removed from the build system. However, three LLVMBuild.txt
files remain in the tree. This patch simply removes them.

llvm/lib/ExecutionEngine/Orc/TargetProcess/LLVMBuild.txt
llvm/tools/llvm-jitlink/llvm-jitlink-executor/LLVMBuild.txt
llvm/tools/llvm-profgen/LLVMBuild.txt

Differential Revision: https://reviews.llvm.org/D92693
2020-12-05 22:00:22 +01:00
Fangrui Song db13a138bd [TargetMachine] Move X86 specific shouldAssumeDSOLocal logic to X86Subtarget::classifyGlobalFunctionReference 2020-12-05 12:32:50 -08:00
Nikita Popov ae5e013f6e [BasicAA] Add more tests for non-equal index (NFC) 2020-12-05 21:22:57 +01:00
Fangrui Song 68edf39ede [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.
2020-12-05 11:40:18 -08:00
Jonas Devlieghere c722096b39 [debugserver] Remove bridgeos availability
I didn't realize that the 'bridgeos' is not part of the public SDK.
2020-12-05 10:18:45 -08:00
Benjamin Kramer 2a136a7a9c [X86] Autodetect znver3 2020-12-05 19:08:20 +01:00
Joachim Protze a148216b31 [OpenMP][OMPT] Fix OMPT return address guard for gomp interface
D91692 missed various locations in kmp_gsupport, where the scope for
OMPT_STORE_RETURN_ADDRESS is too narrow, i.e. the scope ends before the OMPT
callback is called in some nested function.

This patch fixes the scoping issue, so that all OMPT tests pass, when the
tests are built with gcc.

Differential Revision: https://reviews.llvm.org/D92121
2020-12-05 19:06:28 +01:00
Zbigniew Sarbinowski e6c89a499d [SystemZ][ZOS] Fix the usage of pthread_t within libc++
This is the the minimal change introduced in [[ https://reviews.llvm.org/D88599 | D88599 ]]  to unblock the controversial change and discussion of proper separation between thread from thread id which will continue in D88599.

This patch will address the differences of definition of pthread_t on z/OS vs. Linux and other OS. Main trick to make the code work on z/OS relies on redefining libcpp_thread_id type and _LIBCPP_NULL_THREAD macro. This is necessary to separate initialization of libcxx_thread_id from the one of __libcxx_thread_t;

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D91875
2020-12-05 17:46:30 +00:00
mydeveloperday 8668eae2ad [clang-format] Add option for case sensitive regexes for sorted includes
I think the title says everything.

Reviewed By: MyDeveloperDay

Patch By:  HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D91507
2020-12-05 16:33:21 +00:00
Mark de Wever ce6269f9ba [NFC][libc++] Update C++20 issues status.
Properly mark LWG1203 as completed and move the version number to the
version column.
2020-12-05 16:36:19 +01:00
Mark de Wever f687b4ac84 [NFC][clang-tidy] Fixes comment typos. 2020-12-05 16:31:16 +01:00
Florian Hahn 4e5c0c2a63 [ConstraintElimination] Wrap dump() call in LLVM_DEBUG (NFC).
ConstraintSystem::dump only generates output with -debug, but there's no
need to call it without -debug.
2020-12-05 13:14:53 +00:00
Florian Hahn 4ceecc820b [ConstraintElimination] Handle constraints with all zero var coeffs.
Constraints where all variable coefficients are 0 do not add any useful
information. When checking, we can check if they are always true/false.
2020-12-05 12:06:53 +00:00
Dmitry Preobrazhensky a0b3a9391c [AMDGPU][MC] Improved diagnostics message for sym/expr operands
See bug 48295 (https://bugs.llvm.org/show_bug.cgi?id=48295)

Reviewers: rampitec

Differential Revision: https://reviews.llvm.org/D92088
2020-12-05 14:05:53 +03:00
Nikita Popov 0003600aaf [AA] Initialize Depth member
Fix mistake introduced in f8afba5f7a25a69c12191d979d78d40fa6e5b684:
I failed to initialize the Depth member to zero.
2020-12-05 11:37:36 +01:00
Dmitry Preobrazhensky e97dd11977 [AMDGPU][MC] Corrected error position for invalid MOVREL src
See bug 47518 (https://bugs.llvm.org/show_bug.cgi?id=47518)

Reviewers: rampitec

Differential Revision: https://reviews.llvm.org/D92084
2020-12-05 13:23:14 +03:00
mydeveloperday 0e226d00d2 [clang-format] [NFC] keep clang-format tests clang-format clean
I use several of the clang-format clean directories as a test suite, this one had got slightly out of wack in a prior commit

Reviewed By: HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D92666
2020-12-05 10:15:52 +00:00
Nikita Popov f8afba5f7a [AA] Add statistics for alias results (NFC)
Count how many NoAlias/MustAlias/MayAlias we get from top-level
queries.
2020-12-05 11:09:15 +01:00
Nikita Popov 8925d23474 [BasicAA] Add recphi tests with nested loops (NFC) 2020-12-05 11:09:15 +01:00
Fangrui Song 1ab9327d1c [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).
2020-12-05 00:42:07 -08:00
Fangrui Song 2ec43a7b22 [TargetMachine] Delete wasm special case from shouldAssumeDSOLocal 2020-12-04 23:22:47 -08:00
Francis Visoiu Mistrih 3d381a7102 [llvm-nm][MachO] Don't call getFlags on redacted symbols
Avoid calling getFlags on a non-existent symbol.

The way this is triggered is by calling strip -N on a binary, which sets
the MH_NLIST_OUTOFSYNC_WITH_DYLDINFO header flag. Then, in the
LC_FUNCTION_STARTS command, nm is trying to print the stripped symbols
and needs the proper checks.
2020-12-04 21:48:53 -08:00
Kazu Hirata 2dc4a14e4d [AMDGPU] Use llvm::is_contained (NFC) 2020-12-04 21:42:55 -08:00
Kazu Hirata 8006043b13 [IRCE] Remove unused IsSigned and its accessor (NFC)
IsSigned and its accessor, isSigned, were introduced on Oct 25, 2017
in commit 9ac7021a25.  The last use was
removed on Nov 20, 2017 in commit
268467869b.
2020-12-04 21:26:12 -08:00
Hsiangkai Wang 3c12307c7a [RISCV] Formatting for easier reading (NFC)
Authored-by: Hsiangkai Wang <kai.wang@sifive.com>
2020-12-04 23:11:36 -06:00
River Riddle 47364f95e8 [mlir][IR] Move the storage for results to before the Operation instead of after.
Trailing objects are really nice for storing additional data inline with the main class, and is something that we heavily take advantage of for Operation(and many other classes). To get the address of the inline data you need to compute the address by doing some pointer arithmetic taking into account any objects stored before the object you want to access. Most classes keep the count of the number of objects, so this is relatively cheap to compute. This is not the case for results though, which have two different types(inline and trailing) that are not necessarily as cheap to compute as the count for other objects. This revision moves the storage for results to before the operation and stores them in reverse order. This allows for getting results to still be very fast given that they are never iterated directly in order, and also greatly improves the speed when accessing the other trailing objects of an operation(operands/regions/blocks/etc).

This reduced compile time when compiling a decently sized mlir module by about ~400ms, or 2.17s -> 1.76s.

Differential Revision: https://reviews.llvm.org/D92687
2020-12-04 21:01:42 -08:00
River Riddle 7924fb34f3 [mlir][OpFormatGen] Add support for optional enum attributes
The check for formatting enum attributes was missing a call to get the base attribute, which is necessary to strip off the top-level OptionalAttr<> wrapper.

Differential Revision: https://reviews.llvm.org/D92713
2020-12-04 21:00:44 -08:00
Zhuojia Shen 24333481cb [builtins][ARM] Check __ARM_FP instead of __VFP_FP__.
This patch fixes builtins' CMakeLists.txt and their VFP tests to check
the standard macro defined in the ACLE for VFP support. It also enables
the tests to be built and run for single-precision-only targets while
builtins were built with double-precision support.

Differential revision: https://reviews.llvm.org/D92497
2020-12-04 20:53:23 -08:00
Jonas Devlieghere 0db37576c1 [debugserver] Honor the cpu sub type if specified
Use the newly added spawnattr API, posix_spawnattr_setarchpref_np, to
select a slice preferences per cpu and subcpu types, instead of just cpu
with posix_spawnattr_setarchpref_np.

rdar://16094957

Differential revision: https://reviews.llvm.org/D92712
2020-12-04 20:37:41 -08:00
Jonas Devlieghere 315fab428d [lldb] Remove unused argument to expectedFailure 2020-12-04 20:37:41 -08:00
Fangrui Song f2bbbad141 [ELF] Fix relocation-model.ll 2020-12-04 19:33:19 -08:00
Fangrui Song 961f31d8ad [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.
2020-12-04 19:03:41 -08:00
Fangrui Song fd32639823 [test] Split some tests which test both static and pic relocation models
TargetMachine::shouldAssumeDSOLocal currently implies dso_local for
Static. Split some tests so that these `external dso_local global`
will align with the Clang behavior.
2020-12-04 19:03:40 -08:00
Craig Topper 03fc4f2e9a [RISCV] Use fcvt.h/d/f.w if the input is an assertsexti32 not just when the input is sext_inreg. 2020-12-04 18:40:02 -08:00
Tony 3242eaef27 [NFC][AMDGPU] AMDGPUUsage updates
- Document code object V2 gfx800.
- Document amdpal is supported by Linux Pro.

Differential Revision: https://reviews.llvm.org/D92708
2020-12-05 02:13:17 +00:00
Fangrui Song 6dbd0eac02 [test] Split some tests which test both static and pic relocation models
TargetMachine::shouldAssumeDSOLocal currently implies dso_local for
Static. Split some tests so that these `external dso_local global` will
align with the Clang behavior.
2020-12-04 18:11:35 -08:00
Sam Clegg ab58e4cb51 [lld][WebAssembly] Add suppport for PIC + passive data initialization
This change improves our support for shared memory to include
PIC executables (and shared libraries).

To handle this case the linker-generated `__wasm_init_memory`
function (that only exists in shared memory builds) must be
capable of loading memory segements at non-const offsets based
on the runtime value of `__memory_base`.

Differential Revision: https://reviews.llvm.org/D92620
2020-12-04 17:28:23 -08:00
Fangrui Song 2518433f86 Make __stack_chk_guard dso_local if Reloc::Static
This is currently implied by TargetMachine::shouldAssumeDSOLocal
but will be changed in the future.
2020-12-04 16:57:45 -08:00
Nathan Lanza 54971c3a75 [llvm] Update WinMsvc.cmake's fms-compatability to match llvm's prereqs
llvm's minimum fms-compatability-version was just bumped to 19.14 and
thus the WinMsvc.cmake file needs to be adjusted accordingly.
2020-12-04 16:35:05 -08:00
Hsiangkai Wang 5e953a274b [RISCV] Define preprocessor definitions for 'V' extension.
Differential Revision: https://reviews.llvm.org/D92650
2020-12-05 08:34:32 +08:00
Alex Lorenz db226cdf4c [objc] diagnose protocol conformance in categories with direct members
in their corresponding class interfaces

Categories that add protocol conformances to classes with direct members should prohibit protocol
conformances when the methods/properties that the protocol expects are actually declared as 'direct' in the class.

Differential Revision: https://reviews.llvm.org/D92602
2020-12-04 15:55:34 -08:00
Alex Lorenz eddd1d192b [clang] add a `swift_async_name` attribute
The swift_async_name attribute provides a name for a function/method that can be used
to call the async overload of this method from Swift. This name specified in this attribute
assumes that the last parameter in the function/method its applied to is removed when
Swift invokes it, as the the Swift's await/async transformation implicitly constructs the callback.

Differential Revision: https://reviews.llvm.org/D92355
2020-12-04 15:55:29 -08:00
Alex Lorenz 03dcd57ecf [clang] add a new `swift_attr` attribute
The swift_attr attribute is a generic annotation attribute that's not used by clang,
but is used by the Swift compiler. The Swift compiler can use these annotations to provide
various syntactic and semantic sugars for the imported Objective-C API declarations.

Differential Revision: https://reviews.llvm.org/D92354
2020-12-04 15:53:24 -08:00
Philip Reames 99f79cbf31 [test] precommit test for D92698 2020-12-04 15:17:39 -08:00
Duncan P. N. Exon Smith d126943251 Index: Remove unused internal header SimpleFormatContext.h, NFC
Looks like nothing has included this header since
d21485d2f5 / r286279 in 2016. Delete the
dead code.
2020-12-04 15:10:27 -08:00
shafik 6333871f85 Add diagnostic for for-range-declaration being specificed with thread_local
Currently we have a diagnostic that catches the other storage class specifies for the range based for loop declaration but we miss the thread_local case. This changes adds a diagnostic for that case as well.

Differential Revision: https://reviews.llvm.org/D92671
2020-12-04 15:06:35 -08:00
Fangrui Song 190b4374c0 [asan][test] Improve -asan-use-private-alias tests
In preparation for D92078
2020-12-04 15:05:59 -08:00