Ilya Biryukov [Thu, 15 Feb 2018 15:41:49 +0000 (15:41 +0000)]
[clangd] Fixed compilation with MVSC.
llvm-svn: 325254
Simon Pilgrim [Thu, 15 Feb 2018 15:31:00 +0000 (15:31 +0000)]
[SelectionDAG] Pull out repeated Op.getOpcode(). NFCI.
llvm-svn: 325253
Krasimir Georgiev [Thu, 15 Feb 2018 15:30:22 +0000 (15:30 +0000)]
[clang-format] Support repeated field lists in protos
Summary:
This patch adds support for list initialization of proto repeated fields:
```
keys: [1, 2, 3]
```
Reviewers: djasper
Reviewed By: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D43298
llvm-svn: 325252
Francis Visoiu Mistrih [Thu, 15 Feb 2018 15:27:34 +0000 (15:27 +0000)]
[CodeGen] Print irreducible loop header weight as a MIR comment
Prefix it with '; ' to make it more MIR-compatible.
llvm-svn: 325251
Pavel Labath [Thu, 15 Feb 2018 15:24:32 +0000 (15:24 +0000)]
@skipIfRemote TestTargetXMLArch
The test does not actually connect to any remote targets.
llvm-svn: 325250
Kamil Rytarowski [Thu, 15 Feb 2018 15:24:01 +0000 (15:24 +0000)]
Try to unbreak Darwin after XRay/FreeBSD commit
Add a fallback definition of getTSCFrequency().
llvm-svn: 325249
Kamil Rytarowski [Thu, 15 Feb 2018 15:15:45 +0000 (15:15 +0000)]
Implement a large part of NetBSD syscalls of netbsd_syscall_hooks.h
This is a follow up of:
r325206 - Add NetBSD syscall hooks skeleton in sanitizers
Sponsored by <The NetBSD Foundation>
llvm-svn: 325248
Sanjay Patel [Thu, 15 Feb 2018 15:07:12 +0000 (15:07 +0000)]
[InstCombine] allow sin/cos transforms with 'reassoc'
The variable name 'AllowReassociate' is a lie at this point because
it's set to 'isFast()' which is more than the 'reassoc' FMF after
rL317488.
In D41286, we showed that this transform may be valid even with strict
math by brute force checking every 32-bit float result.
There's a potential problem here because we're replacing with a tan()
libcall rather than a hypothetical LLVM tan intrinsic. So we might
set errno when we should be guaranteed not to do that. But that's
independent of this change.
llvm-svn: 325247
Kamil Rytarowski [Thu, 15 Feb 2018 14:59:59 +0000 (14:59 +0000)]
Enable test/asan for NetBSD
Sponsored by <The NetBSD Foundation>
llvm-svn: 325246
Kamil Rytarowski [Thu, 15 Feb 2018 14:58:15 +0000 (14:58 +0000)]
Enable syscall-specific functions in TSan/NetBSD
NetBSD ships now with netbsd_syscall_hooks.h and requires support
for TSan specific features to be enabled.
This is follow up of:
D42048: Add NetBSD syscall hooks skeleton in sanitizers
Sponsored by <The NetBSD Foundation>
llvm-svn: 325245
Pablo Barrio [Thu, 15 Feb 2018 14:44:22 +0000 (14:44 +0000)]
[ARM] Allow 64- and 128-bit types with 't' inline asm constraint
Summary:
In LLVM, 't' selects a floating-point/SIMD register and only supports
32-bit values. This is appropriately documented in the LLVM Language
Reference Manual. However, this behaviour diverges from that of GCC, where
't' selects the s0-s31 registers and its qX and dX variants depending on
additional operand modifiers (q/P).
For example, the following C code:
#include <arm_neon.h>
float32x4_t a, b, x;
asm("vadd.f32 %0, %1, %2" : "=t" (x) : "t" (a), "t" (b))
results in the following assembly if compiled with GCC:
vadd.f32 s0, s0, s1
whereas LLVM will show "error: couldn't allocate output register for
constraint 't'", since a, b, x are 128-bit variables, not 32-bit.
This patch extends the use of 't' to mean that of GCC, thus allowing
selection of the lower Q vector regs and their D/S variants. For example,
the earlier code will now compile as:
vadd.f32 q0, q0, q1
This behaviour still differs from that of GCC but I think it is actually
more correct, since LLVM picks up the right register type based on the
datatype of x, while GCC would need an extra operand modifier to achieve
the same result, as follows:
asm("vadd.f32 %q0, %q1, %q2" : "=t" (x) : "t" (a), "t" (b))
Since this is only an extension of functionality, existing code should not
be affected by this change. Note that operand modifiers q/P are already
supported by LLVM, so this patch should suffice to support inline
assembly with constraint 't' originally built for GCC.
Reviewers: grosbach, rengolin
Reviewed By: rengolin
Subscribers: rogfer01, efriedma, olista01, aemerson, javed.absar, eraman, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D42962
llvm-svn: 325244
Simon Pilgrim [Thu, 15 Feb 2018 14:37:59 +0000 (14:37 +0000)]
[X86][SSE] combineTruncateWithSat - use truncateVectorWithPACK to chain PACKUS vXi32-vXi8 saturated truncation
We can use PACKSS/PACKUS to saturate each stage of the chain: PACKSSDW down to [-32768,32767] and then PACKUSWB to [0,255].
llvm-svn: 325243
Ilya Biryukov [Thu, 15 Feb 2018 14:32:57 +0000 (14:32 +0000)]
[clangd] Enable snippet completion based on client capabilities.
Summary: And remove -enable-snippets flag.
Reviewers: hokein, ioeric, sammccall
Reviewed By: ioeric
Subscribers: klimek, jkorous-apple, cfe-commits
Differential Revision: https://reviews.llvm.org/D43229
llvm-svn: 325242
Kamil Rytarowski [Thu, 15 Feb 2018 14:19:23 +0000 (14:19 +0000)]
Adding msan support for FreeBSD
Summary: Enabling memory sanitiser for X86_64 arch only. To match the sanitiser counterpart.
Patch by: David CARLIER
Reviewers: krytarowski
Reviewed By: krytarowski
Subscribers: dim, emaste, cfe-commits
Differential Revision: https://reviews.llvm.org/D43148
llvm-svn: 325241
Kamil Rytarowski [Thu, 15 Feb 2018 14:17:15 +0000 (14:17 +0000)]
Add Xray instrumentation support to FreeBSD
Summary:
- Enabling the build.
- Using assembly for the cpuid parts.
- Using thr_self FreeBSD call to get the thread id
Patch by: David CARLIER
Reviewers: dberris, rnk, krytarowski
Reviewed By: dberris, krytarowski
Subscribers: emaste, stevecheckoway, nglevin, srhines, kubamracek, dberris, mgorny, krytarowski, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D43278
llvm-svn: 325240
Sam McCall [Thu, 15 Feb 2018 14:16:17 +0000 (14:16 +0000)]
[clangd] Fix make_unique ambiguity, NFC
llvm-svn: 325239
Kamil Rytarowski [Thu, 15 Feb 2018 14:12:21 +0000 (14:12 +0000)]
Add Xray instrumentation compile-time/link-time support to FreeBSD
Summary: Similarly to the GNU driver version, adding proper compile and linker flags.
Patch by: David CARLIER
Reviewers: vitalybuka, krytarowski, dberris
Reviewed By: krytarowski, dberris
Subscribers: emaste, dberris, cfe-commits
Differential Revision: https://reviews.llvm.org/D43279
llvm-svn: 325238
Sanjay Patel [Thu, 15 Feb 2018 13:55:52 +0000 (13:55 +0000)]
[InstCombine] allow X / C -> X * (1.0/C) for vector splat FP constants
llvm-svn: 325237
Martin Bohme [Thu, 15 Feb 2018 13:50:07 +0000 (13:50 +0000)]
Add -no-canonical-prefixes to allow different build modes.
llvm-svn: 325236
Simon Pilgrim [Thu, 15 Feb 2018 13:33:15 +0000 (13:33 +0000)]
[X86][SSE] combineTruncateWithSat - use truncateVectorWithPACK to chain PACKSS vXi32-vXi8 saturated truncation
We can use PACKSS to saturate each stage of the chain: PACKSSDW down to [-32768,32767] and then PACKSSWB to [-128,127].
PACKUS is a little trickier and will be handled in a separate patch.
llvm-svn: 325235
Momchil Velikov [Thu, 15 Feb 2018 13:29:33 +0000 (13:29 +0000)]
[DebugInfo] Accept enumeration types without underlying integer type present in
debug info metadata
... when generating DWARF.
Differential Revision: https://reviews.llvm.org/D43304
llvm-svn: 325234
Ilya Biryukov [Thu, 15 Feb 2018 13:15:47 +0000 (13:15 +0000)]
[clangd] Make functions of ClangdServer callback-based
Summary:
As a consequence, all LSP operations are now handled asynchronously,
i.e. they never block the main processing thread. However, if
-run-synchronously flag is specified, clangd still runs everything on
the main thread.
Reviewers: sammccall, ioeric, hokein
Reviewed By: sammccall, ioeric
Subscribers: klimek, jkorous-apple, cfe-commits
Differential Revision: https://reviews.llvm.org/D43227
llvm-svn: 325233
Simon Pilgrim [Thu, 15 Feb 2018 12:14:15 +0000 (12:14 +0000)]
[SelectionDAG] Add initial implementation of TargetLowering::SimplifyDemandedVectorElts
This is mainly a move of simplifyShuffleOperands from DAGCombiner::visitVECTOR_SHUFFLE to create a more general purpose TargetLowering::SimplifyDemandedVectorElts implementation.
Further features can be moved/added in future patches.
Differential Revision: https://reviews.llvm.org/D42896
llvm-svn: 325232
Sjoerd Meijer [Thu, 15 Feb 2018 10:33:07 +0000 (10:33 +0000)]
[ARM] f16 vcmp fixes
This adds f16 VCMP match rules and fixes the test cases.
Differential Revision: https://reviews.llvm.org/D43291
llvm-svn: 325228
Serge Pavlov [Thu, 15 Feb 2018 09:45:59 +0000 (09:45 +0000)]
Revert r325224 "Report fatal error in the case of out of memory"
It caused fails on some buildbots.
llvm-svn: 325227
Serge Pavlov [Thu, 15 Feb 2018 09:35:36 +0000 (09:35 +0000)]
Specify namespace for realloc
llvm-svn: 325226
Gabor Horvath [Thu, 15 Feb 2018 09:24:55 +0000 (09:24 +0000)]
[clang-tidy] Make a test pass on platforms where exceptions disabled by default.
llvm-svn: 325225
Serge Pavlov [Thu, 15 Feb 2018 09:20:26 +0000 (09:20 +0000)]
Report fatal error in the case of out of memory
Analysis of fails in the case of out of memory errors can be tricky on
Windows. Such error emerges at the point where memory allocation function
fails, but manifests itself when null pointer is used. These two points
may be distant from each other. Besides, next runs may not exhibit
allocation error.
Usual programming practice does not require checking result of 'operator
new' because it throws 'std::bad_alloc' in the case of allocation error.
However, LLVM is usually built with exceptions turned off, so 'new' can
return null pointer. This change installs custom new handler, which causes
fatal error in the case of out of memory. The handler is installed
automatically prior to call to 'main' during construction of a static
object defined in 'lib/Support/ErrorHandling.cpp'. If the application does
not use this file, the handler may be installed manually by a call to
'llvm::install_out_of_memory_new_handler', declared in
'include/llvm/Support/ErrorHandling.h".
There are calls to C allocation functions, malloc, calloc and realloc.
They are used for interoperability with C code, when allocated object has
variable size and when it is necessary to avoid call of constructors. In
many calls the result is not checked against null pointer. To simplify
checks, new functions are defined in the namespace 'llvm' with the
same names as these C function. These functions produce fatal error if
allocation fails. User should use 'llvm::malloc' instead of 'std::malloc'
in order to use the safe variant. This change replaces 'std::malloc'
in the cases when the result of allocation function is not checked against
null pointer.
Finally, there are plain C code, that uses malloc and similar functions. If
the result is not checked, assert statements are added.
Differential Revision: https://reviews.llvm.org/D43010
llvm-svn: 325224
Gabor Horvath [Thu, 15 Feb 2018 09:19:23 +0000 (09:19 +0000)]
[clang-tidy] Minor documentation fix
llvm-svn: 325223
Gabor Horvath [Thu, 15 Feb 2018 09:08:51 +0000 (09:08 +0000)]
[clang-tidy] New checker for exceptions that are created but not thrown
Patch by: Kristof Umann
Differential Revision: https://reviews.llvm.org/D43120
llvm-svn: 325222
Jacek Olesiak [Thu, 15 Feb 2018 08:47:56 +0000 (08:47 +0000)]
[clang-format] Improve ObjC headers detection
Summary: Detect ObjC characteristic types when they start a line and add additional keywords.
Reviewers: benhamilton
Reviewed By: benhamilton
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D43124
llvm-svn: 325221
Sam McCall [Thu, 15 Feb 2018 08:40:54 +0000 (08:40 +0000)]
[clangd] Fix tracing now that spans lifetimes can overlap on a thread.
Summary:
The chrome trace viewer requires events within a thread to strictly nest.
So we need to record the lifetime of the Span objects, not the contexts.
But we still want to show the relationship between spans where a context crosses
threads, so do this with flow events (i.e. arrows).
Before: https://photos.app.goo.gl/q4Dd9u9xtelaXk1v1
After: https://photos.app.goo.gl/5RNLmAMLZR3unvY83
(This could stand some further improvement, in particular I think we want a
container span whenever we schedule work on a thread. But that's another patch)
Reviewers: ioeric
Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits
Differential Revision: https://reviews.llvm.org/D43272
llvm-svn: 325220
Jonas Hahnfeld [Thu, 15 Feb 2018 08:10:22 +0000 (08:10 +0000)]
[CMake] Add -fno-experimental-isel for testing
GlobalISel doesn't yet implement blockaddress and falls back to
SelectionDAG. This results in additional branch instruction to
the next basic block which breaks the OMPT tests.
Disable GlobalISel for now when compiling the tests because fixing
them is not easily possible. See http://llvm.org/PR36313 for full
discussion history.
Differential Revision: https://reviews.llvm.org/D43195
llvm-svn: 325218
Andrew V. Tischenko [Thu, 15 Feb 2018 07:55:02 +0000 (07:55 +0000)]
(NFC)[MachineCombiner] Improve debug output.
llvm-svn: 325217
Max Kazantsev [Thu, 15 Feb 2018 07:47:17 +0000 (07:47 +0000)]
[NFC] Rename isKnownViaSimpleReasoning to isKnownViaNonRecursiveReasoning
llvm-svn: 325216
Max Kazantsev [Thu, 15 Feb 2018 07:13:18 +0000 (07:13 +0000)]
[NFC] Fix metadata placement in test
llvm-svn: 325215
Max Kazantsev [Thu, 15 Feb 2018 07:09:00 +0000 (07:09 +0000)]
[SCEV] Favor isKnownViaSimpleReasoning over constant ranges check
There is a more powerful but still simple function `isKnownViaSimpleReasoning ` that
does constant range check and few more additional checks. We use it some places (e.g.
when proving implications) and in some other places we only check constant ranges.
Currently, indvar simplifier fails to remove the check in following loop:
int inc = ...;
for (int i = inc, j = inc - 1; i < 200; ++i, ++j)
if (i > j) { ... }
This patch replaces all usages of `isKnownPredicateViaConstantRanges` with
`isKnownViaSimpleReasoning` to have smarter proofs. In particular, it fixes the
case above.
Reviewed-By: sanjoy
Differential Revision: https://reviews.llvm.org/D43175
llvm-svn: 325214
Igor Kudrin [Thu, 15 Feb 2018 06:13:52 +0000 (06:13 +0000)]
[ELF] Simplify handling of AT section attribute.
This also makes the behavior close to GNU ld's.
Differential Revision: https://reviews.llvm.org/D43284
llvm-svn: 325213
Kamil Rytarowski [Thu, 15 Feb 2018 03:36:16 +0000 (03:36 +0000)]
Teach sanitizer about NetBSD specific ioctl(2) calls
Summary:
Introduce handling of 1200 NetBSD specific ioctl(2) calls.
Over 100 operations are disabled as unavailable or conflicting
with the existing ones (the same operation number).
Add a script that generates the rules to detect ioctls on NetBSD.
The generate_netbsd_ioctls.awk script has been written
in NetBSD awk(1) (patched nawk) and is compatible with gawk.
Generate lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
with the awk(1) script.
Update sanitizer_platform_limits_netbsd accordingly to add the needed
definitions.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, vitalybuka, eugenis, dvyukov
Reviewed By: vitalybuka
Subscribers: kubamracek, llvm-commits, mgorny, fedor.sergeev, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D41636
llvm-svn: 325212
Artem Dergachev [Thu, 15 Feb 2018 03:26:43 +0000 (03:26 +0000)]
[analyzer] Inline constructors for destroyable temporaries.
Since r325210, in cfg-temporary-dtors mode, we can rely on the CFG to tell us
that we're indeed constructing a temporary, so we can trivially construct a
temporary region and inline the constructor.
Much like r325202, this is only done under the off-by-default
cfg-temporary-dtors flag because the temporary destructor, even if available,
will not be inlined and won't have the correct object value (target region).
Unless this is fixed, it is quite unsafe to inline the constructor.
If the temporary is lifetime-extended, the destructor would be an automatic
destructor, which would be evaluated with a "correct" target region - modulo
the series of incorrect relocations performed during the lifetime extension.
It means that at least, values within the object are guaranteed to be properly
escaped or invalidated.
Differential Revision: https://reviews.llvm.org/D43062
llvm-svn: 325211
Artem Dergachev [Thu, 15 Feb 2018 03:13:36 +0000 (03:13 +0000)]
[CFG] Provide construction contexts for temproary objects.
Constructors of C++ temporary objects that have destructors now can be queried
to discover that they're indeed constructing temporary objects.
The respective CXXBindTemporaryExpr, which is also repsonsible for destroying
the temporary at the end of full-expression, is now available at the
construction site in the CFG. This is all the context we need to provide for
temporary objects that are not lifetime extended. For lifetime-extended
temporaries, more context is necessary.
Differential Revision: https://reviews.llvm.org/D43056
llvm-svn: 325210
Artem Dergachev [Thu, 15 Feb 2018 02:51:58 +0000 (02:51 +0000)]
[analyzer] Decide on inlining destructors via EvalCallOptions.
EvalCallOptions were introduced in r324018 for allowing various parts of
ExprEngine to notify the inlining mechanism, while preparing for evaluating a
function call, of possible difficulties with evaluating the call that they
foresee. Then mayInlineCall() would still be a single place for making the
decision.
Use that mechanism for destructors as well - pass the necessary flags from the
CFG-element-specific destructor handlers.
Part of this patch accidentally leaked into r324018, which led into a change in
tests; this change is reverted now, because even though the change looked
correct, the underlying behavior wasn't. Both of these commits were not intended
to introduce any function changes otherwise.
Differential Revision: https://reviews.llvm.org/D42991
llvm-svn: 325209
Kamil Rytarowski [Thu, 15 Feb 2018 02:48:20 +0000 (02:48 +0000)]
Prevent recursive MSan interceptors in strftime(3) like functions
Summary:
This corrects intercepting this call on NetBSD without false positives.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, eugenis, vitalybuka
Reviewed By: vitalybuka
Subscribers: llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D42883
llvm-svn: 325208
Kamil Rytarowski [Thu, 15 Feb 2018 02:47:35 +0000 (02:47 +0000)]
Prevent recursive MSan interceptors in fgets(3)
Summary:
This corrects intercepting this call on NetBSD without false positives.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, eugenis, vitalybuka
Reviewed By: vitalybuka
Subscribers: llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D42884
llvm-svn: 325207
Kamil Rytarowski [Thu, 15 Feb 2018 02:43:02 +0000 (02:43 +0000)]
Add NetBSD syscall hooks skeleton in sanitizers
Summary:
Implement the skeleton of NetBSD syscall hooks for use with sanitizers.
Add a script that generates the rules to handle syscalls
on NetBSD: generate_netbsd_syscalls.awk. It has been written
in NetBSD awk(1) (patched nawk) and is compatible with gawk.
Generate lib/sanitizer_common/sanitizer_platform_limits_netbsd.h
that is a public header for applications, and included as:
<sanitizer_common/sanitizer_platform_limits_netbsd.h>.
Generate sanitizer_syscalls_netbsd.inc that defines all the
syscall rules for NetBSD. This file is modeled after the Linux
specific file: sanitizer_common_syscalls.inc.
Start recognizing NetBSD syscalls with existing sanitizers:
ASan, ESan, HWASan, TSan, MSan.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, vitalybuka, kcc, dvyukov, eugenis
Reviewed By: vitalybuka
Subscribers: hintonda, kubamracek, mgorny, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D42048
llvm-svn: 325206
Eric Fiselier [Thu, 15 Feb 2018 02:41:19 +0000 (02:41 +0000)]
Fix test failure on compilers w/o deduction guides
llvm-svn: 325205
Rui Ueyama [Thu, 15 Feb 2018 02:40:58 +0000 (02:40 +0000)]
Fix an issue that lld drops symbol versions for -r.
When we are emitting a relocatable output, we should keep the original
symbol name including "@" part. Previously, we drop that part unconditionally
which resulted in dropping versions from symbols.
Differential Revision: https://reviews.llvm.org/D43307
llvm-svn: 325204
Konstantin Zhuravlyov [Thu, 15 Feb 2018 02:37:04 +0000 (02:37 +0000)]
Reapply r325193
llvm-svn: 325203
Artem Dergachev [Thu, 15 Feb 2018 02:32:32 +0000 (02:32 +0000)]
[analyzer] Allow inlining constructors into return values.
This only affects the cfg-temporary-dtors mode - in this mode we begin inlining
constructors that are constructing function return values. These constructors
have a correct construction context since r324952.
Because temporary destructors are not only never inlined, but also don't have
the correct target region yet, this change is not entirely safe. But this
will be fixed in the subsequent commits, while this stays off behind the
cfg-temporary-dtors flag.
Lifetime extension for return values is still not modeled correctly.
Differential Revision: https://reviews.llvm.org/D42875
llvm-svn: 325202
Artem Dergachev [Thu, 15 Feb 2018 02:30:20 +0000 (02:30 +0000)]
[analyzer] NFC: Remove dead checks when computing DeclStmt construction region.
In CFG, every DeclStmt has exactly one decl, which is always a variable.
It is also pointless to check that the initializer is the constructor because
that's how construction contexts work now.
llvm-svn: 325201
Konstantin Zhuravlyov [Thu, 15 Feb 2018 02:27:45 +0000 (02:27 +0000)]
Revert r325193 as it breaks buildbots
llvm-svn: 325200
Kamil Rytarowski [Thu, 15 Feb 2018 02:17:06 +0000 (02:17 +0000)]
Add new interceptor: lstat(2)
Summary:
lstat - get file status
Use it on NetBSD.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, vitalybuka, eugenis
Reviewed By: vitalybuka
Subscribers: kubamracek, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D42909
llvm-svn: 325199
Craig Topper [Thu, 15 Feb 2018 02:14:20 +0000 (02:14 +0000)]
[X86] Regnerate test to show scheduling comments. NFC
These must have not been printing the last time the test was re-generated.
llvm-svn: 325198
Craig Topper [Thu, 15 Feb 2018 01:21:53 +0000 (01:21 +0000)]
[X86] Change 32 and 64 bit versions of LSL instruction have a 16-bit memory operand.
This matches the Intel and AMD documentation and is consistent with the LAR instruction.
llvm-svn: 325197
Konstantin Zhuravlyov [Thu, 15 Feb 2018 01:01:53 +0000 (01:01 +0000)]
AMDGPU: Enable PIC by default for amdgcn
Differential Revision: https://reviews.llvm.org/D43094
llvm-svn: 325196
Richard Smith [Thu, 15 Feb 2018 01:01:06 +0000 (01:01 +0000)]
Add missing definition for class static after r325193.
llvm-svn: 325195
Vitaly Buka [Thu, 15 Feb 2018 00:40:36 +0000 (00:40 +0000)]
[sanitizer] Fix flakiness in the tests
Seems tests fails if link already exists.
Also removed duplicated part of tests.
llvm-svn: 325194
Konstantin Zhuravlyov [Thu, 15 Feb 2018 00:20:26 +0000 (00:20 +0000)]
AMDGPU: Cleanup most of the macros
- Insert __AMD__ macro
- Insert __AMDGPU__ macro
- Insert __devicename__ macro
- Add missing tests for arch macros
Differential Revision: https://reviews.llvm.org/D36802
llvm-svn: 325193
Craig Topper [Wed, 14 Feb 2018 23:53:26 +0000 (23:53 +0000)]
[X86] Dont' allow 'outs' and 'ins' in at&t syntax without suffixes.
The match would be ambiguous, but at&t asm parsing doesn't support ambiguous matches and will just return the first.
llvm-svn: 325192
Craig Topper [Wed, 14 Feb 2018 23:53:24 +0000 (23:53 +0000)]
[X86] Don't use 64 bit hex constants in a 32 bit assembler test.
llvm-svn: 325191
Craig Topper [Wed, 14 Feb 2018 23:53:21 +0000 (23:53 +0000)]
[X86] Reverse the operand order of invlpga in at&t syntax to match gas.
llvm-svn: 325190
Jake Ehrlich [Wed, 14 Feb 2018 23:31:33 +0000 (23:31 +0000)]
[llvm-objcopy] Fix handling of zero-size segments in llvm-objcopy
Some ELF files produced by lld may have zero-size segment placeholders as shown
below. Since GNU_STACK Offset is 0, the current code makes it the lowest used
offset, and relocates all the segments over the ELF header. The resulting
binary is total garbage.
This change fixes how llvm-objcopy handles PT_PHDR properlly by treating ELF
headers and the program header table as segments to allow the layout algorithm
decide where those should go.
Author: vit9696
Differential Revision: https://reviews.llvm.org/D42872
llvm-svn: 325189
Adrian McCarthy [Wed, 14 Feb 2018 23:16:36 +0000 (23:16 +0000)]
Supply missing break in case statement.
Summary:
All the tests pass without hitting the situation mentioned in the FIXME, so,
per Aaron Smith's suggestion, this case will now return unconditionally.
Subscribers: sanjoy, mgorny, JDevlieghere
Differential Revision: https://reviews.llvm.org/D43215
llvm-svn: 325188
Sanjay Patel [Wed, 14 Feb 2018 23:04:17 +0000 (23:04 +0000)]
[InstCombine] clean up fold for X / C -> X * (1.0/C); NFCI
This should work with vector constants too, but it's currently limited to scalar.
llvm-svn: 325187
Erich Keane [Wed, 14 Feb 2018 23:00:31 +0000 (23:00 +0000)]
Improve documentation for attribute artificial
This patch is related to https://reviews.llvm.org/rC325081
The patch improves documentation for the attribute and removes reference to GCC
documentation.
Patch By: Elizabeth Andrews (eandrews)
Differential Revision: https://reviews.llvm.org/D43321
llvm-svn: 325186
Sam Clegg [Wed, 14 Feb 2018 22:55:38 +0000 (22:55 +0000)]
[WebAssebmly] Remove use of Optional to fix assertion in gcc
This was causing GCC builds with fail with:
Symbols.h:240:3: error: static assertion failed: Symbol types must be
trivially destructible
static_assert(std::is_trivially_destructible<T>(
The reason this is a gcc-only failure is that OptionalStorage has
as specialization for POD types that isn't built under GCC.
Differential Revision: https://reviews.llvm.org/D43317
llvm-svn: 325185
Vitaly Buka [Wed, 14 Feb 2018 22:52:49 +0000 (22:52 +0000)]
Moved CHECK in test closer to source code
llvm-svn: 325184
Rui Ueyama [Wed, 14 Feb 2018 22:43:43 +0000 (22:43 +0000)]
Revert r325158: Convert an assert to a static_assert. NFC.
This reverts commit r325158 because it broke GCC builds.
llvm-svn: 325183
Vitaly Buka [Wed, 14 Feb 2018 22:41:15 +0000 (22:41 +0000)]
[ThinLTO/CFI] Include TYPE_ID summaries into GLOBALVAL_SUMMARY_BLOCK
Summary:
TypeID summaries are used by CFI and need to be serialized by ThinLTO
indexing for later use by LTO Backend.
Reviewers: tejohnson, pcc
Subscribers: mehdi_amini, inglorion, eraman, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D42611
llvm-svn: 325182
Rui Ueyama [Wed, 14 Feb 2018 22:26:23 +0000 (22:26 +0000)]
Remove a failing static_assert.
This static_assert is legitimate, but it is failing on some build environments.
I'm removing it until it's fixed to unbreak the bots.
llvm-svn: 325181
Lang Hames [Wed, 14 Feb 2018 22:13:02 +0000 (22:13 +0000)]
[ORC] Consolidate RTDyldObjectLinkingLayer GetMemMgr and GetResolver into a
unified GetResources callback.
Having a single 'GetResources' callback will simplify adding new resources in
the future.
llvm-svn: 325180
Lang Hames [Wed, 14 Feb 2018 22:12:56 +0000 (22:12 +0000)]
[ORC] Switch to shared_ptr ownership for AsynchronousSymbolQueries.
Queries need to stay alive until each owner has set the values they are
responsible for.
llvm-svn: 325179
Craig Topper [Wed, 14 Feb 2018 21:54:58 +0000 (21:54 +0000)]
[X86] Don't swap argument on BOUND instruction in at&t syntax.
The bound instruction does not have reversed operands in gas.
Fixes PR27653.
Patch by Maya Madhavan.
Differential Revision: https://reviews.llvm.org/D43243
llvm-svn: 325178
Rafael Espindola [Wed, 14 Feb 2018 21:44:34 +0000 (21:44 +0000)]
Change the BugDriver to store the current module with std::unique_ptr.
While there, change a bunch of helper functions to take references to
avoid adding calls to get().
This should conclude the bugpoint yak shaving.
llvm-svn: 325177
Rafael Espindola [Wed, 14 Feb 2018 21:25:07 +0000 (21:25 +0000)]
Use std::uniue_ptr. NFC.
llvm-svn: 325176
Matt Davis [Wed, 14 Feb 2018 21:22:11 +0000 (21:22 +0000)]
[Debug] Annotate compiler generated range-for loop variables.
Summary:
This change aims to simplify debugging by annotating the range-for loop artificial variables (range, begin, end) with the scope depth.
Reviewers: rsmith, dblaikie
Reviewed By: dblaikie
Subscribers: dblaikie, cfe-commits
Tags: #debug-info
Differential Revision: https://reviews.llvm.org/D42813
llvm-svn: 325175
Rafael Espindola [Wed, 14 Feb 2018 21:17:36 +0000 (21:17 +0000)]
Use std::unique_ptr. NFC.
llvm-svn: 325174
Rafael Espindola [Wed, 14 Feb 2018 21:10:29 +0000 (21:10 +0000)]
Use std::unique_ptr. NFC.
llvm-svn: 325173
Rafael Espindola [Wed, 14 Feb 2018 20:59:39 +0000 (20:59 +0000)]
Use std::unique_ptr. NFC.
llvm-svn: 325172
Eric Fiselier [Wed, 14 Feb 2018 20:56:52 +0000 (20:56 +0000)]
Clean up -fdiscard-value-name handling
llvm-svn: 325171
Rafael Espindola [Wed, 14 Feb 2018 20:53:38 +0000 (20:53 +0000)]
Use std::unique_ptr. NFC.
llvm-svn: 325170
Krzysztof Parzyszek [Wed, 14 Feb 2018 20:46:06 +0000 (20:46 +0000)]
[Hexagon] Split HVX vector pair loads/stores, expand unaligned loads
llvm-svn: 325169
Simon Pilgrim [Wed, 14 Feb 2018 20:43:47 +0000 (20:43 +0000)]
Removed superfluous semicolon to fix -Wpedantic gcc warning. NFCI.
llvm-svn: 325168
Rafael Espindola [Wed, 14 Feb 2018 20:25:18 +0000 (20:25 +0000)]
Use std::unique_ptr. NFC.
llvm-svn: 325167
Francis Visoiu Mistrih [Wed, 14 Feb 2018 20:23:05 +0000 (20:23 +0000)]
[CodeGen] Print predecessors, successors, then liveins in -debug printing
Reorder them to match MIR.
Predecessors are only comments, and they're not usually printed in MIR.
llvm-svn: 325166
Rafael Espindola [Wed, 14 Feb 2018 20:21:20 +0000 (20:21 +0000)]
Use std::unique_ptr. NFC.
llvm-svn: 325165
Rafael Espindola [Wed, 14 Feb 2018 20:13:01 +0000 (20:13 +0000)]
Use std::unique_ptr. NFC.
llvm-svn: 325164
Rafael Espindola [Wed, 14 Feb 2018 19:58:41 +0000 (19:58 +0000)]
Use std::unique_ptr. NFC.
llvm-svn: 325163
Volkan Keles [Wed, 14 Feb 2018 19:58:36 +0000 (19:58 +0000)]
GlobalISel: Add templated functions and pattern matcher support for some more opcodes
Summary:
This patch adds templated functions to MachineIRBuilder for some opcodes
and adds pattern matcher support for G_AND and G_OR.
Reviewers: aditya_nandakumar
Reviewed By: aditya_nandakumar
Subscribers: rovka, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D43309
llvm-svn: 325162
Sanjay Patel [Wed, 14 Feb 2018 19:54:51 +0000 (19:54 +0000)]
[InstCombine] add tests and comments for fdiv X, C; NFC
llvm-svn: 325161
Rafael Espindola [Wed, 14 Feb 2018 19:50:40 +0000 (19:50 +0000)]
Pass a module reference to CloneModule.
It can never be null and most callers were already using references or
std::unique_ptr.
llvm-svn: 325160
Krasimir Georgiev [Wed, 14 Feb 2018 19:47:58 +0000 (19:47 +0000)]
[clang-format] Recognize percents as format specifiers in protos
Summary:
Frequently, a percent in protos denotes a formatting specifier for string replacement.
Thus it is desirable to keep the percent together with what follows after it.
Reviewers: djasper
Reviewed By: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D43294
llvm-svn: 325159
Sam Clegg [Wed, 14 Feb 2018 19:28:46 +0000 (19:28 +0000)]
Convert an assert to a static_assert. NFC.
Differential Revision: https://reviews.llvm.org/D43305
llvm-svn: 325158
Rafael Espindola [Wed, 14 Feb 2018 19:23:27 +0000 (19:23 +0000)]
Update examples for API change. NFC.
llvm-svn: 325157
Rafael Espindola [Wed, 14 Feb 2018 19:11:37 +0000 (19:11 +0000)]
Update for llvm change. NFC.
llvm-svn: 325156
Rafael Espindola [Wed, 14 Feb 2018 19:11:32 +0000 (19:11 +0000)]
Pass a reference to a module to the bitcode writer.
This simplifies most callers as they are already using references or
std::unique_ptr.
llvm-svn: 325155
Bruno Cardoso Lopes [Wed, 14 Feb 2018 19:01:03 +0000 (19:01 +0000)]
[Modules] Add more language features to be used with requires-declaration
Features added: c99, c11, c17, cplusplus14 and cplusplus17.
rdar://problem/
36328787
rdar://problem/
36668431
llvm-svn: 325154
Craig Topper [Wed, 14 Feb 2018 18:53:29 +0000 (18:53 +0000)]
[RegisterClassInfo] Invalidate the register pressure set limit cache when reserved regs or callee saved regs change
Previously we only invalidated the pressure set limit cached when the TargetRegisterInfo pointer changes. But as reserved regs and callee saved regs are used as part of calculating the limits we should invalidate when those change too.
I encountered this when reverting a patch from the 6.0 branch. One of the x86 test files had a function that used rbp as a frame pointer, making it reserved. It was followed by another function which didn't use rbp but had the same TRI so the pressure set limit cache was not invalidated. If i removed the function that used rbp as a frame pointer from the file, the remaining function then got a different register pressure limit for the GR16 pressure set. This caused the machine scheduler to change the scheduling for the function. This was an unexpected change from just deleting a function.
I don't have a test case for trunk because the particular x86 test case is different enough from the 6.0 branch to not be affected now.
Differential Revision: https://reviews.llvm.org/D43274
llvm-svn: 325153
Rui Ueyama [Wed, 14 Feb 2018 18:38:33 +0000 (18:38 +0000)]
Make --export-dynamic-symbol to add undefined symbols even if --export-dynamic is given.
This patch addresses a minor compatibility issue with GNU linkers.
Previously, --export-dynamic-symbol is completely ignored if you
pass --export-dynamic together.
Differential Revision: https://reviews.llvm.org/D43266
llvm-svn: 325152
David Green [Wed, 14 Feb 2018 18:34:53 +0000 (18:34 +0000)]
Move llvm::computeLoopSafetyInfo from LICM.cpp to LoopUtils.cpp. NFC
Move computeLoopSafetyInfo, defined in Transforms/Utils/LoopUtils.h,
into the corresponding LoopUtils.cpp, as opposed to LICM where it resides
at the moment. This will allow other functions from Transforms/Utils
to reference it.
llvm-svn: 325151