Nemanja Ivanovic [Wed, 2 Sep 2020 22:04:35 +0000 (17:04 -0500)]
[PowerPC] Fix broken kill flag after MI peephole
The test case in https://bugs.llvm.org/show_bug.cgi?id=47373 exposed
two bugs in the PPC back end. The first one was fixed in commit
27714075848e7f05a297317ad28ad2570d8e5a43 but the test case had to
be added without -verify-machineinstrs due to the second bug.
This commit fixes the use-after-kill that is left behind by the
PPC MI peephole optimization.
Walter Erquinigo [Wed, 2 Sep 2020 21:46:20 +0000 (14:46 -0700)]
Fix
de6caf871be79dc7549aebe4e4fb57d52f6ed202
Failure found in
http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/16855
The issue is a header not being included
Huihui Zhang [Wed, 2 Sep 2020 22:02:04 +0000 (15:02 -0700)]
[VectorCombine][SVE] Do not fold bitcast shuffle for scalable type.
First, shuffle cost for scalable type is not known for scalable type;
Second, we cannot reason if the narrowed shuffle mask for scalable type
is a splat or not.
E.g., Bitcast splat vector from type <vscale x 4 x i32> to <vscale x 8 x i16>
will involve narrowing shuffle mask <vscale x 4 x i32> zeroinitializer to
<vscale x 8 x i32> with element sequence of <0, 1, 0, 1, ...>, which cannot be
reasoned if it's a valid splat or not.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D86995
Geoffrey Martin-Noble [Wed, 2 Sep 2020 22:00:26 +0000 (15:00 -0700)]
Improve error handling for SmallVector programming errors
This patch changes errors in `SmallVector::grow` that are independent of
memory capacity to be reported using report_fatal_error or
std::length_error instead of report_bad_alloc_error, which falsely signals
an OOM.
It also cleans up a few related things:
- makes report_bad_alloc_error to print the failure reason passed
to it.
- fixes the documentation to indicate that report_bad_alloc_error
calls `abort()` not "an assertion"
- uses a consistent name for the size/capacity argument to `grow`
and `grow_pod`
Reviewed By: mehdi_amini, MaskRay
Differential Revision: https://reviews.llvm.org/D86892
Mehdi Amini [Wed, 2 Sep 2020 20:09:07 +0000 (20:09 +0000)]
Use an Identifier instead of an OperationName internally for OpPassManager identification (NFC)
This allows to defers the check for traits to the execution instead of forcing it on the pipeline creation.
In particular, this is making our pipeline creation tolerant to dialects not being loaded in the context yet.
Reviewed By: rriddle, GMNGeoffrey
Differential Revision: https://reviews.llvm.org/D86915
Diego Caballero [Wed, 2 Sep 2020 21:29:04 +0000 (00:29 +0300)]
[mlir][Affine] Support affine vector loads/stores in LICM
Make use of affine memory op interfaces in AffineLoopInvariantCodeMotion so
that it can also work on affine.vector_load and affine.vector_store ops.
Reviewed By: bondhugula
Differential Revision: https://reviews.llvm.org/D86986
Hongtao Yu [Wed, 2 Sep 2020 16:51:30 +0000 (09:51 -0700)]
[ThinLTO] Fix a metadata lost issue with DICompileUnit import.
For ThinLTO importing we don't need to import all the fields of the DICompileUnit, such as enums, macros, retained types lists. The importation of those fields were previously disabled by setting their value map entries to nullptr. Unfortunately a metadata node can be shared by multiple metadata operands. Setting the map entry to nullptr might result in not importing other metadata unexpectedly. The issue is fixed by explicitly setting the original DICompileUnit fields (still a copy of the source module metadata) to null.
Reviewed By: wenlei, dblaikie
Differential Revision: https://reviews.llvm.org/D86675
Walter Erquinigo [Wed, 2 Sep 2020 01:52:14 +0000 (18:52 -0700)]
run in terminal
Kostya Kortchinsky [Fri, 28 Aug 2020 18:44:39 +0000 (11:44 -0700)]
[scudo][standalone] Enable secondary cache release on Fuchsia
I had left this as a TODO, but it turns out it wasn't complicated.
By specifying `MAP_RESIZABLE`, it allows us to keep the VMO which we
can then use for release purposes.
`releasePagesToOS` also had to be called the "proper" way, as Fuchsia
requires the `Offset` field to be correct. This has no impact on
non-Fuchsia platforms.
Differential Revision: https://reviews.llvm.org/D86800
Adrian Prantl [Wed, 2 Sep 2020 20:48:44 +0000 (13:48 -0700)]
Perform an extra consistency check when searching ModuleManager's
cache for implicit modules.
The ModuleManager's use of FileEntry nodes as the keys for its map of
loaded modules is less than ideal. Uniqueness for FileEntry nodes is
maintained by FileManager, which in turn uses inode numbers on hosts
that support that. When coupled with the module cache's proclivity for
turning over and deleting stale PCMs, this means entries for different
module files can wind up reusing the same underlying inode. When this
happens, subsequent accesses to the Modules map will disagree on the
ModuleFile associated with a given file.
In general, it is not sufficient to resolve this conundrum with a type
like FileEntryRef that stores the name of the FileEntry node on first
access because of path canonicalization issues. However, the paths
constructed for implicit module builds are fully under Clang's
control. We *can*, therefore, rely on their structure being consistent
across operating systems and across subsequent accesses to the Modules
map.
To mitigate the effects of inode reuse, perform an extra name check when
implicit modules are returned from the cache. This has the effect of
forcing reused FileEntry nodes to stomp over existing-but-stale entries
in the cache, which simulates a miss - exactly the desired behavior.
rdar://
48443680
Patch by Robert Widmann!
Differential Revision: https://reviews.llvm.org/D86823
Adrian Prantl [Wed, 2 Sep 2020 21:14:26 +0000 (14:14 -0700)]
Revert "[clang] Add missing .def files to Clang's modulemap"
This reverts commit
e0e7eb2e2648aee83caf2ecfe2972ce2f653d306.
[the commit this fixes up was reverted]
Diego Caballero [Wed, 2 Sep 2020 19:26:57 +0000 (22:26 +0300)]
[mlir][Affine] Fix AffineLoopInvariantCodeMotion
Make sure that memory ops that are defined inside the loop are registered
as such in 'defineOp'. In the test provided, the 'mulf' op was hoisted
outside the loop nest even when its 'affine.load' operand was not.
Reviewed By: bondhugula
Differential Revision: https://reviews.llvm.org/D86982
Nemanja Ivanovic [Wed, 2 Sep 2020 20:30:19 +0000 (15:30 -0500)]
[PowerPC] Do not legalize vector FDIV without VSX
Quite a while ago, we legalized these nodes as we added custom
handling for reciprocal estimates in the back end. We have since
moved to target-independent combines but neglected to turn off
legalization. As a result, we can now get selection failures on
non-VSX subtargets as evidenced in the listed PR.
Fixes: https://bugs.llvm.org/show_bug.cgi?id=47373
Jay Foad [Wed, 2 Sep 2020 15:14:58 +0000 (16:14 +0100)]
[APInt] New member function setBitVal
Differential Revision: https://reviews.llvm.org/D87033
Ahsan Saghir [Wed, 2 Sep 2020 19:13:23 +0000 (14:13 -0500)]
[PowerPC] Update MemorySanitizer test to cater for number of CPUs > 1024
MemorySanitizer test fails on systems with more than 1024 CPUs.
This patch updates the test to make it work for machines that
have more than 1024 CPUs. This helps to fix errors on the PowerPC
sanitizer bot.
Reviewed By: #powerpc, nemanjai
Differential Revision: https://reviews.llvm.org/D87053
Yaxun (Sam) Liu [Wed, 2 Sep 2020 18:53:06 +0000 (14:53 -0400)]
Revert "[HIP] Change default --gpu-max-threads-per-block value to 1024"
Temporarily revert commit
04abbb3a78186aa92809866b43217c32cba90b71
due to regressions in some HIP apps due backend issues revealed by
this change.
Will re-commit it when backend issues are fixed.
peter klausler [Wed, 2 Sep 2020 17:37:48 +0000 (10:37 -0700)]
[flang] Implement nonstandard OPEN statement CARRIAGECONTROL specifier
Differential Revision: https://reviews.llvm.org/D87052
Eric Astor [Wed, 2 Sep 2020 20:03:01 +0000 (16:03 -0400)]
Make sure that llvm-ml uses MASM integer lexing when in --as-lex mode
Michael Schellenberger Costa [Wed, 2 Sep 2020 19:42:56 +0000 (21:42 +0200)]
[libcxx] Fix whitespace error
Med Ismail Bennani [Wed, 2 Sep 2020 19:31:09 +0000 (21:31 +0200)]
[lldb/test] Fix TestPlatform*.py Windows failures (NFC)
This patch fixes the windows failures introduced by `addb514`:
http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/18671/steps/test/logs/stdio
This macro, used in the test to check the platform, was missing a `_`,
making the test behave like it was run from a UNIX platform.
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Yitzhak Mandelbaum [Wed, 2 Sep 2020 18:47:29 +0000 (18:47 +0000)]
[libTooling] Restore defaults for matchers in makeRule.
This patch restores the default traversal for Transformer's `makeRule` to
`TK_AsIs`. The implicit mode has proven problematic.
Differential Revision: https://reviews.llvm.org/D87048
Fangrui Song [Wed, 2 Sep 2020 19:21:06 +0000 (12:21 -0700)]
[GCDAProfiling] Suppress -Wprio-ctor-dtor for GCC>=9 and remove unused write_string/length_of_string
The `__attribute__((destructor(100)))` diagnostic does not have a
warning option in GCC 8 (before r264853) and thus cannot be suppressed.
Michael Schellenberger Costa [Wed, 2 Sep 2020 19:20:33 +0000 (21:20 +0200)]
Add constexpr to pair
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D80558
Albion Fung [Wed, 2 Sep 2020 19:16:09 +0000 (14:16 -0500)]
[PowerPC] Implemented Vector Multiply Builtins
This patch implements the builtins for Vector Multiply Builtins (vmulxxd family of instructions), and adds the appropriate test cases for these builtins. The builtins utilize the vector multiply instructions itnroduced with ISA 3.1.
Differential Revision: https://reviews.llvm.org/D83955
Mehdi Amini [Wed, 2 Sep 2020 19:10:36 +0000 (19:10 +0000)]
Store an Identifier instead of a StringRef for the OperationName inside an AbstractOperation (NFC)
Instead of storing a StringRef, we keep an Identifier which otherwise requires a lock on the context to retrieve.
This will allow to get an Identifier for any registered Operation for "free".
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D86994
Erik Pilkington [Wed, 2 Sep 2020 17:30:27 +0000 (13:30 -0400)]
Fix a -Wparenthesis warning in
8ff44e644bb7, NFC
Erik Pilkington [Wed, 2 Sep 2020 16:23:17 +0000 (12:23 -0400)]
[AST] Fix handling of long double and bool in __builtin_bit_cast
On x86, long double has 6 unused trailing bytes. This patch changes the
constant evaluator to treat them as though they were padding bytes, so reading
from them results in an indeterminate value, and nothing is written for them.
Also, fix a similar bug with bool, but instead of treating the unused bits as
padding, enforce that they're zero.
Differential revision: https://reviews.llvm.org/D76323
Raphael Isemann [Wed, 2 Sep 2020 16:01:18 +0000 (18:01 +0200)]
[clang] Add missing .def files to Clang's modulemap
These new .def files weren't marked as textual so they ended up being compiled
into the Clang module (which completely defeats the purpose of .def files).
Nico Weber [Wed, 2 Sep 2020 18:28:42 +0000 (14:28 -0400)]
[gn build] Fix COMPILER_RT_HAS_* defines for libclang_rt.profile
The cmake build uses COMPILER_RT_TARGET_HAS_* in the CMakeLists.txt
but then translates it to -DCOMPILER_RT_HAS_* flags which the
c++ code checks for. So we need to define the latter, not the former.
Julian Lettner [Wed, 2 Sep 2020 18:20:47 +0000 (11:20 -0700)]
[TSan][libdispatch] Fix compilation error on Linux
The interceptor for the block variants of the API references the
function versions (via `REAL(name##_f)`). On Linux, this accesses the
underlying "real pointer", defined by the interceptor macro. So we need
to declare interceptors in the right order to avoid undefined symbol
compiler error:
```
error: no member named 'real_dispatch_async_and_wait_f' in namespace '__tsan::__interception'
```
rdar://
68181542
Douglas Yung [Wed, 2 Sep 2020 17:35:42 +0000 (10:35 -0700)]
Revert "Move all fields of '-cc1' option related classes into def file databases"
This reverts commit
c4a2a1307484cffe94a291c42572775411bac8d8.
This commit was causing a test failure: http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l/builds/1068
Arthur Eubanks [Wed, 2 Sep 2020 16:22:50 +0000 (09:22 -0700)]
[Bindings] Move LLVMAddInstructionSimplifyPass to Scalar.cpp
Should not be with the pass, but alongside all the other C bindings.
Reviewed By: sroland
Differential Revision: https://reviews.llvm.org/D87041
Alex Richardson [Wed, 2 Sep 2020 16:44:00 +0000 (17:44 +0100)]
[clang-format] Parse double-square attributes as pointer qualifiers
Before: x = (foo *[[clang::attr]]) * v;
After: x = (foo *[[clang::attr]])*v;
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D86721
peter klausler [Mon, 31 Aug 2020 19:22:24 +0000 (12:22 -0700)]
[flang] Support multiple CookedSource instances
These are owned by an instance of a new class AllCookedSources.
This removes the need for a Scope to own a string containing
a module's cooked source stream, and will enable errors to be
emitted when parsing module files in the future.
Differential Revision: https://reviews.llvm.org/D86891
Dmitry Preobrazhensky [Wed, 2 Sep 2020 16:42:18 +0000 (19:42 +0300)]
[AMDGPU][MC] Corrected parser to avoid generation of excessive error messages
Summary of changes:
- Changed parser to eliminate generation of excessive error messages;
- Corrected lit tests to match all expected error messages;
- Corrected lit tests to guard against unwanted extra messages (added option "--implicit-check-not=error:");
- Added missing checks and fixed some typos in tests.
See bug 46907: https://bugs.llvm.org/show_bug.cgi?id=46907
Reviewers: arsenm, rampitec
Differential Revision: https://reviews.llvm.org/D86940
peter klausler [Tue, 1 Sep 2020 23:55:43 +0000 (16:55 -0700)]
[flang] Make -fget-symbols-sources output deterministic
The DumpSymbolsSources() routine ordered its output by the addresses
of the names of the symbols, and was susceptible to variation across
environments. Fixed by using a multimap using the values of the names.
Differential Revision: https://reviews.llvm.org/D87035
Louis Dionne [Wed, 2 Sep 2020 16:29:42 +0000 (12:29 -0400)]
[libc++] Remove definition of _LIBCPP_ALIGNOF for GCC in C++03 mode
That definition is known to be potentially incorrect, and we don't support
GCC in C++03 mode anyway.
hyd-dev [Wed, 2 Sep 2020 16:22:29 +0000 (12:22 -0400)]
[libc++] Fix incorrect usage of __STDC_HOSTED__
D56913 introduced the _LIBCPP_FREESTANDING macro and guarded its
definition by:
#ifndef __STDC_HOSTED__
# define _LIBCPP_FREESTANDING
#endif
However, __STDC_HOSTED__ is defined as 0 in freestanding implementations
instead of undefined, which means that _LIBCPP_FREESTANDING would never
get defined. This patch corrects the above as:
#if __STDC_HOSTED__ == 0
# define _LIBCPP_FREESTANDING
#endif
Differential Revision: https://reviews.llvm.org/D86055
Louis Dionne [Wed, 2 Sep 2020 14:36:48 +0000 (10:36 -0400)]
[libc++] Re-apply the workaround for timespec_get not always being available in Apple SDKs
This commit re-applies
99f3b231cb21, which was reverted in
814242572731
because it broke the modules build. The modules failure was a circular
dependency between the Darwin module and __config. Specifically, the
issue was that if <__config> includes a system header, the std_config
module depends on the Darwin module. However, the Darwin module already
depends on the std_config header because some of its headers include
libc++ headers like <ctype.h> (they mean to include the C <ctype.h>,
but libc++ headers are first in the header search path).
This is fixed by moving the workaround to <ctime> only.
https://llvm.org/PR47208
rdar://
68157284
Erik Pilkington [Wed, 2 Sep 2020 00:17:00 +0000 (20:17 -0400)]
Make -fvisibility-inlines-hidden apply to static local variables in inline functions on Darwin
This effectively disables r340386 on Darwin, and provides a command line flag
to opt into/out of this behaviour. This change is needed to compile certain
Apple headers correctly.
rdar://
47688592
Differential revision: https://reviews.llvm.org/D86881
Erik Pilkington [Tue, 1 Sep 2020 15:52:28 +0000 (11:52 -0400)]
[IRGen] Fix an assert when __attribute__((used)) is used on an ObjC method
This assert doesn't really make sense for functions in general, since they
start life as declarations, and there isn't really any reason to require them
to be defined before attributes are applied to them.
rdar://
67895846
Eric Astor [Wed, 2 Sep 2020 16:11:29 +0000 (12:11 -0400)]
[ms] [llvm-ml] Add support for line continuations in MASM
Add support for line continuations (the "backslash operator") in MASM by modifying the Parser's Lex method.
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/D83347
Simon Pilgrim [Wed, 2 Sep 2020 15:53:41 +0000 (16:53 +0100)]
[X86][SSE] Fold vselect(pshufb,pshufb) -> or(pshufb,pshufb)
If the PSHUFBs have no other uses, then we can force the unselected elements to zero to OR them instead, avoiding both an extra mask load and a costly variable blend.
Eventually we should try to bring this into shuffle combining, once we can more easily convert between shuffles + select patterns.
Ehsan Toosi [Fri, 31 Jul 2020 13:20:37 +0000 (15:20 +0200)]
[mlir] Extend BufferAssignmentTypeConverter with result conversion callbacks
In this PR, the users of BufferPlacement can configure
BufferAssginmentTypeConverter. These new configurations would give the user more
freedom in the process of converting function signature, and return and call
operation conversions.
These are the new features:
- Accepting callback functions for decomposing types (i.e. 1 to N type
conversion such as unpacking tuple types).
- Defining ResultConversionKind for specifying whether a function result
with a certain type should be appended to the function arguments list or
should be kept as function result. (Usage:
converter.setResultConversionKind<MemRefType>(AppendToArgumentList))
- Accepting callback functions for composing or decomposing values (i.e. N
to 1 and 1 to N value conversion).
Differential Revision: https://reviews.llvm.org/D85133
Jordan Rupprecht [Wed, 2 Sep 2020 15:24:06 +0000 (08:24 -0700)]
[lldb/Host] Add missing proc states
The /proc/<pid>/status parsing is missing a few cases:
- Idle
- Parked
- Dead
If we encounter an unknown proc state, this leads to an msan warning. In reality, we only check that the state != Zombie, so it doesn't really matter that we handle all cases, but handle them anyway (current list: [1]). Also explicitly set it to unknown if we encounter an unknown state. There will still be an msan warning if the proc entry has no `State:` line, but that should not happen.
Use a StringSwitch to make the handling of proc states a little more compact.
[1] https://github.com/torvalds/linux/blob/master/fs/proc/array.c
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D86818
Congzhe Cao [Wed, 2 Sep 2020 15:02:58 +0000 (11:02 -0400)]
[IPSCCP] Fix a bug that the "returned" attribute is not cleared when function is optimized to return undef
In IPSCCP when a function is optimized to return undef, it should clear the returned attribute for all its input arguments
and its corresponding call sites.
The bug is exposed when the value of an input argument of the function is assigned to a physical register and
because of the argument having a returned attribute, the value of this physical register will continue to be used
as the function return value right after the call instruction returns, even if the value that this register holds may
be clobbered during the function call. This potentially results in incorrect values being used afterwards.
Reviewed By: jdoerfert, fhahn
Differential Revision: https://reviews.llvm.org/D84220
Qiu Chaofan [Wed, 2 Sep 2020 15:09:48 +0000 (23:09 +0800)]
[NFC] [PowerPC] Add FMA flag propagation test
Med Ismail Bennani [Fri, 28 Aug 2020 13:38:39 +0000 (15:38 +0200)]
[lldb/Target] Add custom interpreter option to `platform shell`
This patch adds the ability to use a custom interpreter with the
`platform shell` command. If the user set the `-s|--shell` option
with the path to a binary, lldb passes it down to the platform's
`RunShellProcess` method and set it as the shell to use in
`ProcessLaunchInfo to run commands.
Note that not all the Platforms support running shell commands with
custom interpreters (i.e. RemoteGDBServer is only expected to use the
default shell).
This patch also makes some refactoring and cleanups, like swapping
CString for StringRef when possible and updating `SBPlatformShellCommand`
with new methods and a new constructor.
rdar://
67759256
Differential Revision: https://reviews.llvm.org/D86667
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Anna Thomas [Wed, 2 Sep 2020 14:19:10 +0000 (10:19 -0400)]
[ImplicitNullChecks] NFC: Refactor dependence safety check
After computing dependence, we check if it is safe to hoist by
identifying if it clobbers any liveIns in the sibling block (NullSucc).
This check is moved to its own function which will be used in the
soon-to-be modified dependence checking algorithm for implicit null
checks pass.
Tests-Run: lit tests on X86/implicit-*
Anna Thomas [Wed, 2 Sep 2020 14:06:27 +0000 (10:06 -0400)]
[ImplicitNullChecks] NFC: Separated out checks and added comments
Separated out some checks in isSuitableMemoryOp and added comments
explaining why some of those checks are done.
Tests-Run:X86 implicit null checks tests.
Louis Dionne [Tue, 1 Sep 2020 21:13:24 +0000 (17:13 -0400)]
[libc++] Make some testing utilities constexpr
This will be needed in order to test constexpr std::vector.
Lei Zhang [Wed, 2 Sep 2020 13:24:36 +0000 (09:24 -0400)]
Revert "[mlir] Extend BufferAssignmentTypeConverter with result conversion callbacks"
This reverts commit
94f5d248772ba0f1f9c8b0746fe75a5d246c5540 because
of failing the following tests:
MLIR :: Dialect/Linalg/tensors-to-buffers.mlir
MLIR :: Transforms/buffer-placement-preparation-allowed-memref-results.mlir
MLIR :: Transforms/buffer-placement-preparation.mlir
David Stenberg [Wed, 2 Sep 2020 06:46:53 +0000 (08:46 +0200)]
[GlobalOpt] Fix an incorrect Modified status
When marking a global variable constant, and simplifying users using
CleanupConstantGlobalUsers(), the pass could incorrectly return false if
there were still some uses left, and no further optimizations was done.
This was caught using the check introduced by D80916.
This fixes PR46749.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D85837
Jakub Lichman [Wed, 26 Aug 2020 16:41:04 +0000 (16:41 +0000)]
[mlir][VectorToSCF] 128 byte alignment of alloc ops
Added 128 byte alignment to alloc ops created in VectorToSCF pass.
128b alignment was already introduced to this pass but not to all alloc
ops. This commit changes that by adding 128b alignment to the remaining ops.
The point of specifying alignment is to prevent possible memory alignment errors
on weakly tested architectures.
Differential Revision: https://reviews.llvm.org/D86454
Venkataramanan Kumar [Wed, 2 Sep 2020 12:23:48 +0000 (08:23 -0400)]
[InstCombine] Transform 1.0/sqrt(X) * X to X/sqrt(X)
These transforms will now be performed irrespective of the number of uses for the expression "1.0/sqrt(X)":
1.0/sqrt(X) * X => X/sqrt(X)
X * 1.0/sqrt(X) => X/sqrt(X)
We already handle more general cases, and we are intentionally not creating extra (and likely expensive)
fdiv ops in IR. This pattern is the exception to the rule because we always expect the Backend to reduce
X/sqrt(X) to sqrt(X), if it has the necessary (reassoc) fast-math-flags.
Ref: DagCombiner optimizes the X/sqrt(X) to sqrt(X).
Differential Revision: https://reviews.llvm.org/D86726
Sanjay Patel [Wed, 2 Sep 2020 12:09:24 +0000 (08:09 -0400)]
[VectorCombine] allow vector loads with mismatched insert type
This is an enhancement to D81766 to allow loading the minimum target
vector type into an IR vector with a different number of elements.
In one of the motivating tests from PR16739, SLP creates <2 x float>
load ops mixed with <4 x float> insert ops, so we want to handle that
pattern in addition to potential oversized vectors created by the
vectorizers.
For now, we are assuming the insert/extract subvector with undef is
free because there is no exact corresponding TTI modeling for that.
Differential Revision: https://reviews.llvm.org/D86160
Daniel Grumberg [Wed, 19 Aug 2020 15:16:43 +0000 (16:16 +0100)]
Move all fields of '-cc1' option related classes into def file databases
Once the new option parsing system is committed, this will allow to generate a
check to ensure that correct command line generation happens
Differential Revision: https://reviews.llvm.org/D86290
Max Kazantsev [Wed, 2 Sep 2020 11:26:11 +0000 (18:26 +0700)]
[Test] Simplify test by removing unneeded variable
Ehsan Toosi [Fri, 31 Jul 2020 13:20:37 +0000 (15:20 +0200)]
[mlir] Extend BufferAssignmentTypeConverter with result conversion callbacks
In this PR, the users of BufferPlacement can configure
BufferAssginmentTypeConverter. These new configurations would give the user more
freedom in the process of converting function signature, and return and call
operation conversions.
These are the new features:
- Accepting callback functions for decomposing types (i.e. 1 to N type
conversion such as unpacking tuple types).
- Defining ResultConversionKind for specifying whether a function result
with a certain type should be appended to the function arguments list or
should be kept as function result. (Usage:
converter.setResultConversionKind<MemRefType>(AppendToArgumentList))
- Accepting callback functions for composing or decomposing values (i.e. N
to 1 and 1 to N value conversion).
Differential Revision: https://reviews.llvm.org/D85133
Paul Walker [Fri, 21 Aug 2020 12:38:55 +0000 (13:38 +0100)]
[SVE] Don't reorder subvector/binop sequences when the resulting binop is not legal.
When lowering fixed length vector operations for SVE the subvector
operations are used extensively to marshall data between scalable
and fixed-length vectors. This means that sequences like:
extract_subvec(binop(insert_subvec(a), insert_subvec(b)))
are very common. DAGCombine only checks if the resulting binop is
legal or can be custom lowered when undoing such sequences. When
it's custom lowering that is introducing them the result is an
infinite legalise->combine->legalise loop.
This patch extends the isOperationLegalOr... functions to include
a "LegalOnly" parameter to restrict the check to legal operations
only. Although isOperationLegal could be used it's common for
the affected code paths to be visited pre and post legalisation,
so the extra parameter keeps the code tidy.
Differential Revision: https://reviews.llvm.org/D86450
Jay Foad [Tue, 1 Sep 2020 13:52:01 +0000 (14:52 +0100)]
[AMDGPU] Fix offset for REL32_HI relocs
The addend in a REL32 reloc needs to be adjusted to account for the
offset from the PC value returned by the s_getpc instruction to the
point where the reloc is applied. This was being done correctly for
(GOTPC)REL32_LO but not for (GOTPC)REL32_HI. This will only make a
difference if the target symbol happens to get loaded almost exactly
a multiple of 4G away from the relocated instructions.
Differential Revision: https://reviews.llvm.org/D86938
Sander de Smalen [Wed, 2 Sep 2020 09:12:27 +0000 (10:12 +0100)]
[AArch64][SVE] Preserve full vector regs over EH edge.
Unwinders may only preserve the lower 64bits of Neon and SVE registers,
as only the registers in the base ABI are guaranteed to be preserved
over the exception edge. The caller will need to preserve additional
registers for when the call throws an exception and the unwinder has
tried to recover state.
For e.g.
svint32_t bar(svint32_t);
svint32_t foo(svint32_t x, bool *err) {
try { bar(x); } catch (...) { *err = true; }
return x;
}
`z0` needs to be spilled before the call to `bar(x)` and reloaded before
returning from foo, as the exception handler may have clobbered z0.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D84737
Igor Kudrin [Wed, 2 Sep 2020 09:12:39 +0000 (16:12 +0700)]
[DebugInfo] Emit a 1-byte value as a terminator of entries list in the name index.
As stated in section 6.1.1.2, DWARFv5, p. 142,
| The last entry for each name is followed by a zero byte that
| terminates the list. There may be gaps between the lists.
The patch changes emitting a 4-byte zero value to a 1-byte one, which
effectively removes the gap between entry lists, and thus saves
approximately 3 bytes per name; the calculation is not exact because
the total size of the table is aligned to 4.
Differential Revision: https://reviews.llvm.org/D86927
Igor Kudrin [Wed, 2 Sep 2020 09:08:25 +0000 (16:08 +0700)]
[DebugInfo] Remove Dwarf5AccelTableWriter::Header::UnitLength. NFC.
The member is not in use; the unit length for the table is emitted as
a difference between two labels. Moreover, the type of the member might
be misleading, because for DWARF64 the field should be 64 bit long.
Differential Revision: https://reviews.llvm.org/D86912
Martin Storsjö [Wed, 2 Sep 2020 08:43:01 +0000 (11:43 +0300)]
[X86] Remove superfluous trailing semicolons, fixing warnings. NFC.
Benjamin Kramer [Tue, 1 Sep 2020 15:21:27 +0000 (17:21 +0200)]
[mlir][VectorOps] Fail fast when a strided memref is passed to vector_transfer
Otherwise we'll silently miscompile things.
Differential Revision: https://reviews.llvm.org/D86951
Simon Pilgrim [Wed, 2 Sep 2020 08:24:46 +0000 (09:24 +0100)]
[X86][SSE] SimplifyDemandedVectorEltsForTargetNode - add general shuffle combining support
This patch uses partial DemandedElts masks to further simplify target shuffle chains and finally starts making target shuffle combining part of SimplifyDemandedBits/SimplifyDemandedVectorElts.
We already manage this for Depth == 0 cases, where combineX86ShuffleChain would early-out if the shuffle combined to the same op, but the patch generalizes this by manipulating the depth handling of combineX86ShufflesRecursively - calling with a new Depth = 0 and reducing the maximum shuffle combine depth accordingly.
Differential Revision: https://reviews.llvm.org/D66004
Raphael Isemann [Wed, 2 Sep 2020 07:25:31 +0000 (09:25 +0200)]
Revert "[libc++] Workaround timespec_get not always being available in Apple SDKs"
This reverts commit
99f3b231cb21abc567c93813650cd76cfa614325. It breaks
libcxx/modules/stds_include.sh.cpp on macOS as the new include to sys/cdefs.h
causes a dependency from __config to the Darwin module (which already has
a dependency on __config). This cyclic dependency breaks compiling the std
module which breaks compiling pretty much every program with ToT libc++ and
enabled modules.
I'll revert for now to get the bots green again. Sorry for the inconvenience.
Shinji Okumura [Wed, 2 Sep 2020 07:08:03 +0000 (16:08 +0900)]
[Attributor] Make use of AANoUndef in AAUndefinedBehavior
This patch makes it possible for AAUB to use information from AANoUndef.
This is the next patch of D86983
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D86984
Shinji Okumura [Wed, 2 Sep 2020 06:40:43 +0000 (15:40 +0900)]
[Attributor] Fix AANoUndef initialization
When the associated value is undef, we immediately forced to indicate a pessimistic fixpoint so far.
This patch changes the initialization to check the attribute given in IR at first and to indicate an optimistic fixpoint when it is given.
This change will enable us to catch , for example, the following case in AAUB.
```
call void @foo(i32 noundef undef)
```
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D86983
ZHANG Hongbin [Wed, 2 Sep 2020 04:40:28 +0000 (04:40 +0000)]
[mlir] Add Complex Type, Vector Type and Tuple Type subclasses to python bindings
Based on the PyType and PyConcreteType classes, this patch implements the bindings of Complex Type, Vector Type and Tuple Type subclasses.
For the convenience of type checking, this patch defines a `mlirTypeIsAIntegerOrFloat` function to check whether the given type is an integer or float type.
These three subclasses in this patch have similar binding strategy:
- The function pointer `isaFunction` points to `mlirTypeIsA***`.
- The `mlir***TypeGet` C API is bound with the `get_***` method in the python side.
- The Complex Type and Vector Type check whether the given type is an integer or float type.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D86785
Zi Xuan Wu [Wed, 2 Sep 2020 04:41:38 +0000 (12:41 +0800)]
[RFC][Target] Add a new triple called Triple::csky
Before upstream a new target called CSKY, make a new triple of that called Triple::csky.
For now, it's a 32-bit little endian target and the detail can be referred at D86269.
This is the split part of D86269, which add a new target called CSKY.
Differential Revision: https://reviews.llvm.org/D86505
Fangrui Song [Sat, 29 Aug 2020 19:19:34 +0000 (12:19 -0700)]
[CMake] Remove -Wl,-allow-shlib-undefined which was added in rL221530
In GNU ld, gold and LLD, --no-allow-shlib-undefined is the default when
linking an executable. The option disallows unresolved symbols in shared objects.
(gold and LLD catch fewer cases than GNU ld. See D57385 for details)
See D57569 why it is bad idea to use --allow-shlib-undefined for executables [a].
GNU ld traditionally copied DT_NEEDED entries transitively. This was
deemed not good, so GNU ld 2.22 defaulted to --no-copy-dt-needed-entries.
gold and LLD always behave like --no-copy-dt-needed-entries.
rL221530 added -Wl,-allow-shlib-undefined to make some old releases of GNU ld's
--no-copy-dt-needed-entries to actually work.
Due to [a] and [b], this patch drops -Wl,-allow-shlib-undefined.
[b]: In a -DBUILD_SHARED_LIBS=on build, `--as-needed --allow-shlib-undefined`
can unexpectedly suppress some .dynsym entries. The issue can cause
mlir-cpu-runner to fail at runtime. Note, on Debian, gcc newer than (gcc-9-
20190125-2) enable
--as-needed by default.
See https://sourceware.org/bugzilla/show_bug.cgi?id=26551 for a reduced example.
Reviewed By: mehdi_amini, echristo
Differential Revision: https://reviews.llvm.org/D86839
Lang Hames [Wed, 2 Sep 2020 03:53:28 +0000 (20:53 -0700)]
[ORC] Remove stray debugging output.
Alina Sbirlea [Wed, 2 Sep 2020 03:20:56 +0000 (20:20 -0700)]
Fix build-bots.
BasicAA can be freed (and it is not recomputed).
Lang Hames [Wed, 2 Sep 2020 03:00:21 +0000 (20:00 -0700)]
[ORC] Add an early out for MachOPlatform's init-scraper plugin setup.
If there's no initializer symbol in the current MaterializationResponsibility
then bail out without installing JITLink passes: they're going to be no-ops
anyway.
Lang Hames [Wed, 2 Sep 2020 02:55:19 +0000 (19:55 -0700)]
[ORC] Fix MachOPlatform's synthetic symbol dependence registration.
A think-o in the existing code meant that dependencies were never registered.
This failure could lead to crashes rather than orderly error propagation if
initialization dependencies failed to materialize.
No test case: The bug was discovered in an out-of-tree code and requires
pathalogically misconfigured JIT to generate the original error that lead to
the crash.
Eric Fiselier [Wed, 2 Sep 2020 02:15:33 +0000 (22:15 -0400)]
Revert switch based variant temporarily.
There are currently some failures caused by this change internally. I'm working
to debug them and hopefully these series of patches should be recommitted by
the end of the week.
Thank you to Micheal Park for the contributions, and for allowing the temporary
rollback.
The commits reverted by this change are:
7d15ece79c16dc3237fc514ff56a69e3d58fbd39
e0ec7a02064968c7df11713689107148b4efb993
02197f7e50b938f8167b17b89bdf7c55feff4339
a175a96517c5d9dc05ba13a6481b1b031a53a22f
Richard Smith [Wed, 2 Sep 2020 00:39:57 +0000 (17:39 -0700)]
Don't take the expression range into account when looking for widening
of a unary - expression.
This fixes an issue where we'd produce bogus diagnostics, and also
should recover ~0.3% compile time.
Xing GUO [Wed, 2 Sep 2020 00:41:04 +0000 (08:41 +0800)]
[DebugInfo] Simplify string table dumpers.
This patch adds a helper function DumpStrSection to simplify codes.
Besides, nonprintable chars in debug_str and debug_str.dwo sections
are printed as escaped chars.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D86918
Alina Sbirlea [Fri, 7 Feb 2020 18:51:46 +0000 (10:51 -0800)]
[MemCpyOptimizer] Preserve analyses and replace use of lambdas to get them.
Summary:
Analyses are preserved in MemCpyOptimizer.
Get analyses before running the pass and store the pointers, instead of
using lambdas and getting them every time on demand.
Reviewers: lenary, deadalnix, mehdi_amini, nikic, efriedma
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74494
Jonas Devlieghere [Wed, 2 Sep 2020 00:28:29 +0000 (17:28 -0700)]
[lldb] Move ScriptCommand and RegexCommand under Commands (NFC)
Move the CommandObjectScript and CommandObjectRegexCommand under
Commands where all the other CommandObject implementations live.
Although neither implementations currently use the TableGen-generated
CommandOptions.inc, this move would have been necessary anyway if they
were to in the future.
Jordan Rupprecht [Tue, 1 Sep 2020 23:37:39 +0000 (16:37 -0700)]
[NFC] Fix unused var in release builds.
This was always unused, but the change in D86354 upgraded this to a compiler warning.
Yifan Shen [Tue, 1 Sep 2020 22:59:51 +0000 (15:59 -0700)]
Simplify Symbol Status Message to Only Debug Info Size
The Symbol Status in modules view is simplified so that only when the module has debug info and its size is non-zero, will the status message be displayed. The symbol status message is renamed to debug info size and flag message like "Symbols not found" and "Symbols loaded" is deleted.
Differential Revision: https://reviews.llvm.org/D86662
Med Ismail Bennani [Tue, 1 Sep 2020 22:47:16 +0000 (00:47 +0200)]
[lldb/interpreter] Improve REPL init file compatibility
This patch changes the command interpreter sourcing logic for the REPL
init file. Instead of looking for a arbitrary file name, it standardizes
the REPL init file name to match to following scheme:
`.lldbinit-<language>-repl`
This will make the naming more homogenous and the sourcing logic future-proof.
rdar://
65836048
Differential Revision: https://reviews.llvm.org/D86987
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Nathan Ridge [Mon, 31 Aug 2020 07:00:58 +0000 (03:00 -0400)]
[clangd] Handle templates more consistently in type hierarchy
If the tree includes types derived from all specializations of
a template, do not misleadingly label the root node with the
name of a single specialization.
Fixes https://github.com/clangd/clangd/issues/507
Differential Revision: https://reviews.llvm.org/D86861
Nathan Ridge [Mon, 24 Aug 2020 02:15:12 +0000 (22:15 -0400)]
[clang] Do not consider the template arguments of bases to be bases themselves
Fixes https://github.com/clangd/clangd/issues/504
Differential Revision: https://reviews.llvm.org/D86424
Varun Gandhi [Fri, 21 Aug 2020 08:45:44 +0000 (01:45 -0700)]
[ADT] Make Optional a literal type.
This allows returning Optional values from constexpr contexts.
Reviewed By: fhahn, dblaikie, rjmccall
Differential Revision: https://reviews.llvm.org/D86354
Nick Desaulniers [Tue, 25 Aug 2020 02:03:04 +0000 (19:03 -0700)]
[clang] consistently use getLangOpts()
File was inconsistent.
Thomas Raoux [Tue, 1 Sep 2020 22:37:54 +0000 (15:37 -0700)]
[mlir][vulkan-runner] Explicitly export vulkan-runtime-wrapper entry points.
This ensure that the symbols are being exported no matter what default
visibility is set.
Matt Morehouse [Tue, 1 Sep 2020 22:35:01 +0000 (15:35 -0700)]
[libFuzzer] Break dependency on common_interface_defs.h
Some libFuzzer users build using the build.sh script, without access to
the <sanitizer/common_interface_defs.h> include.
Update https://github.com/rust-fuzz/libfuzzer/issues/65.
Reviewed By: dokyungs
Differential Revision: https://reviews.llvm.org/D86981
Amy Kwan [Tue, 1 Sep 2020 17:39:47 +0000 (12:39 -0500)]
[PowerPC] Implement builtins for xvcvspbf16 and xvcvbf16spn
This patch adds the builtin implementation for the xvcvspbf16 and xvcvbf16spn
instructions.
Differential Revision: https://reviews.llvm.org/D86795
Sergej Jaskiewicz [Tue, 1 Sep 2020 21:54:20 +0000 (00:54 +0300)]
[llvm] [unittests] Fix failing test 'FileCollectorTest.addDirectory'
This fixes a regression in the test suite introduced by
fad75598d272b9a5591fb7d9b591cf00cdf5022c
Cameron McInally [Tue, 1 Sep 2020 21:24:53 +0000 (16:24 -0500)]
[SVE] Update INSERT_SUBVECTOR DAGCombine to use getVectorElementCount().
A small piece of the project to replace getVectorNumElements() with getVectorElementCount().
Differential Revision: https://reviews.llvm.org/D86894
Julian Lettner [Tue, 1 Sep 2020 21:29:49 +0000 (14:29 -0700)]
[Docs] Remove outdated OS limitation
Thread Sanitizer is supported on macOS.
rdar://
68159753
Differential Revision: https://reviews.llvm.org/D86980
Sergej Jaskiewicz [Mon, 6 Jul 2020 12:55:49 +0000 (15:55 +0300)]
[llvm] [unittests] Remove temporary files after they're not needed
Some LLVM unit tests forget to clean up temporary files and
directories. Introduce RAII classes for cleaning them up.
Refactor the tests to use those classes.
Differential Revision: https://reviews.llvm.org/D83228
Amara Emerson [Tue, 1 Sep 2020 21:22:53 +0000 (14:22 -0700)]
Revert "Revert "[GlobalISel] Fold xor(cmp(pred, _, _), 1) -> cmp(inverse(pred), _, _)" (and dependent patch "Optimize away a Not feeding a brcond by using tbz instead of tbnz.")"
This reverts commit
8693ddc74371dedc742c9f3d3e4eda1da72c13ea.
Re-committing with the test requiring asserts.
Anatoly Trosinenko [Tue, 1 Sep 2020 21:14:27 +0000 (00:14 +0300)]
[builtins] Fix divtf3_test.c
Fixes
93eed63d2f3188 [builtins] Make __div[sdt]f3 handle denormal results.
Aaron Puchert [Tue, 1 Sep 2020 21:13:28 +0000 (23:13 +0200)]
Thread safety analysis: More consistent warning message
Other warning messages for negative capabilities also mention their
kind, and the double space was ugly.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D84603
River Riddle [Tue, 1 Sep 2020 20:32:14 +0000 (13:32 -0700)]
[mlir][ODS] Use c++ types for integer attributes of fixed width when possible.
Unsigned and Signless attributes use uintN_t and signed attributes use intN_t, where N is the fixed width. The 1-bit variants use bool.
Differential Revision: https://reviews.llvm.org/D86739