Sebastian Neubauer [Thu, 13 Aug 2020 08:40:24 +0000 (10:40 +0200)]
[AMDGPU] Fix typo. NFC
Rainer Orth [Thu, 13 Aug 2020 08:20:52 +0000 (10:20 +0200)]
[compiler-rt][asan][test] Skipt sanitizer_common tests on Sparc
When building on `sparc64-unknown-linux-gnu`, I found that a large number
of `SanitizerCommon-asan-sparc*-Linux` tests were `FAIL`ing, like
SanitizerCommon-asan-sparc-Linux :: Linux/aligned_alloc-alignment.cpp
[...]
SanitizerCommon-asan-sparcv9-Linux :: Linux/aligned_alloc-alignment.cpp
[...]
many of them due to
fatal error: error in backend: Function "_Z14User_OnSIGSEGViP9siginfo_tPv": over-aligned dynamic alloca not supported.
which breaks ASan on Sparc. Currently ASan is only built for the benefit
of `gcc` where it does work. However, when enabling the compilation in
`compiler-rt` to make certain it continues to build, I missed
`compiler-rt/test/sanitizer_common` when disabling ASan testing on Sparc
(it's not yet enabled on Solaris).
This patch fixes the issue.
Tested on `sparcv9-sun-solaris2.11` with the `sanitizer_comon` testsuite enabled.
Differential Revision: https://reviews.llvm.org/D85732
Eduardo Caldas [Wed, 12 Aug 2020 13:51:52 +0000 (13:51 +0000)]
[SyntaxTree] Rename tests following `TestSuite_TestCase` + nits
Eduardo Caldas [Tue, 11 Aug 2020 16:28:00 +0000 (16:28 +0000)]
[SyntaxTree] Split tests for expressions
We do that because:
* Big tests generated big tree dumps that could hardly serve as documentation.
* In most cases the tests didn't share setup, thus there was not much addition in lines of code.
We split tests for:
* `UserDefinedLiteral`
* `NestedBinaryOperator`
* `UserDefinedBinaryOperator`
* `UserDefinedPrefixOperator`
* `QualifiedId`
Differential Revision: https://reviews.llvm.org/D85819
Michael Kruse [Thu, 13 Aug 2020 08:01:29 +0000 (03:01 -0500)]
[flang] Compilation fix.
unlink() was changed to llvm::sys::fs::remove() in f18.cpp, but the same
change also has to be applied to f18-parse-demo.cpp.
Sam McCall [Tue, 11 Aug 2020 22:06:52 +0000 (00:06 +0200)]
[Parser] Suppress -Wempty-translation-unit if this is a header file
This is motivated by tooling (clangd, libclang etc) - headers without
declarations are legitimate even if they're not valid TUs.
The other use -x c-header cases (PCH/modules) are nonstandard anyway and this
warning doesn't seem necessary there either.
Differential Revision: https://reviews.llvm.org/D85789
Saiyedul Islam [Thu, 13 Aug 2020 07:27:15 +0000 (07:27 +0000)]
[OpenMP] Ensure testing for versions 4.5 and default - Part 1
Many OpenMP Clang tests do not RUN for version 4.5 and the default
version. This first patch in the series only handles test cases
which do not require any modifications in the CHECK lines after
adding RUN lines for default version.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D84844
Michael Kruse [Wed, 12 Aug 2020 21:54:41 +0000 (16:54 -0500)]
[flang][msvc] Use platform-independent primitives in temporary f18 driver.
Use functions for process launching, temporary file creation and file deletion from LLVM support library instead of POSIX-specific ones.
This patch is part of the series to [[ http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html | make flang compilable with MS Visual Studio ]].
Reviewed By: DavidTruby
Differential Revision: https://reviews.llvm.org/D85660
Qiu Chaofan [Thu, 13 Aug 2020 07:02:07 +0000 (15:02 +0800)]
[NFC] [PowerPC] Rename SPE strict conversion test
Ali Tamur [Thu, 13 Aug 2020 06:02:17 +0000 (23:02 -0700)]
Revert "[SCEV] Look through single value PHIs."
This reverts commit
e441b7a7a0a72c28daf5a8e594559c667e5b4534.
This patch causes a compile error in tensorflow opensource project. The stack trace looks like:
Point of crash:
llvm/include/llvm/Analysis/LoopInfoImpl.h : line 35
(gdb) ptype *this
type = const class llvm::LoopBase<llvm::BasicBlock, llvm::Loop> [with BlockT = llvm::BasicBlock, LoopT = llvm::Loop]
(gdb) p *this
$1 = {ParentLoop = 0x0, SubLoops = std::vector of length 0, capacity 0, Blocks = std::vector of length 0, capacity 1,
DenseBlockSet = {<llvm::SmallPtrSetImpl<llvm::BasicBlock const*>> = {<llvm::SmallPtrSetImplBase> = {<llvm::DebugEpochBase> = {Epoch = 3}, SmallArray = 0x1b2bf6c8, CurArray = 0x1b2bf6c8,
CurArraySize = 8, NumNonEmpty = 0, NumTombstones = 0}, <No data fields>}, SmallStorage = {0xfffffffffffffffe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}, IsInvalid = true}
(gdb) p *this->DenseBlockSet->CurArray
$2 = (const void *) 0xfffffffffffffffe
I will try to get a case from tensorflow or use creduce to get a small case.
Nadav Rotem [Thu, 13 Aug 2020 05:47:53 +0000 (22:47 -0700)]
[Clang options] Optimize optionMatches() runtime by removing mallocs
The method optionMatches() constructs 9865 std::string instances when comparing different
options. Many of these instances exceed the size of the internal storage and force memory
allocations. This patch adds an early exit check that eliminates most of the string allocations
while keeping the code simple.
Example inputs:
Prefix: /, Name: Fr
Prefix: -, Name: Fr
Prefix: -, Name: fsanitize-address-field-padding=
Prefix: -, Name: fsanitize-address-globals-dead-stripping
Prefix: -, Name: fsanitize-address-poison-custom-array-cookie
Prefix: -, Name: fsanitize-address-use-after-scope
Prefix: -, Name: fsanitize-address-use-odr-indicator
Prefix: -, Name: fsanitize-blacklist=
Differential Revision: D85538
Aditya Kumar [Thu, 13 Aug 2020 05:38:03 +0000 (22:38 -0700)]
[HotColdSplit] Fix variable name spelling
Jez Ng [Thu, 13 Aug 2020 05:21:12 +0000 (22:21 -0700)]
[lld-macho] Fix invalid-stub test on Windows, take 2
Carl Ritson [Thu, 13 Aug 2020 04:00:04 +0000 (13:00 +0900)]
[AMDGPU] Pre-commit test for D85872
Jez Ng [Thu, 13 Aug 2020 03:57:42 +0000 (20:57 -0700)]
[lld-macho] Try to fix invalid-stub test on Windows
Summary: Path separator issues...
Xing GUO [Thu, 13 Aug 2020 03:13:04 +0000 (11:13 +0800)]
[macho2yaml] Remove an unused variable. NFC.
Jez Ng [Thu, 13 Aug 2020 02:50:28 +0000 (19:50 -0700)]
[lld-macho] Support -rpath
Pretty straightforward; just emits LC_RPATH for dyld to consume.
Note that lld itself does not yet support dylib lookup via @rpath.
Reviewed By: #lld-macho, compnerd
Differential Revision: https://reviews.llvm.org/D85701
Jez Ng [Thu, 13 Aug 2020 02:50:27 +0000 (19:50 -0700)]
[lld-macho] Implement -force_load
It's similar to lld-ELF's `-whole-archive`, but applied to individual
archives instead of to a series of them.
Reviewed By: #lld-macho, smeenai
Differential Revision: https://reviews.llvm.org/D85550
Jez Ng [Thu, 13 Aug 2020 02:50:25 +0000 (19:50 -0700)]
[lld-macho] Support larger dylib symbol ordinals in bindings
Do folks care if we don't have a test for this? Creating 16
dylibs to trigger this straightforward code path seems a little tedious
Reviewed By: #lld-macho, smeenai
Differential Revision: https://reviews.llvm.org/D85467
Jez Ng [Thu, 13 Aug 2020 02:50:13 +0000 (19:50 -0700)]
[lld-macho] Add error handling for malformed TBD files
Previously, lld would crash while complaining that `Expected<T>
must be checked before access or destruction`.
Reviewed By: #lld-macho, compnerd
Differential Revision: https://reviews.llvm.org/D85403
Jez Ng [Thu, 13 Aug 2020 02:50:12 +0000 (19:50 -0700)]
[lld-macho] Avoid unnecessary shared_ptr in DylibFile ctor
DylibFile doesn't store a pointer to its InterfaceFile
parameter, so there's no need to use a shared_ptr.
Reviewed By: #lld-macho, compnerd
Differential Revision: https://reviews.llvm.org/D85402
Jez Ng [Thu, 13 Aug 2020 02:50:10 +0000 (19:50 -0700)]
[lld-macho] Generate ObjC symbols from .tbd files
I followed similar logic in TapiFile.cpp.
Reviewed By: #lld-macho, smeenai
Differential Revision: https://reviews.llvm.org/D85255
Jez Ng [Thu, 13 Aug 2020 02:50:09 +0000 (19:50 -0700)]
[lld-macho] Support dynamic linking of thread-locals
References to symbols in dylibs work very similarly regardless of
whether the symbol is a TLV. The main difference is that we have a
separate `__thread_ptrs` section that acts as the GOT for these
thread-locals.
We can identify thread-locals in dylibs by a flag in their export trie
entries, and we cross-check it with the relocations that refer to them
to ensure that we are not using a GOT relocation to reference a
thread-local (or vice versa).
Reviewed By: #lld-macho, smeenai
Differential Revision: https://reviews.llvm.org/D85081
River Riddle [Thu, 13 Aug 2020 02:28:54 +0000 (19:28 -0700)]
[mlir][Type] Remove the remaining usages of Type::getKind in preparation for its removal
This revision removes all of the lingering usages of Type::getKind. A consequence of this is that FloatType is now split into 4 derived types that represent each of the possible float types(BFloat16Type, Float16Type, Float32Type, and Float64Type). Other than this split, this revision is NFC.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D85566
Ruiling Song [Tue, 11 Aug 2020 07:35:46 +0000 (15:35 +0800)]
[AMDGPU] Fix crash when dag-combining bitcast
From the code after the 'break', they are processing 64bit scalar and
vector bitcast. So I think the break-condition should be (cond1 || cond2)
This means we only execute following code if (64bit and dest-is-vector).
Also remove a previous fix which is not needed with this new fix.
(introduced in:
1349a04ef5f594dda705ec80474dda4837f26dba)
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D85804
Mehdi Amini [Wed, 12 Aug 2020 22:45:16 +0000 (22:45 +0000)]
Merge OpFolderDialectInterface with DialectFoldInterface (NFC)
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D85823
Mehdi Amini [Wed, 12 Aug 2020 09:36:54 +0000 (09:36 +0000)]
Remove DialectHooks and introduce a Dialect Interfaces instead
These hooks were introduced before the Interfaces mechanism was available.
DialectExtractElementHook is unused and entirely removed. The
DialectConstantFoldHook is used a fallback in the
operation fold() method, and is replaced by a DialectInterface.
The DialectConstantDecodeHook is used for interpreting OpaqueAttribute
and should be revamped, but is replaced with an interface in 1:1 fashion
for now.
Differential Revision: https://reviews.llvm.org/D85595
Richard Smith [Wed, 12 Aug 2020 23:53:02 +0000 (16:53 -0700)]
PR47143: Don't crash while constant-evaluating value-initialization of
an array of unknown bound as the initializer of an array new expression.
Jonas Devlieghere [Wed, 12 Aug 2020 22:47:57 +0000 (15:47 -0700)]
[lldb] Fix relative imports and set the appropriate include dirs
After moving python.swig and lua.swig into their respective
subdirectories, the relative paths in these files were out of date. This
fixes that and ensures the appropriate include paths are set in the SWIG
invocation.
Differential revision: https://reviews.llvm.org/D85859
Albion Fung [Wed, 12 Aug 2020 23:26:43 +0000 (18:26 -0500)]
[PowerPC] Implement Vector Shift Builtins
This patch implements the builtins for the vector shifts (shl, srl, sra), and
adds the appropriate test cases for these builtins. The builtins utilize the
vector shift instructions introduced within ISA 3.1.
Differential Revision: https://reviews.llvm.org/D83338
Zequan Wu [Tue, 11 Aug 2020 19:39:25 +0000 (12:39 -0700)]
[Coverage] Enable emitting gap area between macros
Differential Revision: https://reviews.llvm.org/D85176
Kiran Chandramohan [Fri, 14 Aug 2020 21:54:29 +0000 (22:54 +0100)]
[NFC][MLIR][OpenMP] Add comments and test for OpenMP enum declaration utility
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D85857
Michael Kruse [Wed, 12 Aug 2020 20:02:23 +0000 (15:02 -0500)]
[flang][msvc] Remove default arguments for function specializations.
C++ does not allow function template specializations to have default arguments. IIUC callers will only use the default arguments of the primary template. gcc and clang accept the syntax anyway, but msvc emits an error.
See https://en.cppreference.com/w/cpp/language/template_specialization for more details.
This patch is part of the series to [[ http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html | make flang compilable with MS Visual Studio ]].
Reviewed By: DavidTruby
Differential Revision: https://reviews.llvm.org/D85657
Rahul Joshi [Wed, 12 Aug 2020 00:47:07 +0000 (17:47 -0700)]
[MLIR][NFC] Remove tblgen:: prefix in TableGen/*.cpp files
- Add "using namespace mlir::tblgen" in several of the TableGen/*.cpp files and
eliminate the tblgen::prefix to reduce code clutter.
Differential Revision: https://reviews.llvm.org/D85800
Adrian McCarthy [Wed, 12 Aug 2020 20:50:28 +0000 (13:50 -0700)]
[lldb] Fix unit test parsing to handle CR+LF as well as LF
Apparently when the strings are created, the `'\n'` is converted to the
platform's natural new line indicator, which is CR+LF on Windows. But
upon reading back with `sscanf`, the CRs caused a matching failure.
Erik Pilkington [Wed, 12 Aug 2020 19:02:24 +0000 (15:02 -0400)]
[libcxx][test] Fix a -Wstring-concatenation warning in fuzzer_test.h
This was causing failures on green dragon:
http://lab.llvm.org:8080/green/job/libc++%20and%20libc++abi%20trunk/780/
Vedant Kumar [Tue, 11 Aug 2020 19:18:19 +0000 (12:18 -0700)]
Build a flat LLDB.framework for embedded Darwin targets
This patch configures LLDB.framework to build as a flat unversioned
framework on non-macOS Darwin targets, which have never supported the
macOS framework layout.
This patch also renames the 'IOS' cmake variable to 'APPLE_EMBEDDED' to
reflect the fact that lldb is built for several different kinds of embedded
Darwin targets, not just iOS.
Differential Revision: https://reviews.llvm.org/D85770
Nikita Popov [Wed, 12 Aug 2020 20:26:12 +0000 (22:26 +0200)]
[ValueTracking] Add abs intrinsics support to computeConstantRange()
Implementation is the same as for SPF_ABS.
Nikita Popov [Wed, 12 Aug 2020 20:21:47 +0000 (22:21 +0200)]
[InstSimplify] Add additional abs intrinsic icmp tests (NFC)
While abs >= 0 already folds, some variations thereon don't.
Nikita Popov [Wed, 12 Aug 2020 20:14:44 +0000 (22:14 +0200)]
[InstSimplify] Extract abs intrinsic tests into separate file (NFC)
Also move some tests from InstCombine to InstSimplify,
as they are already handled by InstSimplify.
Ilya Leoshkevich [Wed, 12 Aug 2020 20:24:10 +0000 (22:24 +0200)]
[Sanitizer] Fix segfaults during unwinding on SystemZ
Every now and then SystemZ programs built with ASan crash with
ERROR: AddressSanitizer: stack-overflow on address 0x040000000000
for no apparent reason. The problem is that
BufferedStackTrace::UnwindFast() is specialized for SystemZ: it takes
register 14 from the frame, however, IsValidFrame() is not
specialized, and does not guarantee that frame[14] is going to be a
valid memory access.
Fix by introducing per-arch kFrameSize and using it in IsValidFrame().
Reviewed By: uweigand
Differential Revision: https://reviews.llvm.org/D85822
Samuel Kostial [Wed, 12 Aug 2020 20:14:15 +0000 (13:14 -0700)]
[lld][WebAssembly] Emit all return types of multivalue functions
We previously were incorrectly emitting only the first result type.
Differential Revision: https://reviews.llvm.org/D85783
Nikita Popov [Wed, 12 Aug 2020 20:05:56 +0000 (22:05 +0200)]
[ValueTracking] Support min/max intrinsics in computeConstantRange()
The implementation is the same as for the SPF_* case.
Nikita Popov [Wed, 12 Aug 2020 19:57:02 +0000 (21:57 +0200)]
[InstSimplify] Add tests for icmp of min/max with constants (NFC)
Test the case where the constants are not the same, but the result
is still known.
Sanjay Patel [Wed, 12 Aug 2020 19:21:17 +0000 (15:21 -0400)]
[InstCombine] prefer xor with -1 because 'not' is easier to understand (PR32706)
This is a retry of rL300977 which was reverted because of infinite loops.
We have fixed all of the known places where that would happen, but there's
still a chance that this patch will cause infinite loops.
This matches the demanded bits behavior in the DAG and should fix:
https://bugs.llvm.org/show_bug.cgi?id=32706
Differential Revision: https://reviews.llvm.org/D32255
Sanjay Patel [Wed, 12 Aug 2020 19:07:45 +0000 (15:07 -0400)]
[InstCombine] add test for 'not' vs 'xor'; NFC
Craig Topper [Wed, 12 Aug 2020 18:47:29 +0000 (11:47 -0700)]
[Target] Cache the command line derived feature map in TargetOptions.
We can use this to remove some calls to initFeatureMap from Sema
and CodeGen when a function doesn't have a target attribute.
This reduces compile time of the linux kernel where this map
is needed to diagnose some inline assembly constraints based
on whether sse, avx, or avx512 is enabled.
Differential Revision: https://reviews.llvm.org/D85807
Michael Kruse [Wed, 12 Aug 2020 19:21:30 +0000 (14:21 -0500)]
[flang][msvc] Tell windows.h to not define min/max macros.
Defining macros for min and max breaks using std::min and std::max. Defining NOMINMAX before including the header stops them from being defined.
See https://web.archive.org/web/
20170911092732/https://support.microsoft.com/en-us/help/143208/prb-using-stl-in-windows-program-can-cause-min-max-conflicts for details.
This patch is part of the series to [[ http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html | make flang compilable with MS Visual Studio ]].
Reviewed By: isuruf
Differential Revision: https://reviews.llvm.org/D85656
Richard Smith [Wed, 12 Aug 2020 19:24:08 +0000 (12:24 -0700)]
PR47138: Don't crash if the preferred alignment of an invalid record
type is requested.
Wouter van Oortmerssen [Wed, 12 Aug 2020 19:22:15 +0000 (12:22 -0700)]
[WebAssembly] Fixed memory.init always using 64-bit ptr
(because the is64 flag was tested incorrectly in LLD).
Siva Chandra [Wed, 12 Aug 2020 07:54:51 +0000 (00:54 -0700)]
[libc][obvious] Remove the unused file utils/CPP/StringRef.h.
Aleksandr Platonov [Wed, 12 Aug 2020 19:10:54 +0000 (22:10 +0300)]
[clang] Check `expr` inside `InitListChecker::UpdateStructuredListElement()`
- Prevent nullptr-deference at try to emit warning for invalid `expr`
- Simplify `InitListChecker::UpdateStructuredListElement()` usages. We do not need to check `expr` and increment `StructuredIndex` (for invalid `expr`) before the call anymore.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D85193
Roman Lebedev [Wed, 12 Aug 2020 18:59:57 +0000 (21:59 +0300)]
[NFC][InstCombine] Add FIXME's for getLogBase2() / visitUDivOperand()
These are not correctness issues.
In visitUDivOperand(), if the (potential) divisor is undef, then udiv is
already UB, so it is not incorrect to keep undef as shift amount.
But, that is suboptimal.
We could instead simply drop that select, picking the other operand.
Afterwards, getLogBase2() could assert that there is no undef in divisor.
Roman Lebedev [Wed, 12 Aug 2020 18:06:28 +0000 (21:06 +0300)]
[InstCombine] Sanitize undef vector constant to 1 in X*(2^C) with X << C (PR47133)
While x*undef is undef, shift-by-undef is poison,
which we must avoid introducing.
Also log2(iN undef) is *NOT* iN undef, because log2(iN undef) u< N.
See https://bugs.llvm.org/show_bug.cgi?id=47133
Francesco Petrogalli [Fri, 31 Jul 2020 20:19:23 +0000 (21:19 +0100)]
[SVE][VLS] Don't combine logical AND.
Testing is performed when targeting 128, 256 and 512-bit wide vectors.
For 128-bit vectors, the original behavior of using NEON instructions is
preserved.
Differential Revision: https://reviews.llvm.org/D85479
Craig Topper [Wed, 12 Aug 2020 18:35:08 +0000 (11:35 -0700)]
[WebAssembly] Don't depend on the flags set by handleTargetFeatures in initFeatureMap.
Properly set "simd128" in the feature map when "unimplemented-simd128"
is requested.
initFeatureMap is used to create the feature vector used by
handleTargetFeatures. There are later calls to initFeatureMap in
CodeGen that were using these flags to recreate the map. But the
original feature vector should be passed to those calls. So that
should be enough to rebuild the map.
The only issue seemed to be that simd128 was not enabled in the
map by the first call to initFeatureMap. Using the SIMDLevel set
by handleTargetFeatures in the later calls allowed simd128 to be
set in the later versions of the map.
To fix this I've added an override of setFeatureEnabled that
will update the map the first time with the correct simd dependency.
Differential Revision: https://reviews.llvm.org/D85806
Amara Emerson [Tue, 4 Aug 2020 17:55:27 +0000 (10:55 -0700)]
[GlobalISel] Implement bit-test switch table optimization.
This is mostly a straight port from SelectionDAG. We re-use the actual bit-test
analysis part from SwitchLoweringUtils, which was factored out earlier to
support jump-tables.
Differential Revision: https://reviews.llvm.org/D85233
Simon Pilgrim [Wed, 12 Aug 2020 18:22:13 +0000 (19:22 +0100)]
Fix signed/unsigned comparison warnings. NFC.
Craig Topper [Wed, 12 Aug 2020 17:40:41 +0000 (10:40 -0700)]
Recommit "[InstSimplify] Remove select ?, undef, X -> X and select ?, X, undef -> X transforms" and its follow up patches
This recommits the following patches now that D85684 has landed
1cf6f210a2e [IR] Disable select ? C : undef -> C fold in ConstantFoldSelectInstruction unless we know C isn't poison.
469da663f2d [InstSimplify] Re-enable select ?, undef, X -> X transform when X is provably not poison
122b0640fc9 [InstSimplify] Don't fold vectors of partial undef in SimplifySelectInst if the non-undef element value might produce poison
ac0af12ed2f [InstSimplify] Add test cases for opportunities to fold select ?, X, undef -> X when we can prove X isn't poison
9b1e95329af [InstSimplify] Remove select ?, undef, X -> X and select ?, X, undef -> X transforms
Christopher Tetreault [Wed, 12 Aug 2020 16:45:28 +0000 (09:45 -0700)]
[SVE] Remove default-false VectorType::get
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D84212
David Green [Wed, 12 Aug 2020 17:36:05 +0000 (18:36 +0100)]
[Scheduler] Fix typo in comments. NFC
David Green [Wed, 12 Aug 2020 13:22:27 +0000 (14:22 +0100)]
[ARM] Predicated VFMA patterns
Similar to the Two op + select patterns that were added recently, this
adds some patterns for select + fma to turn them into predicated
operations.
Differential Revision: https://reviews.llvm.org/D85824
Simon Pilgrim [Wed, 12 Aug 2020 16:41:09 +0000 (17:41 +0100)]
[X86][SSE] Pull out BUILD_VECTOR operand equivalence tests. NFC.
Pull out element equivalence code from isShuffleEquivalent/isTargetShuffleEquivalent, I've also removed many of the index modulos where possible.
First step toward simply adding some additional equivalence tests.
Craig Topper [Wed, 12 Aug 2020 17:03:10 +0000 (10:03 -0700)]
[X86][GlobalISel] Legalize G_ICMP results to s8.
We need to produce a setcc instruction which has an 8-bit result.
This gets rid of a bunch of cases that were using the s1->s8/s16/s32/s64
handling in selectZExt.
I'm not very familiar with GlobalISel yet so I'm not yet sure
the best way to do things. I'd especially like feedback on the
best way to handle the currently split 32-bit and 64-bit mode
handling.
Differential Revision: https://reviews.llvm.org/D85814
Matt Morehouse [Wed, 12 Aug 2020 16:19:25 +0000 (09:19 -0700)]
Fix sigaction interceptor to always correctly populate oldact
This fixes https://bugs.llvm.org/show_bug.cgi?id=47118. Before this change, when the sigaction interceptor prevented a signal from being changed, it also prevented the oldact output parameter from being written to. This resulted in a use-of-uninitialized-variable by any program that used sigaction for the purpose of reading signals.
This change fixes this: the regular sigaction implementation is still called, but with the act parameter nullified, preventing any changes.
Patch By: IanPudney
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D85797
Cameron McInally [Wed, 12 Aug 2020 17:00:37 +0000 (12:00 -0500)]
[SVE] Lower fixed length FP minnum/maxnum
Lower fixed length MINNUM/MAXNUM to scalable vectors. Cherry-picked from D71767 with added tests.
Differential Revision: https://reviews.llvm.org/D85744
Johannes Doerfert [Wed, 12 Aug 2020 16:56:55 +0000 (11:56 -0500)]
[UpdateTestChecks][FIX] Python 2.7 compatibility and use right prefix
Ilya Leoshkevich [Wed, 12 Aug 2020 16:37:28 +0000 (18:37 +0200)]
[SanitizerCoverage] Use zeroext for cmp parameters on all targets
Commit
9385aaa84851 ("[sancov] Fix PR33732") added zeroext to
__sanitizer_cov_trace(_const)?_cmp[1248] parameters for x86_64 only,
however, it is useful on other targets, in particular, on SystemZ: it
fixes swap-cmp.test.
Therefore, use it on all targets. This is safe: if target ABI does not
require zero extension for a particular parameter, zeroext is simply
ignored. A similar change has been implemeted as part of commit
3bc439bdff8b ("[MSan] Add instrumentation for SystemZ"), and there were
no problems with it.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D85689
Dávid Bolvanský [Wed, 12 Aug 2020 16:36:06 +0000 (18:36 +0200)]
[Driver] Change -fnostack-clash-protection to -fno-stack-clash-protection
Clang command line docs mention `-fno-stack-clash-protection`, and GCC also uses -fno-stack-clash-protection.
Fixes PR47139
Reviewed By: tstellar
Differential Revision: https://reviews.llvm.org/D85844
Jakub Lichman [Wed, 12 Aug 2020 13:07:28 +0000 (13:07 +0000)]
[mlir] Added support for Index type inside getZeroAttr function
Differential Revision: https://reviews.llvm.org/D85833
Erik Pilkington [Wed, 12 Aug 2020 15:51:52 +0000 (11:51 -0400)]
[clang-tidy] use stable_sort instead of sort to fix EXPENSIVE_CHECKS tests
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/17317/console
Stanislav Mekhanoshin [Mon, 10 Aug 2020 19:57:12 +0000 (12:57 -0700)]
[AMDGPU][test] Add dedicated llvm-readobj test.
Differential Revision: https://reviews.llvm.org/D85683
Alexey Bataev [Wed, 12 Aug 2020 15:48:53 +0000 (11:48 -0400)]
[OPENMP] Fix PR47063: crash when trying to get captured statetment.
Need to call getRawStmt() function instead, when trying to get inner
associated statement for the executable directive. Not all directives
use captured statements.
Louis Dionne [Thu, 30 Jul 2020 13:42:23 +0000 (09:42 -0400)]
[libc++] Remove workarounds for missing rvalue references
We don't support GCC in C++03 mode, and Clang provides rvalue references
even in C++03 mode. So there's effectively no supported compiler that
doesn't support rvalue references.
Differential Revision: https://reviews.llvm.org/D84943
Valentin Clement [Wed, 12 Aug 2020 15:44:00 +0000 (11:44 -0400)]
[mlir][linalg][NFC] Remove extra semi-colon causing warnings
Extra semi-colon causes bunch of warnings with GCC 9.2.0
```
[1354/1516] Building CXX object tools/mlir/lib/Dialect/Linalg/IR/CMakeFiles/obj.MLIRLinalgOps.dir/LinalgOps.cpp.o
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1306:35: warning: extra ';' [-Wpedantic]
1306 | CANONICALIZERS_AND_FOLDERS(ConvOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1307:41: warning: extra ';' [-Wpedantic]
1307 | CANONICALIZERS_AND_FOLDERS(PoolingMaxOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1308:41: warning: extra ';' [-Wpedantic]
1308 | CANONICALIZERS_AND_FOLDERS(PoolingMinOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1309:41: warning: extra ';' [-Wpedantic]
1309 | CANONICALIZERS_AND_FOLDERS(PoolingSumOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1310:35: warning: extra ';' [-Wpedantic]
1310 | CANONICALIZERS_AND_FOLDERS(CopyOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1311:35: warning: extra ';' [-Wpedantic]
1311 | CANONICALIZERS_AND_FOLDERS(FillOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1312:38: warning: extra ';' [-Wpedantic]
1312 | CANONICALIZERS_AND_FOLDERS(GenericOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1313:45: warning: extra ';' [-Wpedantic]
1313 | CANONICALIZERS_AND_FOLDERS(IndexedGenericOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1318:42: warning: extra ';' [-Wpedantic]
1318 | CANONICALIZERS_AND_FOLDERS(BatchMatmulOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1319:34: warning: extra ';' [-Wpedantic]
1319 | CANONICALIZERS_AND_FOLDERS(DotOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1320:37: warning: extra ';' [-Wpedantic]
1320 | CANONICALIZERS_AND_FOLDERS(MatmulOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1321:37: warning: extra ';' [-Wpedantic]
1321 | CANONICALIZERS_AND_FOLDERS(MatvecOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1322:36: warning: extra ';' [-Wpedantic]
1322 | CANONICALIZERS_AND_FOLDERS(ConvWOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1323:38: warning: extra ';' [-Wpedantic]
1323 | CANONICALIZERS_AND_FOLDERS(ConvNWCOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1324:38: warning: extra ';' [-Wpedantic]
1324 | CANONICALIZERS_AND_FOLDERS(ConvNCWOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1325:37: warning: extra ';' [-Wpedantic]
1325 | CANONICALIZERS_AND_FOLDERS(ConvHWOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1326:39: warning: extra ';' [-Wpedantic]
1326 | CANONICALIZERS_AND_FOLDERS(ConvNHWCOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1327:39: warning: extra ';' [-Wpedantic]
1327 | CANONICALIZERS_AND_FOLDERS(ConvNCHWOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1328:38: warning: extra ';' [-Wpedantic]
1328 | CANONICALIZERS_AND_FOLDERS(ConvDHWOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1329:40: warning: extra ';' [-Wpedantic]
1329 | CANONICALIZERS_AND_FOLDERS(ConvNDHWCOp);
| ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1330:40: warning: extra ';' [-Wpedantic]
1330 | CANONICALIZERS_AND_FOLDERS(ConvNCDHWOp);
| ^
```
Reviewed By: mehdi_amini, rriddle
Differential Revision: https://reviews.llvm.org/D85766
Alexey Bataev [Wed, 12 Aug 2020 14:54:36 +0000 (10:54 -0400)]
[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks.
In untied tasks, need to allocate the space for local variales, declared
in task region, when the memory for task data is allocated. THe function
can be interrupted and we can exit from the function in untied task
switch. Need to keep the state of the local variables in this case.
Also, the compiler should not call cleanup when exiting in untied task
switch until the real exit out of the declaration scope is met during
execution.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D84457
Anastasia Stulova [Wed, 12 Aug 2020 09:01:46 +0000 (10:01 +0100)]
[OpenCL] Remove warning for variadic macros in C++ for OpenCL.
Patch by Ole Strohm (olestrohm)!
Tags: #clang
Differential Revision: https://reviews.llvm.org/D85429
Krzysztof Parzyszek [Wed, 12 Aug 2020 15:11:12 +0000 (10:11 -0500)]
[Hexagon] Return scalar size in getMinVectorRegisterBitWidth() when no HVX
This fixes https://llvm.org/PR47128.
Anna Welker [Wed, 12 Aug 2020 12:44:18 +0000 (13:44 +0100)]
[ARM][MVE] Enable tail predication for loops containing MVE gather/scatters
Widen the scope of memory operations that are allowed to be tail predicated
to include gathers and scatters, such that loops that are auto-vectorized
with the option -enable-arm-maskedgatscat (and actually end up containing
an MVE gather or scatter) can be tail predicated.
Differential Revision: https://reviews.llvm.org/D85138
Zurab Tsinadze [Wed, 12 Aug 2020 14:18:42 +0000 (16:18 +0200)]
[analyzer] StdLibraryFunctionsChecker: Add support for new functions
`toupper`, `tolower`, `toascii` functions were added to
StdLibraryFunctionsChecker to fully cover CERT STR37-C rule:
https://wiki.sei.cmu.edu/confluence/x/BNcxBQ
Differential Revision: https://reviews.llvm.org/D85093
Alexey Bataev [Tue, 11 Aug 2020 16:30:45 +0000 (12:30 -0400)]
[OPENMP]Do not add TGT_OMP_TARGET_PARAM flag to non-captured mapped arguments.
If the arguments are mapped, but are actually not used in the target
region, the compiler still adds attribute TGT_OMP_TARGET_PARAM for such
arguments. It makes the libomptarget to add such parameters to the list
of arguments, passed to the kernel at the runtime, and may lead to
incorrect results/crashes during execution.
Differential Revision: https://reviews.llvm.org/D85755
Matt Arsenault [Thu, 6 Aug 2020 03:21:16 +0000 (23:21 -0400)]
AMDGPU/GlobalISel: Select llvm.amdgcn.global.atomic.fadd
Remove the intermediate transform in the DAG path. I believe this is
the last non-deprecated intrinsic that needs handling.
Matt Arsenault [Mon, 10 Aug 2020 16:25:48 +0000 (12:25 -0400)]
AMDGPU: Handle intrinsics in performMemSDNodeCombine
This avoids a possible regression in a future patch
Alexey Bataev [Wed, 12 Aug 2020 13:49:59 +0000 (09:49 -0400)]
Revert "[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks."
This reverts commit
ec9563c54ed25e9f9cbe60985399212d50bd801d to
investigate compiler crash revelaed by the buildbots.
Xing GUO [Wed, 12 Aug 2020 13:47:27 +0000 (21:47 +0800)]
[DWARFYAML] Make the address size of compilation units optional.
This patch makes the 'AddrSize' field optional. If the address size is
missing, yaml2obj will infer it from the object file.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D85805
Xing GUO [Wed, 12 Aug 2020 13:44:56 +0000 (21:44 +0800)]
[MachOYAML] Simplify the section data emitting function. NFC.
This patch helps simplify some codes in writeSectionData() function.
Reviewed By: jhenderson, grimar
Differential Revision: https://reviews.llvm.org/D85821
Alexey Bataev [Tue, 21 Jul 2020 19:20:16 +0000 (15:20 -0400)]
[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks.
Summary:
In untied tasks, need to allocate the space for local variales, declared
in task region, when the memory for task data is allocated. THe function
can be interrupted and we can exit from the function in untied task
switch. Need to keep the state of the local variables in this case.
Also, the compiler should not call cleanup when exiting in untied task
switch until the real exit out of the declaration scope is met during
execution.
Reviewers: jdoerfert
Subscribers: yaxunl, guansong, cfe-commits, sstefan1, caomhin
Tags: #clang
Differential Revision: https://reviews.llvm.org/D84457
Erich Keane [Fri, 7 Aug 2020 19:05:24 +0000 (12:05 -0700)]
Limit Max Vector alignment on COFF targets to 8192.
COFF targets have a max object alignment of 8192, so trying to create
one with a larger size results in an unreachable in WinCOFFObjectWriter.
For the reproducer I have uses thread local storage, however other
alignments are likely affected as well.
This patch sets the MaxVectorAlign for COFF to 8192. Additionally,
though there is no longer a way to reproduce that I could find, it
correctly sets the MaxTLSAlign for COFF to that value as well, so that
if anyone comes up with a situation where this is true, it will cause an
error.
Differential Revision: https://reviews.llvm.org/D85543
Sanjay Patel [Wed, 12 Aug 2020 13:20:59 +0000 (09:20 -0400)]
[VectorCombine] early exit if target has no vector registers
Based on post-commit discussion in:
D81766
Other vectorization passes (SLP and Loop) use this TTI API similarly.
Sanjay Patel [Wed, 12 Aug 2020 13:15:11 +0000 (09:15 -0400)]
[VectorCombine] add test for x86 target with SSE disabled; NFC
David Green [Wed, 12 Aug 2020 13:20:20 +0000 (14:20 +0100)]
[ARM] Add additional predicated VFMA tests. NFC
Sanjay Patel [Wed, 12 Aug 2020 13:08:17 +0000 (09:08 -0400)]
[InstCombine] eliminate a pointer cast around insertelement
I'm not sure if this solves PR46839 completely, but reducing the casting should help:
https://bugs.llvm.org/show_bug.cgi?id=46839
Differential Revision: https://reviews.llvm.org/D85647
Sanjay Patel [Wed, 12 Aug 2020 12:36:02 +0000 (08:36 -0400)]
[VectorCombine] add test for Hexagon that would crash; NFC
This test verifies the code change from:
rGb0b95dab1ce2
(although that would not be true if PR47128 is fixed)
Kai Nacke [Tue, 28 Jul 2020 08:33:50 +0000 (10:33 +0200)]
[SystemZ/ZOS] Implement computeHostNumPhysicalCores
On z/OS, the information is stored in the Common System Data Area
(CSD). It is the number of CPs allocated to the current LPAR.
Reviewers: aganea, hubert.reinterpertcast, MaskRay
Reviewed By: hubert.reinterpertcast
Differential Revision: https://reviews.llvm.org/D85531
Sam Parker [Tue, 11 Aug 2020 13:19:35 +0000 (14:19 +0100)]
[LoopUnroll] Adjust CostKind query
When TTI was updated to use an explicit cost, TCK_CodeSize was used
although the default implicit cost would have been the hand-wavey
cost of size and latency. So, revert back to this behaviour. This is
not expected to have (much) impact on targets since most (all?) of
them return the same value for SizeAndLatency and CodeSize.
When optimising for size, the logic has been changed to query
CodeSize costs instead of SizeAndLatency.
This patch also adds a testing option in the unroller so that
OptSize thresholds can be specified.
Differential Revision: https://reviews.llvm.org/D85723
Raphael Isemann [Wed, 12 Aug 2020 11:52:03 +0000 (13:52 +0200)]
Revert "[lldb] Display autosuggestion part in gray if there is one possible suggestion"
This reverts commit
246afe0cd17fce935a01171f3cca548e02523e5c. This broke
the following tests on Linux it seems:
lldb-api :: commands/expression/multiline-completion/TestMultilineCompletion.py
lldb-api :: iohandler/completion/TestIOHandlerCompletion.py
David Green [Wed, 12 Aug 2020 11:50:18 +0000 (12:50 +0100)]
[ARM] Commutative vmin/maxnma tests. NFC
Bogdan Serea [Tue, 11 Aug 2020 13:41:48 +0000 (14:41 +0100)]
[clang-tidy] prevent generated checks from triggering assertions on anonymous functions
Skeleton checks generated by clang-tidy add_check.py cause assertions to fail when run over anonymous functions(lambda functions). This patch introduces an additional check to verify that the target function is not anonymous before calling getName().
The code snippet from the [[ https://clang.llvm.org/extra/clang-tidy/Contributing.html | clang-tidy tutorial ]]is also updated.
Reviewed By: alexfh, DavidTruby
Differential Revision: https://reviews.llvm.org/D85218
Simon Pilgrim [Wed, 12 Aug 2020 11:11:08 +0000 (12:11 +0100)]
[X86][SSE] Fold HOP(SHUFFLE(X),SHUFFLE(Y)) --> SHUFFLE(HOP(X,Y))
This is beginning to look like a canonicalization stage that could be performed as part of shuffle combining
Another step towards PR41813
Shu Anzai [Wed, 12 Aug 2020 10:54:28 +0000 (12:54 +0200)]
[lldb] Display autosuggestion part in gray if there is one possible suggestion
I implemented autosuggestion if there is one possible suggestion.
I set the keybinds for every character. When a character is typed, Editline::TypedCharacter is called.
Then, autosuggestion part is displayed in gray, and you can actually input by typing C-k.
Editline::Autosuggest is a function for finding completion, and it is like Editline::TabCommand now, but I will add more features to it.
Testing does not work well in my environment, so I can't confirm that it goes well, sorry. I am dealing with it now.
Reviewed By: teemperor, JDevlieghere, #lldb
Differential Revision: https://reviews.llvm.org/D81001