Yaxun Liu [Thu, 11 Jul 2019 17:50:09 +0000 (17:50 +0000)]
[HIP] Add GPU arch gfx1010, gfx1011, and gfx1012
Differential Revision: https://reviews.llvm.org/D64364
llvm-svn: 365799
Benjamin Kramer [Thu, 11 Jul 2019 17:44:11 +0000 (17:44 +0000)]
[CodeGen] NVPTX: Switch from atomic.load.add.f32 to atomicrmw fadd
llvm-svn: 365798
Nathan Huckleberry [Thu, 11 Jul 2019 17:12:05 +0000 (17:12 +0000)]
[Docs] Add standardized header links to analyzer doc
Summary:
Header links should have some standard form so clang tidy
docs can easily reference them. The form is as follows.
Start with the analyzer full name including packages.
Replace all periods with dashes and lowercase everything.
Ex: core.CallAndMessage -> core-callandmessage
Reviewers: JonasToth, aaron.ballman, NoQ, Szelethus
Reviewed By: aaron.ballman, Szelethus
Subscribers: nickdesaulniers, lebedev.ri, baloghadamsoftware, mgrang, a.sidorin, Szelethus, jfb, donat.nagy, dkrupp, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64543
llvm-svn: 365797
Benjamin Kramer [Thu, 11 Jul 2019 17:11:25 +0000 (17:11 +0000)]
[NVPTX] Use atomicrmw fadd instead of intrinsics
AutoUpgrade the old intrinsics to atomicrmw fadd.
llvm-svn: 365796
Nico Weber [Thu, 11 Jul 2019 17:09:35 +0000 (17:09 +0000)]
gn build: Merge r365792
llvm-svn: 365795
Sam McCall [Thu, 11 Jul 2019 16:26:53 +0000 (16:26 +0000)]
[clangd] Avoid template in Task constructor, hopefully fix MSVC build
llvm-svn: 365794
Sam McCall [Thu, 11 Jul 2019 16:22:50 +0000 (16:22 +0000)]
[clangd] Consume llvm::Error in test after r365792
llvm-svn: 365793
Sam McCall [Thu, 11 Jul 2019 16:04:18 +0000 (16:04 +0000)]
[clangd] Implementation of auto type expansion.
Add a tweak for clangd to replace an auto keyword to the deduced type.
This way a user can declare something with auto and then have the
IDE/clangd replace auto with whatever type clangd thinks it is. In case
of long/complext types this makes is reduces writing effort for the
user.
The functionality is similar to the hover over the auto keyword.
Example (from the header):
```
/// Before:
/// auto x = Something();
/// ^^^^
/// After:
/// MyClass x = Something();
/// ^^^^^^^
```
Patch by kuhnel! (Christian Kühnel)
Differential Revision: https://reviews.llvm.org/D62855
llvm-svn: 365792
Sanjay Patel [Thu, 11 Jul 2019 15:56:33 +0000 (15:56 +0000)]
[X86] Merge negated ISD::SUB nodes into X86ISD::SUB equivalent (PR40483)
Follow up to D58597, where it was noted that the commuted ISD::SUB variant
was having problems with lack of combines.
See also D63958 where we untangled setcc/sub pairs.
Differential Revision: https://reviews.llvm.org/D58875
llvm-svn: 365791
Kostya Kortchinsky [Thu, 11 Jul 2019 15:32:26 +0000 (15:32 +0000)]
[scudo][standalone] Merge Spin & Blocking mutex into a Hybrid one
Summary:
We ran into a problem on Fuchsia where yielding threads would never
be deboosted, ultimately resulting in several threads spinning on the
same TSD, and no possibility for another thread to be scheduled,
dead-locking the process.
While this was fixed in Zircon, this lead to discussions about if
spinning without a break condition was a good decision, and settled on
a new hybrid model that would spin for a while then block.
Currently we are using a number of iterations for spinning that is
mostly arbitrary (based on sanitizer_common values), but this can
be tuned in the future.
Since we are touching `common.h`, we also use this change as a vehicle
for an Android optimization (the page size is fixed in Bionic, so use
a fixed value too).
Reviewers: morehouse, hctim, eugenis, dvyukov, vitalybuka
Reviewed By: hctim
Subscribers: srhines, delcypher, jfb, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D64358
llvm-svn: 365790
Nico Weber [Thu, 11 Jul 2019 15:26:45 +0000 (15:26 +0000)]
Fix a few 'no newline at end of file' warnings that Xcode emits
(Xcode even has a snazzy "Fix" button, but clicking that inserts two
newlines. So close!)
llvm-svn: 365789
Louis Dionne [Thu, 11 Jul 2019 15:16:39 +0000 (15:16 +0000)]
[libc++] Implement deduction guides for <unordered_set>
Thanks to Arthur O'Dwyer for the patch.
Differential Revision: https://reviews.llvm.org/D58617
llvm-svn: 365788
Nico Weber [Thu, 11 Jul 2019 15:01:50 +0000 (15:01 +0000)]
gn build: Merge r365773
llvm-svn: 365787
Alexey Bataev [Thu, 11 Jul 2019 14:54:17 +0000 (14:54 +0000)]
[OPENMP]Initial fix PR42392: Improve -Wuninitialized warnings for OpenMP programs.
Summary:
Some OpenMP clauses rely on the values of the variables. If the variable
is not initialized and used in OpenMP clauses that depend on the
variables values, it should be reported that the uninitialized variable
is used in the OpenMP clause expression.
This patch adds initial processing for uninitialized variables in OpenMP
constructs. Currently, it checks for use of the uninitialized variables
in the structured blocks.
Reviewers: NoQ, Szelethus, dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet
Subscribers: rnkovacs, guansong, jfb, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64356
llvm-svn: 365786
Simon Pilgrim [Thu, 11 Jul 2019 14:45:03 +0000 (14:45 +0000)]
[DAGCombine] narrowInsertExtractVectorBinOp - add CONCAT_VECTORS support
We already split extract_subvector(binop(insert_subvector(v,x),insert_subvector(w,y))) -> binop(x,y).
This patch adds support for extract_subvector(binop(concat_vectors(),concat_vectors())) cases as well.
In particular this means we don't have to wait for X86 lowering to convert concat_vectors to insert_subvector chains, which helps avoid some cases where demandedelts/combine calls occur too late to split large vector ops.
The fast-isel-store.ll load folding regression is annoying but I don't think is that critical.
Differential Revision: https://reviews.llvm.org/D63653
llvm-svn: 365785
Matt Arsenault [Thu, 11 Jul 2019 14:41:40 +0000 (14:41 +0000)]
RegUsageInfoCollector: Skip calling conventions I missed before
llvm-svn: 365784
Matt Arsenault [Thu, 11 Jul 2019 14:18:25 +0000 (14:18 +0000)]
AMDGPU/GlobalISel: Move kernel argument handling to separate function
llvm-svn: 365782
Matt Arsenault [Thu, 11 Jul 2019 14:18:22 +0000 (14:18 +0000)]
Fix missing C++ mode comment
llvm-svn: 365781
Matt Arsenault [Thu, 11 Jul 2019 14:18:19 +0000 (14:18 +0000)]
GlobalISel: Use Register
llvm-svn: 365780
George Rimar [Thu, 11 Jul 2019 14:03:27 +0000 (14:03 +0000)]
Revert r365775 - "[Object/ELF] - Improve error reporting for notes."
It broke BB: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/15419
llvm-svn: 365779
Haojian Wu [Thu, 11 Jul 2019 13:58:56 +0000 (13:58 +0000)]
[clangd] Remove an extra ";", NFC
llvm-svn: 365778
Alexey Bataev [Thu, 11 Jul 2019 13:54:26 +0000 (13:54 +0000)]
Added mapping for pointers captured in Lambdas in OpenMP target regions,
by David Truby.
Summary:
This adds a zero length array section mapping for each pointer captured by a lambda that is used in a target region, as per section 2.19.7.1 of the OpenMP 5 specification.
Reviewers: ABataev
Reviewed By: ABataev
Subscribers: guansong, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64558
llvm-svn: 365777
Kadir Cetinkaya [Thu, 11 Jul 2019 13:47:46 +0000 (13:47 +0000)]
[clangd][QueryDriver] Use language from underlying database if possible
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64489
llvm-svn: 365776
George Rimar [Thu, 11 Jul 2019 13:47:44 +0000 (13:47 +0000)]
[Object/ELF] - Improve error reporting for notes.
This patch improves the error messages reported for
note sections and phdrs and also makes a cleanup for
existent test case.
Differential revision: https://reviews.llvm.org/D64470
llvm-svn: 365775
Sanjay Patel [Thu, 11 Jul 2019 13:44:29 +0000 (13:44 +0000)]
[InstCombine] don't move FP negation out of a constant expression
-(X * ConstExpr) becomes X * (-ConstExpr), so don't reverse that
and infinite loop.
llvm-svn: 365774
Sam McCall [Thu, 11 Jul 2019 13:34:38 +0000 (13:34 +0000)]
[clangd] Add priorities to background index queue, extract to separate class
Reviewers: kadircet
Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64560
llvm-svn: 365773
George Rimar [Thu, 11 Jul 2019 13:26:36 +0000 (13:26 +0000)]
[yaml2obj/elf-override-shsize.yaml] - An attemp to fix ppc64 bot.
Failture:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/35670/steps/ninja%20check%201/logs/FAIL%3A%20LLVM%3A%3Aelf-override-shsize.yaml
Solution:
Change `od` tool invocation to print single bytes.
llvm-svn: 365772
Sam Clegg [Thu, 11 Jul 2019 13:13:25 +0000 (13:13 +0000)]
[WebAssembly] Import __stack_pointer when building -pie binaries
The -pie binary doesn't know that layout ahead of time so needs to
import the stack pointer from the embedder, just like we do already
for shared libraries.
This change is needed in order to address:
https://github.com/emscripten-core/emscripten/issues/8915
Differential Revision: https://reviews.llvm.org/D64516
llvm-svn: 365771
Tim Northover [Thu, 11 Jul 2019 13:13:02 +0000 (13:13 +0000)]
OpaquePtr: switch to GlobalValue::getValueType in a few places. NFC.
llvm-svn: 365770
Tim Northover [Thu, 11 Jul 2019 13:12:38 +0000 (13:12 +0000)]
OpaquePtr: use byval accessor instead of inspecting pointer type. NFC.
The accessor can deal with both "byval(ty)" and "ty* byval" forms
seamlessly.
llvm-svn: 365769
Tim Northover [Thu, 11 Jul 2019 13:12:08 +0000 (13:12 +0000)]
OpaquePtr: use load instruction directly for type. NFC.
llvm-svn: 365768
Tim Northover [Thu, 11 Jul 2019 13:11:44 +0000 (13:11 +0000)]
InstructionSimplify: Simplify InstructionSimplify. NFC.
The interface predates CallBase, so both it and implementation were
significantly more complicated than they needed to be. There was even
some redundancy that could be eliminated.
Should also help with OpaquePointers by not trying to derive a
function's type from it's PointerType.
llvm-svn: 365767
George Rimar [Thu, 11 Jul 2019 12:59:29 +0000 (12:59 +0000)]
[yaml2obj] - Allow overriding the sh_size field.
There is no way to set broken sh_size field currently
for sections. It can be usefull for writing the
test cases.
Differential revision: https://reviews.llvm.org/D64401
llvm-svn: 365766
David Bolvansky [Thu, 11 Jul 2019 12:51:33 +0000 (12:51 +0000)]
[NFC] Updated tests for D64285
llvm-svn: 365765
Haojian Wu [Thu, 11 Jul 2019 12:31:18 +0000 (12:31 +0000)]
[clangd] Remove the extra ";", NFC
llvm-svn: 365764
Haojian Wu [Thu, 11 Jul 2019 12:29:01 +0000 (12:29 +0000)]
[clangd] Fix an assertion crash in "ExtractVariable" tweak
Summary:
GetTypePtr requires that the type should not be null, otherwise we hit
an assertion, we should use getTypePtrOrNull instead.
Reviewers: sammccall, SureYeaah
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64556
llvm-svn: 365763
George Rimar [Thu, 11 Jul 2019 12:26:48 +0000 (12:26 +0000)]
[llvm-readobj/llvm-readelf] - Report a warning instead of a error when dumping a broken dynamic section.
It does not make sence to stop dumping the object if the broken
dynamic section was found. In this patch I changed the behavior from
"report an error" to "report a warning". This matches GNU.
Differential revision: https://reviews.llvm.org/D64472
llvm-svn: 365762
David Carlier [Thu, 11 Jul 2019 12:21:04 +0000 (12:21 +0000)]
[LLDB] Fix FreeBSD build.
To align with the LaunchThread change.
Reviewers: MaskRay, mgorny
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D64398
llvm-svn: 365761
Fangrui Song [Thu, 11 Jul 2019 11:16:51 +0000 (11:16 +0000)]
[ELF] Handle non-glob patterns before glob patterns in version scripts & fix a corner case of --dynamic-list
This fixes PR38549, which is silently accepted by ld.bfd.
This seems correct because it makes sense to let non-glob patterns take
precedence over glob patterns.
lld issues an error because
`assignWildcardVersion(ver, VER_NDX_LOCAL);` is processed before `assignExactVersion(ver, v.id, v.name);`.
Move all assignWildcardVersion() calls after assignExactVersion() calls
to fix this.
Also, move handleDynamicList() to the bottom. computeBinding() called by
includeInDynsym() has this cryptic rule:
if (versionId == VER_NDX_LOCAL && isDefined() && !isPreemptible)
return STB_LOCAL;
Before the change:
* foo's version is set to VER_NDX_LOCAL due to `local: *`
* handleDynamicList() is called
- foo.computeBinding() is STB_LOCAL
- foo.includeInDynsym() is false
- foo.isPreemptible is not set (wrong)
* foo's version is set to V1
After the change:
* foo's version is set to VER_NDX_LOCAL due to `local: *`
* foo's version is set to V1
* handleDynamicList() is called
- foo.computeBinding() is STB_GLOBAL
- foo.includeInDynsym() is true
- foo.isPreemptible is set (correct)
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D64550
llvm-svn: 365760
Fangrui Song [Thu, 11 Jul 2019 11:16:44 +0000 (11:16 +0000)]
[ELF] Warn rather than error when duplicate version assignments occur
In lvm2, libdevmapper.so is linked with a version script with duplicate
version assignments:
DM_1_02_138 { global: ... dm_bitset_parse_list; ... };
DM_1_02_129 { global: ... dm_bitset_parse_list; ... };
ld.bfd silently accepts this while gold issues a warning. We currently
error, thus inhibit producing the executable. Change the error to
warning to allow this case, and improve the message.
There are some cases where ld.bfd error
`anonymous version tag cannot be combined with other version tags`
but we just warn. It is probably OK for now.
Reviewed By: grimar, ruiu
Differential Revision: https://reviews.llvm.org/D64549
llvm-svn: 365759
David Bolvansky [Thu, 11 Jul 2019 10:55:04 +0000 (10:55 +0000)]
[InstCombine] Reorder recently added/improved pow transformations
Changed cases are now faster with exp2.
llvm-svn: 365758
Florian Hahn [Thu, 11 Jul 2019 10:53:40 +0000 (10:53 +0000)]
Revert [BitcodeReader] Validate OpNum, before accessing Record array.
This reverts r365750 (git commit
8b222ecf2769ee133691f208f6166ce118c4a164)
llvm-dis runs out of memory while opening invalid-fcmp-opnum.bc on
llvm-hexagon-elf, probably because the bitcode file contains other
suspicious values.
http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/21949
llvm-svn: 365757
Kadir Cetinkaya [Thu, 11 Jul 2019 10:41:58 +0000 (10:41 +0000)]
[clangd] Fix windows buildbots
llvm-svn: 365756
Simon Pilgrim [Thu, 11 Jul 2019 10:40:23 +0000 (10:40 +0000)]
[X86] Regenerate intrinsics tests. NFCI.
llvm-svn: 365755
Simon Pilgrim [Thu, 11 Jul 2019 10:37:58 +0000 (10:37 +0000)]
[AMDGPU] Regenerate idot tests. NFCI.
Reduces diff in D63281.
llvm-svn: 365754
Fangrui Song [Thu, 11 Jul 2019 10:17:59 +0000 (10:17 +0000)]
[llvm-objcopy] Don't change permissions of non-regular output files
There is currently an EPERM error when a regular user executes `llvm-objcopy a.o /dev/null`.
Worse, root can even change the mode bits of /dev/null.
Fix it by checking if the output file is special.
A new overload of llvm::sys::fs::setPermissions with FD as the parameter
is added. Users should provide `perm & ~umask` as the parameter if they
intend to respect umask.
The existing overload of llvm::sys::fs::setPermissions may be deleted if
we can find an implementation of fchmod() on Windows. fchmod() is
usually better than chmod() because it saves syscalls and can avoid race
condition.
Reviewed By: jakehehrlich, jhenderson
Differential Revision: https://reviews.llvm.org/D64236
llvm-svn: 365753
Fangrui Song [Thu, 11 Jul 2019 10:10:09 +0000 (10:10 +0000)]
[X86] -fno-plt: use GOT __tls_get_addr only if GOTPCRELX is enabled
Summary:
As of binutils 2.32, ld has a bogus TLS relaxation error when the GD/LD
code sequence using R_X86_64_GOTPCREL (instead of R_X86_64_GOTPCRELX) is
attempted to be relaxed to IE/LE (binutils PR24784). gold and lld are good.
In gcc/config/i386/i386.md, there is a configure-time check of as/ld
support and the GOT relaxation will not be used if as/ld doesn't support
it:
if (flag_plt || !HAVE_AS_IX86_TLS_GET_ADDR_GOT)
return "call\t%P2";
return "call\t{*%p2@GOT(%1)|[DWORD PTR %p2@GOT[%1]]}";
In clang, -DENABLE_X86_RELAX_RELOCATIONS=OFF is the default. The ld.bfd
bogus error can be reproduced with:
thread_local int a;
int main() { return a; }
clang -fno-plt -fpic a.cc -fuse-ld=bfd
GOTPCRELX gained relative good support in 2016, which is considered
relatively new. It is even difficult to conditionally default to
-DENABLE_X86_RELAX_RELOCATIONS=ON due to cross compilation reasons. So
work around the ld.bfd bug by only using GOT when GOTPCRELX is enabled.
Reviewers: dalias, hjl.tools, nikic, rnk
Reviewed By: nikic
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64304
llvm-svn: 365752
Haojian Wu [Thu, 11 Jul 2019 10:06:24 +0000 (10:06 +0000)]
[clangd] Add a missing "return nullptr;" to the SelectionTree::commonAncestor.
This would fix some mysterious crashes on codeAction in clangd.
llvm-svn: 365751
Florian Hahn [Thu, 11 Jul 2019 09:57:00 +0000 (09:57 +0000)]
[BitcodeReader] Validate OpNum, before accessing Record array.
Currently invalid bitcode files can cause a crash, when OpNum exceeds
the number of elements in Record, like in the attached bitcode file.
The test case was generated by clusterfuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15698
Reviewers: t.p.northover, thegameg, jfb
Reviewed By: jfb
Differential Revision: https://reviews.llvm.org/D64507
llvm-svn: 365750
Sam Parker [Thu, 11 Jul 2019 09:56:15 +0000 (09:56 +0000)]
[ARM][LowOverheadLoops] Correct offset checking
This patch addresses a couple of problems:
1) The maximum supported offset of LE is -4094.
2) The offset of WLS also needs to be checked, this uses a
maximum positive offset of 4094.
The use of BasicBlockUtils has been changed because the block offsets
weren't being initialised, but the isBBInRange checks both positive
and negative offsets.
ARMISelLowering has been tweaked because the test case presented
another pattern that we weren't supporting.
llvm-svn: 365749
Kadir Cetinkaya [Thu, 11 Jul 2019 09:54:31 +0000 (09:54 +0000)]
[clangd] Reland rL365634
This was reverted in rL365678, the failure was due to YAML parsing of
compile_commands.json.
Converting backslashes to forward slashes to fix the issue in unittest.
llvm-svn: 365748
Simon Tatham [Thu, 11 Jul 2019 09:52:15 +0000 (09:52 +0000)]
[ARM] Remove nonexistent unsigned forms of MVE VQDMLAH.
The VQDMLAH.U8, VQDMLAH.U16 and VQDMLAH.U32 instructions don't
actually exist: the Armv8.1-M architecture spec only lists signed
forms of that instruction. The unsigned ones were added in error: they
existed in an early draft of the spec, but they were removed before
the public version, and we missed that particular spec change.
Also affects the variant forms VQDMLASH, VQRDMLAH and VQRDMLASH.
Reviewers: miyuki
Subscribers: javed.absar, kristof.beyls, hiraditya, dmgreen, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64502
llvm-svn: 365747
Kai Luo [Thu, 11 Jul 2019 09:43:03 +0000 (09:43 +0000)]
[NFC][PowerPC] Added test to track current behaviour of TailDup
llvm-svn: 365746
Johan Vikstrom [Thu, 11 Jul 2019 09:29:16 +0000 (09:29 +0000)]
[clangd] Added highlightings for namespace specifiers.
Summary: Added highlightings for namespace specifiers.
Reviewers: hokein, sammccall, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64492
llvm-svn: 365745
Petar Avramovic [Thu, 11 Jul 2019 09:28:34 +0000 (09:28 +0000)]
[MIPS GlobalISel] Skip copies in addUseDef and addDefUses
Skip copies between virtual registers during search for UseDefs
and DefUses.
Since each operand has one def search for UseDefs is straightforward.
But since operand can have many uses, we have to check all uses of
each copy we traverse during search for DefUses.
Differential Revision: https://reviews.llvm.org/D64486
llvm-svn: 365744
Petar Avramovic [Thu, 11 Jul 2019 09:22:49 +0000 (09:22 +0000)]
[MIPS GlobalISel] RegBankSelect for chains of ambiguous instructions
When one of the uses/defs of ambiguous instruction is also ambiguous
visit it recursively and search its uses/defs for instruction with
only one mapping available.
When all instruction in a chain are ambiguous arbitrary mapping can
be selected. For s64 operands in ambiguous chain fprb is selected since
it results in less instructions then having to narrow scalar s64 to s32.
For s32 both gprb and fprb result in same number of instructions and
gprb is selected like a general purpose option.
At the moment we always avoid cross register bank copies.
TODO: Implement a model for costs calculations of different mappings
on same instruction and cross bank copies. Allow cross bank copies
when appropriate according to cost model.
Differential Revision: https://reviews.llvm.org/D64485
llvm-svn: 365743
Haojian Wu [Thu, 11 Jul 2019 08:54:28 +0000 (08:54 +0000)]
Revert Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the Option class."
This reverts r365675 (git commit
43d75f977853c3ec891a440c362b2df183a211b5)
The patch causes a crash in SupportTests (CommandLineTest.AliasesWithArguments).
llvm-svn: 365742
Jay Foad [Thu, 11 Jul 2019 08:49:52 +0000 (08:49 +0000)]
Remove some redundant code from r290372 and improve a comment.
llvm-svn: 365741
Sam Parker [Thu, 11 Jul 2019 07:47:50 +0000 (07:47 +0000)]
[ARM][ParallelDSP] Change the search for smlads
Two functional changes have been made here:
- Now search up from any add instruction to find the chains of
operations that we may turn into a smlad. This allows the
generation of a smlad which doesn't accumulate into a phi.
- The search function has been corrected to stop it falsely searching
up through an invalid path.
The bulk of the changes have been making the Reduction struct a class
and making it more C++y with getters and setters.
Differential Revision: https://reviews.llvm.org/D61780
llvm-svn: 365740
Petr Hosek [Thu, 11 Jul 2019 07:30:11 +0000 (07:30 +0000)]
[ASan] Use __sanitizer_fill_shadow for FastPoisonShadow on Fuchsia
This is the optimized implementation for Fuchsia provided by the libc.
Differential Revision: https://reviews.llvm.org/D64166
llvm-svn: 365739
Mikael Holmen [Thu, 11 Jul 2019 07:07:23 +0000 (07:07 +0000)]
[test] Silence gcc 7.4 warning [NFC]
Without this gcc 7.4.0 complains with
../unittests/Analysis/ValueTrackingTest.cpp:937:66: error: ISO C++11 requires at least one argument for the "..." in a variadic macro [-Werror]
::testing::ValuesIn(IsBytewiseValueTests));
^
llvm-svn: 365738
Rui Ueyama [Thu, 11 Jul 2019 06:56:44 +0000 (06:56 +0000)]
Fix build breakage on Win32.
llvm-svn: 365737
Mikael Holmen [Thu, 11 Jul 2019 06:50:10 +0000 (06:50 +0000)]
[clang-doc] Silence compiler warning with gcc 7.4 [NFC]
Without the fix gcc 7.4.0 complains with
/data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp: In member function 'llvm::SmallString<16> clang::doc::{anonymous}::HTMLTag::ToString() const':
/data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp:165:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
/data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp: In member function 'bool clang::doc::{anonymous}::HTMLTag::HasInlineChildren() const':
/data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp:142:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
/data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp: In member function 'bool clang::doc::{anonymous}::HTMLTag::IsSelfClosing() const':
/data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp:126:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
cc1plus: all warnings being treated as errors
llvm-svn: 365736
Kamil Rytarowski [Thu, 11 Jul 2019 06:22:35 +0000 (06:22 +0000)]
Add NetBSD LSan support
Summary:
Combine few relatively small changes into one:
- implement internal_ptrace() and internal_clone() for NetBSD
- add support for stoptheworld based on the ptrace(2) API
- define COMPILER_RT_HAS_LSAN for NetBSD
- enable tests for NetBSD/amd64
Inspired by the original implementation by Christos Zoulas in netbsd/src for GCC.
The implementation is in theory CPU independent through well defined macros
across all NetBSD ports, however only the x86_64 version was tested.
Reviewers: mgorny, dvyukov, vitalybuka, joerg, jfb
Reviewed By: vitalybuka
Subscribers: dexonsmith, jfb, srhines, kubamracek, llvm-commits, christos
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64057
llvm-svn: 365735
Rui Ueyama [Thu, 11 Jul 2019 06:12:18 +0000 (06:12 +0000)]
Fix build breakage on Darwin.
llvm-svn: 365734
Rui Ueyama [Thu, 11 Jul 2019 06:08:54 +0000 (06:08 +0000)]
Update comments for r365730. NFC.
llvm-svn: 365733
Rui Ueyama [Thu, 11 Jul 2019 06:00:40 +0000 (06:00 +0000)]
Fix build breakage on Win32.
llvm-svn: 365732
Heejin Ahn [Thu, 11 Jul 2019 05:55:47 +0000 (05:55 +0000)]
[WebAssembly] Print error message for llvm.clear_cache intrinsic
Summary:
Wasm does not currently support `llvm.clear_cache` intrinsic, and this
prints a proper error message instead of segfault.
Reviewers: dschuff, sbc100, sunfish
Subscribers: jgravelle-google, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64322
llvm-svn: 365731
Rui Ueyama [Thu, 11 Jul 2019 05:40:30 +0000 (05:40 +0000)]
[Coding style change][lld] Rename variables for non-ELF ports
This patch does the same thing as r365595 to other subdirectories,
which completes the naming style change for the entire lld directory.
With this, the naming style conversion is complete for lld.
Differential Revision: https://reviews.llvm.org/D64473
llvm-svn: 365730
Huihui Zhang [Thu, 11 Jul 2019 04:56:37 +0000 (04:56 +0000)]
[InstCombine][NFCI] Add test coverage to onehot_merge.ll
Prep work for upcoming patch D64275.
llvm-svn: 365729
Richard Trieu [Thu, 11 Jul 2019 02:54:15 +0000 (02:54 +0000)]
Increase the number of parser diagnostics.
The reserved range for parser diagnostics is getting close to being filled,
so increase the space for them.
llvm-svn: 365727
Chen Zheng [Thu, 11 Jul 2019 02:18:22 +0000 (02:18 +0000)]
[SCEV] teach SCEV symbolical execution about overflow intrinsics folding.
Differential Revision: https://reviews.llvm.org/D64422
llvm-svn: 365726
Nico Weber [Thu, 11 Jul 2019 01:21:17 +0000 (01:21 +0000)]
Change another test I missed in r365724
llvm-svn: 365725
Nico Weber [Thu, 11 Jul 2019 01:18:05 +0000 (01:18 +0000)]
clang-cl: Remove -O0 option
cl.exe doesn't understand it; there's /Od instead. See also the review
thread for r229575.
Update lots of compiler-rt tests to use -Od instead of -O0.
Ran `rg -l 'clang_cl.*O0' compiler-rt/test/ | xargs sed -i -c 's/-O0/-Od/'`
Differential Revision: https://reviews.llvm.org/D64506
llvm-svn: 365724
Johannes Doerfert [Thu, 11 Jul 2019 01:14:48 +0000 (01:14 +0000)]
Replace three "strip & accumulate" implementations with a single one
This patch replaces the three almost identical "strip & accumulate"
implementations for constant pointer offsets with a single one,
combining the respective functionalities. The old interfaces are kept
for now.
Differential Revision: https://reviews.llvm.org/D64468
llvm-svn: 365723
Johannes Doerfert [Thu, 11 Jul 2019 01:14:30 +0000 (01:14 +0000)]
[NFC] Adjust "invalid.ll.bc" tests to check for AttrKind #255 not #63
We are about to add enum attributes with AttrKind numbers >= 63. This
means we cannot use AttrKind #63 to test for an invalid attribute number
in the RAW format anymore. This patch changes the number of an invalid
attribute to #255. There is no change to the character of the tests.
Differential Revision: https://reviews.llvm.org/D64531
llvm-svn: 365722
Nico Weber [Thu, 11 Jul 2019 01:13:38 +0000 (01:13 +0000)]
Various minor tweaks to CLCompatOptions.td
- Add back indentation I accidentally removed in r364901
- Wrap two lines to 80 cols
- Slightly tighten up help text for several flags
- Consistently use "Do not" instead of "Don't"
- Make every option description start with a verb
- Use "Set" instead of "Specify"
- Mark default values of options more consistently
- Remove text about "/Zi" not producing PDBs since it's confusing
for people not intimately familiar with the implementation of
the normal PDB pipeline. /Zi lets the linker produce PDBs, which
is what most users want.
- Consistently use "file" over "filename" in meta var names,
consistently use "file name" over "filename" in text
- Make all output setting options have consistent language
llvm-svn: 365721
Craig Topper [Thu, 11 Jul 2019 01:01:39 +0000 (01:01 +0000)]
[X86] Don't convert 8 or 16 bit ADDs to LEAs on Atom in FixupLEAPass.
We use the functions that convert to three address to do the
conversion, but changing an 8 or 16 bit will cause it to create
a virtual register. This can't be done after register allocation
where this pass runs.
I've switched the pass completely to a white list of instructions
that can be converted to LEA instead of a blacklist that was
incorrect. This will avoid surprises if we enhance the three
address conversion function to include additional instructions
in the future.
Fixes PR42565.
llvm-svn: 365720
Raphael Isemann [Thu, 11 Jul 2019 00:35:31 +0000 (00:35 +0000)]
[lldb] Disable TestDollarInVariable.py on Windows
It seems on Windows we don't handle the lldb_expr_result variable correctly:
```
AssertionError: False is not True : 'expr $__lldb_expr_result' returns expected result, got '(int &) $0 = 0x0000000000000000'
```
I'll disable the test until I can find a way to debug this on Windows.
llvm-svn: 365719
Jonas Devlieghere [Thu, 11 Jul 2019 00:12:59 +0000 (00:12 +0000)]
[swig] Add workaround for old swig
Apparently, when using swig 1.3.40, properties to set values do not work
without the `__swig_setmethods__` workaround. I conditionally added this
back for SBTypeCategory, as it's causing a test failure on GreenDragon,
while I investigate this further.
llvm-svn: 365718
Stanislav Mekhanoshin [Thu, 11 Jul 2019 00:10:17 +0000 (00:10 +0000)]
[AMDGPU] gfx908 atomic fadd and atomic pk_fadd
Differential Revision: https://reviews.llvm.org/D64435
llvm-svn: 365717
Vedant Kumar [Thu, 11 Jul 2019 00:09:16 +0000 (00:09 +0000)]
[CGDebugInfo] Fix -femit-debug-entry-values crash on os_log_helpers
An os_log_helper FunctionDecl may not have a body. Ignore these for the
purposes of debug entry value emission.
Fixes an assertion failure seen in a stage2 build of clang:
Assertion failed: (FD->hasBody() && "Functions must have body here"),
function analyzeParametersModification
llvm-svn: 365716
Stanislav Mekhanoshin [Thu, 11 Jul 2019 00:00:27 +0000 (00:00 +0000)]
[AMDGPU] gfx908 dot instruction support
Differential Revision: https://reviews.llvm.org/D64431
llvm-svn: 365715
Nico Weber [Wed, 10 Jul 2019 23:50:16 +0000 (23:50 +0000)]
Attempt to fix bots after r365703
llvm-svn: 365714
Sterling Augustine [Wed, 10 Jul 2019 23:38:00 +0000 (23:38 +0000)]
rL365634 adds a unique_ptr<CompilationDatabase> in GobalCompilationDatabase.h:108 but CompilationDatabase is only forward declared. This makes the header not compile standalone, because unique_ptrs expect to have the full-definition of the...
Summary:
...template argument.
Remove the forward declaration and include the appropriate header instead.
Remove CompileCommand too, which is also in the header.
llvm-svn: 365713
Jordan Rupprecht [Wed, 10 Jul 2019 23:32:44 +0000 (23:32 +0000)]
Revert [llvm-objcopy] Allow strip symtab from executables and DSOs
This reverts r365193 (git commit
194f16b3548bcb23a7f0fd638778ed72edd18d37)
This patch doesn't work with binaries built w/ `--emit-relocs`, e.g.
```
$ echo 'int main() { return 0; }' | clang -Wl,--emit-relocs -x c - -o foo && llvm-objcopy --strip-unneeded foo
llvm-objcopy: error: 'foo': not stripping symbol '__gmon_start__' because it is named in a relocation
```
llvm-svn: 365712
Sanjay Patel [Wed, 10 Jul 2019 23:23:54 +0000 (23:23 +0000)]
[SDAG] commute setcc operands to match a subtract
If we have:
R = sub X, Y
P = cmp Y, X
...then flipping the operands in the compare instruction can allow using a subtract that sets compare flags.
Motivated by diffs in D58875 - not sure if this changes anything there,
but this seems like a good thing independent of that.
There's a more involved version of this transform already in IR (in instcombine
although that seems misplaced to me) - see "swapMayExposeCSEOpportunities()".
Differential Revision: https://reviews.llvm.org/D63958
llvm-svn: 365711
Vitaly Buka [Wed, 10 Jul 2019 22:56:15 +0000 (22:56 +0000)]
Add IsBytewiseValue unit test
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63966
llvm-svn: 365710
Vitaly Buka [Wed, 10 Jul 2019 22:53:52 +0000 (22:53 +0000)]
NFC: Pass DataLayout into isBytewiseValue
Summary:
We will need to handle IntToPtr which I will submit in a separate patch as it's
not going to be NFC.
Reviewers: eugenis, pcc
Reviewed By: eugenis
Subscribers: hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D63940
llvm-svn: 365709
Vitaly Buka [Wed, 10 Jul 2019 22:53:50 +0000 (22:53 +0000)]
NFC: Convert large lambda into method
Reviewers: pcc, eugenis
Reviewed By: eugenis
Subscribers: cfe-commits, lldb-commits
Tags: #clang, #lldb
Differential Revision: https://reviews.llvm.org/D63854
llvm-svn: 365708
Julian Lettner [Wed, 10 Jul 2019 22:50:07 +0000 (22:50 +0000)]
[TSan] Fix linker error on Linux/AArch64
llvm-svn: 365707
Vitaly Buka [Wed, 10 Jul 2019 22:47:07 +0000 (22:47 +0000)]
GodeGen, NFC: Add test to track emitStoresForConstant behavior
Reviewers: eugenis, pcc
Reviewed By: eugenis
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64385
llvm-svn: 365706
Craig Topper [Wed, 10 Jul 2019 22:44:32 +0000 (22:44 +0000)]
[X86] Add patterns with and_flag_nocf for BLSI and TBM instructions.
Fixes similar issues to r352306.
llvm-svn: 365705
Craig Topper [Wed, 10 Jul 2019 22:44:24 +0000 (22:44 +0000)]
[X86] Add a few more TBM and BLSI test cases that show the same issue that r352306 fixed for BLSR.
llvm-svn: 365704
Nico Weber [Wed, 10 Jul 2019 22:29:35 +0000 (22:29 +0000)]
driver: Don't warn about assembler flags being unused when not assembling
clang currently warns when passing flags for the assembler (e.g.
-Wa,-mbig-obj) to an invocation that doesn't run the assembler (e.g.
-E).
At first sight, that makes sense -- the flag really is unused. But many
other flags don't have an effect if no assembler runs (e.g.
-fno-integrated-as, -ffunction-sections, and many others), and those
currently don't warn. So this seems more like a side effect of how
CollectArgsForIntegratedAssembler() is implemented than like an
intentional feature.
Since it's a bit inconvenient when debugging builds and adding -E,
always call CollectArgsForIntegratedAssembler() to make sure assembler
args always get claimed. Currently, this affects only these flags:
-mincremental-linker-compatible, -mimplicit-it= (on ARM), -Wa, -Xassembler
It does have the side effect that assembler options now need to be valid
even if -E is passed. Previously, `-Wa,-mbig-obj` would error for
non-coff output only if the assembler ran, now it always errors. This
too makes assembler flags more consistent with all the other flags and
seems like a progression.
Fixes PR42066.
Differential Revision: https://reviews.llvm.org/D64527
llvm-svn: 365703
Craig Topper [Wed, 10 Jul 2019 22:14:39 +0000 (22:14 +0000)]
[X86] Add BLSR and BLSMSK to isUseDefConvertible.
Unfortunately subo formation in CGP prevents obvious ways of
testing this.
But we already have BLSI in here and the flag behavior is
well understood.
Might become more useful if we improve PR42571.
llvm-svn: 365702
David Tenty [Wed, 10 Jul 2019 22:13:55 +0000 (22:13 +0000)]
[NFC]Fix IR/MC depency issue for function descriptor SDAG implementation
Summary: llvm/IR/GlobalValue.h can't be included in MC, that creates a circular dependency between MC and IR libraries. This circular dependency is causing an issue for build system that enforce layering.
Author: Xiangling_L
Reviewers: sfertile, jasonliu, hubert.reinterpretcast, gribozavr
Reviewed By: gribozavr
Subscribers: wuzish, nemanjai, hiraditya, kbarton, MaskRay, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64445
llvm-svn: 365701
Alex Lorenz [Wed, 10 Jul 2019 22:00:59 +0000 (22:00 +0000)]
[clang-scan-deps] Dependency directives source minimizer:
single quotes are not digit separators after a valid character literal prefix
The single quote character can act as a c++ digit separator.
However, the minimizer shouldn't treat it as such when it's actually following
a valid character literal prefix, like L, U, u, or u8.
Differential Revision: https://reviews.llvm.org/D64525
llvm-svn: 365700
Saar Raz [Wed, 10 Jul 2019 21:25:49 +0000 (21:25 +0000)]
[Concepts] Concept definitions (D40381)
First in a series of patches to land C++2a Concepts support.
This patch adds AST and parsing support for concept-declarations.
llvm-svn: 365699
Raphael Isemann [Wed, 10 Jul 2019 21:04:01 +0000 (21:04 +0000)]
[lldb] Fix handling of dollar characters in expr command
llvm-svn: 365698