Dehao Chen [Wed, 19 Oct 2016 03:53:41 +0000 (03:53 +0000)]
Update the section.ll to fix non-x86 failure.
llvm-svn: 284566
Chris Bieneman [Wed, 19 Oct 2016 02:44:20 +0000 (02:44 +0000)]
Revert back to the state before r284550
This patch is causing a lot of issues on bots that I didn't see in local testing. I'm going to have to work on this. Reverting for now while I sort it out.
llvm-svn: 284565
Chris Bieneman [Wed, 19 Oct 2016 02:31:31 +0000 (02:31 +0000)]
Trying to fix a few more missing LDFLAGS.
llvm-svn: 284564
Dehao Chen [Wed, 19 Oct 2016 01:18:25 +0000 (01:18 +0000)]
Revert r284545 again as the regression in ppc still exists. There is bug in MBPI exposed by th patch.
Also update the section.ll to fix non-x86 failure.
llvm-svn: 284563
Vitaly Buka [Wed, 19 Oct 2016 00:16:56 +0000 (00:16 +0000)]
[asan] Replace std::to_string with llvm::to_string
llvm-svn: 284557
Richard Smith [Wed, 19 Oct 2016 00:14:23 +0000 (00:14 +0000)]
Resolve exception specifications when selecting an overloaded operator.
llvm-svn: 284556
Chris Bieneman [Wed, 19 Oct 2016 00:13:56 +0000 (00:13 +0000)]
Fixing the linux bots I broke in r284550
Need to gate cxx linker adding driver-mode flag based on the linker being clang.
llvm-svn: 284555
Kostya Serebryany [Wed, 19 Oct 2016 00:12:03 +0000 (00:12 +0000)]
[libFuzzer] extend -print_coverage to also print uncovered lines, functions, and files.
Example of output:
COVERAGE:
COVERED: in DSO2(int) /pathto/DSO2.cpp:6
COVERED: in DSO2(int) /pathto/DSO2.cpp:8
COVERED: in DSO1(int) /pathto/DSO1.cpp:6
COVERED: in DSO1(int) /pathto/DSO1.cpp:8
COVERED: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:16
COVERED: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:19
COVERED: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:25
COVERED: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:26
MODULE_WITH_COVERAGE: /pathto/libLLVMFuzzer-DSO1.so
UNCOVERED_LINE: in DSO1(int) /pathto/DSO1.cpp:9
UNCOVERED_FUNC: in Uncovered1()
MODULE_WITH_COVERAGE: /pathto/libLLVMFuzzer-DSO2.so
UNCOVERED_LINE: in DSO2(int) /pathto/DSO2.cpp:9
UNCOVERED_FUNC: in Uncovered2()
MODULE_WITH_COVERAGE: /pathto/LLVMFuzzer-DSOTest
UNCOVERED_LINE: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:21
UNCOVERED_LINE: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:27
UNCOVERED_FILE: /pathto/DSOTestExtra.cpp
Several things are not perfect here:
* we are using objdump+awk instead of sancov because sancov does not support DSOs yet.
* this breaks in the presence of ASAN_OPTIONS=strip_path_prefix=...
(need to implement another API to get the module name by PC)
llvm-svn: 284554
Justin Lebar [Wed, 19 Oct 2016 00:06:49 +0000 (00:06 +0000)]
[CUDA] Rework tests now that we emit deferred diagnostics during sema. Test-only change.
Summary:
Previously we had to split out a lot of our tests into a test that
checked only immediate errors and a test that checked only deferred
errors. This was because, if you emitted any immediate errors, we
wouldn't run codegen, where the deferred errors were emitted.
We've fixed this, and now emit deferred errors during sema. This lets
us merge a bunch of tests, and lets us convert some other tests to
-fsyntax-only.
Reviewers: tra
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25755
llvm-svn: 284553
Chris Bieneman [Tue, 18 Oct 2016 23:55:34 +0000 (23:55 +0000)]
When invoking Terminal, don't assume the default shell
Summary:
If a user has their shell set to a non-POSIX conferment shell the TestTerminal.py tests fail because the shell blurb constructed here may not work in their shell.
In my specific case fish-shell (The Friendly Interactive Shell - http://fishshell.com) does not support $?, it instead uses $status (because it is friendly).
This patch removes the assumption of your default shell by running the constructed bash command via "/bin/bash -c ...". This should be safer for users mutating their shell environment.
Reviewers: tfiala
Subscribers: joerg, lldb-commits
Differential Revision: https://reviews.llvm.org/D25750
llvm-svn: 284552
Chris Bieneman [Tue, 18 Oct 2016 23:54:28 +0000 (23:54 +0000)]
[CMake] Don't include LLDB_TEST_COMPILER in cached variable
Summary:
CMake has no builtin mechanism for cache invalidation. As a general convention you want to not expand user-specified variables in other cached variables because they will not get updated when the user changes their specified value.
This patch moves the "-C" option for dotest.py into the LLDB_TEST_COMMON_ARGS and out of the CMake cache. In order to prevent issues with out-of-date cache files on builders I've added code to scrub "-C ${LLDB_TEST_COMPILER}" out of the CMake caches, by Force writing the variable. This code can be removed in a few days once the change has trickled through CI systems.
Reviewers: tfiala, labath, zturner
Subscribers: lldb-commits, mgorny
Differential Revision: https://reviews.llvm.org/D25751
llvm-svn: 284551
Chris Bieneman [Tue, 18 Oct 2016 23:53:24 +0000 (23:53 +0000)]
Use clang --driver-mode instead of guessing c++ compiler path
Summary:
When building the LLDB test programs, if your CC is clang it actually isn't safe to make CXX a string replace of "clang -> clang++". This falls down on unix configurations if your compiler is clang-${version}.
A safer approach is to use the "--driver-mode=g++" option to tell clang to act like clang++.
Reviewers: tfiala, zturner, labath
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D25753
llvm-svn: 284550
Richard Smith [Tue, 18 Oct 2016 23:39:12 +0000 (23:39 +0000)]
DR1330: instantiate exception-specifications when "needed". We previously did
not instantiate exception specifications of functions if they were only used in
unevaluated contexts (other than 'noexcept' expressions).
In C++17 onwards, this becomes essential since the exception specification is
now part of the function's type.
Note that this means that constructs like the following no longer work:
struct A {
static T f() noexcept(...);
decltype(f()) *p;
};
... because the decltype expression now needs the exception specification of
'f', which has not yet been parsed.
llvm-svn: 284549
Vitaly Buka [Tue, 18 Oct 2016 23:30:07 +0000 (23:30 +0000)]
[asan] Update test for D25715
Reviewers: eugenis
Subscribers: kubabrecka, llvm-commits
Differential Revision: https://reviews.llvm.org/D25716
llvm-svn: 284548
Vitaly Buka [Tue, 18 Oct 2016 23:29:52 +0000 (23:29 +0000)]
[asan] Simplify calculation of stack frame layout extraction calculation of stack description into separate function.
Reviewers: eugenis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D25754
llvm-svn: 284547
Vitaly Buka [Tue, 18 Oct 2016 23:29:41 +0000 (23:29 +0000)]
[asan] Append line number to variable name if line is available and in the same file as the function.
PR30498
Reviewers: eugenis
Differential Revision: https://reviews.llvm.org/D25715
llvm-svn: 284546
Dehao Chen [Tue, 18 Oct 2016 23:24:02 +0000 (23:24 +0000)]
Using branch probability to guide critical edge splitting.
Summary:
The original heuristic to break critical edge during machine sink is relatively conservertive: when there is only one instruction sinkable to the critical edge, it is likely that the machine sink pass will not break the critical edge. This leads to many speculative instructions executed at runtime. However, with profile info, we could model the splitting benefits: if the critical edge has 50% taken rate, it would always be beneficial to split the critical edge to avoid the speculated runtime instructions. This patch uses profile to guide critical edge splitting in machine sink pass.
The performance impact on speccpu2006 on Intel sandybridge machines:
spec/2006/fp/C++/444.namd 25.3 +0.26%
spec/2006/fp/C++/447.dealII 45.96 -0.10%
spec/2006/fp/C++/450.soplex 41.97 +1.49%
spec/2006/fp/C++/453.povray 36.83 -0.96%
spec/2006/fp/C/433.milc 23.81 +0.32%
spec/2006/fp/C/470.lbm 41.17 +0.34%
spec/2006/fp/C/482.sphinx3 48.13 +0.69%
spec/2006/int/C++/471.omnetpp 22.45 +3.25%
spec/2006/int/C++/473.astar 21.35 -2.06%
spec/2006/int/C++/483.xalancbmk 36.02 -2.39%
spec/2006/int/C/400.perlbench 33.7 -0.17%
spec/2006/int/C/401.bzip2 22.9 +0.52%
spec/2006/int/C/403.gcc 32.42 -0.54%
spec/2006/int/C/429.mcf 39.59 +0.19%
spec/2006/int/C/445.gobmk 26.98 -0.00%
spec/2006/int/C/456.hmmer 24.52 -0.18%
spec/2006/int/C/458.sjeng 28.26 +0.02%
spec/2006/int/C/462.libquantum 55.44 +3.74%
spec/2006/int/C/464.h264ref 46.67 -0.39%
geometric mean +0.20%
Manually checked 473 and 471 to verify the diff is in the noise range.
Reviewers: rengolin, davidxl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D24818
llvm-svn: 284545
Dehao Chen [Tue, 18 Oct 2016 23:11:20 +0000 (23:11 +0000)]
revert r284541.
llvm-svn: 284544
Michael Kruse [Tue, 18 Oct 2016 22:58:09 +0000 (22:58 +0000)]
[test] Fix buildbot after SCEV change.
Update test after commit r284501:
[SCEV] Make CompareValueComplexity a little bit smarter
Contributed-by: Sanjoy Das <sanjoy@playingwithpointers.com>
llvm-svn: 284543
Rong Xu [Tue, 18 Oct 2016 21:36:27 +0000 (21:36 +0000)]
Conditionally eliminate library calls where the result value is not used
Summary:
This pass shrink-wraps a condition to some library calls where the call
result is not used. For example:
sqrt(val);
is transformed to
if (val < 0)
sqrt(val);
Even if the result of library call is not being used, the compiler cannot
safely delete the call because the function can set errno on error
conditions.
Note in many functions, the error condition solely depends on the incoming
parameter. In this optimization, we can generate the condition can lead to
the errno to shrink-wrap the call. Since the chances of hitting the error
condition is low, the runtime call is effectively eliminated.
These partially dead calls are usually results of C++ abstraction penalty
exposed by inlining. This optimization hits 108 times in 19 C/C++ programs
in SPEC2006.
Reviewers: hfinkel, mehdi_amini, davidxl
Subscribers: modocache, mgorny, mehdi_amini, xur, llvm-commits, beanz
Differential Revision: https://reviews.llvm.org/D24414
llvm-svn: 284542
Dehao Chen [Tue, 18 Oct 2016 21:36:11 +0000 (21:36 +0000)]
Using branch probability to guide critical edge splitting.
Summary:
The original heuristic to break critical edge during machine sink is relatively conservertive: when there is only one instruction sinkable to the critical edge, it is likely that the machine sink pass will not break the critical edge. This leads to many speculative instructions executed at runtime. However, with profile info, we could model the splitting benefits: if the critical edge has 50% taken rate, it would always be beneficial to split the critical edge to avoid the speculated runtime instructions. This patch uses profile to guide critical edge splitting in machine sink pass.
The performance impact on speccpu2006 on Intel sandybridge machines:
spec/2006/fp/C++/444.namd 25.3 +0.26%
spec/2006/fp/C++/447.dealII 45.96 -0.10%
spec/2006/fp/C++/450.soplex 41.97 +1.49%
spec/2006/fp/C++/453.povray 36.83 -0.96%
spec/2006/fp/C/433.milc 23.81 +0.32%
spec/2006/fp/C/470.lbm 41.17 +0.34%
spec/2006/fp/C/482.sphinx3 48.13 +0.69%
spec/2006/int/C++/471.omnetpp 22.45 +3.25%
spec/2006/int/C++/473.astar 21.35 -2.06%
spec/2006/int/C++/483.xalancbmk 36.02 -2.39%
spec/2006/int/C/400.perlbench 33.7 -0.17%
spec/2006/int/C/401.bzip2 22.9 +0.52%
spec/2006/int/C/403.gcc 32.42 -0.54%
spec/2006/int/C/429.mcf 39.59 +0.19%
spec/2006/int/C/445.gobmk 26.98 -0.00%
spec/2006/int/C/456.hmmer 24.52 -0.18%
spec/2006/int/C/458.sjeng 28.26 +0.02%
spec/2006/int/C/462.libquantum 55.44 +3.74%
spec/2006/int/C/464.h264ref 46.67 -0.39%
geometric mean +0.20%
Manually checked 473 and 471 to verify the diff is in the noise range.
Reviewers: rengolin, davidxl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D24818
llvm-svn: 284541
David Blaikie [Tue, 18 Oct 2016 21:18:43 +0000 (21:18 +0000)]
dwarfdump: add space missing from the type unit header description
llvm-svn: 284540
David Blaikie [Tue, 18 Oct 2016 21:16:45 +0000 (21:16 +0000)]
dwarfdump: Include the name in the unit description, even in non-summarized mode
(accidentally removed this from my previous change when I was rejecting
some clang-format formatting... )
llvm-svn: 284539
Dehao Chen [Tue, 18 Oct 2016 21:13:31 +0000 (21:13 +0000)]
Add target for test to fix regression introduced by r284533.
llvm-svn: 284538
David Blaikie [Tue, 18 Oct 2016 21:09:48 +0000 (21:09 +0000)]
dwarfdump: -summarize-types: print a short summary (unqualified type name, hash, length) of type units rather than dumping contents
This is just a quick utility handy for getting rough summaries of types
in a given object or dwo file. I've been using it to investigate the
amount of type info redundancy across a project build, for example.
llvm-svn: 284537
Eli Friedman [Tue, 18 Oct 2016 21:03:40 +0000 (21:03 +0000)]
Improve ARM lowering for "icmp <2 x i64> eq".
The custom lowering is pretty straightforward: basically, just AND
together the two halves of a <4 x i32> compare.
Differential Revision: https://reviews.llvm.org/D25713
llvm-svn: 284536
Davide Italiano [Tue, 18 Oct 2016 21:02:27 +0000 (21:02 +0000)]
[GVN] Consistently use division instead of shift. NFCI.
This is in line with other places of GVN (e.g. load coercion
logic).
llvm-svn: 284535
Davide Italiano [Tue, 18 Oct 2016 21:00:26 +0000 (21:00 +0000)]
[GVN] Remove dead code. NFC.
llvm-svn: 284534
Dehao Chen [Tue, 18 Oct 2016 20:42:47 +0000 (20:42 +0000)]
Use profile info to set function section prefix to group hot/cold functions.
Summary:
The original implementation is in r261607, which was reverted in r269726 to accomendate the ProfileSummaryInfo analysis pass. The new implementation:
1. add a new metadata for function section prefix
2. query against ProfileSummaryInfo in CGP to set the correct section prefix for each function
3. output the section prefix set by CGP
Reviewers: davidxl, eraman
Subscribers: vsk, llvm-commits
Differential Revision: https://reviews.llvm.org/D24989
llvm-svn: 284533
Evandro Menezes [Tue, 18 Oct 2016 20:41:30 +0000 (20:41 +0000)]
[AArch64] Fix test triplet
llvm-svn: 284532
Evandro Menezes [Tue, 18 Oct 2016 20:37:35 +0000 (20:37 +0000)]
[AArch64] Avoid materializing 0.0 when generating FP SELECT
Transform `a == 0.0 ? 0.0 : x` to `a == 0.0 ? a : x` and `a != 0.0 ? x : 0.0`
to `a != 0.0 ? x : a` to avoid materializing 0.0 for FCSEL, since it does not
have to be materialized beforehand for FCMP, as it has a form that has 0.0
as an implicit operand.
Differential Revision: https://reviews.llvm.org/D24808
llvm-svn: 284531
Richard Smith [Tue, 18 Oct 2016 20:27:16 +0000 (20:27 +0000)]
Add missing warning for use of C++1z init-statements in C++14 and before.
llvm-svn: 284530
Kevin Enderby [Tue, 18 Oct 2016 20:24:12 +0000 (20:24 +0000)]
One more additional error check for invalid Mach-O files for a
load command that use the MachO:: linkedit_data_command
type but is not used in llvm libObject code but used in llvm tool code.
This is for the LC_CODE_SIGNATURE load command.
llvm-svn: 284529
Richard Smith [Tue, 18 Oct 2016 20:13:25 +0000 (20:13 +0000)]
[c++1z] Fix corner case where we could create a function type whose canonical type is not actually canonical.
llvm-svn: 284528
Tim Northover [Tue, 18 Oct 2016 20:03:51 +0000 (20:03 +0000)]
GlobalISel: translate the @llvm.objectsize intrinsic.
llvm-svn: 284527
Tim Northover [Tue, 18 Oct 2016 20:03:48 +0000 (20:03 +0000)]
GlobalISel: select small binary operations on AArch64.
AArch64 actually supports many 8-bit operations under the definition used by
GlobalISel: the designated information-carrying bits of a GPR32 get the right
value if you just use the normal 32-bit instruction.
llvm-svn: 284526
Tim Northover [Tue, 18 Oct 2016 20:03:45 +0000 (20:03 +0000)]
GlobalISel: translate memcpy intrinsics.
llvm-svn: 284525
Mandeep Singh Grang [Tue, 18 Oct 2016 20:01:12 +0000 (20:01 +0000)]
Remove unused typedef
Summary: Unused: typedef SmallSetVector<RegionT *, 4> RegionSet
Reviewers: MatzeB, grosser
Subscribers: zinob
Differential Revision: https://reviews.llvm.org/D25744
llvm-svn: 284524
Tim Northover [Tue, 18 Oct 2016 19:47:57 +0000 (19:47 +0000)]
GlobalISel: support floating-point constants on AArch64.
Patch from Ahmed Bougacha.
llvm-svn: 284523
Krzysztof Parzyszek [Tue, 18 Oct 2016 19:47:20 +0000 (19:47 +0000)]
[Hexagon] Handle block live-ins with lane masks in HexagonBlockRanges
llvm-svn: 284522
Benjamin Kramer [Tue, 18 Oct 2016 19:39:31 +0000 (19:39 +0000)]
Reduce global namespace pollution. NFC.
llvm-svn: 284521
Benjamin Kramer [Tue, 18 Oct 2016 19:39:23 +0000 (19:39 +0000)]
[esan] Remove global variable.
It's not thread safe and completely unnecessary.
llvm-svn: 284520
Richard Smith [Tue, 18 Oct 2016 19:29:18 +0000 (19:29 +0000)]
When two function types have equivalent (but distinct) noexcept specifications, create separate type sugar nodes. This is necessary so that substitution into the exception specification will substitute into the correct expression.
llvm-svn: 284519
Simon Pilgrim [Tue, 18 Oct 2016 19:28:12 +0000 (19:28 +0000)]
[X86][SSE] Added vector lshr/shl combine tests
This doesn't cover all combines in DAGCombiner::visitSRL/visitSHL yet, but identifies several cases where we fail to combine vectors (or non-splatted) vectors
llvm-svn: 284518
Mandeep Singh Grang [Tue, 18 Oct 2016 19:22:20 +0000 (19:22 +0000)]
Fix clang tests
Summary:
Add REQUIRES for target specific tests.
Patch by Azharuddin Mohammed.
Reviewers: apazos, weimingz, rsmith, ddunbar, spop, mgrang
Subscribers: sebpop, llvm-commits
Differential Revision: https://reviews.llvm.org/D25574
llvm-svn: 284517
Akira Hatanaka [Tue, 18 Oct 2016 19:05:41 +0000 (19:05 +0000)]
[CodeGen][ObjC] Do not call objc_storeStrong when initializing a
constexpr variable.
When compiling a constexpr NSString initialized with an objective-c
string literal, CodeGen emits objc_storeStrong on an uninitialized
alloca, which causes a crash.
This patch folds the code in EmitScalarInit into EmitStoreThroughLValue
and fixes the crash by calling objc_retain on the string instead of
using objc_storeStrong.
rdar://problem/
28562009
Differential Revision: https://reviews.llvm.org/D25547
llvm-svn: 284516
Benjamin Kramer [Tue, 18 Oct 2016 18:59:58 +0000 (18:59 +0000)]
[InterleavedAccessPass] Remove global variable.
This is a threading hazard and rightfully complained about by tsan. No
functionality change.
llvm-svn: 284515
Kostya Serebryany [Tue, 18 Oct 2016 18:38:08 +0000 (18:38 +0000)]
[libFuzzer] detect leaks after every run when executing fixed inputs (./fuzzer -runs=1000000 my-file)
llvm-svn: 284514
Sanjay Patel [Tue, 18 Oct 2016 18:36:49 +0000 (18:36 +0000)]
revert r284495: [Target] remove TargetRecip class
There's something wrong with the StringRef usage while parsing the attribute string.
llvm-svn: 284513
Kuba Brecka [Tue, 18 Oct 2016 18:33:42 +0000 (18:33 +0000)]
[tsan] Always use -std=c++11 in TSan tests
We currently only pass -std=c++11 when we have an instrumented libcxx.
Differential Revision: https://reviews.llvm.org/D25740
llvm-svn: 284512
Vedant Kumar [Tue, 18 Oct 2016 18:19:02 +0000 (18:19 +0000)]
Drop a redundant ".get()" call (NFC)
Pointed out by Malcolm Parsons.
llvm-svn: 284510
Kostya Serebryany [Tue, 18 Oct 2016 18:11:42 +0000 (18:11 +0000)]
[sancov] add __sanitizer_cov_trace_pc_guard to the supported coverage points
llvm-svn: 284509
Kostya Serebryany [Tue, 18 Oct 2016 18:06:05 +0000 (18:06 +0000)]
[libFuzzer] reshuffle the code for -exit_on_src_pos and -exit_on_item
llvm-svn: 284508
Vitaly Buka [Tue, 18 Oct 2016 18:05:06 +0000 (18:05 +0000)]
[asan] Rename test file as the poisoning is not "experimental"
Reviewers: eugenis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D25737
llvm-svn: 284507
Vitaly Buka [Tue, 18 Oct 2016 18:05:04 +0000 (18:05 +0000)]
[asan] Combine check-prefixes in stack-poisoning test
Reviewers: eugenis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D25736
llvm-svn: 284506
Vitaly Buka [Tue, 18 Oct 2016 18:04:59 +0000 (18:04 +0000)]
[asan] Make -asan-experimental-poisoning the only behavior
Reviewers: eugenis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D25735
llvm-svn: 284505
Kevin Enderby [Tue, 18 Oct 2016 17:54:17 +0000 (17:54 +0000)]
Next set of additional error checks for invalid Mach-O files for the
load commands that use the MachO::routines_command and
and MachO::routines_command_64 types but are not used in llvm
libObject code but used in llvm tool code.
This includes the LC_ROUTINES and LC_ROUTINES_64
load commands.
llvm-svn: 284504
Justin Lebar [Tue, 18 Oct 2016 17:50:39 +0000 (17:50 +0000)]
[ADT] Remove CachedHash<T>.
Nobody is using it.
Differential Revision: https://reviews.llvm.org/D25630
llvm-svn: 284503
Justin Lebar [Tue, 18 Oct 2016 17:50:36 +0000 (17:50 +0000)]
Use CachedHashStringRef instead of CachedHash<StringRef>.
Summary:
This uses one less word on 64-bit platforms, so should be a strict
improvement. This change also lets us get rid of llvm::CachedHash.
Reviewers: rafael, timshen
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D25646
llvm-svn: 284502
Sanjoy Das [Tue, 18 Oct 2016 17:45:16 +0000 (17:45 +0000)]
[SCEV] Make CompareValueComplexity a little bit smarter
This helps canonicalization in some cases.
Thanks to Pankaj Chawla for the investigation and the test case!
llvm-svn: 284501
Sanjoy Das [Tue, 18 Oct 2016 17:45:13 +0000 (17:45 +0000)]
[SCEV] Extract out a helper function; NFC
llvm-svn: 284500
Jonathan Peyton [Tue, 18 Oct 2016 17:39:06 +0000 (17:39 +0000)]
Fix OpenMP 4.0 library build
Patch by Andrey Churbanov
Differential Revision: https://reviews.llvm.org/D25505
llvm-svn: 284499
Simon Pilgrim [Tue, 18 Oct 2016 17:31:07 +0000 (17:31 +0000)]
[X86][SSE] Added vector ashr combine tests
This doesn't cover all combines in DAGCombiner::visitSRA yet, but identifies several cases where we fail to combine vectors (or non-splatted) vectors
llvm-svn: 284498
Teresa Johnson [Tue, 18 Oct 2016 17:17:37 +0000 (17:17 +0000)]
[docs] Increase minimum supported GCC version for building LLVM to 4.8
Summary:
The RFC proposal sent to increase the minimum required GCC version
to 4.8 received a lot of support. See the following thread:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105955.html,
This patch implements that by updating the docs. I believe the
references to libstdc++ 4.7 issues can be removed as well, please
let me know if that is not the case or if they should be updated
a different way.
Reviewers: rengolin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D25683
llvm-svn: 284497
Michal Gorny [Tue, 18 Oct 2016 17:07:30 +0000 (17:07 +0000)]
[cmake] Update lit search to match the one in LLVM
Update the lit search logic to support all names supported in LLVM
(since r283029). The search order (i.e. PATHS vs HINTS) does no really
matter since the established path is not used, except for determining
whether lit is available.
Differential Revision: https://reviews.llvm.org/D23745
llvm-svn: 284496
Sanjay Patel [Tue, 18 Oct 2016 17:05:05 +0000 (17:05 +0000)]
[Target] remove TargetRecip class; move reciprocal estimate isel functionality to TargetLowering
This is a follow-up to D24816 - where we changed reciprocal estimates to be function attributes
rather than TargetOptions.
This patch is intended to be a structural, but not functional change. By moving all of the
TargetRecip functionality into TargetLowering, we can remove all of the reciprocal estimate
state, shield the callers from the string format implementation, and simplify/localize the
logic needed for a target to enable this.
If a function has a "reciprocal-estimates" attribute, those settings may override the target's
default reciprocal preferences for whatever operation and data type we're trying to optimize.
If there's no attribute string or specific setting for the op/type pair, just use the target
default settings.
As noted earlier, a better solution would be to move the reciprocal estimate settings to IR
instructions and SDNodes rather than function attributes, but that's a multi-step job that
requires infrastructure improvements. I intend to work on that, but it's not clear how long
it will take to get all the pieces in place.
Differential Revision: https://reviews.llvm.org/D25440
llvm-svn: 284495
Michal Gorny [Tue, 18 Oct 2016 16:54:59 +0000 (16:54 +0000)]
[solaris] Convert the support library to C++ to fix -std=c++11 build
Convert the Solaris xlocale.c compatibility library from plain C to C++
in order to fix the build failures caused by the addition of -std=c++11
to LIBCXX_COMPILE_FLAGS. The additional flag got propagated to the C
file, resulting in error with strict compilers.
Differential Revision: https://reviews.llvm.org/D25431
llvm-svn: 284494
Michal Gorny [Tue, 18 Oct 2016 16:54:54 +0000 (16:54 +0000)]
[solaris] Fix iswxdigit_l() support function prototype
Fix the iswxdigit_l() function prototype to take wint_t parameter
instead of incorrect wchar_t.
Differential Revision: https://reviews.llvm.org/D25431
llvm-svn: 284493
Michal Gorny [Tue, 18 Oct 2016 16:38:44 +0000 (16:38 +0000)]
Fix a compile error on musl-libc due to strerror_r() prototype
Function strerror_r() has different signatures in different
implementations of libc: glibc's version returns a char*, while BSDs
and musl return a int. libomp unconditionally assumes glibc on Linux
and thus fails to compile against musl-libc. This patch addresses this
issue.
Differential Revision: https://reviews.llvm.org/D25071
llvm-svn: 284492
Simon Pilgrim [Tue, 18 Oct 2016 16:36:00 +0000 (16:36 +0000)]
[DAGCombiner] Add splatted vector support to (udiv x, (shl pow2, y)) -> x >>u (log2(pow2)+y)
llvm-svn: 284491
Adrian Prantl [Tue, 18 Oct 2016 16:24:43 +0000 (16:24 +0000)]
Disable fatal errors in the Verifier instantiated by bugpoint's crash
debugger.
When bugpoint hacks at a testcase it may at one point create illegal
debug info metadata that won't even pass the Verifier. A bugpoint
*driver* built with assertions should not assert on it, but reject the
malformed intermediate step and continue to do its job.
llvm-svn: 284490
Jonathan Peyton [Tue, 18 Oct 2016 16:20:55 +0000 (16:20 +0000)]
Mixed type atomic routines added for capture and update/capture reverse.
New mixed type atomic routines added for regular capture operations as well as
reverse update/capture operations. LHS - all integer and float types (no
complex so far), RHS - float16.
Patch by Olga Malysheva
Differential Revision: https://reviews.llvm.org/D25275
llvm-svn: 284489
Simon Pilgrim [Tue, 18 Oct 2016 15:45:37 +0000 (15:45 +0000)]
[X86][AVX512] Add mask/maskz writemask support to constant pool shuffle decode commentx
llvm-svn: 284488
Rafael Espindola [Tue, 18 Oct 2016 15:31:23 +0000 (15:31 +0000)]
Use reserve instead of grow.
The table was still being resized as grow doesn't account for the fact
that the table needs to remain 3/4 full.
llvm-svn: 284487
Erik Pilkington [Tue, 18 Oct 2016 15:26:43 +0000 (15:26 +0000)]
Revert r284265 "[Sema] Refactor context checking for availability diagnostics"
This has a bug in it, pointed out by Bob Wilson!
llvm-svn: 284486
Simon Dardis [Tue, 18 Oct 2016 15:17:17 +0000 (15:17 +0000)]
[mips][ias] Handle more complicated expressions for memory operands
This patch teaches ias for mips to handle expressions such as
(8*4)+(8*31)($sp). Such expression typically occur from the expansion
of multiple macro definitions.
This partially resolves PR/30383.
Thanks to Sean Bruno for reporting the issue!
Reviewers: zoran.jovanovic, vkalintiris
Differential Revision: https://reviews.llvm.org/D24667
llvm-svn: 284485
Todd Fiala [Tue, 18 Oct 2016 15:15:24 +0000 (15:15 +0000)]
xfail TestMiSyntax.py's test_lldbmi_output_grammar on macOS
Needs to be investigated. This is failing locally and on the
Xcode CI.
rdar://
28805064
llvm-svn: 284484
Simon Dardis [Tue, 18 Oct 2016 14:42:13 +0000 (14:42 +0000)]
[mips] Fix sync instruction definition
The 'sync' instruction for MIPS was defined in MIPS-II as taking no operands.
MIPS32 extended the define of 'sync' as taking an optional unsigned 5 bit
immediate.
This patch correct the definition of sync so that it is accepted with an
operand of 0 or no operand for MIPS-II to MIPS-V, and a 5 bit unsigned
immediate for MIPS32 and later revisions.
Additionally a clear error is given when the MIPS32 version of sync is
used when targeting pre MIPS32.
This partially resolves PR/30714.
Thanks to Daniel Sanders for reporting this issue!
Reveiwers: vkalintiris
Differential Revision: https://reviews.llvm.org/D25672
llvm-svn: 284483
Victor Leschuk [Tue, 18 Oct 2016 14:31:22 +0000 (14:31 +0000)]
DebugInfo: change alignment type from uint64_t to uint32_t to save space.
In futher patches we shall have alignment field added to DIVariable family
and switching from uint64_t to uint32_t will save 4 bytes per variable.
Differential Revision: https://reviews.llvm.org/D25620
llvm-svn: 284482
Simon Dardis [Tue, 18 Oct 2016 14:28:00 +0000 (14:28 +0000)]
[mips] Macro expansion for ld, sd for O32
ld and sd when assembled for the O32 ABI expand to a pair of 32 bit word loads
or stores using the specified source or destination register and the next
register.
This patch does not add support for the cases where the offset is greater than
a 16 bit signed immediate as that would lead to a wrong/misleading error
message as the assembler would report "instruction requires a CPU feature
not currently enabled" for ld & sd for MIPS64 when their offset is not a signed
16 bit number.
This fixes PR/29159.
Thanks to Sean Bruno for reporting this issue!
Reviewers: vkalintiris, seanbruno, zoran.jovanovic
Differential Review: https://reviews.llvm.org/D24556
llvm-svn: 284481
Michael Zuckerman [Tue, 18 Oct 2016 13:52:39 +0000 (13:52 +0000)]
[x86][inline-asm][avx512] allow swapping of '{k<num>}' & '{z}' marks
Committing on behalf of Coby Tayree: After check-all and LGTM
Desc:
AVX512 allows dest operand to be followed by an op-mask register specifier ('{k<num>}', which in turn may be followed by a merging/zeroing specifier ('{z}')
Currently, the following forms are allowed:
{k<num>}
{k<num>}{z}
This patch allows the following forms:
{z}{k<num>}
and ignores the next form:
{z}
Justification would be quite simple - GCC
Differential Revision: http://reviews.llvm.org/D25013
llvm-svn: 284479
Simon Pilgrim [Tue, 18 Oct 2016 13:44:00 +0000 (13:44 +0000)]
Strip trailing whitespace (NFCI)
llvm-svn: 284478
Daniel Marjamaki [Tue, 18 Oct 2016 13:16:53 +0000 (13:16 +0000)]
alpha.core.UnreachableCode - don't warn about unreachable code inside macro
In macros, 'do {...} while (0)' is often used. Don't warn about the condition 0 when it is unreachable.
Differential Revision: https://reviews.llvm.org/D25606
llvm-svn: 284477
Simon Pilgrim [Tue, 18 Oct 2016 13:15:31 +0000 (13:15 +0000)]
Fix signed/unsigned comparison warnings
llvm-svn: 284476
Vasileios Kalintiris [Tue, 18 Oct 2016 13:05:42 +0000 (13:05 +0000)]
[mips][FastISel] Instantiate the MipsFastISel class only for targets that support FastISel.
Summary:
Instead of instantiating the MipsFastISel class and checking if the
target is supported in the overriden methods, we should perform that
check before creating the class. This allows us to enable FastISel *only*
for targets that truly support it, ie. MIPS32 to MIPS32R5.
Reviewers: sdardis
Subscribers: ehostunreach, llvm-commits
Differential Revision: https://reviews.llvm.org/D24824
llvm-svn: 284475
George Rimar [Tue, 18 Oct 2016 11:11:03 +0000 (11:11 +0000)]
[ELF] - Update testcases after llvm change.
llvm-svn: 284474
Artem Dergachev [Tue, 18 Oct 2016 11:06:28 +0000 (11:06 +0000)]
[analyzer] Add NumberObjectConversion checker.
When dealing with objects that represent numbers, such as Objective-C NSNumber,
the language provides little protection from accidentally interpreting
the value of a pointer to such object as the value of the number represented
by the object. Results of such mis-interpretation may be unexpected.
The checker attempts to fill this gap in cases when the code is obviously
incorrect.
With "Pedantic" option enabled, this checker enforces a coding style to
completely prevent errors of this kind (off by default).
Differential Revision: https://reviews.llvm.org/D22968
llvm-svn: 284473
Alex Lorenz [Tue, 18 Oct 2016 10:55:01 +0000 (10:55 +0000)]
[CodeCompletion] Add a block property setter completion result
This commit changes code completion results for Objective-C block properties:
clang now suggests an additional completion result that displays the block
property together with '=' and the block literal placeholder for the appropriate
readwrite block properties.
This commit uses a simple heuristic to determine when it's appropriate to
suggest a setter completion for block properties: the additional block setter
completion is provided iff the member access that's being completed is a
standalone statement.
rdar://
28481726
Differential Revision: https://reviews.llvm.org/D25520
llvm-svn: 284472
George Rimar [Tue, 18 Oct 2016 10:54:56 +0000 (10:54 +0000)]
[llvm-readobj] - Teach readobj to print PT_OPENBSD_RANDOMIZE/PT_OPENBSD_WXNEEDED headers.
These are OpenBSD specific program headers and
currently we support them in LLD.
Description of headers (just in case) available here:
http://man.openbsd.org/OpenBSD-current/man5/elf.5
OpenBSD commits were:
For PT_OPENBSD_RANDOMIZE:
https://github.com/openbsd/src/commit/
c494713c450d98da3f2e1451ee8c7fb675a7c461
For PT_OPENBSD_WXNEEDED:
https://github.com/openbsd/src/commit/
2a5a8fc7e30928c2cff57cfe5fb491c90d8478ad
Differential revision: https://reviews.llvm.org/D25616
llvm-svn: 284471
George Rimar [Tue, 18 Oct 2016 10:49:50 +0000 (10:49 +0000)]
[ELF] - Linkerscript: accept integer values for PHDRS types.
Both gold and ld accepts integers instead of named constants
for PHDRS.
Patch adds support for that.
Differential revision: https://reviews.llvm.org/D25549
llvm-svn: 284470
Pavel Labath [Tue, 18 Oct 2016 10:46:45 +0000 (10:46 +0000)]
Fixup r284466 - try to unbreak NetBSD
NetBSD does not have getopt as well - we need to apply the workaround there too.
FreeBSD seems to be fine though.
llvm-svn: 284469
Alex Lorenz [Tue, 18 Oct 2016 10:38:58 +0000 (10:38 +0000)]
[CodeCompletion][NFC] Extract a function that formats block placeholders.
This commit extracts a new function named `formatBlockPlaceholder` from
the function `FormatFunctionParameter` so that it can be reused in follow-up
commits that improve code completion for block property setters.
Differential Revision: https://reviews.llvm.org/D25519
llvm-svn: 284468
Alex Lorenz [Tue, 18 Oct 2016 10:35:27 +0000 (10:35 +0000)]
[CodeCompletion][NFC] Extract a function that looks for block decl type locs.
This commit extracts a new function named `findTypeLocationForBlockDecl` from
the function `FormatFunctionParameter` so that it can be reused in follow-up
commits that improve code completion for block property setters.
Differential Revision: https://reviews.llvm.org/D25519
llvm-svn: 284467
Pavel Labath [Tue, 18 Oct 2016 10:26:57 +0000 (10:26 +0000)]
[cmake] Make dependencies of lldb libraries private, take 2
Summary:
The dependencies of our libraries (only liblldb, really) we marked as public, which caused all
their dependencies to be repeated when linking any executables to them. This is a problem because
then all the .a files could end up being linked twice, once to liblldb and once
again to to the executable linking against liblldb (lldb, lldb-mi). As it turns out,
our build actually depends on this behavior:
- on windows, lldb does not have getopt, so it pulls it from inside liblldb, even
though getopt is not a part of the exported interface of liblldb (maybe some of
the bsd variants have this problem as well)
- lldb-mi uses llvm, which again is not exported by liblldb
This change does not actually fix these problems (that is going to be a hard
one), but it does make them explicit by moving this magic from add_lldb_library
to the places the executable targets are defined. That way, I can link the
additional .a files only on targets that really need it, and the other targets
can build cleanly and make sure we don't regress further. It also fixes the
LLVM_LINK_LLVM_DYLIB build on linux.
Reviewers: zturner, beanz
Subscribers: ki.stfu, lldb-commits, mgorny
Differential Revision: https://reviews.llvm.org/D25680
llvm-svn: 284466
John Brawn [Tue, 18 Oct 2016 10:10:53 +0000 (10:10 +0000)]
[SCEV] More accurate calculation of max backedge count of some less-than loops
In loops that look something like
i = n;
do {
...
} while(i++ < n+k);
where k is a constant, the maximum backedge count is k (in fact the backedge
count will be either 0 or k, depending on whether n+k wraps). More generally
for LHS < RHS if RHS-(LHS of first comparison) is a constant then the loop will
iterate either 0 or that constant number of times.
This allows for more loop unrolling with the recent upper bound loop unrolling
changes, and I'm working on a patch that will let loop unrolling additionally
make use of the loop being executed either 0 or k times (we need to retain the
loop comparison only on the first unrolled iteration).
Differential Revision: https://reviews.llvm.org/D25607
llvm-svn: 284465
Igor Kudrin [Tue, 18 Oct 2016 09:42:03 +0000 (09:42 +0000)]
[libclang] Add missing cursor kinds to python bindings.
Differential Revision: https://reviews.llvm.org/D25673
llvm-svn: 284464
Igor Kudrin [Tue, 18 Oct 2016 09:30:33 +0000 (09:30 +0000)]
[libclang] Fix a failure in a test for python bindings on CursorKind.OVERLOAD_CANDIDATE.
The test fails because the value does not lay in any existing group.
Differential Revision: https://reviews.llvm.org/D25470
llvm-svn: 284463
Renato Golin [Tue, 18 Oct 2016 09:30:18 +0000 (09:30 +0000)]
Revert "Resubmit "Add support for advanced number formatting.""
This reverts commits 284436 and 284437 because they still break AArch64 bots:
Value of: format_number(-10, IntegerStyle::Integer, 1)
Actual: "-0"
Expected: "-10"
llvm-svn: 284462
Simon Pilgrim [Tue, 18 Oct 2016 09:29:13 +0000 (09:29 +0000)]
[X86][SSE] Added extra (mul x, (1 << c)) -> x << c style vector tests
vXi64 will benefit more from lowering to shifts than multiplies
llvm-svn: 284461
Javed Absar [Tue, 18 Oct 2016 09:08:54 +0000 (09:08 +0000)]
[ARM] Assign cost of scaling for Cortex-R52
This patch assigns cost of the scaling used in addressing for Cortex-R52.
On Cortex-R52 a negated register offset takes longer than a non-negated
register offset, in a register-offset addressing mode.
Differential Revision: http://reviews.llvm.org/D25670
Reviewer: jmolloy
llvm-svn: 284460