Aaron Ballman [Tue, 30 Oct 2018 19:23:06 +0000 (19:23 +0000)]
Silencing a -Wunused-variable warning; NFC.
llvm-svn: 345633
Petr Hosek [Tue, 30 Oct 2018 19:19:47 +0000 (19:19 +0000)]
[CMake] Check -ffreestanding as C not C++ flag
When -ffreestanding is used, main() isn't considered special and
when compiled as C++ code it'll get mangled which makes the
compilation fail since main() will be undefined so this check will
never succeed.
Differential Revision: https://reviews.llvm.org/D49332
llvm-svn: 345632
David Greene [Tue, 30 Oct 2018 19:17:51 +0000 (19:17 +0000)]
[AArch64] Create proper memoperand for multi-vector stores
Re-apply r345315 with testcase fixes.
Include all of the store's source vector operands when creating the
MachineMemOperand. Previously, we were missing the first operand,
making the store size seem smaller than it really is.
Differential Revision: https://reviews.llvm.org/D52816
llvm-svn: 345631
Aaron Ballman [Tue, 30 Oct 2018 19:06:58 +0000 (19:06 +0000)]
Fixing some build bot failures from r345628; NFC intended.
llvm-svn: 345630
Zachary Turner [Tue, 30 Oct 2018 18:57:08 +0000 (18:57 +0000)]
[NativePDB] Add support for dumping global variables of class type.
Previous patches added support for dumping global variables of
primitive types, so we now do the same for class types.
For the most part, everything just worked, there was only one
minor bug needing fixed, which was that for variables of modified
types (e.g. const, volatile, etc) we can't resolve the forward
decl in CreateAndCacheType because the PdbSymUid must point to the
LF_MODIFIER which must point to the forward decl. So when it comes
time to call CompleteType, an assert was firing because we expected
to get a class, struct, union, or enum, but we were getting an
LF_MODIFIER instead.
The other issue is that one the newly added tests is for an array
member, which was not yet supported, so we add support for that
now in this patch.
There's probably room for other interesting layout test cases
here, but this at least should test the basics.
Differential Revision: https://reviews.llvm.org/D53822
llvm-svn: 345629
Aaron Ballman [Tue, 30 Oct 2018 18:55:38 +0000 (18:55 +0000)]
Add the ability to output static analysis results to SARIF.
This allows users to specify SARIF (https://github.com/oasis-tcs/sarif-spec) as the output from the clang static analyzer so that the results can be read in by other tools, such as extensions to Visual Studio and VSCode, as well as static analyzers like CodeSonar.
llvm-svn: 345628
Kamil Rytarowski [Tue, 30 Oct 2018 18:49:19 +0000 (18:49 +0000)]
Handle NetBSD alias for pthread_sigmask
Summary:
Add a new helper macro TSAN_INTERCEPTOR_NETBSD_ALIAS_THR2
that handles pthread(3)/libc aliases in scenarios when a name in both
libraries differs not just in prefix namespace.
Handle TSan pthread_sigmask mangling accordingly into __libc_thr_sigsetmask.
Reviewers: vitalybuka, joerg
Reviewed By: vitalybuka
Subscribers: kubamracek, jfb, llvm-commits, #sanitizers, mgorny
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D53863
llvm-svn: 345627
Craig Topper [Tue, 30 Oct 2018 18:48:42 +0000 (18:48 +0000)]
[X86] In lowerVectorShuffleAsBroadcast, make peeking through CONCAT_VECTORS work correctly if we already walked through a bitcast that changed the element size.
The CONCAT_VECTORS case was using the original mask element count to determine how to adjust the broadcast index. But if we looked through a bitcast the original mask size doesn't tell us anything about the concat_vectors.
This patch switchs to using the concat_vectors input element count directly instead.
Differential Revision: https://reviews.llvm.org/D53823
llvm-svn: 345626
Calixte Denizet [Tue, 30 Oct 2018 18:41:41 +0000 (18:41 +0000)]
[GCOV] Add a test for function defined on one line (follow-up of https://reviews.llvm.org/D53600)
Summary: Add a test for coverage for function definition like void foo() { }.
Reviewers: marco-c
Reviewed By: marco-c
Subscribers: delcypher, llvm-commits, #sanitizers, sylvestre.ledru
Differential Revision: https://reviews.llvm.org/D53601
llvm-svn: 345625
Calixte Denizet [Tue, 30 Oct 2018 18:41:31 +0000 (18:41 +0000)]
[GCOV] Function counters are wrong when on one line
Summary:
After commit https://reviews.llvm.org/rL344228, the function definitions have a counter but when on one line the counter is wrong (e.g. void foo() { })
I added a test in: https://reviews.llvm.org/D53601
Reviewers: marco-c
Reviewed By: marco-c
Subscribers: llvm-commits, sylvestre.ledru
Differential Revision: https://reviews.llvm.org/D53600
llvm-svn: 345624
Nirav Dave [Tue, 30 Oct 2018 18:26:43 +0000 (18:26 +0000)]
[DAG] Add const variants for BaseIndexOffset functions.
llvm-svn: 345623
Zachary Turner [Tue, 30 Oct 2018 18:25:38 +0000 (18:25 +0000)]
Fix printing bug in pdb2yaml.
We were using the wrong enum table when mapping enum values
to strings for public symbol flags.
llvm-svn: 345622
Jonas Devlieghere [Tue, 30 Oct 2018 18:25:28 +0000 (18:25 +0000)]
[DebugInfo] Define base function on DWARFDie reverse iterators
This defines member function base on the specialization of
std::reverse_iterator for DWARFDie::iterator as required by C++
[reverse.iter.conv].
This fixes unit test DWARFDebugInfoTest.cpp under EXPENSIVE_CHECKS which
currently can't be built due to GNU C++ Library calling this member
function in debug mode.
This fixes https://llvm.org/PR38785
Patch by: Eugene Sharygin
Differential revision: https://reviews.llvm.org/D53792
llvm-svn: 345621
Kamil Rytarowski [Tue, 30 Oct 2018 18:25:12 +0000 (18:25 +0000)]
Cast the return value of _Unwind_GetIP() to uptr
This is needed for NetBSD to match the expected type in
Unwind_GetIP().
llvm-svn: 345620
Kamil Rytarowski [Tue, 30 Oct 2018 18:21:58 +0000 (18:21 +0000)]
Mark interception_failure_test with XFAIL for NetBSD
This test breaks also on FreeBSD.
llvm-svn: 345619
Ulrich Weigand [Tue, 30 Oct 2018 18:20:59 +0000 (18:20 +0000)]
[SystemZ] Simplify LRV/STRV ISD nodes
The LRV and STRV nodes carry an extra operand to indicate the
type of the memory access. This is redundant, since the nodes
are actually of class MemIntrinsicNode and therefore hold that
same information already as MemoryVT.
NFC intended.
llvm-svn: 345618
Simon Pilgrim [Tue, 30 Oct 2018 18:10:02 +0000 (18:10 +0000)]
[TTI] Fix uses of SK_ExtractSubvector shuffle costs (PR39368)
Correct costings of SK_ExtractSubvector requires the SubTy argument to indicate the type/size of the extracted subvector.
Unlike the rest of the shuffle kinds this means that the main Ty argument represents the source vector type not the destination!
I've done my best to fix a number of vectorizer uses:
SLP - the reduction epilogue costs should be using a SK_PermuteSingleSrc shuffle as these all occur at the hardware vector width - we're not extracting (illegal) subvector types. This is causing the cost model diffs as SK_ExtractSubvector costs are poorly handled and tend to just return 1 at the moment.
LV - I'm not clear on what the SK_ExtractSubvector should represents for recurrences - I've used a <1 x ?> subvector extraction as that seems to match the VF delta.
Differential Revision: https://reviews.llvm.org/D53573
llvm-svn: 345617
Volkan Keles [Tue, 30 Oct 2018 17:51:14 +0000 (17:51 +0000)]
[InstCombine] Add preliminary tests for nested min/max combines. NFC
Summary: As requested in D53774.
Reviewers: spatel
Reviewed By: spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53875
llvm-svn: 345616
Sanjay Patel [Tue, 30 Oct 2018 16:58:43 +0000 (16:58 +0000)]
[InstSimplify] add tests for fcmp folds; NFC
This is part of a problem noted in PR39475:
https://bugs.llvm.org/show_bug.cgi?id=39475
llvm-svn: 345615
Jordan Rupprecht [Tue, 30 Oct 2018 16:23:38 +0000 (16:23 +0000)]
[llvm-objcopy] Fix --keep-global-symbol/--globalize-symbol for undefined symbols.
Summary: --keep-global-symbol and --globalize-symbol don't make sense for undefined symbols, so it should be ignored for those symbols. This matches GNU objcopy behavior.
Reviewers: jhenderson, alexshap, jakehehrlich, espindola
Reviewed By: jhenderson, jakehehrlich
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D53733
llvm-svn: 345614
Sanjay Patel [Tue, 30 Oct 2018 16:21:56 +0000 (16:21 +0000)]
[InstCombine] use getFltSemantics() instead of duplicating it; NFC
llvm-svn: 345613
Fangrui Song [Tue, 30 Oct 2018 15:56:08 +0000 (15:56 +0000)]
[llvm-mca] Move namespace mca inside llvm::
Summary: This allows to remove `using namespace llvm;` in those *.cpp files
When we want to revisit the decision (everything resides in llvm::mca::*) in the future, we can move things to a nested namespace of llvm::mca::, to conceptually make them separate from the rest of llvm::mca::*
Reviewers: andreadb, mattd
Reviewed By: andreadb
Subscribers: javed.absar, tschuett, gbedwell, llvm-commits
Differential Revision: https://reviews.llvm.org/D53407
llvm-svn: 345612
Samuel Benzaquen [Tue, 30 Oct 2018 15:54:22 +0000 (15:54 +0000)]
Add more benchmarks for std::string.
Summary:
Added benchmarks for Construct, Copy, Move, Destroy, Relationals and
Read. On the ones that matter, the benchmarks tests hot and cold data,
and opaque and transparent inputs.
Reviewers: EricWF
Subscribers: christof, ldionne, libcxx-commits
Differential Revision: https://reviews.llvm.org/D53825
llvm-svn: 345611
Roman Lebedev [Tue, 30 Oct 2018 15:52:36 +0000 (15:52 +0000)]
[clang-tidy] cppcoreguidelines-macro-usage: print macro names
Summary:
The macro may not have location (or more generally, the location may not exist),
e.g. if it originates from compiler's command-line.
The check complains on all the macros, even those without the location info.
Which means, it only says it does not like it. What is 'it'? I have no idea.
If we don't print the name, then there is no way to deal with that situation.
And in general, not printing name here forces the user to try to understand,
given, the macro definition location, what is the macro name?
This isn't fun.
Also, ignores-by-default the macros originating from command-line,
with an option to not ignore those.
I suspect some more issues may crop up later.
Reviewers: JonasToth, aaron.ballman, hokein, xazax.hun, alexfh
Reviewed By: JonasToth, aaron.ballman
Subscribers: nemanjai, kbarton, rnkovacs, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D53817
llvm-svn: 345610
Alexey Bataev [Tue, 30 Oct 2018 15:50:12 +0000 (15:50 +0000)]
[OPENMP] Support for mapping of the lambdas in target regions.
Added support for mapping of lambdas in the target regions. It scans all
the captures by reference in the lambda, implicitly maps those variables
in the target region and then later reinstate the addresses of
references in lambda to the correct addresses of the captured|privatized
variables.
llvm-svn: 345609
Alexey Bataev [Tue, 30 Oct 2018 15:42:12 +0000 (15:42 +0000)]
[LIBOMPTARGET] Add support for mapping of lambda captures.
Summary:
Added support for correct mapping of variables captured by reference in
lambdas. That kind of mapping may appear only in target-executable
regions and must follow the original lambda or another lambda capture
for the same lambda.
The expected data: base address - the address of the lambda, begin
pointer - pointer to the address of the lambda capture, size - size of
the captured variable.
When OMP_TGT_MAPTYPE_PTR_AND_OBJ mapping type is seen in
target-executable region, the target address of the last processed item
is taken as the address of the original lambda `tgt_lambda_ptr`. Then,
the pointer to capture on the device is calculated like `tgt_lambda_ptr
+ (host_begin_pointer - host_begin_base)` and the target-based address
of the original variable (which host address is
`*(void**)begin_pointer`) is written to that pointer.
Reviewers: kkwli0, gtbercea, grokos
Subscribers: openmp-commits
Differential Revision: https://reviews.llvm.org/D51107
llvm-svn: 345608
Sanjay Patel [Tue, 30 Oct 2018 15:26:39 +0000 (15:26 +0000)]
[InstCombine] try to turn shuffle into insertelement
shuffle (insert ?, Scalar, IndexC), V1, Mask --> insert V1, Scalar, IndexC'
The motivating case is at least a couple of steps away: I noticed that
SLPVectorizer does not analyze shuffles as well as sequences of
insert/extract in PR34724:
https://bugs.llvm.org/show_bug.cgi?id=34724
...so SLP may fail to vectorize when source code has shuffles to start
with or instcombine has converted insert/extract to shuffles.
Independent of that, an insertelement is always a simpler op for IR
analysis vs. a shuffle, so we should transform to insert when possible.
I don't think there's any codegen concern here - if a target can't insert
a scalar directly to some fixed element in a vector (x86?), then this
should get expanded to the insert+shuffle that we started with.
Differential Revision: https://reviews.llvm.org/D53507
llvm-svn: 345607
Jonas Paulsson [Tue, 30 Oct 2018 15:04:40 +0000 (15:04 +0000)]
[SchedModel] Fix for read advance cycles with implicit pseudo operands.
The SchedModel allows the addition of ReadAdvances to express that certain
operands of the instructions are needed at a later point than the others.
RegAlloc may add pseudo operands that are not part of the instruction
descriptor, and therefore cannot have any read advance entries. This meant
that in some cases the desired read advance was nullified by such a pseudo
operand, which still had the original latency.
This patch fixes this by making sure that such pseudo operands get a zero
latency during DAG construction.
Review: Matthias Braun, Ulrich Weigand.
https://reviews.llvm.org/D49671
llvm-svn: 345606
Bruno Ricci [Tue, 30 Oct 2018 14:40:49 +0000 (14:40 +0000)]
[AST] Only store data for the NRVO candidate in ReturnStmt if needed
Only store the NRVO candidate if needed in ReturnStmt.
A good chuck of all of the ReturnStmt have no NRVO candidate
(more than half when parsing all of Boost). For all of them
this saves one pointer. This has no impact on children().
Differential Revision: https://reviews.llvm.org/D53716
Reviewed By: rsmith
llvm-svn: 345605
Sean Fertile [Tue, 30 Oct 2018 14:37:17 +0000 (14:37 +0000)]
[PPC64] Handle powerpc64 in OUTPUT_FORMAT.
Differential Revision: https://reviews.llvm.org/D53652
llvm-svn: 345604
Jonas Paulsson [Tue, 30 Oct 2018 14:34:15 +0000 (14:34 +0000)]
[LoopVectorizer] Fix for cost values of memory accesses.
This commit is a combination of two patches:
* "Fix in getScalarizationOverhead()"
If target returns false in TTI.prefersVectorizedAddressing(), it means the
address registers will not need to be extracted. Therefore, there should
be no operands scalarization overhead for a load instruction.
* "Don't pass the instruction pointer from getMemInstScalarizationCost."
Since VF is always > 1, this is a cost query for an instruction in the
vectorized loop and it should not be evaluated within the scalar
context of the instruction.
Review: Ulrich Weigand, Hal Finkel
https://reviews.llvm.org/D52351
https://reviews.llvm.org/D52417
llvm-svn: 345603
Sanjay Patel [Tue, 30 Oct 2018 14:14:34 +0000 (14:14 +0000)]
[DAGCombiner] narrow vector binops when extraction is cheap
Narrowing vector binops came up in the demanded bits discussion in D52912.
I don't think we're going to be able to do this transform in IR as a canonicalization
because of the risk of creating unsupported widths for vector ops, but we already have
a DAG TLI hook to allow what I was hoping for: isExtractSubvectorCheap(). This is
currently enabled for x86, ARM, and AArch64 (although only x86 has existing regression
test diffs).
This is artificially limited to not look through bitcasts because there are so many
test diffs already, but that's marked with a TODO and is a small follow-up.
Differential Revision: https://reviews.llvm.org/D53784
llvm-svn: 345602
Diogo N. Sampaio [Tue, 30 Oct 2018 13:59:21 +0000 (13:59 +0000)]
[FIX][AArch64] Add support for UDF instruction
Fix: Simplify test files from rL345581 failing
in windows bots.
llvm-svn: 345601
Kamil Rytarowski [Tue, 30 Oct 2018 13:58:45 +0000 (13:58 +0000)]
Disable ASan test asan_and_llvm_coverage_test for NetBSD
Right now the LLVM profile feature is turned off for this OS.
llvm-svn: 345600
Kamil Rytarowski [Tue, 30 Oct 2018 13:49:15 +0000 (13:49 +0000)]
Adapt ASan test heavy_uar_test for NetBSD
The stack size is tight for the main thread in multithread
environment and follow the FreeBSD approach of reducing stack
usage.
llvm-svn: 345599
Sanjay Patel [Tue, 30 Oct 2018 13:47:19 +0000 (13:47 +0000)]
[SelectionDAG] fix build warning for mismatched signs in compare; NFC
llvm-svn: 345598
Bruno Ricci [Tue, 30 Oct 2018 13:42:41 +0000 (13:42 +0000)]
[AST] Only store the needed data in WhileStmt
Don't store the data for the condition variable if not needed.
This cuts the size of WhileStmt by up to a pointer.
The order of the children is kept the same.
Differential Revision: https://reviews.llvm.org/D53715
Reviewed By: rjmccall
llvm-svn: 345597
Jonas Paulsson [Tue, 30 Oct 2018 13:41:03 +0000 (13:41 +0000)]
[SystemZ] Improve isFoldableLoad() for Sub, SDiv and UDiv.
Sub, SDiv and UDiv are not commutative, so only the RHS operand can fold a
load. This patch adds a check for this.
Review: Ulrich Weigand
https://reviews.llvm.org/D53791
llvm-svn: 345596
Kamil Rytarowski [Tue, 30 Oct 2018 13:28:32 +0000 (13:28 +0000)]
Mark breaking TSan tests on NetBSD with XFAIL
Failing tests:
- dtls
- ignored-interceptors-mmap
- mutex_lock_destroyed
llvm-svn: 345595
Roman Lebedev [Tue, 30 Oct 2018 12:37:16 +0000 (12:37 +0000)]
[clang] Move two utility functions into SourceManager
Summary: So we can keep that not-so-great logic in one place.
Reviewers: rsmith, aaron.ballman
Reviewed By: rsmith
Subscribers: nemanjai, kbarton, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D53837
llvm-svn: 345594
Francis Visoiu Mistrih [Tue, 30 Oct 2018 12:20:17 +0000 (12:20 +0000)]
[X86] Re-enable the machine verifier after fixing more tests
Was disabled again in r345528. Hopefully this the bots.
llvm-svn: 345593
Diogo N. Sampaio [Tue, 30 Oct 2018 12:19:55 +0000 (12:19 +0000)]
[FIX][AArch64] lld test change
Adding AArch64 UDF, in rL345581,
breaks some lld test files, due
different decoding
llvm-svn: 345592
Francis Visoiu Mistrih [Tue, 30 Oct 2018 12:18:33 +0000 (12:18 +0000)]
[CodeGen] Disable the machine verifier on a ThinLTO test
This allows us to turn the machine verifier on by default on X86.
llvm-svn: 345591
Kadir Cetinkaya [Tue, 30 Oct 2018 12:13:27 +0000 (12:13 +0000)]
[clangd] Use thread pool for background indexing.
Reviewers: sammccall, ioeric
Reviewed By: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, jfb, cfe-commits
Differential Revision: https://reviews.llvm.org/D53651
llvm-svn: 345590
Francis Visoiu Mistrih [Tue, 30 Oct 2018 12:07:18 +0000 (12:07 +0000)]
[llc] Error out when -print-machineinstrs is used with an unknown pass
We used to assert instead of reporting an error.
PR39494
llvm-svn: 345589
James Henderson [Tue, 30 Oct 2018 11:52:47 +0000 (11:52 +0000)]
[llvm-size] Reject unknown radix values
This addresses https://bugs.llvm.org/show_bug.cgi?id=39403 by making
-radix an enumeration option with 8, 10, and 16 as the only accepted
values.
Reviewed by: jhenderson, MaskRay
Differential Revision: https://reviews.llvm.org/D53799
Patch by Eugene Sharygin
llvm-svn: 345588
Diogo N. Sampaio [Tue, 30 Oct 2018 11:39:33 +0000 (11:39 +0000)]
[FIX][AArch64] Add support for UDF instruction
Fix wrong test files submited
in rL345581
llvm-svn: 345587
Kamil Rytarowski [Tue, 30 Oct 2018 11:34:36 +0000 (11:34 +0000)]
Cleanup includes in sanitizer_platform_limits_netbsd.cc
Sort the headers more correctly according to NetBSD style.
Prevent in this code part clang-format, as shuffling the order
will cause build failures.
llvm-svn: 345586
Nicola Zaghen [Tue, 30 Oct 2018 11:15:04 +0000 (11:15 +0000)]
[SROA] Use offset sizes from the DataLayout instead of the pointer siezes.
This fixes an assertion when constant folding a GEP when the part of the offset
was in i32 (IndexSize, as per DataLayout) and part in the i64 (PointerSize) in
the newly created test case.
Differential Revision: https://reviews.llvm.org/D52609
llvm-svn: 345585
Roman Lebedev [Tue, 30 Oct 2018 11:12:34 +0000 (11:12 +0000)]
[X86][BMI1] X86DAGToDAGISel: select BEXTR from x & (-1 >> (32 - y)) pattern
Summary:
The final pattern.
There is no test changes:
* We are looking for the pattern with one-use of it's mask,
* If the mask is one-use, D48768 will unfold it into pattern d.
* Thus, the tests have extra-use on the mask.
* Thus, only the BMI2 BZHI can be tested, and it already worked.
* So there is no BMI1 test coverage, we just assume it works since it uses the same codepath.
Reviewers: craig.topper, RKSimon
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53575
llvm-svn: 345584
Roman Lebedev [Tue, 30 Oct 2018 11:12:29 +0000 (11:12 +0000)]
[X86] Add extra-uses on the mask of pattern c of extract-{low,}bits.ll tests
Summary:
Because of the D48768, that pattern is always unfolded into pattern d,
thus we had no test coverage.
Reviewers: RKSimon, craig.topper
Reviewed By: craig.topper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53574
llvm-svn: 345583
Kamil Rytarowski [Tue, 30 Oct 2018 11:10:36 +0000 (11:10 +0000)]
Regenerate syscall hooks for NetBSD 8.99.25
Register new syscall getsockopt2.
Drop removed syscalls pmc_get_info and pmc_control.
While there address compiler warnings about potentially
unused variables.
llvm-svn: 345582
Diogo N. Sampaio [Tue, 30 Oct 2018 11:06:50 +0000 (11:06 +0000)]
[AArch64] Add support for UDF instruction
Summary: Add support for AArch64 UDF instruction.
UDF - Permanently Undefined generates an Undefined
Instruction exception (ESR_ELx.EC =
0b000000).
Reviewers: DavidSpickett, javed.absar, t.p.northover
Reviewed By: javed.absar
Subscribers: nhaehnle, kristof.beyls
Differential Revision: https://reviews.llvm.org/D53319
llvm-svn: 345581
Kamil Rytarowski [Tue, 30 Oct 2018 11:03:37 +0000 (11:03 +0000)]
Update generate_netbsd_syscalls.awk for NetBSD 8.99.25
Register new syscall getsockopt2.
Drop removed syscalls pmc_get_info and pmc_control.
While there address compiler warnings about potentially
unused variables.
llvm-svn: 345580
James Henderson [Tue, 30 Oct 2018 10:55:14 +0000 (10:55 +0000)]
[ELF][PPC64]Workaround bogus Visual Studio build warning
Visual Studio has a bug where it converts the integer literal
2147483648
into an unsigned int instead of a long long (i.e. it follows C89 rules).
The bug has been reported as:
https://developercommunity.visualstudio.com/content/problem/141813/-
2147483648-c4146-error.html.
Because of this bug, we were getting a signed/unsigned comparison
warning in VS2015 from the old code (the subsequent unary negation had
no effect on the type).
Reviewed by: sfertile
Differential Revision: https://reviews.llvm.org/D53821
llvm-svn: 345579
Simon Pilgrim [Tue, 30 Oct 2018 10:32:11 +0000 (10:32 +0000)]
[SelectionDAG] Add FoldBUILD_VECTOR to simplify new BUILD_VECTOR nodes
Similar to FoldCONCAT_VECTORS, this patch adds FoldBUILD_VECTOR to simplify cases that can avoid the creation of the BUILD_VECTOR - if all the operands are UNDEF or if the BUILD_VECTOR simplifies to a copy.
This exposed an assumption in some AMDGPU code that getBuildVector was guaranteed to be a BUILD_VECTOR node that I've tried to handle.
Differential Revision: https://reviews.llvm.org/D53760
llvm-svn: 345578
Aleksandr Urakov [Tue, 30 Oct 2018 10:07:08 +0000 (10:07 +0000)]
[x86] Fix issues with a realigned stack in MSVC compiled applications
Summary:
This patch fixes issues with a stack realignment.
MSVC maintains two frame pointers (`ebx` and `ebp`) for a realigned stack - one
is used for access to function parameters, while another is used for access to
locals. To support this the patch:
- adds an alternative frame pointer (`ebx`);
- considers stack realignment instructions (e.g. `and esp, -32`);
- along with CFA (Canonical Frame Address) which point to the position next to
the saved return address (or to the first parameter on the stack) introduces
AFA (Aligned Frame Address) which points to the position of the stack pointer
right after realignment. AFA is used for access to registers saved after the
realignment (see the test);
Here is an example of the code with the realignment:
```
struct __declspec(align(256)) OverAligned {
char c;
};
void foo(int foo_arg) {
OverAligned oa_foo = { 1 };
auto aaa_foo = 1234;
}
void bar(int bar_arg) {
OverAligned oa_bar = { 2 };
auto aaa_bar = 5678;
foo(1111);
}
int main() {
bar(2222);
return 0;
}
```
and here is the `bar` disassembly:
```
push ebx
mov ebx, esp
sub esp, 8
and esp, -100h
add esp, 4
push ebp
mov ebp, [ebx+4]
mov [esp+4], ebp
mov ebp, esp
sub esp, 200h
mov byte ptr [ebp-200h], 2
mov dword ptr [ebp-4], 5678
push 1111 ; foo_arg
call j_?foo@@YAXH@Z ; foo(int)
add esp, 4
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
retn
```
Reviewers: labath, zturner, jasonmolenda, stella.stamenova
Reviewed By: jasonmolenda
Subscribers: abidh, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D53435
llvm-svn: 345577
Takuto Ikuta [Tue, 30 Oct 2018 09:42:49 +0000 (09:42 +0000)]
Remove trailing space from clang/Basic/LangOptions.h
llvm-svn: 345576
David Bolvansky [Tue, 30 Oct 2018 09:07:22 +0000 (09:07 +0000)]
[DAGCombiner] Improve X div/rem Y fold if single bit element type
Summary: Tests by @spatel, thanks
Reviewers: spatel, RKSimon
Reviewed By: spatel
Subscribers: sdardis, atanasyan, llvm-commits, spatel
Differential Revision: https://reviews.llvm.org/D52668
llvm-svn: 345575
Kamil Rytarowski [Tue, 30 Oct 2018 08:51:34 +0000 (08:51 +0000)]
Handle pthread_sigmask in DemangleFunctionName()
Translate __libc_thr_sigsetmask to pthread_sigmask on NetBSD.
llvm-svn: 345574
Bjorn Pettersson [Tue, 30 Oct 2018 08:49:26 +0000 (08:49 +0000)]
[OPENMP] Fix for "error: unused variable 'CED'"
Quick fix to make code compile with -Werror,-Wunused-variable.
llvm-svn: 345573
Kamil Rytarowski [Tue, 30 Oct 2018 08:32:47 +0000 (08:32 +0000)]
Drop now hidden ioctl(2) operations for NetBSD
POWER_IOC_GET_TYPE_WITH_LOSSAGE is no longer accessible from userland.
llvm-svn: 345572
Kamil Rytarowski [Tue, 30 Oct 2018 08:16:14 +0000 (08:16 +0000)]
Handle NetBSD symbol mangling for tzset
Native code generated on NetBSD mangles tzet to __tzset50.
Handle this accordingly in MSan.
llvm-svn: 345571
Kamil Rytarowski [Tue, 30 Oct 2018 08:06:42 +0000 (08:06 +0000)]
Handle NetBSD symbol mangling for nanosleep and vfork
Summary:
Native code generated on NetBSD mangles:
- vfork into __vfork14
- nanosleep into __nanosleep50
Handle this accordingly in TSan.
Reviewers: vitalybuka, dvyukov, joerg
Reviewed By: vitalybuka
Subscribers: kubamracek, llvm-commits, #sanitizers, mgorny
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D53806
llvm-svn: 345570
Saleem Abdulrasool [Tue, 30 Oct 2018 06:29:28 +0000 (06:29 +0000)]
Utility: fix cross-compilation from Linux to Windows
Only attempt to link against Backtrace if it is found. Without this,
trying to cross-compile to Windows would try to link against
"Backtrace_LIBRARY-NOTFOUND.lib".
llvm-svn: 345569
Dean Michael Berris [Tue, 30 Oct 2018 04:35:48 +0000 (04:35 +0000)]
[XRay] Migrate FDR runtime to use refactored controller
Summary:
This change completes the refactoring of the FDR runtime to support the
following:
- Generational buffer management.
- Centralised and well-tested controller implementation.
In this change we've had to:
- Greatly simplify the code in xray_fdr_logging.cc to only implement the
glue code for calling into the controller.
- Implement the custom and typed event logging functions in the
FDRLogWriter.
- Imbue the `XRAY_NEVER_INSTRUMENT` attribute onto all functions in the
controller implementation.
Reviewers: mboerger, eizan, jfb
Subscribers: jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D53858
llvm-svn: 345568
Craig Topper [Tue, 30 Oct 2018 03:27:15 +0000 (03:27 +0000)]
[LegalizeTypes] Teach PromoteIntRes_BITCAST to better handle a bitcast with vector output type and a vector input type that needs to be widened
Summary: Previously if we had a bitcast vector output type that needs promotion and a vector input type that needs widening we would just do a stack store and load to handle the conversion. We can do a little better if we can widen the bitcast to a legal vector type the same size as the widened input type. Then we can do the bitcast between this widened type and the widened input type. Afterwards we can extract_subvector back to the original output and any_extend that. Type legalization will then circle back and handle promotion of the extract_subvector and the any_extend will just be removed. This will avoid going through the stack and allows us to remove a custom version of this legalization from X86.
Reviewers: efriedma, RKSimon
Reviewed By: efriedma
Subscribers: javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D53229
llvm-svn: 345567
Craig Topper [Tue, 30 Oct 2018 03:27:13 +0000 (03:27 +0000)]
[AArch64] Add test case for D53229. NFC
llvm-svn: 345566
Craig Topper [Tue, 30 Oct 2018 03:27:12 +0000 (03:27 +0000)]
[X86] Cleanup the code in LowerFABSorFNEG and LowerFCOPYSIGN a little. NFC
Use SelectionDAG::EVTToAPFloatSemantics. Make the LogicVT calculation in LowerFABSorFNEG similar to LowerFCOPYSIGN. Use APInt::getSignedMaxValue instead of ~APInt::getSignMask.
llvm-svn: 345565
Craig Topper [Tue, 30 Oct 2018 03:27:11 +0000 (03:27 +0000)]
[X86] Stop changing f128 fand/for/fxor to v2i64.
The additional patterns don't cost us much and it seems better than changing element widths.
llvm-svn: 345564
Marc-Andre Laperle [Tue, 30 Oct 2018 03:10:41 +0000 (03:10 +0000)]
[lldb-mi] Implement -gdb-set breakpoint pending on/off
Summary:
This allows creating pending breakpoint automatically when a location is not found.
This is used by some front-ends instead of doing "-break-insert -f" every time.
See also https://sourceware.org/gdb/onlinedocs/gdb/Set-Breaks.html
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
Subscribers: MaskRay, llvm-commits, lldb-commits, ki.stfu
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D52953
llvm-svn: 345563
Richard Smith [Tue, 30 Oct 2018 02:02:49 +0000 (02:02 +0000)]
PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of type
nullptr_t does not access memory.
We now reuse CK_NullToPointer to represent a conversion from a glvalue
of type nullptr_t to a prvalue of nullptr_t where necessary.
llvm-svn: 345562
Eric Fiselier [Tue, 30 Oct 2018 02:02:00 +0000 (02:02 +0000)]
Unify definition of _LIBCPP_BEGIN/END_NAMESPACE_STD
llvm-svn: 345561
Matt Arsenault [Tue, 30 Oct 2018 01:37:59 +0000 (01:37 +0000)]
AMDGPU: Remove custom BUILD_VECTOR combine
This was looping in a testcase and removing it
now slightly improves a test.
llvm-svn: 345560
Matt Arsenault [Tue, 30 Oct 2018 01:33:14 +0000 (01:33 +0000)]
AMDGPU: Use scavengeRegisterBackwards
llvm-svn: 345559
Alexander Shaposhnikov [Tue, 30 Oct 2018 01:20:37 +0000 (01:20 +0000)]
[analyzer] Allow padding checker to traverse simple class hierarchies
The existing padding checker skips classes that have any base classes.
This patch allows the checker to traverse very simple cases:
classes that have no fields and have exactly one base class.
This is important mostly in the case of array declarations.
Patch by Max Bernstein!
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D53206
llvm-svn: 345558
Vitaly Buka [Tue, 30 Oct 2018 01:20:12 +0000 (01:20 +0000)]
[ubsan-minimal] update comments in CMakeLists.txt
Summary:
Prepend minimal when UBsan is mentioned and delete a dead comment
Patch by Igor Sugak
Reviewers: eugenis, pcc
Reviewed By: eugenis
Subscribers: mgorny, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D53826
llvm-svn: 345557
Vitaly Buka [Tue, 30 Oct 2018 01:20:01 +0000 (01:20 +0000)]
[sanitizer] Move interceptor initialization check into real_clock_gettime
Reviewers: cryptoad, kubamracek
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53777
llvm-svn: 345556
Matt Arsenault [Tue, 30 Oct 2018 01:12:12 +0000 (01:12 +0000)]
Remove dead declaration
llvm-svn: 345555
Matt Arsenault [Tue, 30 Oct 2018 01:11:52 +0000 (01:11 +0000)]
Fix typos in comment
llvm-svn: 345554
Matt Arsenault [Tue, 30 Oct 2018 01:11:31 +0000 (01:11 +0000)]
Pass TRI to printReg
llvm-svn: 345553
Petr Hosek [Mon, 29 Oct 2018 23:10:49 +0000 (23:10 +0000)]
[CMake][Fuchsia] Drop the LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT
Now that libc++ uses __exclude_from_explicit_instantiation__ attribute,
this is no longer needed.
Differential Revision: https://reviews.llvm.org/D53839
llvm-svn: 345552
Erik Pilkington [Mon, 29 Oct 2018 23:01:26 +0000 (23:01 +0000)]
[compiler-rt][builtins] Don't #include CoreFoundation in os_version_check.c
This breaks some configurations, so just forward declare everything that we need.
rdar://
35943793
Differential revision: https://reviews.llvm.org/D50269
llvm-svn: 345551
Reid Kleckner [Mon, 29 Oct 2018 22:48:14 +0000 (22:48 +0000)]
[builtins] Fix -Wunused-local-typedef warning in compile time asserts
Use the __attribute__ spellings when compiling with clang-cl so that
__attribute__((unused)) expands to something.
llvm-svn: 345550
Reid Kleckner [Mon, 29 Oct 2018 22:38:13 +0000 (22:38 +0000)]
Remove unneeded friend declarations that clang-cl warns on
llvm-svn: 345549
Alina Sbirlea [Mon, 29 Oct 2018 22:25:59 +0000 (22:25 +0000)]
[AliasSetTracker] Cleanup addPointer interface. [NFCI]
Summary:
Attempting to simplify the addPointer interface.
Currently there's code decomposing a MemoryLocation into (Ptr, Size, AAMDNodes) only to recreate the MemoryLocation inside the call.
Reviewers: reames, mkazantsev
Subscribers: sanjoy, jlebar, llvm-commits
Differential Revision: https://reviews.llvm.org/D53836
llvm-svn: 345548
Petr Hosek [Mon, 29 Oct 2018 22:16:56 +0000 (22:16 +0000)]
[CMake] When built with LLVM, not use `-Wl,-z,defs`
This matches standalone build behavior. PR28681
Differential Revision: https://reviews.llvm.org/D53686
Patch By: tabloid.adroit
llvm-svn: 345547
Wolfgang Pieb [Mon, 29 Oct 2018 22:16:47 +0000 (22:16 +0000)]
[DWARF][NFC] Refactor range list extraction and dumping
The purpose of this patch is twofold:
- Fold pre-DWARF v5 functionality into v5 to eliminate the need for 2 different
versions of range list handling. We get rid of DWARFDebugRangelist{.cpp,.h}.
- Templatize the handling of range list tables so that location list handling
can take advantage of it as well. Location list and range list tables have the
same basic layout.
A non-NFC version of this patch was previously submitted with r342218, but it caused
errors with some TSan tests. This patch has no functional changes. The difference to
the non-NFC patch is that there are no changes to rangelist dumping in this patch.
Differential Revision: https://reviews.llvm.org/D53545
llvm-svn: 345546
Aleksei Sidorin [Mon, 29 Oct 2018 21:46:18 +0000 (21:46 +0000)]
[ASTImporter] Reorder fields after structure import is finished
There are multiple reasons why field structures can be imported
in wrong order. The simplest is the ability of field initializers
and method bodies to refer fields not in order they are listed in.
Unfortunately, there is no clean solution for that currently
so I'm leaving a FIXME.
Differential Revision: https://reviews.llvm.org/D44100
llvm-svn: 345545
Alexander Shaposhnikov [Mon, 29 Oct 2018 21:22:58 +0000 (21:22 +0000)]
[llvm-objcopy] Move elf-specific code into subfolder
In this diff the elf-specific code is moved into the subfolder ELF
(and factored out from llvm-objcopy.cpp).
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D53790
llvm-svn: 345544
Erich Keane [Mon, 29 Oct 2018 21:21:55 +0000 (21:21 +0000)]
Add parens to fix incorrect assert check.
&& has higher priority than ||, so this assert works really oddly. Add
parens to match the programmer's intent.
Change-Id: I3abe1361ee0694462190c5015779db664012f3d4
llvm-svn: 345543
Konstantin Zhuravlyov [Mon, 29 Oct 2018 21:07:27 +0000 (21:07 +0000)]
AMDGPU: Enable code object v3 by default
Differential Revision: https://reviews.llvm.org/D53525
llvm-svn: 345542
Sanjay Patel [Mon, 29 Oct 2018 21:05:41 +0000 (21:05 +0000)]
[InstSimplify] add tests for abs/nabs+icmp folding; NFC
llvm-svn: 345541
Petr Hosek [Mon, 29 Oct 2018 21:04:12 +0000 (21:04 +0000)]
[Driver] Include missing touch files for sanitized library paths
These were forgotten in r345537 causing test failures on Clang builders.
Differential Revision: https://reviews.llvm.org/D53833
llvm-svn: 345540
Fedor Sergeev [Mon, 29 Oct 2018 20:38:23 +0000 (20:38 +0000)]
[LoopUnroll] NFC. Factor out runtime-loop.ll common test behavior.
Adding COMMON prefix to get common part handled there.
Needed to simplify test changes for D53440.
llvm-svn: 345538
Petr Hosek [Mon, 29 Oct 2018 20:37:52 +0000 (20:37 +0000)]
[Driver] Support sanitized libraries on Fuchsia
When using sanitizers, add <resource_dir>/<target>/lib/<sanitizer>
to the list of library paths to support using sanitized version of
runtime libraries if available.
Differential Revision: https://reviews.llvm.org/D53487
llvm-svn: 345537
John McCall [Mon, 29 Oct 2018 20:32:36 +0000 (20:32 +0000)]
In swiftcall, don't merge FP/vector types within a chunk.
llvm-svn: 345536
Jessica Paquette [Mon, 29 Oct 2018 20:27:07 +0000 (20:27 +0000)]
[MachineOutliner] Inherit target features from parent function
If a function has target features, it may contain instructions that aren't
represented in the default set of instructions. If the outliner pulls out one
of these instructions, and the function doesn't have the right attributes
attached, we'll run into an LLVM error explaining that the target doesn't
support the necessary feature for the instruction.
This makes outlined functions inherit target features from their parents.
It also updates the machine-outliner.ll test to check that we're properly
inheriting target features.
llvm-svn: 345535
Petr Hosek [Mon, 29 Oct 2018 20:20:26 +0000 (20:20 +0000)]
[libc++abi] Provide __cxa_thread_atexit on Fuchsia
Fuchsia already supports this interface.
Differential Revision: https://reviews.llvm.org/D53801
llvm-svn: 345534
Alexey Bataev [Mon, 29 Oct 2018 20:17:42 +0000 (20:17 +0000)]
[OPENMP]Fix PR39372: Does not complain about loop bound variable not
being shared.
According to the standard, the variables with unspecified data-sharing
attributes in presence of `default(none)` clause must be reported to
users. Compiler did not generate error reports for the variables used in
other OpenMP regions. Patch fixes this.
llvm-svn: 345533