Krzysztof Parzyszek [Tue, 2 May 2017 17:58:52 +0000 (17:58 +0000)]
[Hexagon] Remove unneeded code from HexagonShuffler
Patch by Colin LeMahieu.
llvm-svn: 301947
Krzysztof Parzyszek [Tue, 2 May 2017 17:56:11 +0000 (17:56 +0000)]
[Hexagon] Extract function that checks endloops with other branches
Change location number to point to conflicting branch instruction.
Patch by Colin LeMahieu.
llvm-svn: 301946
Krzysztof Parzyszek [Tue, 2 May 2017 17:53:51 +0000 (17:53 +0000)]
[Hexagon] Add new packet iterator which will iterate through duplexes
Patch by Colin LeMahieu.
llvm-svn: 301945
Zachary Turner [Tue, 2 May 2017 17:51:27 +0000 (17:51 +0000)]
Revert "Remove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 and"
This reverts commit
c08155afc5d3230792da2ad30a046a8617735a73.
This is causing undefined symbol errors with some of the constants.
llvm-svn: 301944
Krzysztof Parzyszek [Tue, 2 May 2017 17:51:14 +0000 (17:51 +0000)]
[Hexagon] Check for .cur def without use without using a map data structure
Patch by Colin LeMahieu.
llvm-svn: 301943
Peter Collingbourne [Tue, 2 May 2017 17:48:39 +0000 (17:48 +0000)]
Bitcode: Simplify how we enumerate summaries in the index. NFCI.
Instead of defining a custom iterator class, just use a function with a
callback, which is much easier to understand and less error prone.
Differential Revision: https://reviews.llvm.org/D32470
llvm-svn: 301942
Reid Kleckner [Tue, 2 May 2017 17:45:16 +0000 (17:45 +0000)]
[lit] Try to exit more cleanly
If all jobs complete successfully, use pool.close() instead of
pool.terminate() before waiting for the workers. Zach Turner reported
that he was getting "access denied" exceptions from pool.terminate().
Make the workers abort immediately without printing to stderr when they
are interrupted.
Finally, catch exceptions when attempting to remove our temporary
testing directory. On abnormal exit, there can often be open handles
that haven't been cleaned up yet.
llvm-svn: 301941
Paul Robinson [Tue, 2 May 2017 17:37:32 +0000 (17:37 +0000)]
Make DWARFDebugLine use StringRef for directory/file tables. NFC
Differential Revision: http://reviews.llvm.org/D32728
llvm-svn: 301940
Joel Jones [Tue, 2 May 2017 17:14:31 +0000 (17:14 +0000)]
Remove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 and
TLSDESC_ADD_LO12 relocations
Rearrange ordering in AArch64.def to follow relocation encoding
Fix name:
R_AARCH64_P32_LD64_GOT_LO12_NC => R_AARCH64_P32_LD32_GOT_LO12_NC
Add support for several "TLS", "TLSGD", and "TLSLD" relocations for
ILP32
Fix return values from isNonILP32reloc
Add implementations for
R_AARCH64_ADR_PREL_PG_HI21_NC, R_AARCH64_P32_LD32_GOT_LO12_NC,
R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC,
R_AARCH64_P32_TLSDESC_LD32_LO12, R_AARCH64_LD64_GOT_LO12_NC,
*TLSLD_LDST128_DTPREL_LO12, *TLSLD_LDST128_DTPREL_LO12_NC,
*TLSLE_LDST128_TPREL_LO12, *TLSLE_LDST128_TPREL_LO12_NC
Modify error messages to give name of equivalent relocation in the
ABI not being used, along with better checking for non-existent
requested relocations.
Added assembler support for "pg_hi21_nc"
Relocation definitions added without implementations:
R_AARCH64_P32_TLSDESC_ADR_PREL21, R_AARCH64_P32_TLSGD_ADR_PREL21,
R_AARCH64_P32_TLSGD_ADD_LO12_NC, R_AARCH64_P32_TLSLD_ADR_PREL21,
R_AARCH64_P32_TLSLD_ADR_PAGE21, R_AARCH64_P32_TLSLD_ADD_LO12_NC,
R_AARCH64_P32_TLSLD_LD_PREL19, R_AARCH64_P32_TLSDESC_LD_PREL19,
R_AARCH64_P32_TLSGD_ADR_PAGE21, R_AARCH64_P32_TLS_DTPREL,
R_AARCH64_P32_TLS_DTPMOD, R_AARCH64_P32_TLS_TPREL,
R_AARCH64_P32_TLSDESC
Fix encoding:
R_AARCH64_P32_TLSDESC_ADR_PAGE21
Reviewers: Peter Smith
Patch by: Joel Jones (jjones@cavium.com)
Differential Revision: https://reviews.llvm.org/D32072
llvm-svn: 301939
Matt Arsenault [Tue, 2 May 2017 17:14:00 +0000 (17:14 +0000)]
AMDGPU: Refactor AsmPrinter
Avoid analyzing functions multiple times. This allows
asserting that each function is only analyzed once.
llvm-svn: 301938
Matt Arsenault [Tue, 2 May 2017 16:57:44 +0000 (16:57 +0000)]
AMDGPU: Make intrinsics speculatable
llvm-svn: 301937
Zachary Turner [Tue, 2 May 2017 16:56:09 +0000 (16:56 +0000)]
[PDB/CodeView] Read/write codeview inlinee line information.
Previously we wrote line information and file checksum
information, but we did not write information about inlinee
lines and functions. This patch adds support for that.
llvm-svn: 301936
Sterling Augustine [Tue, 2 May 2017 16:43:39 +0000 (16:43 +0000)]
Roll back r301831 to fix broken powerpc64le tests.
http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/5941
llvm-svn: 301935
Tim Northover [Tue, 2 May 2017 16:37:37 +0000 (16:37 +0000)]
CMake: Silence more stderr when running git.
It can confuse bots collecting errors.
llvm-svn: 301934
Amaury Sechet [Tue, 2 May 2017 16:07:32 +0000 (16:07 +0000)]
Add new test case for addcarry. NFC.
llvm-svn: 301932
Rafael Espindola [Tue, 2 May 2017 15:45:31 +0000 (15:45 +0000)]
Avoid empty .eh_frame sections.
Strip on OpenBSD does not correctly handle an empty .eh_frame section
and produces broken binaries in that case. Currently lld creates such
an empty .eh_frame section, despite the fact that the OpenBSD crtend.o
explicitly inserts a terminator. The Linux LSB "standard":
https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html#EHFRAME
explicitly says that
The .eh_frame section shall contain 1 or more Call Frame Information (CFI) records.
This diff includes a test that specifically tests the issue I'm seeing
on OpenBSD.
Patch by Mark Kettenis!
llvm-svn: 301931
Marek Olsak [Tue, 2 May 2017 15:41:10 +0000 (15:41 +0000)]
AMDGPU: Add AMDGPU_HS calling convention
Reviewers: arsenm, nhaehnle
Subscribers: mehdi_amini, kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D32644
llvm-svn: 301930
Sanjay Patel [Tue, 2 May 2017 15:31:40 +0000 (15:31 +0000)]
[InstCombine] don't use DeMorgan's Law on integer constants (2nd try)
This was originally checked in here:
https://reviews.llvm.org/rL301923
And reverted here:
https://reviews.llvm.org/rL301924
Because there's a clang test that would fail after this. I fixed/removed the
offending CHECK lines in:
https://reviews.llvm.org/rL301928
So let's try this again. Original commit message:
This is the fold that causes the infinite loop in BoringSSL
(https://github.com/google/boringssl/blob/master/crypto/cipher/e_rc2.c)
when we fix instcombine demanded bits to prefer 'not' ops as in https://reviews.llvm.org/D32255.
There are 2 or 3 problems with dyn_castNotVal, and I don't think we can
reinstate https://reviews.llvm.org/D32255 until dyn_castNotVal is completely eliminated.
1. As shown here, it transforms 'not' into random xor. This transform is harmful to SCEV and codegen because 'not' can often be folded while random xor cannot.
2. It does not transform vector constants. This is actually a good thing, but if you don't believe the above argument, then we shouldn't have excluded vectors.
3. It tries to avoid transforming not(not(X)). That's nice, but it doesn't match the greedy nature of instcombine. If we DeMorganize a pattern that has an extra 'not' in it: ~(~(~X) & Y) --> (~X | ~Y)
That's just another case of DeMorgan, so we should trust that we'll fold that pattern too: (~X | ~ Y) --> ~(X & Y)
Differential Revision: https://reviews.llvm.org/D32665
llvm-svn: 301929
Sanjay Patel [Tue, 2 May 2017 15:20:18 +0000 (15:20 +0000)]
[CodeGen] remove/fix checks that will fail when r301923 is recommitted
Don't test the optimizer as part of front-end verification.
llvm-svn: 301928
Dmitry Vyukov [Tue, 2 May 2017 15:15:45 +0000 (15:15 +0000)]
tsan: allow fast large MemoryRangeSet on non-Windows Go
The fast reset for large memory regions is not working
only on windows. So enable it for Go/linux/darwin/freebsd.
See https://github.com/golang/go/issues/20139
for background and motivation.
Based on idea by Josh Bleecher Snyder.
llvm-svn: 301927
Kostya Kortchinsky [Tue, 2 May 2017 15:13:36 +0000 (15:13 +0000)]
[compiler-rt] move tsan's Android __get_tls() to sanitizer_common
Summary:
TSan's Android `__get_tls()` and `TLS_SLOT_TSAN` can be used by other sanitizers as well (see D32649), this change moves them to sanitizer_common.
I picked sanitizer_linux.h as their new home.
In the process, add the 32-bit versions for ARM, i386 & MIPS.
Can the address of `__get_tls()[TLS_SLOT_TSAN]` change in between the calls?
I am not sure if there is a need to repeat the construct as opposed to using a variable. So I left things as they were.
Testing on my side was restricted to a successful cross-compilation.
Reviewers: dvyukov, kubamracek
Reviewed By: dvyukov
Subscribers: aemerson, rengolin, srhines, dberris, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D32705
llvm-svn: 301926
Siddharth Bhat [Tue, 2 May 2017 14:54:49 +0000 (14:54 +0000)]
[NFC] [IslAST] fix typo: "int the" -> "in the"
llvm-svn: 301925
Sanjay Patel [Tue, 2 May 2017 14:48:23 +0000 (14:48 +0000)]
revert r301923 : [InstCombine] don't use DeMorgan's Law on integer constants
There's a clang test that is wrongly using -O1 and failing after this commit.
llvm-svn: 301924
Sanjay Patel [Tue, 2 May 2017 14:31:30 +0000 (14:31 +0000)]
[InstCombine] don't use DeMorgan's Law on integer constants
This is the fold that causes the infinite loop in BoringSSL
(https://github.com/google/boringssl/blob/master/crypto/cipher/e_rc2.c)
when we fix instcombine demanded bits to prefer 'not' ops as in D32255.
There are 2 or 3 problems with dyn_castNotVal, and I don't think we can
reinstate D32255 until dyn_castNotVal is completely eliminated.
1. As shown here, it transforms 'not' into random xor. This transform is
harmful to SCEV and codegen because 'not' can often be folded while
random xor cannot.
2. It does not transform vector constants. This is actually a good thing,
but if you don't believe the above argument, then we shouldn't have
excluded vectors.
3. It tries to avoid transforming not(not(X)). That's nice, but it doesn't
match the greedy nature of instcombine. If we DeMorganize a pattern
that has an extra 'not' in it:
~(~(~X) & Y) --> (~X | ~Y)
That's just another case of DeMorgan, so we should trust that we'll fold
that pattern too:
(~X | ~ Y) --> ~(X & Y)
Differential Revision: https://reviews.llvm.org/D32665
llvm-svn: 301923
Amaury Sechet [Tue, 2 May 2017 14:15:48 +0000 (14:15 +0000)]
[DAGCombine] (uaddo X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry)
Summary: This is a common pattern that arise when legalizing large integers operations. Only do it when Y + 1 cannot overflow as this would change the carry behavior of uaddo .
Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32687
llvm-svn: 301922
Rafael Espindola [Tue, 2 May 2017 14:04:52 +0000 (14:04 +0000)]
Add llvm::object::getELFSectionTypeName().
This is motivated by https://reviews.llvm.org/D32488 where I am trying
to add printing of the section type for incompatible sections to LLD
error messages. This patch allows us to use the same code in
llvm-readobj and LLD instead of duplicating the function inside LLD.
Patch by Alexander Richardson!
llvm-svn: 301921
Alex Bradbury [Tue, 2 May 2017 13:47:10 +0000 (13:47 +0000)]
Improvements to TableGen/LangIntro.rst
Document the 'code' data type, and that value{15-17} is different to
value{17-15}.
Patch by @chenwj (Wei-Ren Chen).
Differential Revision: https://reviews.llvm.org/D32117
llvm-svn: 301920
Amaury Sechet [Tue, 2 May 2017 13:34:25 +0000 (13:34 +0000)]
[DAGCombine] (add X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry)
Summary: Common pattern when legalizing large integers operations. Similar to D32687, when the carry isn't used.
Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer
Differential Revision: https://reviews.llvm.org/D32738
llvm-svn: 301919
Pavel Labath [Tue, 2 May 2017 13:14:45 +0000 (13:14 +0000)]
Android.rules: set "ar" path correctly
llvm-svn: 301918
Pavel Labath [Tue, 2 May 2017 12:40:31 +0000 (12:40 +0000)]
ObjectFileELF: Fix symbol lookup in bss section
Summary:
If we have symbol information in a separate file, we need to be very
careful about presenting a unified section view of module to the rest of
the debugger. ObjectFileELF had code to handle that, but it was being
overly cautious -- the section->GetFileSize()!=0 meant that the
unification would fail for sections which do not occupy any space in the
object file (e.g., .bss). In my case, that manifested itself as not
being able to display the values of .bss variables properly as the
section associated with the variable did not have it's load address set
(because it was not present in the unified section list).
I test this by making sure the unified section list and the variables
refer to the same section.
Reviewers: eugene, zturner
Subscribers: tberghammer, lldb-commits, mgorny
Differential Revision: https://reviews.llvm.org/D32434
llvm-svn: 301917
Daniel Jasper [Tue, 2 May 2017 12:38:27 +0000 (12:38 +0000)]
Revert r301735 (and subsequent r301786).
It leads to clang crashing, e.g. on this short code fragment (added to
test/SemaCXX/warn-thread-safety-parsing.cpp):
class SomeClass {
public:
void foo() {
auto l = [this] { auto l = [] EXCLUSIVE_LOCKS_REQUIRED(mu_) {}; };
}
Mutex mu_;
};
llvm-svn: 301916
Simon Pilgrim [Tue, 2 May 2017 12:25:17 +0000 (12:25 +0000)]
[X86][SSE] Add test for PR30264 (combining multiple constants inputs in a shuffle)
llvm-svn: 301915
Haojian Wu [Tue, 2 May 2017 12:15:11 +0000 (12:15 +0000)]
[clang-move] Find template class forward declarations more precisely.
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D32741
llvm-svn: 301914
Daniel Marjamaki [Tue, 2 May 2017 11:46:12 +0000 (11:46 +0000)]
[analyzer] Detect bad free of function pointers
Differential Revision: https://reviews.llvm.org/D31650
llvm-svn: 301913
Simon Pilgrim [Tue, 2 May 2017 11:08:15 +0000 (11:08 +0000)]
[X86] Tidyup subvector insert/extract helpers. NFCI.
Use getConstantOperandVal where possible.
llvm-svn: 301912
Simon Pilgrim [Tue, 2 May 2017 10:43:33 +0000 (10:43 +0000)]
Fix typo in comment. NFCI.
llvm-svn: 301911
Simon Pilgrim [Tue, 2 May 2017 10:33:08 +0000 (10:33 +0000)]
[SelectionDAG] Improve support for promotion of <1 x fX> floating point argument types (PR31088)
PR31088 demonstrated that we were assuming that only integers require promotion from <1 x iX> types, when in fact float types may require it as well - in this case half floats.
This patch adds support for extension/truncation for both integer and float types.
Differential Revision: https://reviews.llvm.org/D32391
llvm-svn: 301910
Pierre Gousseau [Tue, 2 May 2017 10:22:05 +0000 (10:22 +0000)]
Revert r301904 causing tsan test failure in x86_64-linux-autoconf
llvm-svn: 301909
Pavel Labath [Tue, 2 May 2017 10:17:30 +0000 (10:17 +0000)]
Change UniqueCStringMap to use ConstString as the key
Summary:
UniqueCStringMap "sorts" the entries for fast lookup, but really it only cares about uniqueness. ConstString can be compared by pointer alone, rather than with strcmp, resulting in much faster comparisons. Change the interface to take ConstString instead, and propagate use of the type to the callers where appropriate.
Reviewers: #lldb, clayborg
Reviewed By: clayborg
Subscribers: labath, jasonmolenda, lldb-commits
Differential Revision: https://reviews.llvm.org/D32316
Patch by Scott Smith <scott.smith@purestorage.com>.
llvm-svn: 301908
Simon Pilgrim [Tue, 2 May 2017 10:16:19 +0000 (10:16 +0000)]
[DAGCombiner] Improve MatchBswapHword logic (PR31357)
The existing code only looks at half of the tree when matching bswap + rol patterns ending in an OR tree (as opposed to a cascade).
Patch originally introduced by Jim Lewis.
Submitted on the behalf of Dinar Temirbulatov.
Differential Revision: https://reviews.llvm.org/D32039
llvm-svn: 301907
Emilio Cobos Alvarez [Tue, 2 May 2017 09:57:30 +0000 (09:57 +0000)]
Remove leftover test expectation from rL301902.
llvm-svn: 301906
Diana Picus [Tue, 2 May 2017 09:40:49 +0000 (09:40 +0000)]
[ARM] GlobalISel: Use TableGen instruction selector
Emit and use the TableGen instruction selector for ARM. At the moment,
this allows us to remove the hand-written code for selecting G_SDIV and
G_UDIV.
Future commits will focus on increasing the code coverage for it and
removing more dead code from the current instruction selector.
llvm-svn: 301905
Pierre Gousseau [Tue, 2 May 2017 09:01:02 +0000 (09:01 +0000)]
[asan] Add strndup/__strndup interceptors if targeting linux.
Differential Revision: https://reviews.llvm.org/D31457
llvm-svn: 301904
Pavel Labath [Tue, 2 May 2017 09:00:52 +0000 (09:00 +0000)]
Remove unused code related to CPlusPlusLanguage::FindEquivalentNames
Summary: It is simply unused, and the header for it is private, so there should be no external dependencies.
Reviewers: #lldb, zturner
Reviewed By: zturner
Subscribers: zturner, tberghammer, jingham, lldb-commits
Differential Revision: https://reviews.llvm.org/D32503
Patch by Scott Smith <scott.smith@purestorage.com>.
llvm-svn: 301903
Emilio Cobos Alvarez [Tue, 2 May 2017 08:32:15 +0000 (08:32 +0000)]
[libclang] Revert rL301328 and add tests for the regressions introduced.
Differential Revision: https://reviews.llvm.org/D32566
llvm-svn: 301902
Craig Topper [Tue, 2 May 2017 06:32:27 +0000 (06:32 +0000)]
[APInt] Move APInt::getSplat out of line.
I think this method is probably too complex to be inlined.
llvm-svn: 301901
Craig Topper [Tue, 2 May 2017 05:49:40 +0000 (05:49 +0000)]
[APInt] Move the setBit and clearBit methods inline.
This makes setBit/clearBit more consistent with setBits which is already inlined.
llvm-svn: 301900
Xinliang David Li [Tue, 2 May 2017 05:38:41 +0000 (05:38 +0000)]
Refactor callsite cost computation into a helper function /NFC
Makes code more readable. The function will also be used
by the partial inlining's cost analysis.
llvm-svn: 301899
NAKAMURA Takumi [Tue, 2 May 2017 05:12:55 +0000 (05:12 +0000)]
clang/test/Modules/diag-flags.cpp: Appease targeting *-win32 with explicit triple. Fixes r301846.
MicrosoftRecordLayoutBuilder doesn't have ability of -Wpadded.
FIXME: Would other diag be available here?
llvm-svn: 301898
Peter Collingbourne [Tue, 2 May 2017 05:07:41 +0000 (05:07 +0000)]
ELF: Set symbol binding to STB_GLOBAL when undefining symbols during LTO.
If there is a bug in the LTO implementation that causes it to fail to provide
an expected symbol definition, the linker should report an undefined symbol
error. Unfortunately, we were failing to do so if the symbol definition
was weak, as the undefine() function was turning the definition into a weak
undefined symbol, which resolves to zero if the symbol remains undefined. This
patch causes us to set the binding to STB_GLOBAL when we undefine a symbol.
I can't see a good way to test this. The behaviour should only be observable
if there is a bug in the LTO implementation.
Differential Revision: https://reviews.llvm.org/D32731
llvm-svn: 301897
Rui Ueyama [Tue, 2 May 2017 02:58:04 +0000 (02:58 +0000)]
Update commetns.
llvm-svn: 301896
Rui Ueyama [Tue, 2 May 2017 02:57:45 +0000 (02:57 +0000)]
Make getArchiveMembers function a non-member function.
It didn't have to be a member function of Driver. This patch makes
that function a file-scoped non-member function.
llvm-svn: 301895
Xinliang David Li [Tue, 2 May 2017 02:44:14 +0000 (02:44 +0000)]
[PartialInlining] Hook up inline cost analysis
Differential Revision: http://reviews.llvm.org/D32666
llvm-svn: 301894
Dylan McKay [Tue, 2 May 2017 01:57:48 +0000 (01:57 +0000)]
[AVR] Save/restore the frame pointer for all functions
A recent commit I made made it so that we only did this for signal or
interrupt handlers. This broke normal functions.
llvm-svn: 301893
Nemanja Ivanovic [Tue, 2 May 2017 01:47:34 +0000 (01:47 +0000)]
[PowerPC] Emit VMX loads/stores for aligned ops to avoid adding swaps on LE
Fixes PR30730.
This is a re-commit of a pulled commit. The commit was pulled because some
software projects contained uses of Altivec vectors that violated alignment
requirements. Known issues have now been fixed.
Committing on behalf of Lei Huang.
Differential Revision: https://reviews.llvm.org/D26861
llvm-svn: 301892
Nick Lewycky [Tue, 2 May 2017 01:06:16 +0000 (01:06 +0000)]
Revert r301785 (and r301787) because they caused PR32864.
The fix is that ExprEvaluatorBase::VisitInitListExpr should handle transparent exprs instead of exprs with one element. Fixing that uncovers one testcase failure because the AST for "constexpr _Complex float test2 = {1};" is wrong (the _Complex prvalue should not be const-qualified), and a number of test failures in test/OpenMP where the captured stmt contains an InitListExpr that is in syntactic form.
llvm-svn: 301891
Ahmed Bougacha [Tue, 2 May 2017 00:45:01 +0000 (00:45 +0000)]
[AArch64] armv8-A doesn't have LSE.
r288279 mistakenly added it to all arches, but it's only available
from v8.1 onwards.
The testcase is awkward, because (I suspect) of PR32873.
Spotted by inspection.
llvm-svn: 301890
Kostya Serebryany [Tue, 2 May 2017 00:44:24 +0000 (00:44 +0000)]
[sanitizer-coverage] add a deprecation note for the old sanitizer-coverage; remove a TODO printf
llvm-svn: 301889
Kostya Serebryany [Tue, 2 May 2017 00:32:57 +0000 (00:32 +0000)]
[sanitizer-coverage] update the SanitizerCoverage docs to reflect the current state
llvm-svn: 301888
Dylan McKay [Tue, 2 May 2017 00:11:34 +0000 (00:11 +0000)]
[AVR] Fix a bug where the frame pointer is clobbered
Because it was a callee-saved register, we automatically generated code
to spill and unspill its original value so that it is restored after the
function returns.
The problem is that this code was being generated before the epilogue.
The epilogue itself uses the Y register, which could be prematurely
restored by the CSR restoration process.
This removes R29R28 from the CSR list and changes the prologue/epilogue
code to handle it explicitly.
llvm-svn: 301887
George Burgess IV [Mon, 1 May 2017 23:54:41 +0000 (23:54 +0000)]
Revert r301880
This change caused buildbot failures, apparently because we're not
passing around types that InstSimplify is used to seeing. I'm not overly
familiar with InstSimplify, so I'm reverting this until I can figure out
what exactly is wrong.
llvm-svn: 301885
Paul Robinson [Mon, 1 May 2017 23:27:55 +0000 (23:27 +0000)]
Stylistic makeover of DWARFDebugLine before working on it. NFC
Rename parameters and locals to CamelCase, doxygenize the header, and
run clang-format on the whole thing.
llvm-svn: 301883
Zachary Turner [Mon, 1 May 2017 23:27:42 +0000 (23:27 +0000)]
[CodeView] Write CodeView line information.
Differential Revision: https://reviews.llvm.org/D32716
llvm-svn: 301882
Dylan McKay [Mon, 1 May 2017 23:16:59 +0000 (23:16 +0000)]
[AVR] Enable the frame pointer for all functions
This is a temporary measure while we figure out a way to get the frame
pointer working correctly.
llvm-svn: 301881
George Burgess IV [Mon, 1 May 2017 23:12:08 +0000 (23:12 +0000)]
[InstSimplify] Handle selects of GEPs with 0 offset
In particular (since it wouldn't fit nicely in the summary):
(select (icmp eq V 0) P (getelementptr P V)) -> (getelementptr P V)
Differential Revision: https://reviews.llvm.org/D31435
llvm-svn: 301880
Simon Pilgrim [Mon, 1 May 2017 23:09:01 +0000 (23:09 +0000)]
[X86] Reduce code for setting operations actions by merging into loops across multiple types/ops. NFCI.
llvm-svn: 301879
Xin Tong [Mon, 1 May 2017 23:08:19 +0000 (23:08 +0000)]
Empty Space. NFC
llvm-svn: 301878
Davide Italiano [Mon, 1 May 2017 23:04:33 +0000 (23:04 +0000)]
[IR] Garbage collect unused variants. NFCI.
llvm-svn: 301877
Peter Collingbourne [Mon, 1 May 2017 22:48:10 +0000 (22:48 +0000)]
Fix a pessimising move warning.
llvm-svn: 301852
Matthias Braun [Mon, 1 May 2017 22:32:25 +0000 (22:32 +0000)]
MachineFrameInfo: Track whether MaxCallFrameSize is computed yet; NFC
This tracks whether MaxCallFrameSize is computed yet. Ideally we would
assert and fail when the value is queried before it is computed, however
this fails various targets that need to be fixed first.
Differential Revision: https://reviews.llvm.org/D32570
llvm-svn: 301851
NAKAMURA Takumi [Mon, 1 May 2017 22:31:43 +0000 (22:31 +0000)]
llvm-link: Add BitReader to deps corresponding to r301832.
llvm-svn: 301850
Davide Italiano [Mon, 1 May 2017 22:26:28 +0000 (22:26 +0000)]
[NewGVN] Don't derive incorrect implications.
In the testcase attached, we believe %tmp1 implies %tmp4.
where:
br i1 %tmp1, label %bb2, label %bb7
br i1 %tmp4, label %bb5, label %bb7
because Wwhile looking at PredicateInfo stuffs we end up calling
isImpliedTrueByMatchingCmp() with the arguments backwards.
Differential Revision: https://reviews.llvm.org/D32718
llvm-svn: 301849
Sanjay Patel [Mon, 1 May 2017 22:25:42 +0000 (22:25 +0000)]
[InstCombine] check one-use before applying DeMorgan nor/nand folds
If we have ~(~X & Y), it only makes sense to transform it to (X | ~Y) when we do not need
the intermediate (~X & Y) value. In that case, we would need an extra instruction to
generate ~Y + 'or' (as shown in the test changes).
It's ok if we have multiple uses of ~X or Y, however. In those cases, we may not reduce the
instruction count or critical path, but we might improve throughput because we can generate
~X and ~Y in parallel. Whether that actually makes perf sense or not for a target is something
we can't answer in IR.
Differential Revision: https://reviews.llvm.org/D32703
llvm-svn: 301848
Richard Smith [Mon, 1 May 2017 22:11:08 +0000 (22:11 +0000)]
New file missed from r301846.
llvm-svn: 301847
Richard Smith [Mon, 1 May 2017 22:10:47 +0000 (22:10 +0000)]
Fix initial diagnostic state setup for an explicit module with no diagnostic pragmas.
If a file has no diagnostic pragmas, we build its diagnostic state lazily, but
in this case we never set up the root state to be the diagnostic state in which
the module was originally built, so the diagnostic flags for files in the
module with no diagnostic pragmas were incorrectly based on the user of the
module rather than the diagnostic state when the module was built.
llvm-svn: 301846
Kostya Serebryany [Mon, 1 May 2017 22:07:12 +0000 (22:07 +0000)]
[sanitizer-coverage] remove more stale code
llvm-svn: 301845
Greg Clayton [Mon, 1 May 2017 22:07:02 +0000 (22:07 +0000)]
Adds initial llvm-dwarfdump --verify support with unit tests.
lldb-dwarfdump gets a new "--verify" option that will verify a single file's DWARF debug info and will print out any errors that it finds. It will return an non-zero exit status if verification fails, and a zero exit status if verification succeeds. Adding the --quiet option will suppress any output the STDOUT or STDERR.
The first part of the verify does the following:
- verifies that all CU relative references (DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref8, DW_FORM_ref_udata) have valid CU offsets
- verifies that all DW_FORM_ref_addr references have valid .debug_info offsets
- verifies that all DW_AT_ranges attributes have valid .debug_ranges offsets
- verifies that all DW_AT_stmt_list attributes have valid .debug_line offsets
- verifies that all DW_FORM_strp attributes have valid .debug_str offsets
Unit tests were added for each of the above cases.
Differential Revision: https://reviews.llvm.org/D32707
llvm-svn: 301844
Peter Collingbourne [Mon, 1 May 2017 22:04:36 +0000 (22:04 +0000)]
Bitcode: Make the summary reader responsible for merging. NFCI.
This is to prepare for an upcoming change which uses pointers instead of
GUIDs to represent references.
Differential Revision: https://reviews.llvm.org/D32469
llvm-svn: 301843
Craig Topper [Mon, 1 May 2017 21:56:05 +0000 (21:56 +0000)]
[APInt] In operator!, handle single word case by comparing VAL to 0 directly and handle multiword case by comparing countLeadingZerosSlowCase() to BitWidth.
We were using operator=(0) which implicitly calls countLeadingZeros but only to compare with 64 to determine if we can compare VAL or pVal[0] to uint64_t. By handling the multiword case with countLeadingZerosSlowCase==BitWidth we can prevent a load of pVal[0] from being inserted inline at each call site. This saves a little bit of code size.
llvm-svn: 301842
Quentin Colombet [Mon, 1 May 2017 21:53:19 +0000 (21:53 +0000)]
[AArch64] Move GISel accessor initialization from TargetMachine to Subtarget.
NFC
llvm-svn: 301841
Richard Smith [Mon, 1 May 2017 21:49:54 +0000 (21:49 +0000)]
Put back REQUIRES: system-darwin to fix asan bot.
These tests do not appear to be Darwin-specific, and this REQUIRES: appears to
be hiding a real bug; this change is just restoring the prior state to get the
buildbots happy again while we investigate. (The system-darwin requirement is
covered by PR32851.)
llvm-svn: 301840
Vedant Kumar [Mon, 1 May 2017 21:41:01 +0000 (21:41 +0000)]
[ubsan] Fall back to the fast unwinder when print_stacktrace=1
This makes it possible to get stacktrace info when print_stacktrace=1 on
Darwin (where the slow unwinder is not currently supported [1]). This
should not regress any other platforms.
[1] The thread about r300295 has a relatively recent discusion about
this. We should be able to enable the existing slow unwind functionality
for Darwin, but this needs more testing.
Differential Revision: https://reviews.llvm.org/D32517
llvm-svn: 301839
Craig Topper [Mon, 1 May 2017 21:16:44 +0000 (21:16 +0000)]
[APInt] Fix copy/paste mistake in comment for isNullValue. NFC
llvm-svn: 301838
Kostya Serebryany [Mon, 1 May 2017 21:05:29 +0000 (21:05 +0000)]
[asan] speed up small memcpy (> 32 but <= 64 bytes)
llvm-svn: 301837
Gabor Horvath [Mon, 1 May 2017 21:02:38 +0000 (21:02 +0000)]
Reorder release notes, fix missing link and a grammar issue.
Patch by Réka Nikolett Kovács!
llvm-svn: 301836
Peter Collingbourne [Mon, 1 May 2017 20:57:20 +0000 (20:57 +0000)]
IPO: Add missing build dep.
llvm-svn: 301835
Simon Pilgrim [Mon, 1 May 2017 20:56:35 +0000 (20:56 +0000)]
[X86][AVX] Rename LowerVectorBroadcast to lowerBuildVectorAsBroadcast. NFCI.
Since the shuffle refactor, this is only used during BUILD_VECTOR lowering.
llvm-svn: 301834
Rui Ueyama [Mon, 1 May 2017 20:49:09 +0000 (20:49 +0000)]
Add comments about how we handle mergeable sections with relocations.
Also factored out code.
llvm-svn: 301833
Peter Collingbourne [Mon, 1 May 2017 20:42:32 +0000 (20:42 +0000)]
Object: Remove ModuleSummaryIndexObjectFile class.
Differential Revision: https://reviews.llvm.org/D32195
llvm-svn: 301832
Sterling Augustine [Mon, 1 May 2017 20:35:02 +0000 (20:35 +0000)]
Add powerpc64 and powerpc64le to build infrastructure.
From Phab D32031.
llvm-svn: 301831
Rafael Espindola [Mon, 1 May 2017 20:32:39 +0000 (20:32 +0000)]
Fix pr32816.
When using linkerscripts we were trying to sort SHF_LINK_ORDER
sections too early. Instead of always doing two runs of
assignAddresses, record the section order in processCommands.
llvm-svn: 301830
Krzysztof Parzyszek [Mon, 1 May 2017 20:16:35 +0000 (20:16 +0000)]
[Hexagon] Replace CVI_VM_CUR_LD type with CVI_VM_LD
A .cur instruction can be identified by checking isCVINew() && mayLoad().
Patch by Colin LeMahieu.
llvm-svn: 301829
Krzysztof Parzyszek [Mon, 1 May 2017 20:10:41 +0000 (20:10 +0000)]
[Hexagon] Improving error reporting for writing to read only registers
Patch by Colin LeMahieu.
llvm-svn: 301828
Krzysztof Parzyszek [Mon, 1 May 2017 20:06:01 +0000 (20:06 +0000)]
[Hexagon] Give better error messages for solo instruction errors
Patch by Colin LeMahieu.
llvm-svn: 301827
Kostya Serebryany [Mon, 1 May 2017 20:01:50 +0000 (20:01 +0000)]
[sanitizer-coverage] disable coverage_direct=1, will remove the code in a few weeks
llvm-svn: 301826
Benjamin Kramer [Mon, 1 May 2017 20:00:23 +0000 (20:00 +0000)]
Silence unused variable warning. NFC.
llvm-svn: 301825
Kostya Serebryany [Mon, 1 May 2017 19:52:01 +0000 (19:52 +0000)]
[sanitizer-coverage] add a deprecation note to coverage_direct=1
llvm-svn: 301824
Krzysztof Parzyszek [Mon, 1 May 2017 19:41:43 +0000 (19:41 +0000)]
[Hexagon] Improve shuffle error reporting
Patch by Colin LeMahieu.
llvm-svn: 301823
Richard Smith [Mon, 1 May 2017 18:49:04 +0000 (18:49 +0000)]
Improve handling of arrays of unknown bound in constant expressions.
Do not spuriously reject constexpr functions that access elements of an array
of unknown bound; this may later become valid once the bound is known. Permit
array-to-pointer decay on such arrays, but disallow pointer arithmetic (since
we do not know whether it will have defined behavior).
The standard is not clear on how this should work, but this seems to be a
decent answer.
Patch by Robert Haberlach!
llvm-svn: 301822
Rui Ueyama [Mon, 1 May 2017 18:38:37 +0000 (18:38 +0000)]
Change an unusual directory permission back to a sane value after test.
Leaving a directory with a permission 0o100 is inconvenient.
For example, macOS's rm can't remove such directory.
llvm-svn: 301821