Simon Pilgrim [Sat, 19 Oct 2019 11:53:48 +0000 (11:53 +0000)]
[X86][SSE] LowerUINT_TO_FP_i64 - only use HADDPD for size/fast-hops
We were always generating a single source HADDPD, but really we should only do this if shouldUseHorizontalOp says its a good idea.
Differential Revision: https://reviews.llvm.org/D69175
llvm-svn: 375341
Dimitry Andric [Sat, 19 Oct 2019 10:59:23 +0000 (10:59 +0000)]
Refine check for `_LIBCPP_C_HAS_NO_GETS` on FreeBSD
Summary:
In D67316 we added `_LIBCPP_C_HAS_NO_GETS` to signal that the C library
does not provide `gets()`, and added a test for FreeBSD 13 or higher,
using the compiler-defined `__FreeBSD__` macro.
Unfortunately this did not work that well for FreeBSD's own CI process,
since the gcc compilers used for some architectures define `__FreeBSD__`
to match the build host, not the target.
Instead, we should use the `__FreeBSD_version` macro from the userland
header `<osreldate.h>`, which is more fine-grained. See also
<https://reviews.freebsd.org/D22034>.
Reviewers: EricWF, mclow.lists, emaste, ldionne
Reviewed By: emaste, ldionne
Subscribers: dexonsmith, bsdjhb, krytarowski, christof, ldionne, libcxx-commits
Differential Revision: https://reviews.llvm.org/D69174
llvm-svn: 375340
Sylvestre Ledru [Sat, 19 Oct 2019 09:55:24 +0000 (09:55 +0000)]
Explicit in the doc the current list of projects (with easy copy and paste)
llvm-svn: 375339
Michael J. Spencer [Sat, 19 Oct 2019 09:45:28 +0000 (09:45 +0000)]
Revert "[Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which includes search paths and diagnostics." and "[Docs] Fix header level."
The test doesn't work on Windows. I'll fix it and recommit later.
llvm-svn: 375338
Sylvestre Ledru [Sat, 19 Oct 2019 09:27:14 +0000 (09:27 +0000)]
Make it clear in the doc that 'all' in LLVM_ENABLE_PROJECTS does install ALL projects
llvm-svn: 375337
Lawrence D'Anna [Sat, 19 Oct 2019 07:05:39 +0000 (07:05 +0000)]
convert LLDBSwigPythonCallTypeScript to ArgInfo::max_positional_args
Summary:
This patch converts another user of ArgInfo::count over to
use ArgInfo::max_positional_args instead. I also add a test
to make sure both documented signatures for python type formatters
work.
Reviewers: JDevlieghere, clayborg, labath, jingham
Reviewed By: labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D69153
llvm-svn: 375334
Lawrence D'Anna [Sat, 19 Oct 2019 07:05:33 +0000 (07:05 +0000)]
[LLDB] bugfix: command script add -f doesn't work for some callables
Summary:
When users define a debugger command from python, they provide a callable
object. Because the signature of the function has been extended, LLDB
needs to inspect the number of parameters the callable can take.
The rule it was using to decide was weird, apparently not tested, and
giving wrong results for some kinds of python callables.
This patch replaces the weird rule with a simple one: if the callable can
take 5 arguments, it gets the 5 argument version of the signature.
Otherwise it gets the old 4 argument version.
It also adds tests with a bunch of different kinds of python callables
with both 4 and 5 arguments.
Reviewers: JDevlieghere, clayborg, labath, jingham
Reviewed By: labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D69014
llvm-svn: 375333
Artem Dergachev [Sat, 19 Oct 2019 01:50:46 +0000 (01:50 +0000)]
[analyzer] PR43551: Do not dereferce void* in UndefOrNullArgVisitor.
Patch by Kristóf Umann!
Differential Revision: https://reviews.llvm.org/D68591
llvm-svn: 375329
Artem Dergachev [Sat, 19 Oct 2019 01:50:43 +0000 (01:50 +0000)]
[analyzer] Fix a crash on tracking Objective-C 'self' as a control dependency.
'self' was previously never tracked, but now it can be tracked
because it may be part of a condition.
llvm-svn: 375328
Michael J. Spencer [Sat, 19 Oct 2019 01:48:57 +0000 (01:48 +0000)]
[Docs] Fix header level.
llvm-svn: 375327
Richard Trieu [Sat, 19 Oct 2019 01:47:49 +0000 (01:47 +0000)]
Add -Wbitwise-conditional-parentheses to warn on mixing '|' and '&' with "?:"
Extend -Wparentheses to cover mixing bitwise-and and bitwise-or with the
conditional operator. There's two main cases seen with this:
unsigned bits1 = 0xf0 | cond ? 0x4 : 0x1;
unsigned bits2 = cond1 ? 0xf0 : 0x10 | cond2 ? 0x5 : 0x2;
// Intended order of evaluation:
unsigned bits1 = 0xf0 | (cond ? 0x4 : 0x1);
unsigned bits2 = (cond1 ? 0xf0 : 0x10) | (cond2 ? 0x5 : 0x2);
// Actual order of evaluation:
unsigned bits1 = (0xf0 | cond) ? 0x4 : 0x1;
unsigned bits2 = cond1 ? 0xf0 : ((0x10 | cond2) ? 0x5 : 0x2);
Differential Revision: https://reviews.llvm.org/D66043
llvm-svn: 375326
Reid Kleckner [Sat, 19 Oct 2019 01:44:09 +0000 (01:44 +0000)]
Avoid including CodeView/SymbolRecord.h from MCStreamer.h
Move the types needed out so they can be forward declared instead.
llvm-svn: 375325
Michael J. Spencer [Sat, 19 Oct 2019 01:36:37 +0000 (01:36 +0000)]
[Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which includes search paths and diagnostics.
Differential Revision: https://reviews.llvm.org/D68528
llvm-svn: 375322
Matt Arsenault [Sat, 19 Oct 2019 01:34:59 +0000 (01:34 +0000)]
AMDGPU: Remove optnone from a test
It's not clear why the test had this. I'm unable to break the original
case with the original patch reverted with or without optnone.
This avoids a failure in a future commit.
llvm-svn: 375321
Reid Kleckner [Sat, 19 Oct 2019 01:31:09 +0000 (01:31 +0000)]
Prune a LegacyDivergenceAnalysis and MachineLoopInfo include each
Now X86ISelLowering doesn't depend on many IR analyses.
llvm-svn: 375320
Reid Kleckner [Sat, 19 Oct 2019 01:07:48 +0000 (01:07 +0000)]
Prune Analysis includes from SelectionDAG.h
Only forward declarations are needed here. Follow-on to r375311.
llvm-svn: 375319
Richard Trieu [Sat, 19 Oct 2019 00:57:23 +0000 (00:57 +0000)]
New tautological warning for bitwise-or with non-zero constant always true.
Taking a value and the bitwise-or it with a non-zero constant will always
result in a non-zero value. In a boolean context, this is always true.
if (x | 0x4) {} // always true, intended '&'
This patch creates a new warning group -Wtautological-bitwise-compare for this
warning. It also moves in the existing tautological bitwise comparisons into
this group. A few other changes were needed to the CFGBuilder so that all bool
contexts would be checked. The warnings in -Wtautological-bitwise-compare will
be off by default due to using the CFG.
Fixes: https://bugs.llvm.org/show_bug.cgi?id=42666
Differential Revision: https://reviews.llvm.org/D66046
llvm-svn: 375318
Vedant Kumar [Sat, 19 Oct 2019 00:51:27 +0000 (00:51 +0000)]
[profile] Use -fPIC -shared in a test instead of -dynamiclib
This is more portable than -dynamiclib. Also, fix the path to an input
file that broke when the test was moved in r375315.
llvm-svn: 375317
Reid Kleckner [Sat, 19 Oct 2019 00:48:11 +0000 (00:48 +0000)]
Move endian constant from Host.h to SwapByteOrder.h, prune include
Works on this dependency chain:
ArrayRef.h ->
Hashing.h -> --CUT--
Host.h ->
StringMap.h / StringRef.h
ArrayRef is very popular, but Host.h is rarely needed. Move the
IsBigEndianHost constant to SwapByteOrder.h. Clients of that header are
more likely to need it.
llvm-svn: 375316
Vedant Kumar [Sat, 19 Oct 2019 00:46:53 +0000 (00:46 +0000)]
[profile] Disable instrprof-get-filename-merge-mode.c on Windows
The Windows bots are failing with:
clang: warning: argument unused during compilation: '-dynamiclib' [-Wunused-command-line-argument]
llvm-svn: 375315
Peter Collingbourne [Sat, 19 Oct 2019 00:34:54 +0000 (00:34 +0000)]
Sema: Create a no-op implicit cast for lvalue function conversions.
This fixes an assertion failure in the case where an implicit conversion for a
function call involves an lvalue function conversion, and makes the AST for
initializations involving implicit lvalue function conversions more accurate.
Differential Revision: https://reviews.llvm.org/D66437
llvm-svn: 375313
Adrian Prantl [Sat, 19 Oct 2019 00:30:30 +0000 (00:30 +0000)]
Skip (more) PExpect tests under ASAN, I can't get them to work reliably.
llvm-svn: 375312
Reid Kleckner [Sat, 19 Oct 2019 00:22:07 +0000 (00:22 +0000)]
Prune two MachineInstr.h includes, fix up deps
MachineInstr.h included AliasAnalysis.h, which includes a world of IR
constructs mostly unneeded in CodeGen. Prune it. Same for
DebugInfoMetadata.h.
Noticed with -ftime-trace.
llvm-svn: 375311
Michael Liao [Sat, 19 Oct 2019 00:17:00 +0000 (00:17 +0000)]
[clang][driver] Print compilation phases with indentation.
Reviewers: tra, sfantao, echristo
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69124
llvm-svn: 375310
Michael Liao [Sat, 19 Oct 2019 00:15:19 +0000 (00:15 +0000)]
[hip][cuda] Fix the extended lambda name mangling issue.
Summary:
- HIP/CUDA host side needs to use device kernel symbol name to match the
device side binaries. Without a consistent naming between host- and
device-side compilations, it's risky that wrong device binaries are
executed. Consistent naming is usually not an issue until unnamed
types are used, especially the lambda. In this patch, the consistent
name mangling is addressed for the extended lambdas, i.e. the lambdas
annotated with `__device__`.
- In [Itanium C++ ABI][1], the mangling of the lambda is generally
unspecified unless, in certain cases, ODR rule is required to ensure
consisent naming cross TUs. The extended lambda is such a case as its
name may be part of a device kernel function, e.g., the extended
lambda is used as a template argument and etc. Thus, we need to force
ODR for extended lambdas as they are referenced in both device- and
host-side TUs. Furthermore, if a extended lambda is nested in other
(extended or not) lambdas, those lambdas are required to follow ODR
naming as well. This patch revises the current lambda mangle numbering
to force ODR from an extended lambda to all its parent lambdas.
- On the other side, the aforementioned ODR naming should not change
those lambdas' original linkages, i.e., we cannot replace the original
`internal` with `linkonce_odr`; otherwise, we may violate ODR in
general. This patch introduces a new field `HasKnownInternalLinkage`
in lambda data to decouple the current linkage calculation based on
mangling number assigned.
[1]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html
Reviewers: tra, rsmith, yaxunl, martong, shafik
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68818
llvm-svn: 375309
Artem Dergachev [Sat, 19 Oct 2019 00:08:17 +0000 (00:08 +0000)]
[analyzer] Specify the C++ standard in more tests.
Makes life easier for downstream developers with different default standard.
llvm-svn: 375308
Richard Smith [Sat, 19 Oct 2019 00:06:00 +0000 (00:06 +0000)]
P1152R4: Fix deprecation warnings in libc++ testsuite and in uses of is_invocable that would internally conjure up a deprecated function type.
Summary: The implementation of P1152R4 in Clang has resulted in some deprecation warnings appearing in the libc++ and libc++abi test suite. Fix or suppress these warnings.
Reviewers: mclow.lists, EricWF
Subscribers: christof, ldionne, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D68879
llvm-svn: 375307
Richard Smith [Sat, 19 Oct 2019 00:04:43 +0000 (00:04 +0000)]
[c++20] Add rewriting from comparison operators to <=> / ==.
This adds support for rewriting <, >, <=, and >= to a normal or reversed
call to operator<=>, for rewriting != to a normal or reversed call to
operator==, and for rewriting <=> and == to reversed forms of those same
operators.
Note that this is a breaking change for various C++17 code patterns,
including some in use in LLVM. The most common patterns (where an
operator== becomes ambiguous with a reversed form of itself) are still
accepted under this patch, as an extension (with a warning). I'm hopeful
that we can get the language rules fixed before C++20 ships, and the
extension warning is aimed primarily at providing data to inform that
decision.
llvm-svn: 375306
Richard Smith [Sat, 19 Oct 2019 00:04:38 +0000 (00:04 +0000)]
[c++20] Add CXXRewrittenBinaryOperator to represent a comparison
operator that is rewritten as a call to multiple other operators.
No functionality change yet: nothing creates these expressions.
llvm-svn: 375305
David Blaikie [Fri, 18 Oct 2019 23:58:34 +0000 (23:58 +0000)]
DebugInfo: Render the canonical name of a class template specialization, even when nested in another class template specialization
Differential Revision: https://reviews.llvm.org/D63031
llvm-svn: 375304
Vedant Kumar [Fri, 18 Oct 2019 23:33:40 +0000 (23:33 +0000)]
[profile] Do not cache __llvm_profile_get_filename result
When the %m filename pattern is used, the filename is unique to each
image, so the cached value is wrong.
It struck me that the full filename isn't something that's recomputed
often, so perhaps it doesn't need to be cached at all. David Li pointed
out we can go further and just hide lprofCurFilename. This may regress
workflows that depend on using the set-filename API to change filenames
across all loaded DSOs, but this is expected to be very rare.
rdar://
55137071
Differential Revision: https://reviews.llvm.org/D69137
llvm-svn: 375301
Matt Arsenault [Fri, 18 Oct 2019 23:24:25 +0000 (23:24 +0000)]
LiveIntervals: Fix handleMoveUp with subreg def moving across a def
If a subregister def was moved across another subregister def and
another use, the main range was not correctly updated. The end point
of the moved interval ended too early and missed the use from theh
other lanes in the subreg def.
llvm-svn: 375300
Peter Collingbourne [Fri, 18 Oct 2019 22:52:17 +0000 (22:52 +0000)]
gn build: Build compiler-rt code with -fvisibility=hidden.
This matches the CMake build.
Differential Revision: https://reviews.llvm.org/D69202
llvm-svn: 375299
Peter Collingbourne [Fri, 18 Oct 2019 22:51:38 +0000 (22:51 +0000)]
hwasan: Add missing SANITIZER_INTERFACE_ATTRIBUTE on __hwasan_personality_wrapper.
Differential Revision: https://reviews.llvm.org/D69201
llvm-svn: 375298
Stanislav Mekhanoshin [Fri, 18 Oct 2019 22:48:45 +0000 (22:48 +0000)]
[AMDGPU] move PHI nodes to AGPR class
If all uses of a PHI are in AGPR register class we should
avoid unneeded copies via VGPRs.
Differential Revision: https://reviews.llvm.org/D69200
llvm-svn: 375297
Evgeniy Stepanov [Fri, 18 Oct 2019 22:36:25 +0000 (22:36 +0000)]
[hwasan] Remove system allocator fallback.
Summary:
This has been an experiment with late malloc interposition, made
possible by a non-standard feature of the Android dynamic loader.
Reviewers: pcc, mmalcomson
Subscribers: srhines, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D69199
llvm-svn: 375296
Wei Mi [Fri, 18 Oct 2019 22:35:20 +0000 (22:35 +0000)]
[SampleFDO] Add profile remapping support for profile on-demand loading used
by ExtBinary format profile
Profile on-demand loading was added for ExtBinary format profile in rL374233,
but currently profile on-demand loading doesn't work well with profile
remapping. The patch adds the support.
Suppose a function in the current module has outline instance in the profile.
The function name in the module is different from the name of the outline
instance, but remapper knows the two names are equal. When loading profile
on-demand, the outline instance has to be loaded with remapper's help.
At the same time SampleProfileReaderItaniumRemapper is changed from a proxy
of SampleProfileReader to a helper member in SampleProfileReader.
Differential Revision: https://reviews.llvm.org/D68901
llvm-svn: 375295
Jonas Devlieghere [Fri, 18 Oct 2019 22:16:15 +0000 (22:16 +0000)]
[Reproducer] XFAIL TestWorkingDir on Windows
I'm having a hard time reproducing this and it's failing on the Windows
bot. Temporarily X-failing this test while I continue to try building
LLDB on Windows.
llvm-svn: 375294
Jay Foad [Fri, 18 Oct 2019 21:48:22 +0000 (21:48 +0000)]
[AMDGPU] Remove -amdgpu-spill-sgpr-to-smem.
Summary: The implementation was never completed and never used except in tests.
Reviewers: arsenm, mareko
Subscribers: qcolombet, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69163
llvm-svn: 375293
Jonas Devlieghere [Fri, 18 Oct 2019 21:47:31 +0000 (21:47 +0000)]
[Reproducer] Improve reproducer help (NFC)
Provide a little more detail for the reproducer command.
llvm-svn: 375292
Roman Lebedev [Fri, 18 Oct 2019 21:19:26 +0000 (21:19 +0000)]
[CVP] setDeducedOverflowingFlags(): actually inc per-opcode stats
This is really embarrassing. Those are pointers, so that offsets the
pointers, not the statistics pointed-by the pointer...
llvm-svn: 375290
GN Sync Bot [Fri, 18 Oct 2019 21:11:20 +0000 (21:11 +0000)]
gn build: Merge r375288
llvm-svn: 375289
Vedant Kumar [Fri, 18 Oct 2019 21:05:30 +0000 (21:05 +0000)]
Disable exit-on-SIGPIPE in lldb
Occasionally, during test teardown, LLDB writes to a closed pipe.
Sometimes the communication is inherently unreliable, so LLDB tries to
avoid being killed due to SIGPIPE (it calls `signal(SIGPIPE, SIG_IGN)`).
However, LLVM's default SIGPIPE behavior overrides LLDB's, causing it to
exit with IO_ERR.
Opt LLDB out of the default SIGPIPE behavior. I expect that this will
resolve some LLDB test suite flakiness (tests randomly failing with
IO_ERR) that we've seen since r344372.
rdar://
55750240
Differential Revision: https://reviews.llvm.org/D69148
llvm-svn: 375288
Reid Kleckner [Fri, 18 Oct 2019 21:01:41 +0000 (21:01 +0000)]
[X86] Fix register parsing in .seh_* in Intel syntax
Previously, the parser checked for a '%' prefix to indicate a register.
In Intel syntax mode, LLVM does not print a '%' prefix on registers, so
LLVM could not parse its own assembly output. Instead, require that
register numbers be integer literals, or at least start with an integer
literal, which is consistent with .cfi_* directive register parsing.
llvm-svn: 375287
Artem Dergachev [Fri, 18 Oct 2019 20:48:21 +0000 (20:48 +0000)]
[analyzer] exploded-graph-rewriter: Unforget to censor stmt_ids in the test.
They're not stable across machines.
Fixes buildbots after r375278.
llvm-svn: 375286
Roman Lebedev [Fri, 18 Oct 2019 20:36:19 +0000 (20:36 +0000)]
[NFC][CVP] Some tests for `mul` no-wrap deduction
llvm-svn: 375285
Peter Collingbourne [Fri, 18 Oct 2019 20:35:29 +0000 (20:35 +0000)]
Update global_symbols.txt.
llvm-svn: 375284
Thomas Lively [Fri, 18 Oct 2019 20:27:30 +0000 (20:27 +0000)]
[WebAssembly] Allow multivalue signatures in object files
Summary:
Also changes the wasm YAML format to reflect the possibility of having
multiple return types and to put the returns after the params for
consistency with the binary encoding.
Reviewers: aheejin, sbc100
Subscribers: dschuff, jgravelle-google, hiraditya, sunfish, arphaman, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69156
llvm-svn: 375283
Artem Dergachev [Fri, 18 Oct 2019 20:15:41 +0000 (20:15 +0000)]
[analyzer] exploded-graph-rewriter: Rename Environment to Expressions.
It's less confusing for newcomers.
llvm-svn: 375282
Artem Dergachev [Fri, 18 Oct 2019 20:15:39 +0000 (20:15 +0000)]
[analyzer] Fix FieldRegion dumps.
The '->' thing has always been confusing; the actual operation '->'
translates to a pointer dereference together with adding a FieldRegion,
but FieldRegion on its own doesn't imply an additional pointer
dereference.
llvm-svn: 375281
Artem Dergachev [Fri, 18 Oct 2019 20:15:35 +0000 (20:15 +0000)]
[analyzer] Drop the logic for collapsing the state if it's same as in preds.
One of the first attempts to reduce the size of the exploded graph dumps
was to skip the state dump as long as the state is the same as in all of
the predecessor nodes. With all the new facilities in place (node joining,
diff dumps), this feature doesn't do much, and when it does,
it's more harmful than useful. Let's remove it.
llvm-svn: 375280
Artem Dergachev [Fri, 18 Oct 2019 20:15:32 +0000 (20:15 +0000)]
[analyzer] exploded-graph-rewriter: Fix dump for state 0.
It shouldn't say "unspecified" when the state is specified to be empty.
llvm-svn: 375279
Artem Dergachev [Fri, 18 Oct 2019 20:15:29 +0000 (20:15 +0000)]
[analyzer] Fix hidden node traversal in exploded graph dumps.
The joined nodes now actually have the same state. That was intended
from the start but the original implementation turned out to be buggy.
Differential Revision: https://reviews.llvm.org/D69150
llvm-svn: 375278
Quentin Colombet [Fri, 18 Oct 2019 20:13:42 +0000 (20:13 +0000)]
[GISel][CallLowering] Make isIncomingArgumentHandler a pure virtual method
The default implementation of isIncomingArgumentHandler could lead
to generating incorrect code.
Make it a pure virtual method, so that targets know they have to
override it to produce correct code.
NFC
Differential Revision: https://reviews.llvm.org/D69187
llvm-svn: 375277
Peter Collingbourne [Fri, 18 Oct 2019 20:00:32 +0000 (20:00 +0000)]
scudo: Update TLS_SLOT_SANITIZER value.
Android now allocates only 8 fixed TLS slots. Somehow we were getting away
with using a non-existent slot until now, but in some cases the TLS slots
were being placed at the end of a page, which led to a segfault at startup.
Differential Revision: https://reviews.llvm.org/D69191
llvm-svn: 375276
Ryan Prichard [Fri, 18 Oct 2019 19:59:22 +0000 (19:59 +0000)]
[libunwind][Android] Fix findUnwindSections for ARM EHABI Bionic
Summary:
Fix the arm_section_length count. The meaning of the arm_section_length
field changed from num-of-elements to num-of-bytes when the
dl_unwind_find_exidx special case was removed (D30306 and D30681). The
special case was restored in D39468, but that patch didn't account for the
change in arm_section_length's meaning.
That patch worked when it was applied to the NDK's fork of libunwind,
because it never removed the special case in the first place, and the
special case is probably disabled in the Android platform's copy of
libunwind, because __ANDROID_API__ is greater than 21.
Turn the dl_unwind_find_exidx special case on unconditionally for Bionic.
Bionic's dl_unwind_find_exidx is much faster than using dl_iterate_phdr.
(e.g. Bionic stores exidx info on an internal soinfo object.)
Reviewers: thomasanderson, srhines, danalbert, ed, keith.walker.arm, mclow.lists, compnerd
Reviewed By: srhines, danalbert
Subscribers: srhines, kristof.beyls, christof, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D68972
llvm-svn: 375275
Roman Lebedev [Fri, 18 Oct 2019 19:32:47 +0000 (19:32 +0000)]
[CVP] After proving that @llvm.with.overflow()/@llvm.sat() don't overflow, also try to prove other no-wrap
Summary:
CVP, unlike InstCombine, does not run till exaustion.
It only does a single pass.
When dealing with those special binops, if we prove that they can
safely be demoted into their usual binop form,
we do set the no-wrap we deduced. But when dealing with usual binops,
we try to deduce both no-wraps.
So if we convert e.g. @llvm.uadd.with.overflow() to `add nuw`,
we won't attempt to check whether it can be `add nuw nsw`.
This patch proposes to call `processBinOp()` on newly-created binop,
which is identical to what we do for div/rem already.
Reviewers: nikic, spatel, reames
Reviewed By: nikic
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69183
llvm-svn: 375273
Raphael Isemann [Fri, 18 Oct 2019 19:18:41 +0000 (19:18 +0000)]
[lldb][NFC] Remove wrong tests in TestCallOverriddenMethod
We call these tests in the second test function where they are
x-failed on Windows. I forgot to remove the tests from the first
test function (which is not x-failed on Windows) when extracting these
calls into their own test function, so the test is still failing on Windows.
llvm-svn: 375271
Lang Hames [Fri, 18 Oct 2019 18:35:02 +0000 (18:35 +0000)]
[examples] Fix some comments in the LLJITWithJITLink example
llvm-svn: 375269
Matt Arsenault [Fri, 18 Oct 2019 18:26:37 +0000 (18:26 +0000)]
AMDGPU: Relax 32-bit SGPR register class
Mostly use SReg_32 instead of SReg_32_XM0 for arbitrary values. This
will allow the register coalescer to do a better job eliminating
copies to m0.
For GlobalISel, as a terrible hack, use SGPR_32 for things that should
use SCC until booleans are solved.
llvm-svn: 375267
Lang Hames [Fri, 18 Oct 2019 18:25:15 +0000 (18:25 +0000)]
[examples] Add an example of how to use JITLink and small-code-model with LLJIT.
JITLink is LLVM's newer jit-linker. It is an alternative to (and hopefully
eventually a replacement for) LLVM's older jit-linker, RuntimeDyld. Unlike
RuntimeDyld which requries JIT'd code to be complied with the large code
model, JITlink can link code compiled with the small code model, which is
the native code model for a number of targets (including all supported MachO
targets).
This example shows how to:
-- Create a JITLink InProcessMemoryManager
-- Set the code model to small
-- Use a JITLink backed ObjectLinkingLayer as the linking layer for LLJIT
(rather than the default RTDyldObjectLinkingLayer).
Note: This example will only work on platforms supported by JITLink. As of
this commit that's MachO/x86-64 and MachO/arm64.
llvm-svn: 375266
Austin Kerbow [Fri, 18 Oct 2019 18:20:30 +0000 (18:20 +0000)]
AMDGPU: Fix SMEM WAR hazard for gfx10 readlane
Summary: Hazard recognizer fails to see hazard with V_READLANE_B32_gfx10.
Reviewers: rampitec
Reviewed By: rampitec
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69172
llvm-svn: 375265
Julian Lettner [Fri, 18 Oct 2019 17:59:46 +0000 (17:59 +0000)]
[lit] Reduce value of synthesized timeouts
Large timeout values (one year, positive infinity) trip up Python on
Windows with "OverflowError: timeout value is too large". One week
seems to work and is still large enough in practice.
Thanks to Simon Pilgrim for helping me test this.
https://reviews.llvm.org/rL375171
llvm-svn: 375264
Julian Lettner [Fri, 18 Oct 2019 17:31:48 +0000 (17:31 +0000)]
[lit] Remove unnecessary tracking of test_index
llvm-svn: 375263
Julian Lettner [Fri, 18 Oct 2019 17:31:45 +0000 (17:31 +0000)]
[lit] Only send back test result from worker process
Avoid sending back the whole run.Test object (which needs to be pickled)
from the worker process when we are only interested in the test result.
llvm-svn: 375262
Roman Lebedev [Fri, 18 Oct 2019 17:18:21 +0000 (17:18 +0000)]
[Codegen] Link MIRParser into CodeGenTests to fix MachineSizeOptsTest building
llvm-svn: 375261
Roman Lebedev [Fri, 18 Oct 2019 17:18:12 +0000 (17:18 +0000)]
[NFC][CVP] Add @llvm.*.sat tests where we could prove both no-overflows
llvm-svn: 375260
Jonas Devlieghere [Fri, 18 Oct 2019 17:11:48 +0000 (17:11 +0000)]
[Reproducer] Use ::rtrim() to remove trailing control characters.
Pavel correctly pointed out that removing all control characters from
the working directory is overkill. It should be sufficient to just strip
the last ones.
llvm-svn: 375259
Brian Gesiak [Fri, 18 Oct 2019 16:59:02 +0000 (16:59 +0000)]
[Format] Add format check for throwing negative numbers
Summary:
The code `throw -1;` is currently formatted by clang-format as
`throw - 1;`. This diff adds a fix for this edge case and a test to check
for this in the future.
For context, I am looking into a related bug in the clang-formatting of
coroutine keywords: `co_yield -1;` is also reformatted in this manner
as `co_yield - 1;`. A later diff will add these changes and tests for the
`co_yield` and `co_return` keywords.
Patch by Jonathan Thomas (jonathoma)!
Reviewers: modocache, sammccall, Quuxplusone
Reviewed By: sammccall
Subscribers: cfe-commits
Tags: #clang-format, #clang
Differential Revision: https://reviews.llvm.org/D69144
llvm-svn: 375258
Alexey Bataev [Fri, 18 Oct 2019 16:53:54 +0000 (16:53 +0000)]
[DOCS]Update list of implemented constructs, NFC.
llvm-svn: 375257
GN Sync Bot [Fri, 18 Oct 2019 16:52:12 +0000 (16:52 +0000)]
gn build: Merge r375254
llvm-svn: 375256
Alexey Bataev [Fri, 18 Oct 2019 16:47:35 +0000 (16:47 +0000)]
[OPENMP50]Add support for master taskloop simd.
Added trsing/semantics/codegen for combined construct master taskloop simd.
llvm-svn: 375255
Hiroshi Yamauchi [Fri, 18 Oct 2019 16:46:01 +0000 (16:46 +0000)]
[PGO][PGSO] SizeOpts changes.
Summary:
(Split of off D67120)
SizeOpts/MachineSizeOpts changes for profile guided size optimization.
Reviewers: davidxl
Subscribers: mgorny, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69070
llvm-svn: 375254
Simon Pilgrim [Fri, 18 Oct 2019 16:39:01 +0000 (16:39 +0000)]
[X86] combineX86ShufflesRecursively - pull out isTargetShuffleVariableMask. NFCI.
llvm-svn: 375253
Jay Foad [Fri, 18 Oct 2019 16:16:36 +0000 (16:16 +0000)]
[IR] Reimplement FPMathOperator::classof as a whitelist.
Summary:
This makes it much easier to verify that the implementation matches the
documentation. It uncovered a bug in the unit tests where we were
accidentally setting fast math flags on a load instruction.
Reviewers: spatel, wristow, arsenm, hfinkel, aemerson, efriedma, cameron.mcinally, mcberg2017, jmolloy
Subscribers: wdng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69176
llvm-svn: 375252
Jay Foad [Fri, 18 Oct 2019 16:07:09 +0000 (16:07 +0000)]
Update docs for fast-math flags.
This adds fneg, phi and select to the list of operations that may use
fast-math flags.
llvm-svn: 375250
Krasimir Georgiev [Fri, 18 Oct 2019 15:21:06 +0000 (15:21 +0000)]
[clang-format] fix regression recognizing casts in Obj-C calls
Summary:
r373922 added checks for a few tokens that, following an `)` make it
unlikely that the `)` is the closing paren of a cast expression. The
specific check for `tok::l_square` there introduced a regression for
casts of Obj-C calls, like:
```
(cast)[func arg]
```
From the tests added in r373922, I believe the `tok::l_square` case is added to
capture the case where a non-cast `)` is directly followed by an
attribute specifier, like:
```
int f(int x) [[noreturn]];
```
I've specialized the code to look for such attribute specifier instead
of `tok::l_square` in general. Also, I added a regression test and moved
the test cases added in r373922 to an already existing place documenting
other instances of historically misidentified casts.
Reviewers: MyDeveloperDay
Reviewed By: MyDeveloperDay
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69164
llvm-svn: 375247
Michael Liao [Fri, 18 Oct 2019 15:03:34 +0000 (15:03 +0000)]
[tooling] Relax an assert when multiple GPU targets are specified.
llvm-svn: 375245
Joseph Tremoulet [Fri, 18 Oct 2019 15:02:16 +0000 (15:02 +0000)]
ProcessMinidump: Suppress reporting stop for signal '0'
Summary:
The minidump exception stream can report an exception record with
signal 0. If we try to create a stop reason with signal zero, processing
of the stop event won't find anything, and the debugger will hang.
So, simply early-out of RefreshStateAfterStop in this case.
Also set the UnixSignals object in DoLoadCore as is done for
ProcessElfCore.
Reviewers: labath, clayborg, jfb
Reviewed By: labath, clayborg
Subscribers: dexonsmith, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68096
llvm-svn: 375244
Joseph Tremoulet [Fri, 18 Oct 2019 14:59:10 +0000 (14:59 +0000)]
LLDB: Use LLVM's type for minidump ExceptionStream [NFC]
Summary: The types defined for it in LLDB are now redundant with core types.
Reviewers: labath, clayborg
Reviewed By: clayborg
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68658
llvm-svn: 375243
Joseph Tremoulet [Fri, 18 Oct 2019 14:56:19 +0000 (14:56 +0000)]
Update MinidumpYAML to use minidump::Exception for exception stream
Reviewers: labath, jhenderson, clayborg, MaskRay, grimar
Reviewed By: grimar
Subscribers: lldb-commits, grimar, MaskRay, hiraditya, llvm-commits
Tags: #llvm, #lldb
Differential Revision: https://reviews.llvm.org/D68657
llvm-svn: 375242
Dmitry Preobrazhensky [Fri, 18 Oct 2019 14:49:53 +0000 (14:49 +0000)]
[AMDGPU][MC][GFX10] Added sdwa/dpp versions of v_cndmask_b32
See https://bugs.llvm.org/show_bug.cgi?id=43608
Reviewers: arsenm, rampitec
Differential Revision: https://reviews.llvm.org/D69096
llvm-svn: 375241
James Molloy [Fri, 18 Oct 2019 14:48:35 +0000 (14:48 +0000)]
[DFAPacketizer] Fix large compile-time regression for VLIW targets
D68992 / rL375086 refactored the packetizer and removed a bunch of logic. Unfortunately it creates an Automaton object whenever a DFAPacketizer is required. These objects have no longevity, and in particular on a debug build the population of the Automaton's transition map from the underlying table is very slow (because it is called ~10 times per MachineFunction, in the testcase I'm looking at).
This patch changes Automaton to wrap its underlying constant data in std::shared_ptr, which allows trivial copy construction. The DFAPacketizer creation function now creates a static archetypical Automaton and copies that whenever a new DFAPacketizer is required.
This takes a testcase down from ~20s to ~0.5s in debug mode.
llvm-svn: 375240
Joseph Tremoulet [Fri, 18 Oct 2019 14:43:15 +0000 (14:43 +0000)]
Add ExceptionStream to llvm::Object::minidump
Summary:
This will allow updating MinidumpYAML and LLDB to use this common
definition.
Reviewers: labath, jhenderson, clayborg
Reviewed By: labath
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68656
llvm-svn: 375239
Michael Liao [Fri, 18 Oct 2019 14:31:58 +0000 (14:31 +0000)]
[lld][coff] Add missing dependency to fix build.
llvm-svn: 375238
Eugene Leviant [Fri, 18 Oct 2019 14:11:19 +0000 (14:11 +0000)]
One more attempt to fix PS4 buildbot after r375219
PS4 buildbot seems to be dropping variable names for some reason
llvm-svn: 375237
Eugene Leviant [Fri, 18 Oct 2019 13:52:51 +0000 (13:52 +0000)]
Attempt to fix PS4 buildbot after r375219
llvm-svn: 375235
Pavel Labath [Fri, 18 Oct 2019 13:49:40 +0000 (13:49 +0000)]
Add REQUIRES: x86 to more tests which need the x86 llvm target built
llvm-svn: 375234
Nemanja Ivanovic [Fri, 18 Oct 2019 13:38:46 +0000 (13:38 +0000)]
Revert r375152 as it is causing failures on EXPENSIVE_CHECKS bot
llvm-svn: 375233
Victor Campos [Fri, 18 Oct 2019 13:33:45 +0000 (13:33 +0000)]
[SCEV] Removing deprecated comment in ScalarEvolutionExpander
Removing a comment in the ScalarEvolutionExpander.cpp file that was about the
class SCEVSDivExpr, which has been long gone from LLVM.
llvm-svn: 375232
Dmitry Preobrazhensky [Fri, 18 Oct 2019 13:31:53 +0000 (13:31 +0000)]
[AMDGPU][MC][GFX9] Corrected parsing of v_cndmask_b32_sdwa
See https://bugs.llvm.org/show_bug.cgi?id=43607
Reviewers: arsenm, rampitec
Differential Revision: https://reviews.llvm.org/D69095
llvm-svn: 375231
Roman Lebedev [Fri, 18 Oct 2019 13:20:16 +0000 (13:20 +0000)]
[NFC][CVP] Count all the no-wraps we proved
Summary:
It looks like this is the only missing statistic in the CVP pass.
Since we prove NSW and NUW separately i'd think we should count them separately too.
Reviewers: nikic, spatel, reames
Reviewed By: spatel
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68740
llvm-svn: 375230
Victor Campos [Fri, 18 Oct 2019 12:40:29 +0000 (12:40 +0000)]
[AArch64] Adding support for PMMIR_EL1 register
Summary:
The PMMIR_EL1 register is present in Armv8.4 with PMU extension.
This patch adds support for it.
Reviewers: t.p.northover, dnsampaio
Reviewed By: dnsampaio
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68940
llvm-svn: 375228
Haojian Wu [Fri, 18 Oct 2019 12:07:19 +0000 (12:07 +0000)]
[clangd] Report declaration references in findExplicitReferences.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68977
llvm-svn: 375226
Eugene Leviant [Fri, 18 Oct 2019 11:58:21 +0000 (11:58 +0000)]
[ThinLTOCodeGenerator] Add support for index-based WPD
This is clang part of the patch. It adds -flto-unit flag for thin LTO
builds on Mac and PS4
Differential revision: https://reviews.llvm.org/D68950
llvm-svn: 375224
Graham Hunter [Fri, 18 Oct 2019 11:48:35 +0000 (11:48 +0000)]
[AArch64][SVE] Add SPLAT_VECTOR ISD Node
Adds a new ISD node to replicate a scalar value across all elements of
a vector. This is needed for scalable vectors, since BUILD_VECTOR cannot
be used.
Fixes up default type legalization for scalable vectors after the
new MVT type ranges were introduced.
At present I only use this node for scalable vectors. A DAGCombine has
been added to transform a BUILD_VECTOR into a SPLAT_VECTOR if all
elements are the same, but only if the default operation action of
Expand has been overridden by the target.
I've only added result promotion legalization for scalable vector
i8/i16/i32/i64 types in AArch64 for now.
Reviewers: t.p.northover, javed.absar, greened, cameron.mcinally, jmolloy
Reviewed By: jmolloy
Differential Revision: https://reviews.llvm.org/D47775
llvm-svn: 375222
Pavel Labath [Fri, 18 Oct 2019 11:47:23 +0000 (11:47 +0000)]
SystemInitializerCommon fix compilation on linux
C++ defines two overloads of std::iscntrl. One in <cctype> and one in
<locale>. On linux we seem to include both which makes the std::erase_if
call ambiguous.
Wrap std::iscntrl call in a lambda to ensure regular overload
resolution.
llvm-svn: 375221
Sjoerd Meijer [Fri, 18 Oct 2019 11:01:45 +0000 (11:01 +0000)]
[Arm][libsanitizer] Fix arm libsanitizer failure with bleeding edge glibc
Glibc has recently introduced changed to the mode field in ipc_perm in commit
2f959dfe849e0646e27403f2e4091536496ac0f0. For Arm this means that the mode
field no longer has the same size.
This causes an assert failure against libsanitizer's internal copy of ipc_perm.
Since this change can't be easily detected I am adding arm to the list of
targets that are excluded from this check.
Patch by: Tamar Christina
Differential Revision: https://reviews.llvm.org/D69104
llvm-svn: 375220
Eugene Leviant [Fri, 18 Oct 2019 10:54:14 +0000 (10:54 +0000)]
[ThinLTOCodeGenerator] Add support for index-based WPD
Differential revision: https://reviews.llvm.org/D68950
llvm-svn: 375219
Martin Storsjo [Fri, 18 Oct 2019 10:43:15 +0000 (10:43 +0000)]
[LLD] [COFF] Try to report source locations for duplicate symbols
This fixes the second part of PR42407.
For files with dwarf debug info, it manually loads and iterates
.debug_info to find the declared location of variables, to allow
reporting them. (This matches the corresponding code in the ELF
linker.)
For functions, it uses the existing getFileLineDwarf which uses
LLVMSymbolizer for translating addresses to file lines.
In object files with codeview debug info, only the source location
of duplicate functions is printed. (And even there, only for the
first input file. The getFileLineCodeView function requires the
object file to be fully loaded and initialized to properly resolve
source locations, but duplicate symbols are reported at a stage when
the second object file isn't fully loaded yet.)
Differential Revision: https://reviews.llvm.org/D68975
llvm-svn: 375218