Alexey Bataev [Tue, 15 Nov 2016 09:11:50 +0000 (09:11 +0000)]
[OPENMP] Fixed codegen for 'omp cancel' construct.
If 'omp cancel' construct is used in a worksharing construct it may cause
hanging of the software in case if reduction clause is used. Patch fixes
this problem by avoiding extra reduction processing for branches that
were canceled.
llvm-svn: 286944
Haojian Wu [Tue, 15 Nov 2016 09:06:59 +0000 (09:06 +0000)]
[clang-move] Make the output code look more pretty.
Summary:
Add decent blank lines between declarations:
* Add extra blank line after #define or #includes.
* Add extra blank line between declarations.
* Add extra blank line in front of #endif.
Previously, the new generated code is quite tight:
```
#ifndef FOO_H
#define FOO_H
namespace a {
class A { public: int f(); };
int A::f() { return 0; }
} // namespace a
#endif // FOO_H
```
After this patch, the code looks like:
```
#ifndef FOO_H
#define FOO_H
namespace a {
class A { public: int f(); };
int A::f() { return 0; }
} // namespace a
#endif // FOO_H
```
Reviewers: ioeric
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26493
llvm-svn: 286943
Adam Nemet [Tue, 15 Nov 2016 08:40:51 +0000 (08:40 +0000)]
[opt-viewer] Add support for libYAML for faster parsing
This results in a speed-up of over 6x on sqlite3.
Before:
$ time -p /org/llvm/utils/opt-viewer/opt-viewer.py ./MultiSource/Applications/sqlite3/CMakeFiles/sqlite3.dir/sqlite3.c.opt.yaml html
real 415.07
user 410.00
sys 4.66
After with libYAML:
$ time -p /org/llvm/utils/opt-viewer/opt-viewer.py ./MultiSource/Applications/sqlite3/CMakeFiles/sqlite3.dir/sqlite3.c.opt.yaml html
real 63.96
user 60.03
sys 3.67
I followed these steps to get libYAML working with PyYAML: http://rmcgibbo.github.io/blog/2013/05/23/faster-yaml-parsing-with-libyaml/
llvm-svn: 286942
George Rimar [Tue, 15 Nov 2016 08:19:02 +0000 (08:19 +0000)]
[ELF] - Do not create reserved symbols in case of relocatable output.
This patch stops creating symbols like __ehdr_start,
_end/_etext_edata,__tls_get_addr when using -r.
This fixes PR30984.
Differential revision: https://reviews.llvm.org/D26600
llvm-svn: 286941
George Rimar [Tue, 15 Nov 2016 08:07:14 +0000 (08:07 +0000)]
[ELF] - Better diagnostic for relative relocation to an absolute value error.
Patch adds a filename to that error message.
I faced next error when debugged one of FreeBSD port:
error: relocation R_X86_64_PLT32 cannot refer to absolute symbol __tls_get_addr
error message was poor and this patch improves it to show the locations
of symbol declaration and using.
Differential revision: https://reviews.llvm.org/D26508
llvm-svn: 286940
George Rimar [Tue, 15 Nov 2016 07:56:28 +0000 (07:56 +0000)]
[ELF] - Allow symbols of STT_NOTYPE to be associated with SHT_SYMTAB sections.
Found this when tried to link lang/ccl FreeBSD port.
Issue is very close to D23201.
This is the reason of lang/ccl port link fail.
GNU assembler 2.17.50 [FreeBSD] 2007-07-03 could generate broken objects,
where notype symbols are associated with symtab:
...
[ 9] .symtab SYMTAB
0000000000000000 00003c78
0000000000006858 0000000000000018 10 803 8
...
192:
000000000000000d 0 NOTYPE LOCAL DEFAULT 9 _cons_org
Patch allows to handle such objects.
Differential revision: https://reviews.llvm.org/D26613
llvm-svn: 286939
Asaf Badouh [Tue, 15 Nov 2016 07:55:22 +0000 (07:55 +0000)]
DAGCombiner: fix combine of trunc and select
bugzilla:
https://llvm.org/bugs/show_bug.cgi?id=29002
pr29002
Differential Revision: https://reviews.llvm.org/D26449
llvm-svn: 286938
Vitaly Buka [Tue, 15 Nov 2016 07:32:51 +0000 (07:32 +0000)]
Avoid creating reference from nullptr.
Summary:
getFile() can return nullptr. This usually happens when Rels is empty so
the reference is never used. Still UBSAN complains.
Reviewers: rafael
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26662
llvm-svn: 286937
Matt Arsenault [Tue, 15 Nov 2016 06:49:28 +0000 (06:49 +0000)]
TableGen: Add operator !or
llvm-svn: 286936
Zvi Rackover [Tue, 15 Nov 2016 06:34:33 +0000 (06:34 +0000)]
[X86][GlobalISel] Add minimal call lowering support to the IRTranslator
Summary:
Add basic functionality to support call lowering for X86.
Currently only supports functions which return void and take zero arguments.
Inspired by commit 286573.
Reviewers: ab, qcolombet, t.p.northover
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26593
llvm-svn: 286935
Craig Topper [Tue, 15 Nov 2016 05:21:55 +0000 (05:21 +0000)]
[AVX-512] Add an example test case for PR31018.
llvm-svn: 286934
Craig Topper [Tue, 15 Nov 2016 05:04:51 +0000 (05:04 +0000)]
[X86] Add LLVM version number for each intrinsic handled by auto upgrade for age tracking.
One day we'd like to remove some of this autoupgrade support and it will be easier if we know how long some of it has been around.
Differential Revision: https://reviews.llvm.org/D26321
llvm-svn: 286933
Marshall Clow [Tue, 15 Nov 2016 05:03:22 +0000 (05:03 +0000)]
Missed one of the try blocks the first time :-(. Thanks to Renato for the heads up.
llvm-svn: 286932
Matt Arsenault [Tue, 15 Nov 2016 02:25:28 +0000 (02:25 +0000)]
AMDGPU: Fix f16 fabs/fneg
llvm-svn: 286931
Lang Hames [Tue, 15 Nov 2016 02:14:57 +0000 (02:14 +0000)]
[ORC] Work around an apparent modules/linkage issue.
<rdar://problem/
29247092>
llvm-svn: 286930
Anna Zaks [Tue, 15 Nov 2016 01:57:29 +0000 (01:57 +0000)]
[asan] Fixup to r286608 that makes the test pass on iOS.
TARGET_OS_IPHONE is defined in TargetConditionals.h. Without the include the
iOS path is never triggered.
llvm-svn: 286929
Rui Ueyama [Tue, 15 Nov 2016 01:57:05 +0000 (01:57 +0000)]
Simplify identify_magic.
This patch defines a memcmp-ish helper function to simplify identify_magic.
llvm-svn: 286928
Dominic Chen [Tue, 15 Nov 2016 01:54:41 +0000 (01:54 +0000)]
[analyzer] Rename assumeWithinInclusiveRange*()
Summary: The name is slightly confusing, since the constraint is not necessarily within the range unless `Assumption` is true. Split out renaming for ConstraintManager.h from D26061
Reviewers: zaks.anna, dcoughlin
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26644
llvm-svn: 286927
Jason Molenda [Tue, 15 Nov 2016 01:41:27 +0000 (01:41 +0000)]
Change the kernel searching code to not go through the
memory cache subsystem so we're reading only the 4 bytes
needed to check for the magic word at the start of a mach-o
binary instead of the default 512 block. It can be a small
performance help to reduce the size of memory reads from
possibly unmapped memory.
<rdar://problem/
29256385>
llvm-svn: 286926
Dominic Chen [Tue, 15 Nov 2016 01:40:58 +0000 (01:40 +0000)]
[analyzer] Minor optimization: avoid setting state if unchanged
Summary: Split out optimization from D26061
Reviewers: zaks.anna, dcoughlin
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26642
llvm-svn: 286925
Greg Clayton [Tue, 15 Nov 2016 01:23:06 +0000 (01:23 +0000)]
Improve DWARF parsing speed by improving DWARFAbbreviationDeclaration
This patch gets a DWARF parsing speed improvement by having DWARFAbbreviationDeclaration instances know if they have a fixed byte size. If an abbreviation has a fixed byte size that can be calculated given a DWARFUnit, then parsing a DIE becomes two steps: parse ULEB128 abbrev code, and then add constant size to the offset.
This patch also adds a fixed byte size to each DWARFAbbreviationDeclaration::AttributeSpec so that attributes can quickly skip their values if needed without the need to lookup the fixed for size.
Notable improvements:
- DWARFAbbreviationDeclaration::findAttributeIndex() now returns an Optional<uint32_t> instead of a uint32_t and we no longer have to look for the magic -1U return value
- Optional<uint32_t> DWARFAbbreviationDeclaration::findAttributeIndex(dwarf::Attribute attr) const;
- DWARFAbbreviationDeclaration now has a getAttributeValue() function that extracts an attribute value given a DIE offset that takes advantage of the DWARFAbbreviationDeclaration::AttributeSpec::ByteSize
- bool DWARFAbbreviationDeclaration::getAttributeValue(const uint32_t DIEOffset, const dwarf::Attribute Attr, const DWARFUnit &U, DWARFFormValue &FormValue) const;
- A DWARFAbbreviationDeclaration instance can return a fixed byte size for itself so DWARF parsing is faster:
- Optional<size_t> DWARFAbbreviationDeclaration::getFixedAttributesByteSize(const DWARFUnit &U) const;
- Any functions that used to take a "const DWARFUnit *U" that would crash if U was NULL now take a "const DWARFUnit &U" and are only called with a valid DWARFUnit
Differential Revision: https://reviews.llvm.org/D26567
llvm-svn: 286924
Rui Ueyama [Tue, 15 Nov 2016 01:01:51 +0000 (01:01 +0000)]
Identify object files compiled with cl.exe /GL.
Object files compiled with cl.exe /GL contain intermediate code for LTO.
We can't (and don't want to) interpret such code, but we should print
out a user-friendly error message.
Differential Revision: https://reviews.llvm.org/D26647
llvm-svn: 286921
Rui Ueyama [Tue, 15 Nov 2016 00:58:50 +0000 (00:58 +0000)]
Fix -Wswitch.
llvm-svn: 286920
Rui Ueyama [Tue, 15 Nov 2016 00:54:54 +0000 (00:54 +0000)]
Add a file magic for CL.exe's object file created with /GL.
This patch makes it possible to identify object files created by CL.exe
with /GL option. Such file contains Microsoft proprietary intermediate
code instead of target machine code to do LTO.
I need this to print out user-friendly error message from LLD.
Differential Revision: https://reviews.llvm.org/D26645
llvm-svn: 286919
Lang Hames [Tue, 15 Nov 2016 00:49:12 +0000 (00:49 +0000)]
[ORC] Temporarily disable RPCUtils unit test.
This broke s390x due to a bug in the QueueChannel implementation that led to it
infinite-looping. Disabling it while I look into a fix.
llvm-svn: 286917
Zachary Turner [Tue, 15 Nov 2016 00:45:23 +0000 (00:45 +0000)]
Fix some more Printf warnings.
llvm-svn: 286916
Zachary Turner [Tue, 15 Nov 2016 00:45:18 +0000 (00:45 +0000)]
Fix some more StringRef printf warnings.
llvm-svn: 286915
Saleem Abdulrasool [Tue, 15 Nov 2016 00:43:52 +0000 (00:43 +0000)]
llvm-strings: support the `-n` option
Permit specifying the match length (the `-n` or `--bytes` option). The
deprecated `-[length]` form is not supported as an option. This allows the
strings tool to display only the specified length strings rather than the
hardcoded default length of >= 4.
llvm-svn: 286914
Matt Arsenault [Tue, 15 Nov 2016 00:05:42 +0000 (00:05 +0000)]
AMDGPU: Set hasExtraSrcRegAllocReq on v_div_scale_*
This doesn't solve any problems I know about, but this should have
more conservative assumptions about the operands'
llvm-svn: 286913
Matt Arsenault [Tue, 15 Nov 2016 00:04:33 +0000 (00:04 +0000)]
AMDGPU: Fix formatting of 1/2pi immediate
llvm-svn: 286912
Tom Stellard [Tue, 15 Nov 2016 00:03:14 +0000 (00:03 +0000)]
MIRParser: Add support for parsing vreg reg alloc hints
Reviewers: qcolombet, MatzeB
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D26573
llvm-svn: 286911
Vitaly Buka [Tue, 15 Nov 2016 00:01:40 +0000 (00:01 +0000)]
Avoid calling std::memcmp with nullptr
Summary:
UBSAN complains that this is undefined behavior.
We can assume that empty substring (N==1) always satisfy conditions. So
std::memcmp will be called only only for N > 1 and Str.size() > 0.
Reviewers: ruiu, zturner
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26646
llvm-svn: 286910
Adrian McCarthy [Mon, 14 Nov 2016 23:53:45 +0000 (23:53 +0000)]
Fix TestMiniDumpNew.py test for Python 2/3 issue
On Windows, where we use Python 3 for testing, we have to be more explicit about converting between binary and string representations. I believe this should still work for Python 2, but I don't have a convenient way to try it out.
Differential Revision: https://reviews.llvm.org/D26643
llvm-svn: 286909
Greg Clayton [Mon, 14 Nov 2016 23:45:50 +0000 (23:45 +0000)]
Fix a deadlock issue that would happen when loading an AppleTV or watchOS binary.
This was a regression that was caused by svn revision 269877:
commit
1ded4a2a25d60dd2c81bd432bcf63b6ded58e5d6
Author: Saleem Abdulrasool <compnerd@compnerd.org>
Date: Wed May 18 01:59:10 2016 +0000
remove use of Mutex in favour of std::{,recursive_}mutex
This is a pretty straightforward first pass over removing a number of uses of
Mutex in favor of std::mutex or std::recursive_mutex. The problem is that there
are interfaces which take Mutex::Locker & to lock internal locks. This patch
cleans up most of the easy cases. The only non-trivial change is in
CommandObjectTarget.cpp where a Mutex::Locker was split into two.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@269877
91177308-0d34-0410-b5e6-
96231b3b80d8
This change actually changed the Platform::m_mutex to be non-recursive which caused the regression.
<rdar://problem/
29094384>
llvm-svn: 286908
Evandro Menezes [Mon, 14 Nov 2016 23:29:01 +0000 (23:29 +0000)]
[AArch64] Compute the Newton series for reciprocals natively
Implement the Newton series for square root, its reciprocal and reciprocal
natively using the specialized instructions in AArch64 to perform each
series iteration.
Differential revision: https://reviews.llvm.org/D26518
llvm-svn: 286907
Zachary Turner [Mon, 14 Nov 2016 23:23:31 +0000 (23:23 +0000)]
Fix some StringRef Printf warnings.
llvm-svn: 286906
Peter Collingbourne [Mon, 14 Nov 2016 23:18:38 +0000 (23:18 +0000)]
Linker: Remove unnecessary call to copyMetadata in IRLinker::linkGlobalVariable.
This was causing us to create duplicate metadata on global variables.
Debug info test case by Adrian Prantl, additional test cases by me.
Fixes PR31012.
Differential Revision: https://reviews.llvm.org/D26622
llvm-svn: 286905
Vedant Kumar [Mon, 14 Nov 2016 23:12:52 +0000 (23:12 +0000)]
[cfi] Mark tests as xfailing on Darwin
This allows them to be run on other platforms, undoing damage from
r286902.
llvm-svn: 286904
Tim Northover [Mon, 14 Nov 2016 22:50:22 +0000 (22:50 +0000)]
GlobalISel: add tests for G_ZEXT/G_SEXT to types smaller than 32-bits.
Support was accidentally added in r286407, but there were no tests at the time.
llvm-svn: 286903
Vedant Kumar [Mon, 14 Nov 2016 22:50:13 +0000 (22:50 +0000)]
[cfi] Mark some tests as requiring additional support from the MachO writer
These tests need to be marked as unsupported on Darwin:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/1545
llvm-svn: 286902
Devin Coughlin [Mon, 14 Nov 2016 22:46:02 +0000 (22:46 +0000)]
[analyzer] Fix crash in NullabilityChecker calling block with too few arguments
Fix a crash when checking parameter nullability on a block invocation
with fewer arguments than the block declaration requires.
rdar://problem/
29237566
llvm-svn: 286901
Sanjay Patel [Mon, 14 Nov 2016 22:44:06 +0000 (22:44 +0000)]
[InstCombine] add tests to show missing bitcast folds
llvm-svn: 286900
Chris Bieneman [Mon, 14 Nov 2016 22:43:08 +0000 (22:43 +0000)]
One more cleanup to lldb version printing
With this patch LLDB_VERSION_STRING replaces "lldb version x.x.x" if it is set. This allows builds to not display the open source version numbers if the people making the distribution overrides the LLDB_VERSION_STRING.
Since LLDB_VERSION_STRING is always overridden on Darwin, this means the first line of lldb -version on Darwin is:
lldb-360.99.0 (<repo path> revision <revision>)
llvm-svn: 286899
Kuba Brecka [Mon, 14 Nov 2016 22:38:57 +0000 (22:38 +0000)]
[sanitizer] Passthrough CMAKE_OSX_DEPLOYMENT_TARGET when building compiler-rt from clang/runtime/CMakeLists.txt
This breaks some Swift builds, because Swift's build scripts explicitly set CMAKE_OSX_DEPLOYMENT_TARGET. This however isn't propagated to the compiler-rt build, causing build errors.
Differential Revision: https://reviews.llvm.org/D26558
llvm-svn: 286898
Adrian Prantl [Mon, 14 Nov 2016 22:09:18 +0000 (22:09 +0000)]
Remove redundant uses of \brief.
llvm-svn: 286897
Vitaly Buka [Mon, 14 Nov 2016 22:05:19 +0000 (22:05 +0000)]
Don't pass nullptr into memcpy
Summary:
It's undefined according UBSAN.
Not sure which CL caused test failures, but seems writeBytes for empty buffer
should be OK.
Reviewers: rnk, zturner
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26638
llvm-svn: 286896
Tom Stellard [Mon, 14 Nov 2016 21:50:13 +0000 (21:50 +0000)]
RegAllocGreedy: Properly initialize this pass, so that -run-pass will work
Reviewers: qcolombet, MatzeB
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D26572
llvm-svn: 286895
Kuba Brecka [Mon, 14 Nov 2016 21:41:33 +0000 (21:41 +0000)]
[tsan] Add support for C++ exceptions into TSan (call __tsan_func_exit during unwinding), compiler-rt part
This adds support for TSan C++ exception handling, where we need to add extra calls to __tsan_func_exit when a function is exitted via exception mechanisms. Otherwise the shadow stack gets corrupted (leaked). This patch moves and enhances the existing implementation of EscapeEnumerator that finds all possible function exit points, and adds extra EH cleanup blocks where needed.
Differential Revision: https://reviews.llvm.org/D26177
llvm-svn: 286894
Kuba Brecka [Mon, 14 Nov 2016 21:41:13 +0000 (21:41 +0000)]
[tsan] Add support for C++ exceptions into TSan (call __tsan_func_exit during unwinding), LLVM part
This adds support for TSan C++ exception handling, where we need to add extra calls to __tsan_func_exit when a function is exitted via exception mechanisms. Otherwise the shadow stack gets corrupted (leaked). This patch moves and enhances the existing implementation of EscapeEnumerator that finds all possible function exit points, and adds extra EH cleanup blocks where needed.
Differential Revision: https://reviews.llvm.org/D26177
llvm-svn: 286893
Jonathan Peyton [Mon, 14 Nov 2016 21:13:44 +0000 (21:13 +0000)]
Update stats-gathering code
Have developer timers use partitioning scheme which also required that some
redundant developer timers be removed in favor of the already existing normal
timers. Move per thread stats initialization to just after global thread id
assignment which is as early as possible. Also put all global stats
initialization code in __kmp_stats_init() and all global stats destruction code
in __kmp_stats_fini().
Differential Revision: https://reviews.llvm.org/D26361
llvm-svn: 286892
Saleem Abdulrasool [Mon, 14 Nov 2016 21:10:41 +0000 (21:10 +0000)]
Revert "Revert "llvm-strings: support printing the filename""
Change the dynamic files to static in the hope that it will actually fix the
transient errors that Ive been unable to reproduce.
llvm-svn: 286891
Jonathan Peyton [Mon, 14 Nov 2016 21:08:35 +0000 (21:08 +0000)]
Introduce dynamic affinity dispatch capabilities
This set of changes enables the affinity interface (Either the preexisting
native operating system or HWLOC) to be dynamically set at runtime
initialization. The point of this change is that we were seeing performance
degradations when using HWLOC. This allows the user to use the old affinity
mechanisms which on large machines (>64 cores) makes a large difference in
initialization time.
These changes mostly move affinity code under a small class hierarchy:
KMPAffinity
class Mask {}
KMPNativeAffinity : public KMPAffinity
class Mask : public KMPAffinity::Mask
KMPHwlocAffinity
class Mask : public KMPAffinity::Mask
Since all interface functions (for both affinity and the mask implementation)
are virtual, the implementation can be chosen at runtime initialization.
Differential Revision: https://reviews.llvm.org/D26356
llvm-svn: 286890
Kevin Enderby [Mon, 14 Nov 2016 20:57:04 +0000 (20:57 +0000)]
Add a checkSymbolTable() method to the MachOObjectFile class.
The philosophy of the error checking in libObject for Mach-O files
is that the constructor will check the load commands so for their
tables the offsets and sizes are properly contained in the file.
But there is no checking of the entries of any of the tables.
For the contents of the tables themselves the methods accessing
the contents of the entries return errors as needed. In some
cases this however makes it difficult or cumbersome to produce
a good error message which would include the tool name, file name,
archive member, and name of the architecture of a slice of a universal file
the error occurred in.
So idea is that there will be a method to check a table which can
be called up front before using it allowing a good error message
to be produced before a table is used. And if only verification of
the Mach-O file and its tables are wanted a new possible method
checkAllTables() could be added to call all of the methods to
check all the tables at some time when such methods exist.
The checkSymbolTable() is the first of such methods to check
one of the Mach-O file tables. This method initially will used in
llvm-objdump’s DisassembleMachO() routine before it gets the
section and symbol information. As if there are problems with
the symbol table currently the error is first encountered by the
bool operator() in the SymbolSorter() struct which passed to
std::sort(). In this case there is no context as to the file name
the symbol which results a poor error message:
LLVM ERROR: truncated or malformed object (bad string index: 22 for symbol at index 1)
with the added call to the checkSymbolTable() method the
error message includes the tool name and file name:
llvm-objdump: 'macho-invalid-symbol-strx': truncated or malformed object (bad string table index: 22 past the end of string table, for symbol at index 1)
llvm-svn: 286887
Krzysztof Parzyszek [Mon, 14 Nov 2016 20:53:09 +0000 (20:53 +0000)]
[Hexagon] Give a predicate function a more meaningful name
Change "orisadd" to "IsOrAdd" to follow the naming conventions, and
change "isOrAdd" in the C++ code to "isOrEquivalentToAdd".
llvm-svn: 286886
Evgeniy Stepanov [Mon, 14 Nov 2016 20:46:52 +0000 (20:46 +0000)]
Temporarily relax test expectations to fix failures on ppc64.
Summary: Relax test expectations to fix failures on ppc64.
Reviewers: eugenis
Subscribers: kubabrecka, llvm-commits
Patch by Aleksey Shlyapnikov.
Differential Revision: https://reviews.llvm.org/D26629
llvm-svn: 286885
Marshall Clow [Mon, 14 Nov 2016 20:41:17 +0000 (20:41 +0000)]
P0503R0, adopted in Issaquah, rewords some requirements on nullptr_t and istream_iterator. No code changes were needed, but I updated a few tests. Also resolved P0509 and P0521, which required no changes to the library or tests.
llvm-svn: 286884
Marshall Clow [Mon, 14 Nov 2016 20:38:43 +0000 (20:38 +0000)]
Missed a test with exceptions disabled earlier. Oops.
llvm-svn: 286883
Tim Northover [Mon, 14 Nov 2016 20:31:53 +0000 (20:31 +0000)]
ARM: try to fix GCC 4.8 compilation again after r286881.
llvm-svn: 286882
Tim Northover [Mon, 14 Nov 2016 20:28:24 +0000 (20:28 +0000)]
Recommit: ARM: sort register lists by encoding in push/pop instructions.
For example we were producing
push {r8, r10, r11, r4, r5, r7, lr}
This is misleading (r4, r5 and r7 are actually pushed before the rest), and
other components (stack folding recently) often forget to deal with the extra
complexity coming from the different order, leading to miscompiles. Finally, we
warn about our own code in -no-integrated-as mode without this, which is really
not a good idea.
Fixed usage of std::sort so that we (hopefully) use instantiations that
actually exist in GCC 4.8.
llvm-svn: 286881
Vitaly Buka [Mon, 14 Nov 2016 20:21:41 +0000 (20:21 +0000)]
Fix heap-use-after-free coff::createPDB
Summary:
getInputSections returns std::vector by value and ArrayRef
pointed to destroyed temporarily.
Reviewers: ruiu
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26630
llvm-svn: 286880
Geoff Berry [Mon, 14 Nov 2016 19:59:11 +0000 (19:59 +0000)]
[AArch64] Change some pointers to references. NFC.
Follow-up change to r286875.
llvm-svn: 286879
Michael Kuperstein [Mon, 14 Nov 2016 19:58:11 +0000 (19:58 +0000)]
[X86] Tests exhibiting bad parial reloading behavior. NFC.
llvm-svn: 286878
Marshall Clow [Mon, 14 Nov 2016 19:58:05 +0000 (19:58 +0000)]
Implement P0516: 'Clarify That shared_future’s Copy Operations have Wide Contracts' which was adopted last week in Issaquah
llvm-svn: 286877
Rui Ueyama [Mon, 14 Nov 2016 19:50:10 +0000 (19:50 +0000)]
Attempt to fix freaky bot.
I don't really understand what is failing on lld-x86_64-darwin13 bot,
but this patch should at least reduces the number of moving parts.
llvm-svn: 286876
Geoff Berry [Mon, 14 Nov 2016 19:39:04 +0000 (19:39 +0000)]
[AArch64] Split 0 vector stores into scalar store pairs.
Summary:
Replace a splat of zeros to a vector store by scalar stores of WZR/XZR.
The load store optimizer pass will merge them to store pair stores.
This should be better than a movi to create the vector zero followed by
a vector store if the zero constant is not re-used, since one
instructions and one register live range will be removed.
For example, the final generated code should be:
stp xzr, xzr, [x0]
instead of:
movi v0.2d, #0
str q0, [x0]
Reviewers: t.p.northover, mcrosier, MatzeB, jmolloy
Subscribers: aemerson, rengolin, llvm-commits
Differential Revision: https://reviews.llvm.org/D26561
llvm-svn: 286875
Geoff Berry [Mon, 14 Nov 2016 19:39:00 +0000 (19:39 +0000)]
[AArch64] Factor out transform code from split16BStore. NFC.
llvm-svn: 286874
Eric Liu [Mon, 14 Nov 2016 19:37:55 +0000 (19:37 +0000)]
[change-namespace] consider typedef/using alias decls in the moved namespace.
Summary: If a TypeLoc refers to a type alias defined in the moved namespace, we do not need to update its specifier since the type alias decl will be moved along with the type reference.
Reviewers: hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26592
llvm-svn: 286873
Marshall Clow [Mon, 14 Nov 2016 19:35:34 +0000 (19:35 +0000)]
Make one of the new tests fail correctly on pre-C++17 systems
llvm-svn: 286872
Teresa Johnson [Mon, 14 Nov 2016 19:21:41 +0000 (19:21 +0000)]
[ThinLTO] Only promote exported locals as marked in index
Summary:
We have always speculatively promoted all renamable local values
(except const non-address taken variables) for both the exporting
and importing module. We would then internalize them back based on
the ThinLink results if they weren't actually exported. This is
inefficient, and results in unnecessary renames. It also meant we
had to check the non-renamability of a value in the summary, which
was already checked during function importing analysis in the ThinLink.
Made renameModuleForThinLTO (which does the promotion/renaming) instead
use the index when exporting, to avoid unnecessary renames/promotions.
For importing modules, we can simply promoted all values as any local
we import by definition is exported and needs promotion.
This required changes to the method used by the FunctionImport pass
(only invoked from 'opt' for testing) and when invoked from llvm-link,
since neither does a ThinLink. We simply conservatively mark all locals
in the index as promoted, which preserves the current aggressive
promotion behavior.
I also needed to change an llvm-lto based test where we had previously
been aggressively promoting values that weren't importable (aliasees),
but now will not promote.
Reviewers: mehdi_amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26467
llvm-svn: 286871
Kostya Serebryany [Mon, 14 Nov 2016 19:21:38 +0000 (19:21 +0000)]
[libFuzzer] replace 'auto' with 'auto *' to better follow the LLVM style
llvm-svn: 286870
Daniel Sanders [Mon, 14 Nov 2016 19:10:56 +0000 (19:10 +0000)]
Revert: r286868 - Test commit
llvm-svn: 286869
Daniel Sanders [Mon, 14 Nov 2016 19:09:33 +0000 (19:09 +0000)]
Test commit
llvm-svn: 286868
Tim Northover [Mon, 14 Nov 2016 19:05:28 +0000 (19:05 +0000)]
Revert "ARM: sort register lists by encoding in push/pop instructions."
This reverts commit 286866. It broke a bot, something to do with exactly which
templates std::sort accepts.
llvm-svn: 286867
Tim Northover [Mon, 14 Nov 2016 19:02:17 +0000 (19:02 +0000)]
ARM: sort register lists by encoding in push/pop instructions.
For example we were producing
push {r8, r10, r11, r4, r5, r7, lr}
This is misleading (r4, r5 and r7 are actually pushed before the rest), and
other components (stack folding recently) often forget to deal with the extra
complexity coming from the different order, leading to miscompiles. Finally, we
warn about our own code in -no-integrated-as mode without this, which is really
not a good idea.
llvm-svn: 286866
Michael Kuperstein [Mon, 14 Nov 2016 19:01:59 +0000 (19:01 +0000)]
Give SLP vectorizer credit where it's due.
llvm-svn: 286865
Marshall Clow [Mon, 14 Nov 2016 18:56:24 +0000 (18:56 +0000)]
Implement P0510 'Make future_error Constructible' adopted in Issaquah
llvm-svn: 286864
Sean Fertile [Mon, 14 Nov 2016 18:47:15 +0000 (18:47 +0000)]
[PPC] altivec.h functions for converting half precision to single precision.
Adds 2 vector functions for converting from a vector of unsigned short to a
vector of float. One converts the low 4 halfwords and one converts the high
4 halfwords.
Differential Revision: https://reviews.llvm.org/D26534
llvm-svn: 286863
Sean Fertile [Mon, 14 Nov 2016 18:43:59 +0000 (18:43 +0000)]
[PPC] Add intrinsic mapping to the xscvhpsp instruction
add an intrinsic to expose the 'VSX Scalar Convert Half-Precision to
Single-Precision' instruction.
Differential review: https://reviews.llvm.org/D26536
llvm-svn: 286862
Adam Nemet [Mon, 14 Nov 2016 18:38:48 +0000 (18:38 +0000)]
[opt-viewer] Don't fail with remarks without debug location
llvm-svn: 286861
Changpeng Fang [Mon, 14 Nov 2016 18:33:18 +0000 (18:33 +0000)]
AMDGPU/SI: Support data types other than V4f32 in image intrinsics
Summary:
Extend image intrinsics to support data types of V1F32 and V2F32.
TODO: we should define a mapping table to change the opcode for data type of V2F32 but just one channel is active,
even though such case should be very rare.
Reviewers:
tstellarAMD
Differential Revision:
http://reviews.llvm.org/D26472
llvm-svn: 286860
Kuba Brecka [Mon, 14 Nov 2016 18:27:47 +0000 (18:27 +0000)]
[sanitizer] Max out allowed macOS deployment targets to 10.9
It's not a good idea to build the sanitizers with e.g. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12, because some deprecated functions that we intercept will cause build errors. Let's limit the allowed deployment targets to 10.9 (which is the default anyway), and warn when it's set above.
Differential Revision: https://reviews.llvm.org/D26557
llvm-svn: 286859
Marshall Clow [Mon, 14 Nov 2016 18:22:19 +0000 (18:22 +0000)]
Fixes for LWG 2598, 2686, 2739, 2742, 2747, and 2759, which were adopted last week in Issaquah
llvm-svn: 286858
Davide Italiano [Mon, 14 Nov 2016 18:20:20 +0000 (18:20 +0000)]
[ELF] Clarify why `lld -flavor gnu` is used.
Pointed out by Rafael!
llvm-svn: 286857
Anastasia Stulova [Mon, 14 Nov 2016 18:11:09 +0000 (18:11 +0000)]
Fix OpenCL test for buildbot by removing extra (erroneous) RUN line
llvm-svn: 286856
Zvi Rackover [Mon, 14 Nov 2016 18:10:44 +0000 (18:10 +0000)]
[X86] Adding reproducer for pr30981
llvm-svn: 286855
Reid Kleckner [Mon, 14 Nov 2016 18:02:42 +0000 (18:02 +0000)]
Remove pwd to fix WinASan bot
It only slipped in while I was debugging the test case.
llvm-svn: 286854
Zachary Turner [Mon, 14 Nov 2016 17:59:28 +0000 (17:59 +0000)]
[PDB] Add documentation for the DBI Stream.
Differential Revision: https://reviews.llvm.org/D26552
llvm-svn: 286853
Zachary Turner [Mon, 14 Nov 2016 17:59:21 +0000 (17:59 +0000)]
[PDB] Add documentation for the PDB Stream.
https://reviews.llvm.org/D26516
llvm-svn: 286852
Bob Wilson [Mon, 14 Nov 2016 17:56:18 +0000 (17:56 +0000)]
Use _Unwind_Backtrace on Apple platforms.
Darwin's backtrace() function does not work with sigaltstack (which was
enabled when available with r270395) — it does a sanity check to make
sure that the current frame pointer is within the expected stack area
(which it is not when using an alternate stack) and gives up otherwise.
The alternative of _Unwind_Backtrace seems to work fine on macOS, so use
that when backtrace() fails. Note that we then use backtrace_symbols_fd()
with the addresses from _Unwind_Backtrace, but I’ve tested that and it
also seems to work fine. rdar://problem/
28646552
llvm-svn: 286851
Reid Kleckner [Mon, 14 Nov 2016 17:51:11 +0000 (17:51 +0000)]
Split strncmp and strncasecmp test and XFAIL one for Windows
llvm-svn: 286850
Anastasia Stulova [Mon, 14 Nov 2016 17:39:58 +0000 (17:39 +0000)]
[OpenCL] Fix for integer parameters of enqueue_kernel
Make handling integer parameters more flexible:
- For the number of events argument allow to pass larger
integers than 32 bits as soon as compiler can prove that
the range fits in 32 bits. If not, the diagnostic will be given.
- Change type of the arguments specifying the sizes of
the corresponding block arguments to be size_t.
Review: https://reviews.llvm.org/D26509
llvm-svn: 286849
Reid Kleckner [Mon, 14 Nov 2016 17:37:50 +0000 (17:37 +0000)]
[asan/win] Delay load dbghelp.dll to delay ucrtbase.dll initialization
Summary:
ASan needs to initialize before ucrtbase.dll so that it can intercept
all of its heap allocations. New versions of dbghelp.dll depend on
ucrtbase.dll, which means both of those DLLs will initialize before the
dynamic ASan runtime. By lazily loading dbghelp.dll with LoadLibrary, we
avoid the issue.
Eventually, I would like to remove our dbghelp.dll dependency in favor
of always using llvm-symbolizer.exe, but this seems like an acceptable
interim solution.
Fixes PR30903
Reviewers: etienneb
Subscribers: kubabrecka, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D26473
llvm-svn: 286848
Stephan T. Lavavej [Mon, 14 Nov 2016 17:35:14 +0000 (17:35 +0000)]
[libcxx] [test] D26314: Fix MSVC warning C4189 "local variable is initialized but not referenced".
test/std/depr/depr.c.headers/inttypes_h.pass.cpp
test/std/input.output/file.streams/c.files/cinttypes.pass.cpp
test/std/input.output/iostream.forward/iosfwd.pass.cpp
Add test() to avoid a bunch of void-casts, although we still need a few.
test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp
skippingws was unused (it's unclear to me whether this was mistakenly copy-pasted from round_trip() below).
test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp
test/std/localization/locale.categories/category.ctype/facet.ctype.special/types.pass.cpp
test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char.pass.cpp
test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp
test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp
test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp
test/std/localization/locales/locale.global.templates/use_facet.pass.cpp
When retrieving facets, the references are unused.
test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long.pass.cpp
test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp
"std::ios_base::iostate err = ios.goodbit;" was completely unused here.
test/std/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp
test/std/numerics/c.math/ctgmath.pass.cpp
test/std/numerics/rand/rand.device/entropy.pass.cpp
test/std/numerics/rand/rand.device/eval.pass.cpp
test/std/strings/basic.string/string.modifiers/string_copy/copy.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eof.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eof.pass.cpp
test/std/thread/futures/futures.promise/dtor.pass.cpp
test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp
test/std/thread/thread.condition/thread.condition.condvar/wait_for_pred.pass.cpp
These variables are verifying types but are otherwise unused.
test/std/strings/basic.string/string.capacity/reserve.pass.cpp
old_cap was unused (it's unclear to me whether it was intended to be used).
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/eq.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eq.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/lt.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eq.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/lt.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp
These tests contained unused characters.
llvm-svn: 286847
Mandeep Singh Grang [Mon, 14 Nov 2016 17:31:24 +0000 (17:31 +0000)]
[clang docs] Minor fix in ClangCheck.rst
Reviewers: djasper, rengolin
Subscribers: Eugene.Zelenko
Tags: #clang-c
Differential Revision: https://reviews.llvm.org/D26484
llvm-svn: 286846
Adrian Prantl [Mon, 14 Nov 2016 17:26:32 +0000 (17:26 +0000)]
Typo
llvm-svn: 286845
Teresa Johnson [Mon, 14 Nov 2016 17:12:32 +0000 (17:12 +0000)]
Restore "[ThinLTO] Prevent exporting of locals used/defined in module level asm"
This restores the rest of r286297 (part was restored in r286475).
Specifically, it restores the part requiring adding a dependency from
the Analysis to Object library (downstream use changed to correctly
model split BitReader vs BitWriter libraries).
Original description of this part of patch follows:
Module level asm may also contain defs of values. We need to prevent
export of any refs to local values defined in module level asm (e.g. a
ref in normal IR), since that also requires renaming/promotion of the
local. To do that, the summary index builder looks at all values in the
module level asm string that are not marked Weak or Global, which is
exactly the set of locals that are defined. A summary is created for
each of these local defs and flagged as NoRename.
This required adding handling to the BitcodeWriter to look at GV
declarations to see if they have a summary (rather than skipping them
all).
Finally, added an assert to IRObjectFile::CollectAsmUndefinedRefs to
ensure that an MCAsmParser is available, otherwise the module asm parse
would silently fail. Initialized the asm parser in the opt tool for use
in testing this fix.
Fixes PR30610.
llvm-svn: 286844
Sumanth Gundapaneni [Mon, 14 Nov 2016 17:11:00 +0000 (17:11 +0000)]
[Hexagon] Remove unsafe load instructions that affect Stack Slot Coloring
The Stack slot coloring pass removes a store that is followed by a load
that deal with the same stack slot. The function isLoadFromStackSlot
is supposed to consider the loads that have no side-effects. This
patch fixed the issue by removing the unsafe loads from this function
Eg:
%vreg0<def> = L2_loadruh_io <fi#15>, 0
S2_storeri_io <fi#15>, 0, %vreg0
In this case, we load an unsigned extended half word and store this in to
the same stack slot. The Stack slot coloring pass considers safe to remove
the store. This patch marked all the non-vector byte and half word loads as
unsafe.
llvm-svn: 286843
Sumanth Gundapaneni [Mon, 14 Nov 2016 17:09:39 +0000 (17:09 +0000)]
Fix the unit test darwin-multiarch-arm.c for windows
llvm-svn: 286842
Stephan Bergmann [Mon, 14 Nov 2016 17:07:09 +0000 (17:07 +0000)]
Handle non-inlined clang::Type::getAs specializations in extract_symbols.py
The existing logic was to discard any symbols representing function template
instantiations, as the definitions were assumed to be inline. But there are
three explicit specializations of clang::Type::getAs that are only defined in
Clang's lib/AST/Type.cpp, and at least the plugin used by the LibreOffice build
(https://wiki.documentfoundation.org/Development/Clang_plugins) uses those
functions.
Differential Revision: https://reviews.llvm.org/D26455
llvm-svn: 286841
Teresa Johnson [Mon, 14 Nov 2016 16:40:19 +0000 (16:40 +0000)]
[ThinLTO] Make inline assembly handling more efficient in summary
Summary:
The change in r285513 to prevent exporting of locals used in
inline asm added all locals in the llvm.used set to the reference
set of functions containing inline asm. Since these locals were marked
NoRename, this automatically prevented importing of the function.
Unfortunately, this caused an explosion in the summary reference lists
in some cases. In my particular example, it happened for a large protocol
buffer generated C++ file, where many of the generated functions
contained an inline asm call. It was exacerbated when doing a ThinLTO
PGO instrumentation build, where the PGO instrumentation included
thousands of private __profd_* values that were added to llvm.used.
We really only need to include a single llvm.used local (NoRename) value
in the reference list of a function containing inline asm to block it
being imported. However, it seems cleaner to add a flag to the summary
that explicitly describes this situation, which is what this patch does.
Reviewers: mehdi_amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26402
llvm-svn: 286840