Jonathan Peyton [Tue, 25 Apr 2017 19:04:07 +0000 (19:04 +0000)]
Fix Hwloc API Incompatibility
Older Hwloc libraries (< 1.10.0) don't offer the HWLOC_OBJ_NUMANODE nor
HWLOC_OBJ_PACKAGE types. Instead they are named HWLOC_OBJ_NODE and
HWLOC_OBJ_SOCKET instead. This patch just defines the newer names based on
the older names when using an older Hwloc.
Differential Revision: https://reviews.llvm.org/D32496
llvm-svn: 301349
Carlo Bertolli [Tue, 25 Apr 2017 18:59:37 +0000 (18:59 +0000)]
Minor fix for distribute_parallel_for_num_threads_codegen on AARCH64
llvm-svn: 301348
Petr Hosek [Tue, 25 Apr 2017 18:56:33 +0000 (18:56 +0000)]
[llvm-objdump] Don't attempt to print lines beyond the end of file
This may trigger a segfault in llvm-objdump when the line number stored
in debug infromation points beyond the end of file; lines in LineBuffer
are stored in std::vector which is allocated in chunks, so even if the
debug info points beyond the end of the file, this doesn't necessarily
trigger the segfault unless the line number points beyond the allocated
space.
Differential Revision: https://reviews.llvm.org/D32466
llvm-svn: 301347
Krzysztof Parzyszek [Tue, 25 Apr 2017 18:56:14 +0000 (18:56 +0000)]
[Hexagon] Only increment debug counters if debug option is present
llvm-svn: 301346
Gil Rapaport [Tue, 25 Apr 2017 18:14:24 +0000 (18:14 +0000)]
[LV] Make LIT test insensitive to basic block numbering
This patch is part of D28975's breakdown.
induction.ll encodes the specific (and rather arbitrary) numbers given to
predicated basic blocks by the unique naming mechanism, which makes it
sensitive to changes in LV's instruction generation order. This patch replaces
those specific numbers with a numeric pattern.
Differential Revision: https://reviews.llvm.org/D32404
llvm-svn: 301345
Davide Italiano [Tue, 25 Apr 2017 18:04:31 +0000 (18:04 +0000)]
[PGO/tests] Update comment to reflect reality.
llvm-svn: 301344
Stanislav Mekhanoshin [Tue, 25 Apr 2017 18:00:08 +0000 (18:00 +0000)]
Skip bitcasts while looking for GEP in LoadStoreVectorizer
Differential Revisison: https://reviews.llvm.org/D32101
llvm-svn: 301343
Simon Pilgrim [Tue, 25 Apr 2017 18:00:04 +0000 (18:00 +0000)]
[X86][AVX2] Add shuffle test for PR27320 showing current codegen.
llvm-svn: 301342
Craig Topper [Tue, 25 Apr 2017 17:54:12 +0000 (17:54 +0000)]
[InstCombine] Remove redundant code from SimplifyUsingDistributiveLaws
The code I've removed here exists in ExpandBinOp in InstSimplify which we call into before SimplifyUsingDistributiveLaws. The code in InstSimplify looks to have been copied from here.
I verified this code doesn't fire on any lit tests. Not that that proves its definitely dead.
Differential Revision: https://reviews.llvm.org/D32472
llvm-svn: 301341
Carlo Bertolli [Tue, 25 Apr 2017 17:52:12 +0000 (17:52 +0000)]
Recommit of
[OpenMP] Initial implementation of code generation for pragma 'distribute parallel for' on host
https://reviews.llvm.org/D29508
This patch makes the following additions:
It abstracts away loop bound generation code from procedures associated with pragma 'for' and loops in general, in such a way that the same procedures can be used for 'distribute parallel for' without the need for a full re-implementation.
It implements code generation for 'distribute parallel for' and adds regression tests. It includes tests for clauses.
It is important to notice that most of the clauses are implemented as part of existing procedures. For instance, firstprivate is already implemented for 'distribute' and 'for' as separate pragmas. As the implementation of 'distribute parallel for' is based on the same procedures, then we automatically obtain implementation for such clauses without the need to add new code. However, this requires regression tests that verify correctness of produced code.
llvm-svn: 301340
Davide Italiano [Tue, 25 Apr 2017 17:48:10 +0000 (17:48 +0000)]
[PGO] Update test now that we don't call IndirectCallPromotion.
llvm-svn: 301339
Craig Topper [Tue, 25 Apr 2017 17:46:30 +0000 (17:46 +0000)]
[APInt] Use isSubsetOf, intersects, and bit counting methods to reduce temporary APInts
This patch uses various APInt methods to reduce temporary APInt creation.
This should be all of the unrelated cleanups that got buried in D32376(creating a KnownBits struct) as well as some pointed out by Simon during the review of that. Plus a few improvements to use counting instead of masking.
I've left out any places where we do something like (KnownZero & KnownOne) != 0 as I plan to add a helper method to KnownBits to ask that question and didn't want to thrash that code an additional time.
Differential Revision: https://reviews.llvm.org/D32495
llvm-svn: 301338
Craig Topper [Tue, 25 Apr 2017 17:40:58 +0000 (17:40 +0000)]
[InstCombine] Fix CHECK-LABEL in two tests.
llvm-svn: 301337
Rui Ueyama [Tue, 25 Apr 2017 17:40:12 +0000 (17:40 +0000)]
Make it explicit that -export-dynamic overrides -dynamic-list and -export-dynamic-symbol.
No functionality change.
llvm-svn: 301336
Alex Shlyapnikov [Tue, 25 Apr 2017 17:24:27 +0000 (17:24 +0000)]
[lsan] When necessary, define LSan suppression for pthread_exit.
Summary:
Generalize already defined LSan suppression for the leak on
pthread_exit, some envs do not have the entire call stack symbolized,
so we have to be less specific.
Reviewers: eugenis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32497
llvm-svn: 301335
Simon Pilgrim [Tue, 25 Apr 2017 17:22:34 +0000 (17:22 +0000)]
[X86][SSE] Add tests for PR14657 showing current codegen.
llvm-svn: 301334
Adrian Prantl [Tue, 25 Apr 2017 17:22:09 +0000 (17:22 +0000)]
Print complete DIExpressions in the assembler output DEBUG_VALUE comments.
The previous code was complex, incorrect, and couldn't print everything.
llvm-svn: 301333
Rui Ueyama [Tue, 25 Apr 2017 17:19:15 +0000 (17:19 +0000)]
Add a test for ICF and REL relocations.
llvm-svn: 301332
Sam Clegg [Tue, 25 Apr 2017 17:13:23 +0000 (17:13 +0000)]
[WebAssembly] Fix relocation count in wasm binaries with call_indirect
Subscribers: jfb, dschuff
Differential Revision: https://reviews.llvm.org/D32459
llvm-svn: 301331
Sam Clegg [Tue, 25 Apr 2017 17:11:56 +0000 (17:11 +0000)]
[WebAssembly] Read global index in init expression as LEB
Subscribers: jfb, dschuff
Differential Revision: https://reviews.llvm.org/D32462
llvm-svn: 301330
Craig Topper [Tue, 25 Apr 2017 17:01:32 +0000 (17:01 +0000)]
[InstSimplify] Handle (~A & ~B) | (~A ^ B) -> ~A ^ B
The code Sanjay Patel moved over from InstCombine doesn't work properly if the 'and' has both inputs as nots because we used a commuted op matcher on the 'and' first. But this will bind to the first 'not' on 'and' when there could be two 'not's. InstCombine could rely on DeMorgan to ensure the 'and' wouldn't have two 'not's eventually, but InstSimplify can't rely on that.
This patch matches the xor first then checks for the ands and allows a not of either operand of the xor.
Differential Revision: https://reviews.llvm.org/D32458
llvm-svn: 301329
Alex Lorenz [Tue, 25 Apr 2017 16:59:07 +0000 (16:59 +0000)]
[libclang] Check for a record declaration before a template specialization
Fixes PR32539.
Patch by Emilio Cobos Álvarez!
Differential Revision: https://reviews.llvm.org/D32348
llvm-svn: 301328
Davide Italiano [Tue, 25 Apr 2017 16:54:45 +0000 (16:54 +0000)]
[PM] Run IndirectCallPromotion only when PGO is enabled.
Differential Revision: https://reviews.llvm.org/D32465
llvm-svn: 301327
Craig Topper [Tue, 25 Apr 2017 16:48:19 +0000 (16:48 +0000)]
[InstCombine] Remove superfluous curly braces around a single line if body. NFC
llvm-svn: 301326
Craig Topper [Tue, 25 Apr 2017 16:48:14 +0000 (16:48 +0000)]
[ValueTracking] Use APInt::operator|=(uint64_t) instead of creating a temporary APInt. NFC
llvm-svn: 301325
Craig Topper [Tue, 25 Apr 2017 16:48:09 +0000 (16:48 +0000)]
[ValueTracking] Use APInt instead of auto. NFC
This is a pre-commit for a patch I'm working on to turn KnownZero/One into a struct. Once I do that the type here will be less obvious.
llvm-svn: 301324
Craig Topper [Tue, 25 Apr 2017 16:48:03 +0000 (16:48 +0000)]
[ValueTracking] Use BitWidth local variable instead of re-reading it from KnownZero. NFC
This is a pre-commit for a patch that I'm working on to merge KnownZero/KnownOne into a KnownBits struct which would have had to touch this line.
llvm-svn: 301323
Simon Pilgrim [Tue, 25 Apr 2017 16:41:28 +0000 (16:41 +0000)]
[SelectionDAG] Added getBuildVector(ArrayRef<SDUse>) helper.
llvm-svn: 301322
George Rokos [Tue, 25 Apr 2017 16:34:13 +0000 (16:34 +0000)]
[OpenMP] Optimized default kernel launch parameters in CUDA plugin
Differential Revision: https://reviews.llvm.org/D32321
llvm-svn: 301321
Simon Pilgrim [Tue, 25 Apr 2017 16:16:03 +0000 (16:16 +0000)]
[DAGCombiner] Refactor to make it easy to add support for vectors in a future patch. NFCI.
llvm-svn: 301320
Rui Ueyama [Tue, 25 Apr 2017 16:00:44 +0000 (16:00 +0000)]
[ELF] Improve error message for incompatible section flags
Previously we were not printing out the flags of the incompatible
section which made it difficult to determine what the problem was.
The error message format has been change to the following:
error: incompatible section flags for .bar
>>> /foo/bar/incompatible-section-flags.s.tmp.o:(.bar): 0x403
>>> output section .bar: 0x3
Patch by Alexander Richardson.
Differential Revision: https://reviews.llvm.org/D32484
llvm-svn: 301319
George Rokos [Tue, 25 Apr 2017 15:55:39 +0000 (15:55 +0000)]
[OpenMP] Add missing parenthesis which triggers a compile error
Differential Revision: https://reviews.llvm.org/D32490
llvm-svn: 301318
Andrew Ng [Tue, 25 Apr 2017 15:39:57 +0000 (15:39 +0000)]
Resubmit r301309: [DebugInfo][X86] Fix handling of DBG_VALUE's in post-RA scheduler.
This patch reapplies r301309 with the fix to the MIR test to fix the assertion
triggered by r301309. Had trimmed a little bit too much from the MIR!
llvm-svn: 301317
Craig Topper [Tue, 25 Apr 2017 15:19:04 +0000 (15:19 +0000)]
[InstCombine] Add missing commute handling to (A | B) & (B ^ (~A)) -> (A & B)
The matching here wasn't able to handle all the possible commutes. It always assumed the not would be on the left of the xor, but that's not guaranteed.
Differential Revision: https://reviews.llvm.org/D32474
llvm-svn: 301316
Alex Lorenz [Tue, 25 Apr 2017 15:13:42 +0000 (15:13 +0000)]
[index] Index type source info for class specializations
rdar://
31758344
llvm-svn: 301315
Simon Pilgrim [Tue, 25 Apr 2017 15:10:47 +0000 (15:10 +0000)]
[SelectionDAG] Use getBuildVector helper where possible. NFCI
llvm-svn: 301314
Dylan McKay [Tue, 25 Apr 2017 15:09:04 +0000 (15:09 +0000)]
[AVR] Support the LDWRdPtr instruction with the same Src+Dst register
llvm-svn: 301313
Andrew Ng [Tue, 25 Apr 2017 14:36:01 +0000 (14:36 +0000)]
Revert "[DebugInfo][X86] Fix handling of DBG_VALUE's in post-RA scheduler."
This reverts commit r301309 which is causing buildbot assertion failures.
llvm-svn: 301312
Daniel Sanders [Tue, 25 Apr 2017 14:27:27 +0000 (14:27 +0000)]
Bring back the ability opt out of padding zero-byte functions by not providing a nop instruction.
Summary: No test case since I'm not aware of an in-tree target that needs this.
Reviewers: hans
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32398
llvm-svn: 301311
Alex Lorenz [Tue, 25 Apr 2017 14:22:29 +0000 (14:22 +0000)]
[index] Record the 'SpecializationOf' relation for function specializations
rdar://
31603531
llvm-svn: 301310
Andrew Ng [Tue, 25 Apr 2017 13:39:49 +0000 (13:39 +0000)]
[DebugInfo][X86] Fix handling of DBG_VALUE's in post-RA scheduler.
This patch fixes a bug with the updating of DBG_VALUE's in
BreakAntiDependencies. Previously, it would only attempt to update the first
DBG_VALUE following the instruction whose register is being changed,
potentially leaving DBG_VALUE's referring to the wrong register. Now the code
will update all DBG_VALUE's that immediately follow the instruction.
This issue was detected as a result of an optimized codegen difference with
"-g" where an X86 byte/word fixup was not performed due to a DBG_VALUE
referencing the wrong register.
Differential Revision: https://reviews.llvm.org/D31755
llvm-svn: 301309
Simon Pilgrim [Tue, 25 Apr 2017 13:39:07 +0000 (13:39 +0000)]
[SelectionDAG] Pull out repeated getValueType calls. NFCI.
Noticed in D32391.
llvm-svn: 301308
Nitesh Jain [Tue, 25 Apr 2017 13:25:40 +0000 (13:25 +0000)]
[Compiler-rt][MIPS] Fix assert introduce with commit rl301171.
llvm-svn: 301307
Pavel Labath [Tue, 25 Apr 2017 12:58:49 +0000 (12:58 +0000)]
Remove the home-grown android toolchain file and all references to it
Summary:
The toolchain file has been deprecated in favor of the "official"
toolchain file present in the Android NDK. Also update the web
build instructions to reflect this.
Reviewers: eugene
Subscribers: srhines, mgorny, dgross, tberghammer, lldb-commits
Differential Revision: https://reviews.llvm.org/D32441
llvm-svn: 301306
Simon Pilgrim [Tue, 25 Apr 2017 12:40:45 +0000 (12:40 +0000)]
[DAGCombiner] Add vector support for (srl (trunc (srl x, c1)), c2) combine.
llvm-svn: 301305
Andrew Ng [Tue, 25 Apr 2017 12:36:14 +0000 (12:36 +0000)]
[SimplifyLibCalls] Fix infinite loop with fast-math optimization.
One of the fast-math optimizations is to replace calls to standard double
functions with their float equivalents, e.g. exp -> expf. However, this can
cause infinite loops for the following:
float expf(float val) { return (float) exp((double) val); }
A similar inline declaration exists in the MinGW-w64 math.h header file which
when compiled with -O2/3 and fast-math generates infinite loops.
So this fix checks that the calling function to the standard double function
that is being replaced does not match the float equivalent.
Differential Revision: https://reviews.llvm.org/D31806
llvm-svn: 301304
Simon Pilgrim [Tue, 25 Apr 2017 12:29:07 +0000 (12:29 +0000)]
[SelectionDAG] Recognise splat vector isKnownToBeAPowerOfTwo one/sign bit shift cases.
llvm-svn: 301303
Ismail Donmez [Tue, 25 Apr 2017 11:24:14 +0000 (11:24 +0000)]
Fix fuzzer.c test on platforms where CLANG_DEFAULT_CXX_STDLIB is libc++
llvm-svn: 301302
Michael Kruse [Tue, 25 Apr 2017 10:57:32 +0000 (10:57 +0000)]
[DeLICM] Use Known information when comparing Existing.Occupied and Proposed.Occupied.
Do not conflict if the value of Existing and Proposed are the same.
This change only affects unit tests, but no functional changes are
expected on LLVM-IR, as no Known information is yet extracted and
consequently this functionality is only triggered through unit tests.
Differential Revision: https://reviews.llvm.org/D32025
llvm-svn: 301301
Simon Pilgrim [Tue, 25 Apr 2017 10:47:35 +0000 (10:47 +0000)]
[DAGCombiner] Use SDValue::getConstantOperandVal helper where possible. NFCI.
llvm-svn: 301300
Siddharth Bhat [Tue, 25 Apr 2017 08:08:29 +0000 (08:08 +0000)]
[PPCGCodeGeneration] Update PPCG Code Generation for OpenCL compatibility
Added a small change to the way pointer arguments are set in the kernel
code generation. The way the pointer is retrieved now, specifically requests
global address space to be annotated. This is necessary, if the IR should be
run through NVPTX to generate OpenCL compatible PTX.
The changes do not affect the PTX Strings generated for the CUDA target
(nvptx64-nvidia-cuda), but are necessary for OpenCL (nvptx64-nvidia-nvcl).
Additionally, the data layout has been updated to what the NVPTX Backend requests/recommends.
Contributed-by: Philipp Schaad
Reviewers: Meinersbur, grosser, bollu
Reviewed By: grosser, bollu
Subscribers: jlebar, pollydev, llvm-commits, nemanjai, yaxunl, Anastasia
Tags: #polly
Differential Revision: https://reviews.llvm.org/D32215
llvm-svn: 301299
Sanjoy Das [Tue, 25 Apr 2017 06:53:25 +0000 (06:53 +0000)]
[IVUsers] Don't bail out of normalizing non-affine add recs
Summary:
In a previous change I changed SCEV's normalization / denormalization
to work with non-affine add recs. So the bailout in IVUsers can be
removed.
Reviewers: atrick, efriedma
Reviewed By: atrick
Subscribers: davide, mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D32105
llvm-svn: 301298
Craig Topper [Tue, 25 Apr 2017 06:47:49 +0000 (06:47 +0000)]
[InstCombine] Add test cases for missing commute handling in ((A ^ C) ^ B) & (B ^ A) -> (B ^ A) & ~C
llvm-svn: 301297
Craig Topper [Tue, 25 Apr 2017 06:22:17 +0000 (06:22 +0000)]
[InstCombine] Add test cases showing failures to handle commuted patterns after tricking the operand complexity sorting.
llvm-svn: 301296
Nitesh Jain [Tue, 25 Apr 2017 06:12:59 +0000 (06:12 +0000)]
[LLDB][MIPS] Fix typo in TestStepOverWatchpoint.py.
Subscribers: jaydeep, bhushan, lldb-commits, slthakur
llvm-svn: 301295
Craig Topper [Tue, 25 Apr 2017 06:02:11 +0000 (06:02 +0000)]
[InstCombine] Use commutable matchers to reduce some code. NFC
llvm-svn: 301294
Gil Rapaport [Tue, 25 Apr 2017 05:57:22 +0000 (05:57 +0000)]
[LV] Remove redundant basic block split
This patch is part of D28975's breakdown.
Genreating the control-flow to guard predicated instructions modified to
only use SplitBlockAndInsertIfThen() for producing the if-then construct.
Differential Revision: https://reviews.llvm.org/D32224
llvm-svn: 301293
Serge Guelton [Tue, 25 Apr 2017 05:45:37 +0000 (05:45 +0000)]
Update doc of the variadic version of getOrInsertFunction
It no longer needs a null terminator.
llvm-svn: 301292
Xinliang David Li [Tue, 25 Apr 2017 04:51:19 +0000 (04:51 +0000)]
[CodeExtractor]: Fixup use refs of the old phi.
Differential Revision: http://reviews.llvm.org/D32468
llvm-svn: 301291
Rui Ueyama [Tue, 25 Apr 2017 04:44:54 +0000 (04:44 +0000)]
Define __tls_get_addr as a hidden symbol even for ARM or MIPS.
addIgnored defines a given symbol even if there is no existing
symbol with the same name. So, even if libc provides __tls_get_addr,
we should still be able to call addIgnored.
Differential Revision: https://reviews.llvm.org/D32053
llvm-svn: 301290
Akira Hatanaka [Tue, 25 Apr 2017 04:06:35 +0000 (04:06 +0000)]
[ObjCARC] Do not sink an objc_retain past a clang.arc.use.
We need to do this to prevent a miscompile which sinks an objc_retain
past an objc_release that releases the object objc_retain retains. This
happens because the top-down and bottom-up traversals each determines
the insert point for retain or release individually without knowing
where the other instruction is moved.
For example, when the following IR is fed to the ARC optimizer, the
top-down traversal decides to insert objc_retain right before
objc_release and the bottom-up traversal decides to insert objc_release
right after clang.arc.use.
(IR before ARC optimizer)
%11 = call i8* @objc_retain(i8* %10)
call void (...) @clang.arc.use(%0* %5)
call void @llvm.dbg.value(...)
call void @objc_release(i8* %6)
This reverses the order of objc_release and objc_retain, which causes
the object to be destructed prematurely.
(IR after ARC optimizer)
call void (...) @clang.arc.use(%0* %5)
call void @objc_release(i8* %6)
call void @llvm.dbg.value(...)
%11 = call i8* @objc_retain(i8* %10)
rdar://problem/
30530580
llvm-svn: 301289
Davide Italiano [Tue, 25 Apr 2017 03:48:47 +0000 (03:48 +0000)]
[SimplifyLibCalls] Remove a cl::opt that's been `true` for a long time.
llvm-svn: 301288
Rui Ueyama [Tue, 25 Apr 2017 03:31:10 +0000 (03:31 +0000)]
Add comments about Widnows .reloc section.
llvm-svn: 301287
Rui Ueyama [Tue, 25 Apr 2017 03:30:50 +0000 (03:30 +0000)]
Do not create temporary files in the main source tree.
llvm-svn: 301286
Richard Smith [Tue, 25 Apr 2017 00:40:40 +0000 (00:40 +0000)]
Placate MSVC's narrowing conversion unhappiness.
llvm-svn: 301285
Michael Kruse [Tue, 25 Apr 2017 00:30:42 +0000 (00:30 +0000)]
[unittests] Derive Occupied from Unused when given.
When both, OccupiedAndKnown and Unused are given, use the former only
for the Known values. The relation Unused \union Occupied must always
hold.
This allows us to specify Known independently of Occupied. It is needed
for an artificial test case in https://reviews.llvm.org/D32025.
llvm-svn: 301284
Michael Kruse [Tue, 25 Apr 2017 00:30:32 +0000 (00:30 +0000)]
[unittests] Add postcondition to completeLifetime.
llvm-svn: 301283
Rui Ueyama [Tue, 25 Apr 2017 00:15:48 +0000 (00:15 +0000)]
Export __progname even if a -dynamic-list is given.
BSD's __progname symbol is defined in crt1.o and linked against main
executables. The libc expects that main executables export __progname
symbol via .dynsym sections. In order to handle this case, we scan
undefined symbols in DSOs and exported them by setting Sym->ExportDynamic
to true.
But it turned out that setting that variable is not enough to make sure
that symbols are exported in all use cases. If a -dynamic-list option is
given, all symbols not explicitly mentioned in a version script are
hidden by default. That hides __progname symbol. This patch fixes the issue.
Fixes https://bugs.llvm.org/show_bug.cgi?id=32703
llvm-svn: 301282
Sanjoy Das [Tue, 25 Apr 2017 00:09:19 +0000 (00:09 +0000)]
Teach SCEV normalization to de/normalize non-affine add recs
Summary:
Before this change, SCEV Normalization would incorrectly normalize
non-affine add recurrences. To work around this there was (still is)
a check in place to make sure we only tried to normalize affine add
recurrences.
We recently found a bug in aforementioned check to bail out of
normalizing non-affine add recurrences. However, instead of fixing
the bailout, I have decided to teach SCEV normalization to work
correctly with non-affine add recurrences, making the bailout
unnecessary (I'll remove it in a subsequent change).
I've also added some unit tests (which would have failed before this
change).
Reviewers: atrick, sunfish, efriedma
Reviewed By: atrick
Subscribers: mcrosier, mzolotukhin, llvm-commits
Differential Revision: https://reviews.llvm.org/D32104
llvm-svn: 301281
Sean Callanan [Mon, 24 Apr 2017 23:58:36 +0000 (23:58 +0000)]
Name the C++ source files for two tests correctly.
llvm-svn: 301280
Rui Ueyama [Mon, 24 Apr 2017 23:51:18 +0000 (23:51 +0000)]
Replace a binary .so with a text .s.
Since LLD is now able to take version scripts, we no longer
have to keep a pre-generated binary file for a test.
llvm-svn: 301279
Rui Ueyama [Mon, 24 Apr 2017 23:50:58 +0000 (23:50 +0000)]
Remove a useless temporary variable.
llvm-svn: 301278
Sean Callanan [Mon, 24 Apr 2017 23:49:06 +0000 (23:49 +0000)]
Fixed two bad Makefiles that might be breaking Linux.
llvm-svn: 301277
Matt Arsenault [Mon, 24 Apr 2017 23:42:41 +0000 (23:42 +0000)]
InferAddressSpaces: Use reference arguments instead of pointers
llvm-svn: 301276
Eugene Zelenko [Mon, 24 Apr 2017 23:21:38 +0000 (23:21 +0000)]
[Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 301275
Hans Wennborg [Mon, 24 Apr 2017 23:16:49 +0000 (23:16 +0000)]
Revert r301089 "[builtins] Implement emulated TLS on Windows."
This broke the self-host build on Windows (PR32777).
Original commit message:
> [builtins] Implement emulated TLS on Windows.
>
> Summary:
> LLVM JIT needs to be able to use emulated TLS on all platforms, and this provides a reference one can compile to enable emutls for Linux/Mac/Windows.
>
> Reviewers: chh, howard.hinnant
>
> Reviewed By: chh
>
> Subscribers: mgorny, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D30787
llvm-svn: 301274
Sean Callanan [Mon, 24 Apr 2017 23:14:04 +0000 (23:14 +0000)]
[Expression parser] Return both types and variables
Many times a user wants to access a type when there's a variable of
the same name, or a variable when there's a type of the same name.
Depending on the precise context, currently the expression parser
can fail to resolve one or the other.
This is because ClangExpressionDeclMap has logic to limit the
amount of information it searches, and that logic sometimes cuts
down the search prematurely. This patch removes some of those early
exits.
In that sense, this patch trades performance (early exit is faster)
for correctness.
I've also included two new test cases showing examples of this
behavior – as well as modifying an existing test case that gets it
wrong.
llvm-svn: 301273
Reid Kleckner [Mon, 24 Apr 2017 23:13:47 +0000 (23:13 +0000)]
[asan] Fix Windows global dead stripping tests
Pass /Gw to clang-cl which is equivalent to -fdata-sections. This is now
necessary.
llvm-svn: 301272
Richard Smith [Mon, 24 Apr 2017 23:12:30 +0000 (23:12 +0000)]
[modules ts] Diagnose 'export' declarations outside of a module interface.
llvm-svn: 301271
Matt Arsenault [Mon, 24 Apr 2017 23:02:57 +0000 (23:02 +0000)]
InferAddressSpaces: Remove redundant assert
This is just asserting all the operations are handled in the
switch, which the unreachable already handles.
llvm-svn: 301270
Sanjay Patel [Mon, 24 Apr 2017 22:42:34 +0000 (22:42 +0000)]
[ARM, x86] add more vector tests for bool math; NFC
I'm proposing a fold for increment-of-sexted-bool in:
https://reviews.llvm.org/D31944
...so we need to know what happens in more cases like these.
llvm-svn: 301269
Reid Kleckner [Mon, 24 Apr 2017 22:26:46 +0000 (22:26 +0000)]
[git-llvm] Remove CR from middle of svn propget output
llvm-svn: 301268
Reid Kleckner [Mon, 24 Apr 2017 22:25:02 +0000 (22:25 +0000)]
Make getSlotAttributes return an AttributeSet instead of a wrapper list
Remove the temporary, poorly named getSlotSet method which did the same
thing. Also remove getSlotNode, which is a hold-over from when we were
dealing with AttributeSetNode* instead of AttributeSet.
llvm-svn: 301267
Siddharth Bhat [Mon, 24 Apr 2017 22:23:12 +0000 (22:23 +0000)]
[Polly] [DependenceInfo] change WAR generation, Read will not block Read
Earlier, the call to buildFlow was:
WAR = buildFlow(Write, Read, MustWrite, Schedule).
This meant that Read could block another Read, since must-sources can
block each other.
Fixed the call to buildFlow to correctly compute Read. The resulting
code needs to do some ISL juggling to get the output we want.
Bug report: https://bugs.llvm.org/show_bug.cgi?id=32623
Reviewers: Meinersbur
Tags: #polly
Differential Revision: https://reviews.llvm.org/D32011
llvm-svn: 301266
Rafael Espindola [Mon, 24 Apr 2017 22:20:22 +0000 (22:20 +0000)]
Mark a test as requiring a shell.
llvm-svn: 301265
Rui Ueyama [Mon, 24 Apr 2017 22:20:03 +0000 (22:20 +0000)]
Handle _LINK_ env string as command line parameters.
"_LINK_" environment varaible should be appended to the command line.
https://msdn.microsoft.com/en-us/library/6y6t9esh.aspx
Fixes https://bugs.llvm.org/show_bug.cgi?id=32756
llvm-svn: 301264
Sean Callanan [Mon, 24 Apr 2017 22:11:10 +0000 (22:11 +0000)]
[DWARF] Fix lookup in the abstract origins of inlined blocks/functions
LLDB uses clang::DeclContexts for lookups, and variables get put into
the DeclContext for their abstract origin. (The abstract origin is a
DWARF pointer that indicates the unique definition of inlined code.)
When the expression parser is looking for variables, it locates the
DeclContext for the current context. This needs to be done carefully,
though, e.g.:
__attribute__ ((always_inline)) void f(int a) {
{
int b = a * 2;
}
}
void g() {
f(3);
}
Here, if we're stopped in the inlined copy of f, we have to find the
DeclContext corresponding to the definition of f – its abstract
origin. Clang doesn't allow multiple functions with the same name and
arguments to exist. It also means that any variables we see must be
placed in the appropriate DeclContext.
[Bug 1]: When stopped in an inline block, the function
GetDeclContextDIEContainingDIE for that block doesn't properly
construct a DeclContext for the abstract origin for inlined
subroutines. That means we get duplicated function DeclContexts, but
function arguments only get put in the abstract origin's DeclContext,
and as a result when we try to look for them in nested contexts they
aren't found.
[Bug 2]: When stopped in an inline block, the DWARF (for space
reasons) doesn't explicitly point to the abstract origin for that
block. This means that the function GetClangDeclContextForDIE returns
a different DeclContext for each place the block is inlined. However,
any variables defined in the block have abstract origins, so they
will only get placed in the DeclContext for their abstract origin.
In this fix, I've introduced a test covering both of these issues,
and fixed them.
Bug 1 could be resolved simply by making sure we look up the abstract
origin for inlined functions when looking up their DeclContexts on
behalf of nested blocks.
For Bug 2, I've implemented an algorithm that makes the DeclContext
for a block be the containing DeclContext for the closest entity we
would find during lookup that has an abstract origin pointer. That
means that in the following situation:
{ // block 1
int a;
{ // block 2
int b;
}
}
if we looked up the DeclContext for block 2, we'd find the block
containing the abstract origin of b, and lookup would proceed
correctly because we'd see b and a. However, in the situation
{ // block 1
int a;
{ // block 2
}
}
since there isn't anything to look up in block 2, we can't determine
its abstract origin (and there is no such pointer in the DWARF for
blocks). However, we can walk up the parent chain and find a, and its
abstract origin lives in the abstract origin of block 1. So we simply
say that the DeclContext for block 2 is the same as the DeclContext
for block 1, which contains a. Lookups will return the same results.
Thanks to Jim Ingham for review and suggestions.
Differential revision: https://reviews.llvm.org/D32375
llvm-svn: 301263
Reid Kleckner [Mon, 24 Apr 2017 22:09:08 +0000 (22:09 +0000)]
[git-llvm] Make `push` work on CRLF files with svn:eol-style=native
Summary:
`git apply` on Windows doesn't work for files that SVN checks out as
CRLF. There is no way to force SVN to check everything out with Unix
line endings on Windows. Files with svn:eol-style=native will always
come out with CRLF, breaking `git apply`, which wants Unix line endings.
My workaround is to list all files with this property set in the change,
and run `dos2unix` on them. SVN doesn't commit a massive line ending
change because the svn:eol-style property indicates that these are text
files.
Tested on r301245.
Reviewers: zturner, jlebar
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32452
llvm-svn: 301262
Bruno Cardoso Lopes [Mon, 24 Apr 2017 21:58:13 +0000 (21:58 +0000)]
[Modules] Fix test to wipe out the cache before using it
This should appease bots:
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental_check/35914
rdar://problem/
31796737
llvm-svn: 301261
Sanjay Patel [Mon, 24 Apr 2017 21:52:39 +0000 (21:52 +0000)]
[InstSimplify] use ConstantRange to simplify more and-of-icmps
We can simplify (and (icmp X, C1), (icmp X, C2)) to one of the icmps in many cases.
I had to check some of these with Alive to prove to myself it's right, but everything
seems to check out. Eg, the code in instcombine was completely ignoring predicates with
mismatched signedness.
Handling or-of-icmps would be a follow-up step.
Differential Revision: https://reviews.llvm.org/D32143
llvm-svn: 301260
Rafael Espindola [Mon, 24 Apr 2017 21:44:20 +0000 (21:44 +0000)]
Remove DefaultSoName.
We can just use the existing SoName member variable. It now initially
contains what was in DefaultSoName and is modified if the .so has an
actual soname.
llvm-svn: 301259
Simon Pilgrim [Mon, 24 Apr 2017 21:43:21 +0000 (21:43 +0000)]
[DAGCombiner] Use APInt::intersects to avoid tmp variable. NFCI.
llvm-svn: 301258
Evgeniy Stepanov [Mon, 24 Apr 2017 21:27:47 +0000 (21:27 +0000)]
[cfi] Fix wrong CMake condition for WIN32.
llvm-svn: 301257
Evgeniy Stepanov [Mon, 24 Apr 2017 21:27:45 +0000 (21:27 +0000)]
[asan] Remove asanwrapper from Android test harness.
It is only necessary for pre-L and creates problems on newer builds.
llvm-svn: 301256
Matt Arsenault [Mon, 24 Apr 2017 21:08:32 +0000 (21:08 +0000)]
AMDGPU: Slightly simplify prolog reserved register handling
Rely on MachineRegisterInfo's knowledge of used physical
registers.
Move flat_scratch initialization earlier, so the uses are visible
when making these decisions.
This will make it easier to add another reserved register
at the end for the stack pointer rather than handling another
special case.
llvm-svn: 301254
Galina Kistanova [Mon, 24 Apr 2017 21:06:29 +0000 (21:06 +0000)]
Cosmetic change.
llvm-svn: 301253
Saleem Abdulrasool [Mon, 24 Apr 2017 21:05:05 +0000 (21:05 +0000)]
ProfileData: clean up some stale declarations (NFC)
These were removed in SVN r300381. Remove the declarations.
llvm-svn: 301252
Artem Dergachev [Mon, 24 Apr 2017 20:55:07 +0000 (20:55 +0000)]
[analyzer] Improve subscripting null arrays for catching null dereferences.
Array-to-pointer cast now works correctly when the pointer to the array
is concrete, eg. null, which allows further symbolic calculations involving
such values.
Inlined defensive checks are now detected correctly when the resulting null
symbol is being array-subscripted before dereference.
Differential Revision: https://reviews.llvm.org/D32291
llvm-svn: 301251
Vedant Kumar [Mon, 24 Apr 2017 20:54:36 +0000 (20:54 +0000)]
Remove a dead field. NFC.
Suggested by Adam Folwarczny!
llvm-svn: 301250
Vedant Kumar [Mon, 24 Apr 2017 20:52:04 +0000 (20:52 +0000)]
[Coverage] Avoid null deref in skipRegionMappingForDecl (fixes PR32761)
Patch by Adam Folwarczny!
Differential Revision: https://reviews.llvm.org/D32406
llvm-svn: 301249