David Majnemer [Tue, 26 Apr 2016 18:16:49 +0000 (18:16 +0000)]
[SimplifyLibCalls] sprintf doesn't copy null bytes
sprintf doesn't read or copy the terminating null byte from it's string
operands. sprintf will append it's own after processing all of the
format specifiers.
This fixes PR27526.
llvm-svn: 267580
Manman Ren [Tue, 26 Apr 2016 18:08:06 +0000 (18:08 +0000)]
Swift Calling Convention: use %RAX for sret.
We don't need to copy the sret argument into %rax upon return.
rdar://
25671494
llvm-svn: 267579
Saleem Abdulrasool [Tue, 26 Apr 2016 17:54:21 +0000 (17:54 +0000)]
tests: tweak MIR for ARM tests to correct MI issues
The Machine Instruction Verifier flagged some issues in the serialized MIR.
Adjust the input to correct them.
Fixes the remaining portion of PR27480.
llvm-svn: 267578
Saleem Abdulrasool [Tue, 26 Apr 2016 17:54:16 +0000 (17:54 +0000)]
test: remove some bleeding whitespace
Kill bleeding whitespace. NFC
llvm-svn: 267577
Eugene Zelenko [Tue, 26 Apr 2016 17:54:00 +0000 (17:54 +0000)]
[Release notes] Mention Clang-tidy misc-fold-init-type check.
Highlighting consistency in Clang-tidy misc-fold-init-type check documentation.
llvm-svn: 267576
Chris Bieneman [Tue, 26 Apr 2016 17:53:25 +0000 (17:53 +0000)]
[CMake] [PR27403] Fix COMPILER_RT_ENABLE_IOS when using Xcode from the App Store.
This change modifies find_darwin_sdk_dir to set a variable if a Darwin "Internal" SDK is present which allows CMake to disable components that require internal-only APIs.
This mechanism is then used to disable TSan when an internal SDK is not present.
llvm-svn: 267575
Etienne Bergeron [Tue, 26 Apr 2016 17:30:30 +0000 (17:30 +0000)]
[clang-tidy] New checker for redundant expressions.
Summary:
This checker finds redundant expression on both side of a binary operator.
The current implementation provide a function to check whether expressions
are equivalent. This implementation is able to recognize the common
subset encounter in C++ program. Side-effects like "x++" are not considered
to be equivalent.
There are many False Positives related to macros and to floating point
computations (detecting NaN). The checker is ignoring these cases.
Example:
```
if( !dst || dst->depth != desired_depth ||
dst->nChannels != desired_num_channels ||
dst_size.width != src_size.width ||
dst_size.height != dst_size.height ) <<--- bug
{
```
Reviewers: alexfh
Subscribers: danielmarjamaki, fahlgren, jordan_rose, zaks.anna, Eugene.Zelenko, cfe-commits
Differential Revision: http://reviews.llvm.org/D19451
llvm-svn: 267574
Konstantin Zhuravlyov [Tue, 26 Apr 2016 17:24:40 +0000 (17:24 +0000)]
[AMDGPU] Move reserved vgpr count for trap handler usage to SIMachineFunctionInfo + minor commenting changes
Differential Revision: http://reviews.llvm.org/D19537
llvm-svn: 267573
Sanjay Patel [Tue, 26 Apr 2016 17:11:17 +0000 (17:11 +0000)]
[CodeGenPrepare] use branch weight metadata to decide if a select should be turned into a branch
This is part of solving PR27344:
https://llvm.org/bugs/show_bug.cgi?id=27344
CGP should undo the SimplifyCFG transform for the same reason that earlier patches have used this
same mechanism: it's possible that passes between SimplifyCFG and CGP may be able to optimize the
IR further with a select in place.
For the TLI hook default, >99% taken or not taken is chosen as the default threshold for a highly
predictable branch. Even the most limited HW branch predictors will be correct on this branch almost
all the time, so even a massive mispredict penalty perf loss would be overcome by the win from all
the times the branch was predicted correctly.
As a follow-up, we could make the default target hook less conservative by using the SchedMachineModel's
MispredictPenalty. Or we could just let targets override the default by implementing the hook with that
and other target-specific options. Note that trying to statically determine mispredict rates for
close-to-balanced profile weight data is generally impossible if the HW is sufficiently advanced. Ie,
50/50 taken/not-taken might still be 100% predictable.
Finally, note that this patch as-is will not solve PR27344 because the current __builtin_unpredictable()
branch weight default values are 4 and 64. A proposal to change that is in D19435.
Differential Revision: http://reviews.llvm.org/D19488
llvm-svn: 267572
Zachary Turner [Tue, 26 Apr 2016 16:57:53 +0000 (16:57 +0000)]
Fix build broken due to order of initialization problem.
llvm-svn: 267571
Etienne Bergeron [Tue, 26 Apr 2016 16:53:21 +0000 (16:53 +0000)]
[clang-tidy] Enhance misc-suspicious-string-compare to move down false-positives.
Summary:
The checker was noisy when running over llvm code base.
This patch is impriving the way string-compare functions are matched.
1) By default, do not report !strcmp(...) unless it's activate by the user,
2) Only match suspicious expression over a subset of expression (binary operator),
3) Added matching of macro wrapper used with clang on linux.
See bug: 27465.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19497
llvm-svn: 267570
Peter Collingbourne [Tue, 26 Apr 2016 16:50:02 +0000 (16:50 +0000)]
Remove unnecessary function type directives for ifuncs.
llvm-svn: 267569
Rafael Espindola [Tue, 26 Apr 2016 16:26:45 +0000 (16:26 +0000)]
Don't gc symbols that have to go in the dynamic symbol table.
We were only doing it for .so and --export-dynamic, but those are not
the only ways a symbol ends up in the dynamic symbol table.
Problem diagnostic and earlier patch version by Peter Collingbourne.
llvm-svn: 267568
Marshall Clow [Tue, 26 Apr 2016 16:24:44 +0000 (16:24 +0000)]
#include <test_macros.h> in all the regex tests, and remove all mentions of __cpluplus (use TEST_STD_VERS and/or XFAIL instead). No functional change
llvm-svn: 267567
Peter Collingbourne [Tue, 26 Apr 2016 16:22:51 +0000 (16:22 +0000)]
ELF: Treat IFunc definitions in DSOs as functions.
Differential Revision: http://reviews.llvm.org/D19517
llvm-svn: 267566
Davide Italiano [Tue, 26 Apr 2016 16:21:59 +0000 (16:21 +0000)]
[ELF] Avoid polluting source directory with temp files.
llvm-svn: 267565
Zachary Turner [Tue, 26 Apr 2016 16:20:00 +0000 (16:20 +0000)]
Refactor some more PDB reading code into DebugInfoPDB.
Differential Revision: http://reviews.llvm.org/D19445
Reviewed By: David Majnemer
llvm-svn: 267564
Konstantin Zhuravlyov [Tue, 26 Apr 2016 15:43:14 +0000 (15:43 +0000)]
[AMDGPU] Reserve VGPRs for trap handler usage if instructed
Differential Revision: http://reviews.llvm.org/D19235
llvm-svn: 267563
Adrian McCarthy [Tue, 26 Apr 2016 15:15:29 +0000 (15:15 +0000)]
Fix send and receive of ACK byte in test infrastructure for Python 3.5
Python 3.5 is pickier about the distinction between chars and bytes (and strings and bytearrays) than Python 2.7.
Differential Revision: http://reviews.llvm.org/D19510
llvm-svn: 267562
Anastasia Stulova [Tue, 26 Apr 2016 15:14:01 +0000 (15:14 +0000)]
[SPIR] Remove an assert mandating SPIR for OpenCL sources only.
SPIR target can be used for C/C++ inputs too (i.e. in OpenCL compatible mode for the libs creation).
Patch by Neil Henning!
Review: http://reviews.llvm.org/D19478
llvm-svn: 267561
Samuel Antao [Tue, 26 Apr 2016 14:54:23 +0000 (14:54 +0000)]
[OpenMP] Improve mappable expressions Sema.
Summary:
This patch adds logic to save the components of mappable expressions in the clause that uses it, so that they don't have to be recomputed during codegen. Given that the mappable components are (will be) used in several clauses a new geneneric implementation `OMPMappableExprListClause` is used that extends the existing `OMPVarListClause`.
This patch does not add new tests. The goal is to preserve the existing functionality while storing more info in the clauses.
Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev
Subscribers: cfe-commits, caomhin
Differential Revision: http://reviews.llvm.org/D19382
llvm-svn: 267560
Johannes Doerfert [Tue, 26 Apr 2016 14:33:12 +0000 (14:33 +0000)]
Allow unsigned comparisons
With this patch we will optimistically assume that the result of an unsigned
comparison is the same as the result of the same comparison interpreted as
signed.
llvm-svn: 267559
Rafael Espindola [Tue, 26 Apr 2016 13:56:26 +0000 (13:56 +0000)]
Handle --as-needed with symbols, not relocations.
This matches the behavior of both gold and bfd.
llvm-svn: 267558
Nico Weber [Tue, 26 Apr 2016 13:54:29 +0000 (13:54 +0000)]
Update test after LLVM r267556.
llvm-svn: 267557
Nico Weber [Tue, 26 Apr 2016 13:53:56 +0000 (13:53 +0000)]
Use gcc's rules for parsing gcc-style response files
In gcc, \ escapes every character in response files. It is true that this makes
it harder to mention Windows files in rsp files, but not doing this means clang
disagrees with gcc, and also disagrees with the shell (on non-Windows) which
rsp file quoting is supposed to match. clang isn't free to choose what to do
here.
In general, the idea for response files is to take bits of your command line
and write them to a file unchanged, and have things work the same way. Since
the command line would've been interpreted by the shell, things in the rsp file
need to be subject to the same shell quoting rules.
People who want to put Windows-style paths in their response files either need
to do any of:
* escape their backslashes
* or use clang-cl which uses cl.exe/cmd.exe quoting rules
* pass --rsp-quoting=windows to clang to tell it to use
cl.exe/cmd.exe quoting rules for response files.
Fixes PR27464.
http://reviews.llvm.org/D19417
llvm-svn: 267556
Rafael Espindola [Tue, 26 Apr 2016 13:50:46 +0000 (13:50 +0000)]
Store the binding in the Symbol.
This remove a fixme, cleans up the weak undef interaction with archives and
lets us keep weak undefs still weak if they resolve to shared.
llvm-svn: 267555
Pavel Labath [Tue, 26 Apr 2016 13:37:24 +0000 (13:37 +0000)]
Bump up timeout in TestCallWithTimeout
Expression very rarely (linux buildbot, build 13907) completed before we managed to interrupt it.
llvm-svn: 267554
Sam Kolton [Tue, 26 Apr 2016 13:33:56 +0000 (13:33 +0000)]
[AMDGPU] Assembler: basic support for SDWA instructions
Support for SDWA instructions for VOP1 and VOP2 encoding.
Not done yet:
- converters for support optional operands and modifiers
- VOPC
- sext() modifier
- intrinsics
- VOP2b (see vop_dpp.s)
- V_MAC_F32 (see vop_dpp.s)
Differential Revision: http://reviews.llvm.org/D19360
llvm-svn: 267553
Johannes Doerfert [Tue, 26 Apr 2016 12:44:01 +0000 (12:44 +0000)]
[FIX] Adjust assumption space for zext instructions
llvm-svn: 267552
Andrey Turetskiy [Tue, 26 Apr 2016 12:18:12 +0000 (12:18 +0000)]
[X86] PR27502: Fix the LEA optimization pass.
Handle MachineBasicBlock as a memory displacement operand in the LEA optimization pass.
Differential Revision: http://reviews.llvm.org/D19409
llvm-svn: 267551
Omair Javaid [Tue, 26 Apr 2016 11:26:00 +0000 (11:26 +0000)]
rL267291: Architecture change to thumb on parsing arm.attributes causes regression.
Remove case handling elf arm attribute Tag_THUMB_ISA_use and setting architecture to thumb.
Differential revision: http://reviews.llvm.org/D19520
llvm-svn: 267550
Marcin Koscielnicki [Tue, 26 Apr 2016 10:43:47 +0000 (10:43 +0000)]
[Sparc] Fix build error introduced by rL267545.
llvm-svn: 267549
Marcin Koscielnicki [Tue, 26 Apr 2016 10:41:30 +0000 (10:41 +0000)]
[sanitizer] [SystemZ] Add ptrace support bits.
Differential Revision: http://reviews.llvm.org/D19134
llvm-svn: 267548
Marcin Koscielnicki [Tue, 26 Apr 2016 10:41:19 +0000 (10:41 +0000)]
[sanitizer] [SystemZ] Implement internal_clone.
Differential Revision: http://reviews.llvm.org/D19159
llvm-svn: 267547
Marcin Koscielnicki [Tue, 26 Apr 2016 10:37:22 +0000 (10:37 +0000)]
[PowerPC] Add support for llvm.thread.pointer
Differential Revision: http://reviews.llvm.org/D19304
llvm-svn: 267546
Marcin Koscielnicki [Tue, 26 Apr 2016 10:37:14 +0000 (10:37 +0000)]
[SPARC] [SSP] Add support for LOAD_STACK_GUARD.
This fixes PR22248 on sparc.
Differential Revision: http://reviews.llvm.org/D19386
llvm-svn: 267545
Marcin Koscielnicki [Tue, 26 Apr 2016 10:37:01 +0000 (10:37 +0000)]
[SPARC] Add support for llvm.thread.pointer.
Differential Revision: http://reviews.llvm.org/D19387
llvm-svn: 267544
Mehdi Amini [Tue, 26 Apr 2016 10:35:01 +0000 (10:35 +0000)]
ThinLTOCodeGenerator: preserve linkonce when in "MustPreserved" set
If the linker specifically requested for a linkonce to be preserved,
we need to make sure we won't drop it even if all the uses in the
current module disappear.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267543
Alexander Kornienko [Tue, 26 Apr 2016 10:05:45 +0000 (10:05 +0000)]
A clang-tidy check for std:accumulate.
Summary:
For folds (e.g. std::accumulate), check matches between the provided init value and the range's value_type. A typical error is "std::accumulate(begin, end, 0);", where begin and end have float value_type. See the documentation for more examples.
For now we check std::accumulate, std::reduce and std::inner_product.
Reviewers: hokein, alexfh
Subscribers: Prazek, aaron.ballman, cfe-commits, courbet
Patch by Clément Courbet!
Differential Revision: http://reviews.llvm.org/D18442
llvm-svn: 267542
Renato Golin [Tue, 26 Apr 2016 10:02:02 +0000 (10:02 +0000)]
Revert "ARM: put correct symbol index on indirect pointers in __thread_ptr."
This reverts commit r267488, as it broke some ARM buildbots.
llvm-svn: 267541
Dmitry Polukhin [Tue, 26 Apr 2016 09:21:17 +0000 (09:21 +0000)]
[MSVC] PR27337: allow static_cast from private base to derived for WTL
MSVC doesn't report even warning for cast from private base class to
derived.
Differential Revision: http://reviews.llvm.org/D19477
llvm-svn: 267534
Johannes Doerfert [Tue, 26 Apr 2016 09:20:41 +0000 (09:20 +0000)]
Do not use the number of parameters in the complexity check
llvm-svn: 267532
Johannes Doerfert [Tue, 26 Apr 2016 09:16:36 +0000 (09:16 +0000)]
Do not add but record signed-unsigned assumptions
llvm-svn: 267528
Chuang-Yu Cheng [Tue, 26 Apr 2016 07:38:24 +0000 (07:38 +0000)]
[ppc64] Reenable sibling call optimization on ppc64 since fixed tsan library tail-call issue
print-stack-trace.cc test failure of compiler-rt has been fixed by
r266869 (http://reviews.llvm.org/D19148), so reenable sibling call
optimization on ppc64
Reviewers: nemanjai kbarton
llvm-svn: 267527
Mehdi Amini [Tue, 26 Apr 2016 07:03:11 +0000 (07:03 +0000)]
Revert "[sanitizers] read/write page fault detection on mac."
This reverts commit r267477.
It broke our bots that enables the AArch64 backends, it seems that
this code is using a Darwin *X86 specific* field.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267526
Sanjoy Das [Tue, 26 Apr 2016 05:59:14 +0000 (05:59 +0000)]
Align case statements (whitespace-only cleanup)
llvm-svn: 267525
Sanjoy Das [Tue, 26 Apr 2016 05:59:08 +0000 (05:59 +0000)]
Symbolize operand bundle blocks for bcanalyzer
Reviewers: joker.eph
Subscribers: mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D19523
llvm-svn: 267524
Davide Italiano [Tue, 26 Apr 2016 05:51:37 +0000 (05:51 +0000)]
[ELF] Simplify. Pointed out by Rui Ueyama.
llvm-svn: 267523
Craig Topper [Tue, 26 Apr 2016 05:26:51 +0000 (05:26 +0000)]
[AArch64] Expand v1i64 and v2i64 ctlz.
The default is legal, which results in 'Cannot select' errors.
llvm-svn: 267522
Craig Topper [Tue, 26 Apr 2016 05:04:37 +0000 (05:04 +0000)]
[ARM] Expand vector ctlz_zero_undef so it becomes ctlz.
The default is Legal, which results in 'Cannot select' errors.
llvm-svn: 267521
Craig Topper [Tue, 26 Apr 2016 05:04:33 +0000 (05:04 +0000)]
[ARM] Expand v1i64 and v2i64 ctlz.
The default is legal, which results in 'Cannot select' errors.
llvm-svn: 267520
Dehao Chen [Tue, 26 Apr 2016 04:59:11 +0000 (04:59 +0000)]
Tune basic block annotation algorithm.
Summary:
Instead of using maximum IR weight as the basic block weight, this patch uses the voting algorithm to find the most likely weight for the basic block. This can effectively avoid the cases when some IRs are annotated incorrectly due to code motion of the profiled binary.
This patch also updates propagate.ll unittest to include discriminator in the input file so that it is testing something meaningful.
Reviewers: davidxl, dnovillo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D19301
llvm-svn: 267519
Bill Seurer [Tue, 26 Apr 2016 03:59:19 +0000 (03:59 +0000)]
[powerpc] mark JIT tests as UNSUPPORTED on powerpc64 big endian
Some of the JIT tests began failing with "[llvm] r266663 - [Orc] Re-commit
r266581 with fixes for MSVC, and format cleanups." on powerpc64 big endian.
To get the buildbots running I am marking these as UNSUPPORTED for now.
If this is fixed remove the UNSUPPORTED flag "powerpc64-unknown-linux-gnu".
In r267516 I marked these as XFAIL but they succeed on some of the bots
on stage1.
llvm-svn: 267518
Richard Trieu [Tue, 26 Apr 2016 03:43:49 +0000 (03:43 +0000)]
Pass the test file in through stdin instead of by filename.
When passed in via filename, this test will fail if the path to the test
has the strings "f1" and "f2" in somewhere. Pass the file through stdin
to prevent test failures due to coincidences in path names.
llvm-svn: 267517
Bill Seurer [Tue, 26 Apr 2016 02:33:22 +0000 (02:33 +0000)]
[powerpc] mark JIT tests as XFAIL on powerpc64 big endian
Some of the JIT tests began failing with "[llvm] r266663 - [Orc] Re-commit
r266581 with fixes for MSVC, and format cleanups." on powerpc64 big endian.
To get the buildbots running I am marking these as XFAIL for now.
If this is fixed remove the XFAIL flag "powerpc64-unknown-linux-gnu".
llvm-svn: 267516
Hal Finkel [Tue, 26 Apr 2016 02:06:06 +0000 (02:06 +0000)]
[SimplifyCFG] Preserve !llvm.mem.parallel_loop_access when merging
When SimplifyCFG merges identical instructions from both sides of a diamond, it
can preserve !llvm.mem.parallel_loop_access (as it does with most of the other
metadata). There's no real data or control dependency change in this case.
llvm-svn: 267515
Hal Finkel [Tue, 26 Apr 2016 02:00:36 +0000 (02:00 +0000)]
[LoopVectorize] Don't consider conditional-load dereferenceability for marked parallel loops
I really thought we were doing this already, but we were not. Given this input:
void Test(int *res, int *c, int *d, int *p) {
for (int i = 0; i < 16; i++)
res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
}
we did not vectorize the loop. Even with "assume_safety" the check that we
don't if-convert conditionally-executed loads (to protect against
data-dependent deferenceability) was not elided.
One subtlety: As implemented, it will still prefer to use a masked-load
instrinsic (given target support) over the speculated load. The choice here
seems architecture specific; the best option depends on how expensive the
masked load is compared to a regular load. Ideally, using the masked load still
reduces unnecessary memory traffic, and so should be preferred. If we'd rather
do it the other way, flipping the order of the checks is easy.
The LangRef is updated to make explicit that llvm.mem.parallel_loop_access also
implies that if conversion is okay.
Differential Revision: http://reviews.llvm.org/D19512
llvm-svn: 267514
Kostya Serebryany [Tue, 26 Apr 2016 01:53:49 +0000 (01:53 +0000)]
trying to fix the windows build broken by r267496
llvm-svn: 267513
Lang Hames [Tue, 26 Apr 2016 01:45:25 +0000 (01:45 +0000)]
[lli] Fix a sign-compare warning.
llvm-svn: 267512
Dan Gohman [Tue, 26 Apr 2016 01:40:56 +0000 (01:40 +0000)]
[WebAssembly] Account for implicit operands when computing operand indices.
llvm-svn: 267511
Lang Hames [Tue, 26 Apr 2016 01:27:54 +0000 (01:27 +0000)]
[ORC] Try to work around a GCC 4.7 bug triggered by r267457.
llvm-svn: 267510
Saleem Abdulrasool [Tue, 26 Apr 2016 01:11:29 +0000 (01:11 +0000)]
unwind: remove last instance of -Wexpansion-to-defined
This unifies the definition of _LIBUNWIND_BUILD_SJLJ_APIS. It also further
generalises the definition to allow building these APIs on non-Apple targets
when `-fsjlj-excceptions` is used. The header is now clean of macros which
expand to defined checks.
llvm-svn: 267509
Omair Javaid [Tue, 26 Apr 2016 01:08:59 +0000 (01:08 +0000)]
Fix arm-linux-gnueabi regression due to rL267291
rL267291 introduces a lot regression on arm-linux LLDB testsuite.
This patch fixes half of them. I am merging it under already revied android counterpart.
Another patch fixing rest of the issue will follow this commit.
Differential revision: http://reviews.llvm.org/D19480
llvm-svn: 267508
David Majnemer [Tue, 26 Apr 2016 01:05:00 +0000 (01:05 +0000)]
[SROA] Don't falsely report that changes have occured
We would report that the function changed despite creating no new
allocas or performing any promotion.
This fixes PR27316.
llvm-svn: 267507
Andrew Kaylor [Tue, 26 Apr 2016 00:56:36 +0000 (00:56 +0000)]
Reverting Thumb2SizeReduction opt bisect change to fix failing buildbots.
llvm-svn: 267506
Davide Italiano [Tue, 26 Apr 2016 00:56:19 +0000 (00:56 +0000)]
[Tests] Run reproduces.s only on UNIX until I investigate a windows failure.
llvm-svn: 267505
Sanjay Patel [Tue, 26 Apr 2016 00:47:39 +0000 (00:47 +0000)]
[CodeGenPrepare] don't convert an unpredictable select into control flow
Suggested in the review of D19488:
http://reviews.llvm.org/D19488
llvm-svn: 267504
NAKAMURA Takumi [Tue, 26 Apr 2016 00:45:00 +0000 (00:45 +0000)]
CGOpenMPRuntime.h: Prune '\param IfCond' in r267395. [-Wdocumentation]
llvm-svn: 267503
Junmo Park [Tue, 26 Apr 2016 00:37:46 +0000 (00:37 +0000)]
Remove MinLatency in SchedMachineModel. NFC.
Summary:
We don't use MinLatency any more since r184032.
Reviewers: atrick, hfinkel, mcrosier
Differential Revision: http://reviews.llvm.org/D19474
llvm-svn: 267502
George Burgess IV [Tue, 26 Apr 2016 00:31:29 +0000 (00:31 +0000)]
[Docs] Fix indentation error introduced by r267447.
llvm-svn: 267501
Jim Ingham [Tue, 26 Apr 2016 00:29:59 +0000 (00:29 +0000)]
When building the list of variables we're going to write "using $_lldb_local_vars"
statements for, be sure not to include variables that have no locations. We wouldn't
be able to realize them, and that will cause all expressions to fail.
llvm-svn: 267500
Justin Bogner [Tue, 26 Apr 2016 00:28:01 +0000 (00:28 +0000)]
PM: Port GlobalOpt to the new pass manager
llvm-svn: 267499
Justin Bogner [Tue, 26 Apr 2016 00:27:56 +0000 (00:27 +0000)]
PM: Convert the logic for GlobalOpt into static functions. NFC
Pass all of the state we need around as arguments, so that these
functions are easier to reuse. There is one part of this that is
unusual: we pass around a functor to look up a DomTree for a function.
This will be a necessary abstraction when we try to use this code in
both the legacy and the new pass manager.
llvm-svn: 267498
Davide Italiano [Tue, 26 Apr 2016 00:22:24 +0000 (00:22 +0000)]
[ELF] Introduce --reproduce flag.
--reproduce dumps the object files in a directory chosen
(preserving the file system layout) and the linker invocation
so that people can create an archive and upload for debugging.
Differential Revision: http://reviews.llvm.org/D19494
llvm-svn: 267497
Jacques Pienaar [Tue, 26 Apr 2016 00:09:29 +0000 (00:09 +0000)]
[lanai] Update handling of structs in arguments to be passed in registers.
Previously aggregate types were passed byval, change the ABI to pass these in registers instead.
llvm-svn: 267496
Ahmed Bougacha [Tue, 26 Apr 2016 00:00:48 +0000 (00:00 +0000)]
[X86] Use LivePhysRegs in X86FixupBWInsts.
Kill-flags, which computeRegisterLiveness uses, are not reliable.
LivePhysRegs is.
Differential Revision: http://reviews.llvm.org/D19472
llvm-svn: 267495
Greg Clayton [Mon, 25 Apr 2016 23:39:19 +0000 (23:39 +0000)]
Make sure that the following SymbolFileDWARF functions can handle getting a lldb::user_id_t for another SymbolFileDWARF:
CompilerDecl
SymbolFileDWARF::GetDeclForUID (lldb::user_id_t type_uid);
CompilerDeclContext
SymbolFileDWARF::GetDeclContextForUID (lldb::user_id_t type_uid)
CompilerDeclContext
SymbolFileDWARF::GetDeclContextContainingUID (lldb::user_id_t type_uid)
Type*
SymbolFileDWARF::ResolveTypeUID (lldb::user_id_t type_uid)
<rdar://problem/
25592223>
llvm-svn: 267494
Justin Bogner [Mon, 25 Apr 2016 23:36:50 +0000 (23:36 +0000)]
GlobalOpt: Convert a bunch of tests from grep to FileCheck
llvm-svn: 267493
Chaoren Lin [Mon, 25 Apr 2016 23:29:53 +0000 (23:29 +0000)]
Fix TestGetVariables.py.
Reviewers: sivachandra, clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D19511
llvm-svn: 267492
Sanjay Patel [Mon, 25 Apr 2016 23:15:16 +0000 (23:15 +0000)]
Add check for "branch_weights" with prof metadata
While we're here, fix the comment and variable names to make it
clear that these are raw weights, not percentages.
llvm-svn: 267491
Chris Bieneman [Mon, 25 Apr 2016 23:02:47 +0000 (23:02 +0000)]
[CMake] If set we should pass LLVM_VERSION_INFO into config.h
Autoconf used to support setting LLVM_VERSION_INFO and there is some code filtered around llvm in Support/CommandLine.cpp and LTO/LTOCodeGenerator.cpp that uses it if it is set.
We also shouldn't be explicitly setting it as a define on llvm-shlib. It is pointless there because there is no code using it in llvm-shlib, and it is better to have it as part of the generated config.h so that it is available everywhere.
llvm-svn: 267490
James Y Knight [Mon, 25 Apr 2016 22:54:09 +0000 (22:54 +0000)]
[Sparc] Fix double-float fabs and fneg on little endian CPUs.
The SparcV8 fneg and fabs instructions interestingly come only in a
single-float variant. Since the sign bit is always the topmost bit no
matter what size float it is, you simply operate on the high
subregister, as if it were a single float.
However, the layout of double-floats in the float registers is reversed
on little-endian CPUs, so that the high bits are in the second
subregister, rather than the first.
Thus, this expansion must check the endianness to use the correct
subregister.
llvm-svn: 267489
Tim Northover [Mon, 25 Apr 2016 22:36:07 +0000 (22:36 +0000)]
ARM: put correct symbol index on indirect pointers in __thread_ptr.
Otherwise the linker has no idea what should be resolved.
llvm-svn: 267488
Andrew Kaylor [Mon, 25 Apr 2016 22:27:30 +0000 (22:27 +0000)]
Fix build warning
llvm-svn: 267487
Marcin Koscielnicki [Mon, 25 Apr 2016 22:25:49 +0000 (22:25 +0000)]
[MSan] Use COMMON_INTERCEPTOR_ENTER in libdl interceptors.
This fixes fails in test/msan/dlerror.cc - when real dlerror calls strcmp,
our strcmp interceptor now skips poison checking, since it's called in
interceptor context. Strictly speaking, only the dlerror change is
necessary to fix the fail, but let's also change the other two just in case.
Differential Revision: http://reviews.llvm.org/D19499
llvm-svn: 267486
Andrew Kaylor [Mon, 25 Apr 2016 22:23:44 +0000 (22:23 +0000)]
Add optimization bisect opt-in calls for AMDGPU passes
Differential Revision: http://reviews.llvm.org/D19450
llvm-svn: 267485
Amaury Sechet [Mon, 25 Apr 2016 22:23:35 +0000 (22:23 +0000)]
Reformat LLVMConstPointerNull. NFC
llvm-svn: 267484
Amaury Sechet [Mon, 25 Apr 2016 22:23:30 +0000 (22:23 +0000)]
Comment formating. NFC
llvm-svn: 267483
Arch D. Robison [Mon, 25 Apr 2016 22:22:39 +0000 (22:22 +0000)]
Optimize store of "bitcast" from vector to aggregate.
This patch is what was the "instcombine" portion of D14185, with an additional
test added (see julia_pseudovec in test/Transforms/InstCombine/insert-val-extract-elem.ll).
The patch causes instcombine to replace sequences of extractelement-insertvalue-store
that act essentially like a bitcast followed by a store.
Differential review: http://reviews.llvm.org/D14260
llvm-svn: 267482
Philip Reames [Mon, 25 Apr 2016 22:21:24 +0000 (22:21 +0000)]
[LVI] Make a precondition explicit rather than handling a case which never happens [NFC]
llvm-svn: 267481
Andrew Kaylor [Mon, 25 Apr 2016 22:01:04 +0000 (22:01 +0000)]
Add optimization bisect opt-in calls for ARM passes
Differential Revision: http://reviews.llvm.org/D19449
llvm-svn: 267480
Andrew Kaylor [Mon, 25 Apr 2016 21:58:52 +0000 (21:58 +0000)]
Add optimization bisect opt-in calls for AArch64 passes
Differential Revision: http://reviews.llvm.org/D19394
llvm-svn: 267479
Greg Clayton [Mon, 25 Apr 2016 21:54:10 +0000 (21:54 +0000)]
Fix StackFrame::GetVariables(...) function that was broken by 261858 when lambda functions were added to Block::AppendBlockVariables(). The Stackframe::GetVariables(...) function should get all variables regardless if they are in scope.
This wasn't caught by the test suite so I added a test for it.
llvm-svn: 267478
Mike Aizatsky [Mon, 25 Apr 2016 21:44:43 +0000 (21:44 +0000)]
[sanitizers] read/write page fault detection on mac.
Subscribers: kubabrecka
Differential Revision: http://reviews.llvm.org/D19495
llvm-svn: 267477
Krzysztof Parzyszek [Mon, 25 Apr 2016 21:28:52 +0000 (21:28 +0000)]
Add accidentally deleted "break"
llvm-svn: 267476
Lang Hames [Mon, 25 Apr 2016 21:21:20 +0000 (21:21 +0000)]
[ORC] clang-format code that was touched in r267457. NFC.
Commit r267457 made a lot of type-substitutions threw off code formatting and
alignment. This patch should tidy those changes up.
llvm-svn: 267475
Nico Weber [Mon, 25 Apr 2016 21:15:49 +0000 (21:15 +0000)]
driver: Add a `--rsp-quoting` flag to pick response file quoting.
Currently, clang-cl always uses Windows style for unquoting, and clang always
uses POSIX style for unquoting.
With this flag, it's possible to change these defaults.
In general, response file quoting should match the shell the response file is
used in. On Windows, it's possible to run clang-cl in a bash shell, or clang in
cmd.exe, so a flag for overriding the default behavior is natural there.
On non-Windows, Windows quoting probably never makes sense (except maybe in
Wine), but having clang-cl behave differently based on the host OS seems
strange too. So require that people who want to use posix-style response
files with clang-cl on non-Windows pass --rsp-quoting=posix.
http://reviews.llvm.org/D19425
llvm-svn: 267474
Tim Northover [Mon, 25 Apr 2016 21:12:04 +0000 (21:12 +0000)]
ARM: put extern __thread stubs in a special section.
The linker needs to know that the symbols are thread-local to do its job
properly.
llvm-svn: 267473
Jonathan Peyton [Mon, 25 Apr 2016 21:11:26 +0000 (21:11 +0000)]
Remove architecture dependent Hwloc DEBUG section
This debug sections's functionality can be replicated using the environment
variable KMP_TOPOLOGY_METHOD with different values and KMP_AFFINITY=verbose
llvm-svn: 267472
Teresa Johnson [Mon, 25 Apr 2016 21:09:51 +0000 (21:09 +0000)]
[ThinLTO] Introduce typedef for commonly-used map type (NFC)
Add a typedef for the std::map<GlobalValue::GUID, GlobalValueSummary *>
map that is passed around to identify summaries for values defined in a
particular module. This shortens up declarations in a variety of places.
llvm-svn: 267471