Sanjay Patel [Tue, 29 Nov 2016 19:15:27 +0000 (19:15 +0000)]
[AArch64] add tests for bics; NFC
llvm-svn: 288183
Rui Ueyama [Tue, 29 Nov 2016 19:11:39 +0000 (19:11 +0000)]
Use StringRefZ explicitly instead of const char *.
This patch is to avoid an implicit conversion from const char * to
StringRefZ, to make it apparent where we are using StringRefZ.
llvm-svn: 288182
Pavel Labath [Tue, 29 Nov 2016 18:38:09 +0000 (18:38 +0000)]
Add back some of the previous lldb-server dependencies
It seems a debug build of lldb-server will not complete without these, as the
linker is not able to strip out code that aggressively. Add those back until I
can figure out how to break the dependency chains.
llvm-svn: 288181
Sanjay Patel [Tue, 29 Nov 2016 18:35:04 +0000 (18:35 +0000)]
[AArch64] add tests to show select transforms; NFC
llvm-svn: 288180
Adam Nemet [Tue, 29 Nov 2016 18:32:04 +0000 (18:32 +0000)]
Revert "[GVN] Basic optimization remark support"
This reverts commit r288046.
Trying to see if the revert fixes a compiler crash during a stage2 LTO
build with a GVN backtrace.
llvm-svn: 288179
Adam Nemet [Tue, 29 Nov 2016 18:32:00 +0000 (18:32 +0000)]
Revert "[GVN, OptDiag] Include the value that is forwarded in load elimination"
This reverts commit r288047.
Trying to see if the revert fixes a compiler crash during a stage2 LTO
build with a GVN backtrace.
llvm-svn: 288178
Adam Nemet [Tue, 29 Nov 2016 18:31:53 +0000 (18:31 +0000)]
Revert "[GVN, OptDiag] Print the interesting instructions involved in missed load-elimination"
This reverts commit r288090.
Trying to see if the revert fixes a compiler crash during a stage2 LTO
build with a GVN backtrace.
llvm-svn: 288177
Geoff Berry [Tue, 29 Nov 2016 18:28:32 +0000 (18:28 +0000)]
[AArch64] Fold spills of COPY of WZR/XZR
Summary:
In AArch64InstrInfo::foldMemoryOperandImpl, catch more cases where the
COPY being spilled is copying from WZR/XZR, but the source register is
not in the COPY destination register's regclass.
For example, when spilling:
%vreg0 = COPY %XZR ; %vreg0:GPR64common
without this change, the code in TargetInstrInfo::foldMemoryOperand()
and canFoldCopy() that normally handles cases like this would fail to
optimize since %XZR is not in GPR64common. So the spill code generated
would be:
%vreg0 = COPY %XZR
STR %vreg
instead of the new code generated:
STR %XZR
Reviewers: qcolombet, MatzeB
Subscribers: mcrosier, aemerson, t.p.northover, llvm-commits, rengolin
Differential Revision: https://reviews.llvm.org/D26976
llvm-svn: 288176
Eugene Zelenko [Tue, 29 Nov 2016 18:24:01 +0000 (18:24 +0000)]
Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes (NFC).
This preparation to remove SetVector.h dependency on SmallSet.h.
llvm-svn: 288175
Eugene Zelenko [Tue, 29 Nov 2016 18:14:12 +0000 (18:14 +0000)]
Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes (NFC).
This preparation to remove SetVector.h dependency on SmallSet.h.
llvm-svn: 288174
Filipe Cabecinhas [Tue, 29 Nov 2016 18:08:24 +0000 (18:08 +0000)]
Revert "Compiler-rt part of D26230: Add (constant) masked load/store support"
This reverts commit r288162. Buildbot clang-bpf-build fails running tests.
llvm-svn: 288173
Rui Ueyama [Tue, 29 Nov 2016 18:05:04 +0000 (18:05 +0000)]
Introduce StringRefZ class to represent null-terminated strings.
StringRefZ is a class to represent a null-terminated string. String
length is computed lazily, so it's more efficient than StringRef to
represent strings in string table.
The motivation of defining this new class is to merge functions
that only differ in string types; we have many constructors that takes
`const char *` or `StringRef`. With StringRefZ, we can merge them.
Differential Revision: https://reviews.llvm.org/D27037
llvm-svn: 288172
Mehdi Amini [Tue, 29 Nov 2016 18:00:31 +0000 (18:00 +0000)]
[docs] Typos and whitespace fixed in LTO docs.
While reading the LTO docs I fixed few small typos and whitespace issues.
Patch by: Jonas Devlieghere <jonas@devlieghere.com>
Differential Revision: https://reviews.llvm.org/D27196
llvm-svn: 288171
Simon Pilgrim [Tue, 29 Nov 2016 17:57:48 +0000 (17:57 +0000)]
Avoid repeated calls to MVT getSizeInBits and getScalarSizeInBits(). NFCI.
llvm-svn: 288170
Pavel Labath [Tue, 29 Nov 2016 17:45:25 +0000 (17:45 +0000)]
Remove some OS-specific plugins from lldb-server dependencies
I don't believe the code in those plugins could be in any way useful for
lldb-server, but I can't be sure if this will break some transitive dependencies.
Builtbots should be able to tell us that.
llvm-svn: 288169
NAKAMURA Takumi [Tue, 29 Nov 2016 17:32:58 +0000 (17:32 +0000)]
Suppress abi-breaking.h on cygming, for now.
FIXME: Implement checks without weak for them.
llvm-svn: 288168
NAKAMURA Takumi [Tue, 29 Nov 2016 17:32:43 +0000 (17:32 +0000)]
Fix a linefeed at eof.
llvm-svn: 288167
Pavel Labath [Tue, 29 Nov 2016 17:21:18 +0000 (17:21 +0000)]
Remove assorted other plugins which are not needed by lldb-server
language runtime, structured data, sanitizers, process plugins.
llvm-svn: 288166
Roger Ferrer Ibanez [Tue, 29 Nov 2016 17:10:29 +0000 (17:10 +0000)]
Protect std::array tests under noexceptions
Skip tests that expect exceptions be thrown. Also add missing asserts.
Differential Revision: https://reviews.llvm.org/D27095
llvm-svn: 288165
Pavel Labath [Tue, 29 Nov 2016 17:06:26 +0000 (17:06 +0000)]
Remove dynamic loader, platform and ABI plugins from lldb-server dependencies
These packages are not used on the server.
llvm-svn: 288164
Anastasia Stulova [Tue, 29 Nov 2016 17:01:19 +0000 (17:01 +0000)]
[OpenCL] Prevent generation of globals in non-constant AS for OpenCL.
Avoid using shortcut for const qualified non-constant address space
aggregate variables while generating them on the stack such that
the alloca object is used instead of a global variable containing
initializer.
Review: https://reviews.llvm.org/D27109
llvm-svn: 288163
Filipe Cabecinhas [Tue, 29 Nov 2016 16:56:59 +0000 (16:56 +0000)]
Compiler-rt part of D26230: Add (constant) masked load/store support
Summary:
Unfortunately, there is no way to emit an llvm masked load/store in
clang without optimizations, and AVX enabled. Unsure how we should go
about making sure this test only runs if it's possible to execute AVX
code.
Reviewers: kcc, RKSimon, pgousseau
Subscribers: kubabrecka, dberris, llvm-commits
Differential Revision: https://reviews.llvm.org/D26506
llvm-svn: 288162
Artur Pilipenko [Tue, 29 Nov 2016 16:43:30 +0000 (16:43 +0000)]
[CVP] Remove use of removed flag (-cvp-dont-process-adds) from the test
The flag was removed by 288154
llvm-svn: 288161
Michael Kruse [Tue, 29 Nov 2016 16:41:21 +0000 (16:41 +0000)]
[DeLICM] Add pass boilerplate code.
Add an empty DeLICM pass, without any functional parts.
Extracting the boilerplate from the the functional part reduces the size of the
code to review (https://reviews.llvm.org/D24716)
Suggested-by: Tobias Grosser <tobias@grosser.es>
llvm-svn: 288160
Pavel Labath [Tue, 29 Nov 2016 16:40:57 +0000 (16:40 +0000)]
Specify the dependencies of lldb-server manually
Summary:
This basically just inlines the LLDBDependencies.cmake file into lldb-server
CMakeLists.txt. The reason is that most of these dependencies are not actually
necessary for lldb-server (some of them can't be removed because of
cross-dependencies, but most of the plugins can). I intend to start cleaning
these up in follow-up commits, but I want to do this first, so the subsequent
ones can be easily reverted if they don't build in some configurations.
When I cleaned these up locally, I was able to get a 30%--50% improvement in
lldb-server size.
Reviewers: zturner, beanz, tfiala
Subscribers: danalbert, srhines, lldb-commits, mgorny
Differential Revision: https://reviews.llvm.org/D26975
llvm-svn: 288159
Roger Ferrer Ibanez [Tue, 29 Nov 2016 16:40:19 +0000 (16:40 +0000)]
Protect std::string tests under libcpp-no-exceptions
Skip tests that expect an exception be thrown and/or disable
unreachable catch handlers.
Differential Revision: https://reviews.llvm.org/D26612
llvm-svn: 288158
Roger Ferrer Ibanez [Tue, 29 Nov 2016 16:37:48 +0000 (16:37 +0000)]
Protect std::{,unordered_}map tests under noexceptions
Skip tests that use exceptions
Differential Revision: https://reviews.llvm.org/D27093
llvm-svn: 288157
Roger Ferrer Ibanez [Tue, 29 Nov 2016 16:31:40 +0000 (16:31 +0000)]
Protect locale tests under noexceptions
Skip tests that expect exceptions be thrown.
Differential Revision: https://reviews.llvm.org/D27096
llvm-svn: 288156
Roger Ferrer Ibanez [Tue, 29 Nov 2016 16:27:45 +0000 (16:27 +0000)]
Protect test for dynarray under libcpp-no-exceptions
This test expects an exception be thrown.
Differential Revision: https://reviews.llvm.org/D26611
llvm-svn: 288155
Artur Pilipenko [Tue, 29 Nov 2016 16:24:57 +0000 (16:24 +0000)]
[CVP] Remove cvp-dont-process-adds flag
The flag was introduced because the optimization controlled by the flag initially caused regressions. All the regressions were fixed some time ago and the flag has been false for quite a while.
llvm-svn: 288154
Peter Smith [Tue, 29 Nov 2016 16:23:50 +0000 (16:23 +0000)]
[ELF] Add support for static TLS to ARM
The module index dynamic relocation R_ARM_DTPMOD32 is always 1 for an
executable. When static linking and when we know that we are not a shared
object we can resolve the module index relocation statically.
The logic in handleNoRelaxTlsRelocation remains the same for Mips as it
has its own custom GOT writing code. For ARM we add the module index
relocation to the GOT when it can be resolved statically.
In addition the type of the RelExpr for the static resolution of TlsGotRel
should be R_TLS and not R_ABS as we need to include the size of
the thread control block in the calculation.
Addresses the TLS part of PR30218.
Differential revision: https://reviews.llvm.org/D27213
llvm-svn: 288153
Nemanja Ivanovic [Tue, 29 Nov 2016 16:11:34 +0000 (16:11 +0000)]
[PowerPC] Improvements for BUILD_VECTOR Vol. 1
This patch corresponds to review:
https://reviews.llvm.org/D25912
This is the first patch in a series of 4 that improve the lowering and combining
for BUILD_VECTOR nodes on PowerPC.
llvm-svn: 288152
George Rimar [Tue, 29 Nov 2016 16:11:09 +0000 (16:11 +0000)]
[ELF] - Disable emiting multiple output sections when merging is disabled.
When -O0 is specified, we do not do section merging.
Though before this patch several sections were generated instead
of single, what is useless.
Differential revision: https://reviews.llvm.org/D27041
llvm-svn: 288151
George Rimar [Tue, 29 Nov 2016 16:05:27 +0000 (16:05 +0000)]
[ELF] - Add support of proccessing of the rest allocatable synthetic sections from linkerscript.
This change continues what was started by D27040
Now all allocatable synthetics should be available from script side.
Differential revision: https://reviews.llvm.org/D27131
llvm-svn: 288150
Alexey Bataev [Tue, 29 Nov 2016 15:37:52 +0000 (15:37 +0000)]
[SLP] Add a new test for tree vectorization starting from insertelement
instruction.
llvm-svn: 288148
Simon Pilgrim [Tue, 29 Nov 2016 15:32:58 +0000 (15:32 +0000)]
[X86] Moved getTargetConstantFromNode function so a future patch is more understandable. NFCI.
llvm-svn: 288147
Bob Haarman [Tue, 29 Nov 2016 15:24:00 +0000 (15:24 +0000)]
[profile] use GetComputerNameExW instead of gethostname on Windows
Summary: In profile data paths, we replace "%h" with the hostname of the machine the program is running on. On Windows, we used gethostname() to obtain the hostname. This requires linking with ws2_32. With this change, we instead get the hostname from GetComputerNameExW(), which does not require ws2_32.
Reviewers: rnk, vsk, amccarth
Subscribers: zturner, ruiu, hans
Differential Revision: https://reviews.llvm.org/D27178
llvm-svn: 288146
Benjamin Kramer [Tue, 29 Nov 2016 15:15:26 +0000 (15:15 +0000)]
[include-fixer] Don't eat one token too many when replacing a block of includes.
SourceRanges are inclusive token ranges, this was trying to form an
exclusive char range.
llvm-svn: 288145
Michael Kruse [Tue, 29 Nov 2016 15:11:04 +0000 (15:11 +0000)]
canSynthesize: Remove unused argument LI. NFC.
The helper function polly::canSynthesize() does not directly use the LoopInfo
analysis, hence remove it from its argument list.
llvm-svn: 288144
Aditya Kumar [Tue, 29 Nov 2016 14:43:42 +0000 (14:43 +0000)]
[libcxx] remove unused code
The macro _LIBCPP_UNROLL_LOOPS isn't used anywhere
so the code was dead.
Differential Revision: https://reviews.llvm.org/D26991
llvm-svn: 288143
Aditya Kumar [Tue, 29 Nov 2016 14:36:27 +0000 (14:36 +0000)]
[GVNHoist] Rename variables.
Differential Revision: https://reviews.llvm.org/D27110
llvm-svn: 288142
Aditya Kumar [Tue, 29 Nov 2016 14:34:01 +0000 (14:34 +0000)]
[GVNHoist] Enable aggressive hoisting when optimizing for code-size
Enable scalar hoisting at -Oz as it is safe to hoist scalars to a place
where they are partially needed.
Differential Revision: https://reviews.llvm.org/D27111
llvm-svn: 288141
Simon Pilgrim [Tue, 29 Nov 2016 14:18:51 +0000 (14:18 +0000)]
[X86][SSE] Add initial support for combining target shuffles to (V)PMOVZX.
We can only handle 128-bit vectors until we support target shuffle inputs of different size to the output.
llvm-svn: 288140
Eric Liu [Tue, 29 Nov 2016 14:15:14 +0000 (14:15 +0000)]
[change-namespace] fix non-calling function references.
Reviewers: hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D27208
llvm-svn: 288139
Simon Pilgrim [Tue, 29 Nov 2016 13:43:08 +0000 (13:43 +0000)]
Avoid repeated calls to MVT::getScalarSizeInBits(). NFCI.
llvm-svn: 288138
Simon Atanasyan [Tue, 29 Nov 2016 13:26:04 +0000 (13:26 +0000)]
[ELF][MIPS] Make stable an order of GOT page address entries
llvm-svn: 288137
Simon Pilgrim [Tue, 29 Nov 2016 13:16:11 +0000 (13:16 +0000)]
[X86][SSE] Added tests showing missed combines to (V)PMOVZX
llvm-svn: 288136
Chandler Carruth [Tue, 29 Nov 2016 12:54:34 +0000 (12:54 +0000)]
[PM] Fix a bad invalid densemap iterator bug in the new invalidation
logic.
Yup, the invalidation logic has an invalid iterator bug. Can't make this
stuff up.
We can recursively insert things into the map so we can't cache the
iterator into that map across those recursive calls. We did this
differently in two places. I have an end-to-end test that triggers at
least one of them. I'm going to work on a nice minimal test case that
triggers these, but I didn't want to leave the bug in the tree while
I tried to trigger it.
Also, the dense map iterator checking stuff we have now is awesome. =D
llvm-svn: 288135
Tobias Grosser [Tue, 29 Nov 2016 12:52:08 +0000 (12:52 +0000)]
Update for clang-format change in r288119
llvm-svn: 288134
Benjamin Kramer [Tue, 29 Nov 2016 12:41:21 +0000 (12:41 +0000)]
[AST] Use static_assert to verify types instead of undefined classes.
No functionliaty change intended.
llvm-svn: 288133
Simon Atanasyan [Tue, 29 Nov 2016 11:19:47 +0000 (11:19 +0000)]
[ELF][MIPS] Add new check to the test case in attempt to investigate Windows build-bot failure
llvm-svn: 288132
Malcolm Parsons [Tue, 29 Nov 2016 10:53:18 +0000 (10:53 +0000)]
[StringRef] Use default member initializers and = default.
Summary: This makes the default constructor implicitly constexpr and noexcept.
Reviewers: zturner, beanz
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27094
llvm-svn: 288131
Simon Atanasyan [Tue, 29 Nov 2016 10:24:00 +0000 (10:24 +0000)]
[ELF][MIPS] Restore Config->Threads for MIPS targets
llvm-svn: 288130
Simon Atanasyan [Tue, 29 Nov 2016 10:23:56 +0000 (10:23 +0000)]
[ELF][MIPS] Do not change MipsGotSection state in the getPageEntryOffset method
The MipsGotSection::getPageEntryOffset calculates index of GOT entry
with a "page" address. Previously this method changes the state
of MipsGotSection because it modifies PageIndexMap field. That leads
to the unpredictable results if getPageEntryOffset called from multiple threads.
The patch makes getPageEntryOffset constant. To do so it calculates GOT
entry index but does not update PageIndexMap field. Later in the
MipsGotSection::writeTo method linker calculates "page" addresses and
writes them to the output.
llvm-svn: 288129
Simon Atanasyan [Tue, 29 Nov 2016 10:23:50 +0000 (10:23 +0000)]
[ELF][MIPS] Replace the magic number of GOT header entries by constant. NFC
llvm-svn: 288128
Simon Atanasyan [Tue, 29 Nov 2016 10:23:46 +0000 (10:23 +0000)]
[ELF][MIPS] Fix calculation of GOT "page address" entries number
If output section which referenced by R_MIPS_GOT_PAGE or R_MIPS_GOT16
relocations is small (less that 0x10000 bytes) and occupies two adjacent
0xffff-bytes pages, current formula gives incorrect number of required "page"
GOT entries. The problem is that in time of calculation we do not know
the section address and so we cannot calculate number of 0xffff-bytes
pages exactly.
This patch fix the formula. Now it gives a correct number of pages in
the worst case when "small" section intersects 0xffff-bytes page
boundary. From the other side, sometimes it adds one more redundant GOT
entry for each output section. But usually number of output sections
referenced by GOT relocations is small.
llvm-svn: 288127
Alexey Bader [Tue, 29 Nov 2016 10:21:40 +0000 (10:21 +0000)]
[OpenCL] Prohibit using reserve_id_t in program scope.
Patch by Egor Churaev (echuraev).
Reviewers: Anastasia
Subscribers: cfe-commits, yaxunl, bader
Differential Revision: https://reviews.llvm.org/D27099
llvm-svn: 288126
Krasimir Georgiev [Tue, 29 Nov 2016 10:21:28 +0000 (10:21 +0000)]
Removed DEBUG_TYPE from TokenAnalyzer.h
Summary:
Defining DEBUG_TYPE in a header file doesn't make sense.
It is already defined in the corresponding source file.
Reviewers: klimek, ioeric
Subscribers: klimek
Differential Revision: https://reviews.llvm.org/D27164
llvm-svn: 288125
Yaron Keren [Tue, 29 Nov 2016 10:08:20 +0000 (10:08 +0000)]
Correct comment: we are creating a canonicla decltypetype.
llvm-svn: 288124
George Rimar [Tue, 29 Nov 2016 09:43:51 +0000 (09:43 +0000)]
[ELF] - Implemented -N (-omagic) command line option.
-N (-omagic)
Set the text and data sections to be readable and writable.
Also, do not page-align the data segment.
Differential revision: https://reviews.llvm.org/D26888
llvm-svn: 288123
Pavel Labath [Tue, 29 Nov 2016 09:42:35 +0000 (09:42 +0000)]
Remove ConnectionSharedMemory
This class is unused.
llvm-svn: 288122
Daniel Jasper [Tue, 29 Nov 2016 09:40:36 +0000 (09:40 +0000)]
clang-format: [JS] Properly format dict literals that skip labels.
llvm-svn: 288121
Daniel Jasper [Tue, 29 Nov 2016 09:40:32 +0000 (09:40 +0000)]
clang-format: Wrap complex binary expressions on the RHS of a comma.
Specifically, if the RHS of a comma is a complex binary expression and
spans multiple lines, insert a line break before it. This usually is
often more readable compared to producing a hanging indent. See changes
in FormatTest.cpp for examples.
llvm-svn: 288120
Daniel Jasper [Tue, 29 Nov 2016 09:40:01 +0000 (09:40 +0000)]
clang-format: Fix unnnecessary line break.
Before:
aaaaaaaaaa(aaaa(aaaa,
aaaa), //
aaaa,
aaaaa);
After:
aaaaaaaaaa(aaaa(aaaa,
aaaa), //
aaaa, aaaaa);
llvm-svn: 288119
Hafiz Abid Qadeer [Tue, 29 Nov 2016 09:31:57 +0000 (09:31 +0000)]
Fix a typo.
llvm-svn: 288118
Pavel Labath [Tue, 29 Nov 2016 09:23:05 +0000 (09:23 +0000)]
Remove ConnectionMachPort
Summary:
This class is unused, and since the StringRef refactor, it does not even
implement the Connection interface.
Reviewers: clayborg, jingham
Subscribers: mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D27134
llvm-svn: 288117
Marcin Koscielnicki [Tue, 29 Nov 2016 08:25:00 +0000 (08:25 +0000)]
Revert "Revert "[ASan] Enable on SystemZ.""
This reverts commit r287767.
Hopefully, the tests should be fixed by D27118.
llvm-svn: 288116
Alexey Bataev [Tue, 29 Nov 2016 08:21:14 +0000 (08:21 +0000)]
[SLPVectorizer] Improved support of partial tree vectorization.
Currently SLP vectorizer tries to vectorize a binary operation and dies
immediately after unsuccessful the first unsuccessfull attempt. Patch
tries to improve the situation, trying to vectorize all binary
operations of all children nodes in the binop tree.
Differential Revision: https://reviews.llvm.org/D25517
llvm-svn: 288115
Eugene Leviant [Tue, 29 Nov 2016 08:05:44 +0000 (08:05 +0000)]
[ELF] Refactor target error messages
Differential revision: https://reviews.llvm.org/D27097
llvm-svn: 288114
Rui Ueyama [Tue, 29 Nov 2016 04:22:57 +0000 (04:22 +0000)]
Style fix.
llvm-svn: 288113
Rui Ueyama [Tue, 29 Nov 2016 04:17:31 +0000 (04:17 +0000)]
Simplify "missing argument" error message.
llvm-svn: 288112
Rui Ueyama [Tue, 29 Nov 2016 04:17:30 +0000 (04:17 +0000)]
Add comments.
llvm-svn: 288111
Rui Ueyama [Tue, 29 Nov 2016 04:09:08 +0000 (04:09 +0000)]
Print error message header in red.
llvm-svn: 288110
Rafael Espindola [Tue, 29 Nov 2016 03:45:36 +0000 (03:45 +0000)]
Use relocations to fill statically known got entries.
Right now we just remember a SymbolBody for each got entry and
duplicate a bit of logic to decide what value, if any, should be
written for that SymbolBody.
With ARM there will be more complicated values, and it seems better to
just use the relocation code to fill the got entries. This makes it
clear that each entry is filled by the dynamic linker or by the static
linker.
llvm-svn: 288107
Rafael Espindola [Tue, 29 Nov 2016 03:36:30 +0000 (03:36 +0000)]
Sort. NFC.
llvm-svn: 288102
Rafael Espindola [Tue, 29 Nov 2016 03:30:07 +0000 (03:30 +0000)]
Add a test.
It would have found a missing case in another patch.
llvm-svn: 288101
Warren Ristow [Tue, 29 Nov 2016 02:37:13 +0000 (02:37 +0000)]
Test commit. Comment changes. NFC.
llvm-svn: 288100
Saleem Abdulrasool [Tue, 29 Nov 2016 02:31:40 +0000 (02:31 +0000)]
builtins: switch to c11 from c99
This fixes an incorrect standard usage of GNU99 when the compiler check was for
the ISO standard C99. Furthermore, bump the dependency up to C11. The
motivation for this change is ARM EHABI compatibility with clang 3.8. We rely
on a type definition redefinition which causes an error with -Werror builds.
This is problematic for FreeBSD builds. Switching to C11 allows the
compatibility without the unnecessary pedantic warning. The alternative would
be to clutter the support header with a `pragma clang diagnostic ignore`. GCC
4.8+ and the supported clang revisions along with MSVC support enough of C11 to
allow building the builtins in C11 mode. No functional change intended.
llvm-svn: 288099
Peter Collingbourne [Tue, 29 Nov 2016 02:27:04 +0000 (02:27 +0000)]
Bitcode: Change expected layout of module blocks.
We now expect each module's identification block to appear immediately before
the module block. Any module block that appears without an identification block
immediately before it is interpreted as if it does not have a module block.
Also change the interpretation of VST and function offsets in bitcode.
The offset is always taken as relative to the start of the identification
(or module if not present) block, minus one word. This corresponds to the
historical interpretation of offsets, i.e. relative to the start of the file.
These changes allow for bitcode modules to be concatenated by copying bytes.
Differential Revision: https://reviews.llvm.org/D27184
llvm-svn: 288098
Richard Smith [Tue, 29 Nov 2016 01:35:17 +0000 (01:35 +0000)]
Add a warning for 'main' returning 'true' or 'false'.
Patch by Joshua Hurwitz!
llvm-svn: 288097
Reid Kleckner [Tue, 29 Nov 2016 01:32:21 +0000 (01:32 +0000)]
[asan/win] Align global registration metadata to its size
This way, when the linker adds padding between globals, we can skip over
the zero padding bytes and reliably find the start of the next metadata
global.
llvm-svn: 288096
Tom Stellard [Tue, 29 Nov 2016 00:46:46 +0000 (00:46 +0000)]
AMDGPU/SI: Avoid moving PHIs to VALU when phi values are defined in scalar branches
Reviewers: arsenm
Subscribers: arsenm, llvm-commits, kzhuravl
Differential Revision: https://reviews.llvm.org/D23417
llvm-svn: 288095
Alexander Shaposhnikov [Tue, 29 Nov 2016 00:40:13 +0000 (00:40 +0000)]
[lldb] Fix compilation of SymbolFileDWARF.cpp with ENABLE_DEBUG_PRINTF set
This diff adds missing semicolon in SymbolFileDWARF.cpp
Differential revision: https://reviews.llvm.org/D27177
llvm-svn: 288094
Reid Kleckner [Tue, 29 Nov 2016 00:39:37 +0000 (00:39 +0000)]
Use ${:uid} to generate unique MS asm labels, not {:uid}
llvm-svn: 288093
Reid Kleckner [Tue, 29 Nov 2016 00:29:27 +0000 (00:29 +0000)]
Recognize ${:uid} escapes in intel syntax inline asm
It looks like this logic was duplicated long ago and the GCC side of
things has grown additional functionality. We need ${:uid} at least to
generate unique MS inline asm labels (PR23715), so expose these.
llvm-svn: 288092
Evgeniy Stepanov [Tue, 29 Nov 2016 00:22:50 +0000 (00:22 +0000)]
Return memory to OS right after free (not in the async thread).
Summary:
In order to avoid starting a separate thread to return unused memory to
the system (the thread interferes with process startup on Android,
Zygota waits for all threads to exit before fork, but this thread never
exits), try to return it right after free.
Reviewers: eugenis
Subscribers: cryptoad, filcab, danalbert, kubabrecka, llvm-commits
Patch by Aleksey Shlyapnikov.
Differential Revision: https://reviews.llvm.org/D27003
llvm-svn: 288091
Adam Nemet [Tue, 29 Nov 2016 00:09:22 +0000 (00:09 +0000)]
[GVN, OptDiag] Print the interesting instructions involved in missed load-elimination
This includes the intervening store and the load/store that we're trying
to forward from in the optimization remark for the missed load
elimination.
This is hooked up under a new mode in ORE that allows for compile-time
budget for a bit more analysis to print more insightful messages. This
mode is currently enabled for -fsave-optimization-record (-Rpass is
trickier since it is controlled in the front-end).
With this we can now print the red remark in http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/SingleSource/Benchmarks/Dhrystone/CMakeFiles/dry.dir/html/_org_test-suite_SingleSource_Benchmarks_Dhrystone_dry.c.html#L446
Differential Revision: https://reviews.llvm.org/D26490
llvm-svn: 288090
Reid Kleckner [Mon, 28 Nov 2016 23:58:04 +0000 (23:58 +0000)]
Avoid lambdas in default member initializers to work around clang bug
On Windows, Clang is mangling lambdas in default member initializers
incorrectly. See PR31197.
This is causing redness on the self-host bots. Work around the problem
locally so we aren't blind to further issues.
llvm-svn: 288089
Sanjay Patel [Mon, 28 Nov 2016 23:05:55 +0000 (23:05 +0000)]
[DAG] clean up foldSelectCCToShiftAnd(); NFCI
llvm-svn: 288088
Mehdi Amini [Mon, 28 Nov 2016 22:57:11 +0000 (22:57 +0000)]
Put ABI breaking test in Error checking behind LLVM_ENABLE_ABI_BREAKING_CHECKS
This macro is supposed to be the one controlling the compatibility
of ABI breaks induced when enabling or disabling assertions in LLVM.
The macro is enabled by default in assertions build, so this commit
won't disable the tests.
Differential Revision: https://reviews.llvm.org/D26700
llvm-svn: 288087
Kevin Enderby [Mon, 28 Nov 2016 22:40:50 +0000 (22:40 +0000)]
Add error checking for Mach-O universal files.
Add the checking for both the MachO::fat_header and the
MachO::fat_arch struct values in the constructor for
MachOUniversalBinary. Such that when the constructor
for ObjectForArch is called it can assume the values in
the MachO::fat_arch for the offset and size are contained
in the file after the MachOUniversalBinary constructor
is called for the Parent.
llvm-svn: 288084
Peter Collingbourne [Mon, 28 Nov 2016 22:30:21 +0000 (22:30 +0000)]
IRGen: Remove all uses of CreateDefaultAlignedLoad.
Differential Revision: https://reviews.llvm.org/D27157
llvm-svn: 288083
Mehdi Amini [Mon, 28 Nov 2016 22:23:53 +0000 (22:23 +0000)]
Add link-time detection of LLVM_ABI_BREAKING_CHECKS mismatch
The macro LLVM_ENABLE_ABI_BREAKING_CHECKS is moved to a new header
abi-breaking.h, from llvm-config.h. Only headers that are using the
macro are including this new header.
LLVM will define a symbol, either EnableABIBreakingChecks or
DisableABIBreakingChecks depending on the configuration setting for
LLVM_ABI_BREAKING_CHECKS.
The abi-breaking.h header will add weak references to these symbols in
every clients that includes this header. This should ensure that
a mismatch triggers a link failure (or a load time failure for DSO).
On MSVC, the pragma "detect_mismatch" is used instead.
Differential Revision: https://reviews.llvm.org/D26876
llvm-svn: 288082
John McCall [Mon, 28 Nov 2016 22:18:33 +0000 (22:18 +0000)]
Make CGVTables use ConstantInitBuilder. NFC.
llvm-svn: 288081
John McCall [Mon, 28 Nov 2016 22:18:30 +0000 (22:18 +0000)]
Hide the result of building a constant initializer. NFC.
llvm-svn: 288080
John McCall [Mon, 28 Nov 2016 22:18:27 +0000 (22:18 +0000)]
ConstantBuilder -> ConstantInitBuilder for clarity, and
move the member classes up to top level to allow forward
declarations to name them. NFC.
llvm-svn: 288079
Chandler Carruth [Mon, 28 Nov 2016 22:04:31 +0000 (22:04 +0000)]
[PM] Extend the explicit 'invalidate' method API on analysis results to
accept an Invalidator that allows them to invalidate themselves if their
dependencies are in turn invalidated.
Rather than recording the dependency graph ahead of time when analysis
get results from other analyses, this simply lets each result trigger
the immediate invalidation of any analyses they actually depend on. They
do this in a way that has three nice properties:
1) They don't have to handle transitive dependencies because the
infrastructure will recurse for them.
2) The invalidate methods are still called only once. We just
dynamically discover the necessary topological ordering, everything
is memoized nicely.
3) The infrastructure still provides a default implementation and can
access it so that only analyses which have dependencies need to do
anything custom.
To make this work at all, the invalidation logic also has to defer the
deletion of the result objects themselves so that they can remain alive
until we have collected the complete set of results to invalidate.
A unittest is added here that has exactly the dependency pattern we are
concerned with. It hit the use-after-free described by Sean in much
detail in the long thread about analysis invalidation before this
change, and even in an intermediate form of this change where we failed
to defer the deletion of the result objects.
There is an important problem with doing dependency invalidation that
*isn't* solved here: we don't *enforce* that results correctly
invalidate all the analyses whose results they depend on.
I actually looked at what it would take to do that, and it isn't as hard
as I had thought but the complexity it introduces seems very likely to
outweigh the benefit. The technique would be to provide a base class for
an analysis result that would be populated with other results, and
automatically provide the invalidate method which immediately does the
correct thing. This approach has some nice pros IMO:
- Handles the case we care about and nothing else: only *results*
that depend on other analyses trigger extra invalidation.
- Localized to the result rather than centralized in the analysis
manager.
- Ties the storage of the reference to another result to the triggering
of the invalidation of that analysis.
- Still supports extending invalidation in customized ways.
But the down sides here are:
- Very heavy-weight meta-programming is needed to provide this base
class.
- Requires a pretty awful API for accessing the dependencies.
Ultimately, I fear it will not pull its weight. But we can re-evaluate
this at any point if we start discovering consistent problems where the
invalidation and dependencies get out of sync. It will fit as a clean
layer on top of the facilities in this patch that we can add if and when
we need it.
Note that I'm not really thrilled with the names for these APIs... The
name "Invalidator" seems ok but not great. The method name "invalidate"
also. In review some improvements were suggested, but they really need
*other* uses of these terms to be updated as well so I'm going to do
that in a follow-up commit.
I'm working on the actual fixes to various analyses that need to use
these, but I want to try to get tests for each of them so we don't
regress. And those changes are seperable and obvious so once this goes
in I should be able to roll them out throughout LLVM.
Many thanks to Sean, Justin, and others for help reviewing here.
Differential Revision: https://reviews.llvm.org/D23738
llvm-svn: 288077
Peter Collingbourne [Mon, 28 Nov 2016 21:59:14 +0000 (21:59 +0000)]
cmake: Set rpath for loadable modules as well as shared libraries.
This fixes a regression introduced by r285714: we weren't setting the
rpath on LLVMgold.so correctly.
Spotted by mark@chromium.org!
Differential Revision: https://reviews.llvm.org/D27176
llvm-svn: 288076
Eli Friedman [Mon, 28 Nov 2016 21:50:34 +0000 (21:50 +0000)]
[SROA] Drop lifetime.start/end intrinsics when they block promotion.
Preserving lifetime markers isn't as important as allowing promotion,
so just drop the lifetime markers if necessary.
This also fixes an assertion failure where other parts of SROA assumed
that lifetime markers never block promotion.
Fixes https://llvm.org/bugs/show_bug.cgi?id=29139.
Differential Revision: https://reviews.llvm.org/D24854
llvm-svn: 288074
Sanjay Patel [Mon, 28 Nov 2016 21:47:41 +0000 (21:47 +0000)]
[DAG] add helper function for selectcc --> and+shift transforms; NFC
llvm-svn: 288073