Zachary Turner [Wed, 19 Oct 2016 16:42:20 +0000 (16:42 +0000)]
[pdb] Improve error messages when DIA is not found.
llvm-svn: 284610
Krzysztof Parzyszek [Wed, 19 Oct 2016 16:30:56 +0000 (16:30 +0000)]
[RDF] Switch RefMap in liveness calculation to use lane masks
This required reengineering of some of the part of liveness calculation,
including fixing some issues caused by the limitations of the previous
approach. The current code is not necessarily the fastest, but it should
be functionally correct (at least more so than before). The compile-time
performance will be addressed in the future.
llvm-svn: 284609
Simon Pilgrim [Wed, 19 Oct 2016 16:15:30 +0000 (16:15 +0000)]
[DAGCombiner] Add general constant vector support to (shl (sra x, c1), c1) -> (and x, (shl -1, c1))
We already supported scalar constant / splatted constant vector - now accepts any (non opaque) constant scalar / vector
llvm-svn: 284608
Simon Pilgrim [Wed, 19 Oct 2016 15:59:28 +0000 (15:59 +0000)]
[DAGCombiner] Add general constant vector support to (shl (mul x, c1), c2) -> (mul x, c1 << c2)
We already supported scalar constant / splatted constant vector - now accepts any (non opaque) constant scalar / vector
llvm-svn: 284607
Tim Northover [Wed, 19 Oct 2016 15:56:12 +0000 (15:56 +0000)]
Revert r284604. A.K.A. "TMP"
Committed by mistake.
llvm-svn: 284606
Tim Northover [Wed, 19 Oct 2016 15:55:11 +0000 (15:55 +0000)]
Sparc: fix test.
llvm-svn: 284605
Tim Northover [Wed, 19 Oct 2016 15:55:09 +0000 (15:55 +0000)]
TMP
llvm-svn: 284604
Tim Northover [Wed, 19 Oct 2016 15:55:06 +0000 (15:55 +0000)]
GlobalISel: support translating volatile loads and stores.
llvm-svn: 284603
Marshall Clow [Wed, 19 Oct 2016 15:12:50 +0000 (15:12 +0000)]
Implement constexpr support for reverse_iterator. Reviewed as https://reviews.llvm.org/D25534
llvm-svn: 284602
Pavel Labath [Wed, 19 Oct 2016 15:12:45 +0000 (15:12 +0000)]
Simplify GetGlobalProperties functions of Thread/Process/Target
Summary:
"Initialization of function-local statics is guaranteed to occur only once even when called from
multiple threads, and may be more efficient than the equivalent code using std::call_once."
<http://en.cppreference.com/w/cpp/thread/call_once>
I'd add that it's also more readable.
Reviewers: clayborg, zturner
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D17710
llvm-svn: 284601
Eugene Leviant [Wed, 19 Oct 2016 15:04:49 +0000 (15:04 +0000)]
[ELF] Choose default segment when it is not specified
Linker scripts may specify PHDRS, but not specify section to
segment assignments, i.e:
PHDRS { seg PT_LOAD; }
SECTIONS {
.sec1 {} : seg
.sec2 {}
}
In such case linker should still choose some segment for .sec2 section.
This patch will add .sec2 to previously opened segments (seg) or to the
very first PT_LOAD segment, if no section-to-segment assignments has been
made
Differential revision: https://reviews.llvm.org/D24795
llvm-svn: 284600
Pavel Labath [Wed, 19 Oct 2016 15:01:22 +0000 (15:01 +0000)]
Remove IntervalTimer class
Summary:
it was added back in 2013, but there are no uses of it. I started refactoring
it, but then it occured to me it would better to delete it.
Reviewers: clayborg, zturner
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D25393
llvm-svn: 284599
Rafael Espindola [Wed, 19 Oct 2016 14:50:26 +0000 (14:50 +0000)]
Don't gc non-alloca non-string pieces.
We were already doing it for strings. This matches the behavior of
bfd and gold.
llvm-svn: 284598
Artur Pilipenko [Wed, 19 Oct 2016 14:44:23 +0000 (14:44 +0000)]
Introduce ConstantRange.addWithNoSignedWrap
To be used by upcoming change to IndVarSimplify
Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D25732
llvm-svn: 284597
Marek Kurdej [Wed, 19 Oct 2016 14:28:19 +0000 (14:28 +0000)]
[clang-tidy] Add cert-err09-cpp check alias.
Summary: This adds cert-err09-cpp alias for completeness, similar to cert-err61-cpp.
Reviewers: alexfh, hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25770
llvm-svn: 284596
Benjamin Kramer [Wed, 19 Oct 2016 14:22:38 +0000 (14:22 +0000)]
Remove unused diagnostics. NFC.
llvm-svn: 284595
Rafael Espindola [Wed, 19 Oct 2016 14:17:36 +0000 (14:17 +0000)]
Add a faster binary search.
Even with the hash table cache, binary search was still pretty
hot. This can be made even faster with prefetching.
Idea from http://cglab.ca/~morin/misc/arraylayout-v2/
I will suggest moving this to llvm.
llvm-svn: 284594
Dimitar Vlahovski [Wed, 19 Oct 2016 14:14:18 +0000 (14:14 +0000)]
Minidump plugin: functions parsing memory structures and filtering module list
Summary:
Now the Minidump parser can parse the:
1) MemoryInfoList - containing region info about memory ranges (readable,
writable, executable)
2) Memory64List - this is the stuct used when the Minidump is a
full-memory one.
3) Adding filtering of the module list (shared libraries list) - there
can be mutliple records in the module list under the same name but with
different load address (e.g. when the binary has non contigious
sections). FilterModuleList eliminates the duplicated modules, leaving
the one with the lowest load addr.
Added unit tests for everything.
Reviewers: labath, zturner
Subscribers: beanz, mgorny, modocache, lldb-commits, amccarth
Differential Revision: https://reviews.llvm.org/D25569
llvm-svn: 284593
Haojian Wu [Wed, 19 Oct 2016 14:13:21 +0000 (14:13 +0000)]
[clang-move] Move using-decl in old cc.
Summary:
Another fix is to move the whole anonymous namespace declaration
completely instead of moving fun/var declarations only.
Reviewers: ioeric
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25762
llvm-svn: 284592
Chris Dewhurst [Wed, 19 Oct 2016 14:01:06 +0000 (14:01 +0000)]
[Sparc][LEON] Detects an erratum on UT699 LEON 3 processors involving rounding mode changes and issues an appropriate user error message.
Differential Revision: https://reviews.llvm.org/D24665
llvm-svn: 284591
Pavel Labath [Wed, 19 Oct 2016 13:58:55 +0000 (13:58 +0000)]
Add Chrono.h - std::chrono support header
Summary:
std::chrono mostly covers the functionality of llvm::sys::TimeValue and
lldb_private::TimeValue. This header adds a bit of utility functions and
typedefs, which make the usage of the library and porting code from TimeValues
easier.
Rationale:
- TimePoint typedef - precision of system_clock is implementation defined -
using a well-defined precision helps maintain consistency between platforms,
makes it interact better with existing TimeValue classes, and avoids cases
there a time point is implicitly convertible to a specific precision on some
platforms but not on others.
- system_clock::to_time_t only accepts time_points with the default system
precision (even though time_t has only second precision on all platforms we
support). To avoid the need for explicit casts, I have added a toTimeT()
wrapper function. toTimePoint(time_t) was not strictly necessary, but I have
added it for symmetry.
Reviewers: zturner, mehdi_amini
Subscribers: beanz, mgorny, llvm-commits, modocache
Differential Revision: https://reviews.llvm.org/D25416
llvm-svn: 284590
Benjamin Kramer [Wed, 19 Oct 2016 13:50:17 +0000 (13:50 +0000)]
Don't copy replacements in for-range loop. NFC.
llvm-svn: 284589
Sjoerd Meijer [Wed, 19 Oct 2016 13:43:02 +0000 (13:43 +0000)]
Reapply r284571 (with the new tests fixed).
llvm-svn: 284588
NAKAMURA Takumi [Wed, 19 Oct 2016 13:41:12 +0000 (13:41 +0000)]
llvm/test/MC/Mips/macro-ld-sd.s: Sweep a spurious character \xA0 in the test file.
It might crash FileCheck.
llvm-svn: 284587
Ulrich Weigand [Wed, 19 Oct 2016 13:03:18 +0000 (13:03 +0000)]
[SystemZ] Add missing vector instructions for the assembler
Most z13 vector instructions have a base form where the data type of
the operation (whether to consider the vector to be 16 bytes, 8
halfwords, 4 words, or 2 doublewords) is encoded into a mask field,
and then a set of extended mnemonics where the mask field is not
present but the data type is encoded into the mnemonic name.
Currently, LLVM only supports the type-specific forms (since those
are really the ones needed for code generation), but not the base
type-generic forms.
To complete the assembler support and make it fully compatible with
the GNU assembler, this commit adds assembler aliases for all the
base forms of the various vector instructions.
It also adds two more alias forms that are documented in the PoP:
VFPSO/VFPSODB/WFPSODB -- generic form of VFLCDB etc.
VNOT -- special variant of VNO
llvm-svn: 284586
Ulrich Weigand [Wed, 19 Oct 2016 12:57:46 +0000 (12:57 +0000)]
[SystemZ] Add optional argument to some vector string instructions
The vfee[bhf], vfene[bhf], and vistr[bhf] assembler mnemonics are
documented in the Principles of Operation to have an optional last
operand to encode arbitrary values in a mask field.
This commit adds support for those optional operands, and cleans up
the patterns to generate vector string instruction as bit. No change
to code generation intended.
llvm-svn: 284585
Michal Gorny [Wed, 19 Oct 2016 12:54:28 +0000 (12:54 +0000)]
[cmake] Use LLVM_CMAKE_PATH for GetSVN script
Use the LLVM_CMAKE_PATH variable to locate the GetSVN.cmake script.
The variable was already available in stand-alone builds, and is also
set by LLVM since r284581.
llvm-svn: 284584
Michal Gorny [Wed, 19 Oct 2016 12:34:17 +0000 (12:34 +0000)]
[cmake] Allow testing against installed LLVM with no sources
Adjust the stand-alone build files to accept either CMake files from
LLVM_CMAKE_PATH or from LLVM_MAIN_SRC_DIR instead of requiring both.
This makes it possible to run libcxx tests on top of installed LLVM
and lit, without having to unpack a copy of LLVM sources. Furthermore,
it avoids adding duplicate paths.
Differential Revision: https://reviews.llvm.org/D25093
llvm-svn: 284583
Michal Gorny [Wed, 19 Oct 2016 12:21:39 +0000 (12:21 +0000)]
[cmake] Use LLVM_CMAKE_PATH for GetSVN script
Use the LLVM_CMAKE_PATH variable to locate the GetSVN.cmake script.
The variable was already available in stand-alone builds, and is also
set by LLVM since r284581.
llvm-svn: 284582
Michal Gorny [Wed, 19 Oct 2016 12:18:34 +0000 (12:18 +0000)]
[cmake] Declare LLVM_CMAKE_PATH for use in subprojects
Declare the LLVM_CMAKE_PATH to the source directory location of CMake
files, in order to make it possible to easily use them in subprojects.
Such a variable is already declared in most of LLVM projects
(and inconsistently mixed with direct source tree references), including
Clang, LLDB, compiler-rt, libcxx... Declaring it inside main LLVM tree
makes it possible to avoid having to declare fallback values or use
conditionals in those projects.
It should be noted that in some of the subprojects LLVM_CMAKE_PATH is
used to reference generated LLVMConfig.cmake file. However, these
references are conditional to stand-alone builds and explicitly
including this file is unnecessary in combined builds.
Differential Revision: https://reviews.llvm.org/D25724
llvm-svn: 284581
James Molloy [Wed, 19 Oct 2016 12:06:49 +0000 (12:06 +0000)]
[Thumb-1] Synthesize TBB/TBH instructions to make use of compressed jump tables
The TBB and TBH instructions in Thumb-2 allow jump tables to be compressed into sequences of bytes or shorts respectively. These instructions do not exist in Thumb-1, however it is possible to synthesize them out of a sequence of other instructions.
It turns out this sequence is so short that it's almost never a lose for performance and is ALWAYS a significant win for code size.
TBB example:
Before: lsls r0, r0, #2 After: add r0, pc
adr r1, .LJTI0_0 ldrb r0, [r0, #6]
ldr r0, [r0, r1] lsls r0, r0, #1
mov pc, r0 add pc, r0
=> No change in prologue code size or dynamic instruction count. Jump table shrunk by a factor of 4.
The only case that can increase dynamic instruction count is the TBH case:
Before: lsls r0, r4, #2 After: lsls r4, r4, #1
adr r1, .LJTI0_0 add r4, pc
ldr r0, [r0, r1] ldrh r4, [r4, #6]
mov pc, r0 lsls r4, r4, #1
add pc, r4
=> 1 more instruction in prologue. Jump table shrunk by a factor of 2.
So there is an argument that this should be disabled when optimizing for performance (and a TBH needs to be generated). I'm not so sure about that in practice, because on small cores with Thumb-1 performance is often tied to code size. But I'm willing to turn it off when optimizing for performance if people want (also note that TBHs are fairly rare in practice!)
llvm-svn: 284580
Andrey Bokhanko [Wed, 19 Oct 2016 12:06:10 +0000 (12:06 +0000)]
[Sema] Gcc compatibility of vector shift
Gcc prints error if elements of left and right parts of a shift have different
sizes. This patch is provided the GCC compatibility.
Patch by Vladimir Yakovlev.
Differential Revision: https://reviews.llvm.org/D24669
llvm-svn: 284579
Simon Pilgrim [Wed, 19 Oct 2016 11:28:15 +0000 (11:28 +0000)]
[DAGCombiner] Just call isConstOrConstSplat directly. NFCI.
This will get the same ConstantSDNode scalar or vector splat value as the current separate dyn_cast<ConstantSDNode> / isVector() approach.
llvm-svn: 284578
Vassil Vassilev [Wed, 19 Oct 2016 11:19:30 +0000 (11:19 +0000)]
[modules] Do not report missing definitions of demoted constexpr variable templates.
This is a followup to regression introduced in r284284.
This should fix our libstdc++ modules builds.
https://reviews.llvm.org/D25678
Reviewed by Richard Smith!
llvm-svn: 284577
Simon Pilgrim [Wed, 19 Oct 2016 11:16:58 +0000 (11:16 +0000)]
Fix line endings
llvm-svn: 284576
Eugene Leviant [Wed, 19 Oct 2016 09:35:19 +0000 (09:35 +0000)]
[ELF] Add "error" and "warning" prefixes to linker messages
Differential revision: https://reviews.llvm.org/D25729
llvm-svn: 284575
Simon Pilgrim [Wed, 19 Oct 2016 08:57:37 +0000 (08:57 +0000)]
[DAGCombine] Generalize distributeTruncateThroughAnd to work with any non-opaque constant or constant vector
llvm-svn: 284574
Eric Liu [Wed, 19 Oct 2016 08:19:46 +0000 (08:19 +0000)]
[clang-format] Add comment manipulation header
Summary:
Introduces a separate target for comment manipulation.
Currently, comment manipulation is in BreakableComment.cpp.
Towards implementing comment reflowing, we want to factor out the
comment-related functionality, so it can be reused.
Start simple by just moving out getLineCommentIndentPrefix.
Patch by Krasimir Georgiev!
Reviewers: djasper
Subscribers: klimek, beanz, mgorny, modocache
Differential Revision: https://reviews.llvm.org/D25725
llvm-svn: 284573
Sjoerd Meijer [Wed, 19 Oct 2016 07:45:48 +0000 (07:45 +0000)]
Revert of r284571 because of failing tests.
llvm-svn: 284572
Sjoerd Meijer [Wed, 19 Oct 2016 07:25:06 +0000 (07:25 +0000)]
Checking FP function attribute values and adding more build attribute tests.
This renames the function for checking FP function attribute values and also
adds more build attribute tests (which are in separate files because build
attributes are set per file).
Differential Revision: https://reviews.llvm.org/D25625
llvm-svn: 284571
NAKAMURA Takumi [Wed, 19 Oct 2016 05:43:17 +0000 (05:43 +0000)]
DenseSet: Appease msc18 to define derived constructors explicitly.
msc18 doesn't recognize "using BaseT::BaseT;"
llvm\include\llvm/ADT/DenseSet.h(213) : error C2875: using-declaration causes a multiple declaration of 'BaseT'
llvm\include\llvm/ADT/DenseSet.h(214) : see reference to class template instantiation 'llvm::DenseSet<ValueT,ValueInfoT>' being compiled
llvm\include\llvm/ADT/DenseSet.h(231) : error C2875: using-declaration causes a multiple declaration of 'BaseT'
llvm\include\llvm/ADT/DenseSet.h(232) : see reference to class template instantiation 'llvm::SmallDenseSet<ValueT,InlineBuckets,ValueInfoT>' being compiled
llvm-svn: 284570
Craig Topper [Wed, 19 Oct 2016 04:44:17 +0000 (04:44 +0000)]
[AVX-512] Teach isel lowering that a subvector broadcast being inserted into both halves of a 512-bit vector can be combined into a larger subvector broadcast.
Summary:
This allows us to create broadcasts of 128-bit vector loads into 512-bit vectors.
New patterns added to support 8-bit and 16-bit vector types and v2f64/v2i64->v8f64/v8i64 without DQI instructions.
There also fallback patterns when the load can't be folded. These patterns are a little complex as we first need to insert the lower 128-bits into the second 128-bits using a zmm subvector insert instruction. We need to use a zmm insert in case VLX isn't available. Then use another zmm sub vector insert to take those 256-bits and insert them into the upper bits. Since we used a zmm insert to create the 256-bits we also need to do a extract_subreg to get just the lower 256-bits to pass to the second insert.
The outer insert for the fallback patterns should have its type correct because eventually we should also supported masked operations here too. So we need a DQI and a NoDQI version of the v16f32/v16i32 patterns.
Reviewers: RKSimon, delena, igorb
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D25651
llvm-svn: 284567
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