Andrew V. Tischenko [Tue, 25 Jul 2017 13:05:12 +0000 (13:05 +0000)]
X86 Asm uses assertions instead of proper diagnostic. This patch fixes that.
Differential Revision: https://reviews.llvm.org/D35115
llvm-svn: 308972
Siddharth Bhat [Tue, 25 Jul 2017 12:35:36 +0000 (12:35 +0000)]
[PPCGCodeGeneration] Skip arrays with empty extent.
Invariant load hoisted scalars, and arrays whose size we can statically compute
to be 0 do not need to be allocated as arrays.
Invariant load hoisted scalars are sent to the kernel directly as parameters.
Earlier, we used to allocate `0` bytes of memory for these because our
computation of size from `PPCGCodeGeneration::getArraySize` would result in `0`.
Now, since we don't invariant loads as arrays in PPCGCodeGeneration, this
problem does not occur anymore.
Differential Revision: https://reviews.llvm.org/D35795
llvm-svn: 308971
Krasimir Georgiev [Tue, 25 Jul 2017 11:37:43 +0000 (11:37 +0000)]
[clangd] Reuse compile commands during reparse
Summary:
Previously we always queried the compilation database and discarded the results
if the file was already opened.
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D35825
llvm-svn: 308970
Manuel Klimek [Tue, 25 Jul 2017 11:34:55 +0000 (11:34 +0000)]
Fix spelling of FileCheck in test.
llvm-svn: 308969
Chandler Carruth [Tue, 25 Jul 2017 10:48:32 +0000 (10:48 +0000)]
[LIR] Teach LIR to avoid extending the BE count prior to adding one to
it when safe.
Very often the BE count is the trip count minus one, and the plus one
here should fold with that minus one. But because the BE count might in
theory be UINT_MAX or some such, adding one before we extend could in
some cases wrap to zero and break when we scale things.
This patch checks to see if it would be safe to add one because the
specific case that would cause this is guarded for prior to entering the
preheader. This should handle essentially all of the common loop idioms
coming out of C/C++ code once canonicalized by LLVM.
Before this patch, both forms of loop in the added test cases ended up
subtracting one from the size, extending it, scaling it up by 8 and then
adding 8 back onto it. This is really silly, and it turns out made it
all the way into generated code very often, so this is a surprisingly
important cleanup to do.
Many thanks to Sanjoy for showing me how to do this with SCEV.
Differential Revision: https://reviews.llvm.org/D35758
llvm-svn: 308968
Chandler Carruth [Tue, 25 Jul 2017 10:46:07 +0000 (10:46 +0000)]
[PM] Setup TargetLibraryInfo correctly for the new pass manager.
Without this, -fno-builtin and friends doesn't work. Added the obvious
RUN lines to the test for -fno-builtin and they pass now.
llvm-svn: 308967
Matan Haroush [Tue, 25 Jul 2017 10:44:09 +0000 (10:44 +0000)]
This patch enables the usage of constant Enum identifiers within Microsoft style inline assembly statements.
Differential Revision:
https://reviews.llvm.org/D33277
https://reviews.llvm.org/D33278
llvm-svn: 308966
Matan Haroush [Tue, 25 Jul 2017 10:43:43 +0000 (10:43 +0000)]
This patch enables the usage of constant Enum identifiers within Microsoft style inline assembly statements.
Differential Revision:
https://reviews.llvm.org/D33277
https://reviews.llvm.org/D33278
llvm-svn: 308965
Michael Zolotukhin [Tue, 25 Jul 2017 10:35:16 +0000 (10:35 +0000)]
[tests] Cleanup vect.omp.persistence.ll test.
llvm-svn: 308964
Simon Pilgrim [Tue, 25 Jul 2017 10:33:36 +0000 (10:33 +0000)]
[X86] Add 24-byte memcmp tests (PR33914)
llvm-svn: 308963
Manuel Klimek [Tue, 25 Jul 2017 10:22:06 +0000 (10:22 +0000)]
Fix incorrect use of current directory to find moved paths in ASTReader.
CurrentDir was set as the path of the current module, but that can change as
part of a chain of loaded modules.
When we try to locate a file mentioned in a module that does not exist, we use
a heuristic to look at the relative path between the original location of the
module and the file we look for, and use that relatively to the CurrentDir.
This only works if CurrentDir is the same as the (current) path of the module
file the file was mentioned in; if it is not, we look at the path relatively to
the wrong directory, and can end up reading random unrelated files that happen
to have the same name.
This patch fixes this by using the BaseDirectory of the module file the file
we look for was mentioned in instead of the CurrentDir heuristic.
Differential Revision: https://reviews.llvm.org/D35828
llvm-svn: 308962
Artem Dergachev [Tue, 25 Jul 2017 09:44:02 +0000 (09:44 +0000)]
[analyzer] Treat throws as sinks for suppress-on-sink purposes.
Because since r308957 the suppress-on-sink feature contains its own
mini-analysis, it also needs to become aware that C++ unhandled exceptions
cause sinks. Unfortunately, for now we treat all exceptions as unhandled in
the analyzer, so suppress-on-sink needs to do the same.
rdar://problem/
28157554
Differential Revision: https://reviews.llvm.org/D35674
llvm-svn: 308961
Francois Pichet [Tue, 25 Jul 2017 09:40:35 +0000 (09:40 +0000)]
Fix endianness bug in DAGCombiner::visitTRUNCATE and visitEXTRACT_VECTOR_ELT
Summary:
Do not assume little endian architecture in DAGCombiner::visitTRUNCATE and DAGCombiner::visitEXTRACT_VECTOR_ELT.
PR33682
Reviewers: hfinkel, sdardis, RKSimon
Reviewed By: sdardis, RKSimon
Subscribers: uabelho, RKSimon, sdardis, llvm-commits
Differential Revision: https://reviews.llvm.org/D34990
llvm-svn: 308960
Ilya Biryukov [Tue, 25 Jul 2017 09:31:51 +0000 (09:31 +0000)]
[clangd] Workaround Windows test failures.
To properly fix this, Unix-specific paths should not be used when
running tests on Windows.
llvm-svn: 308959
George Rimar [Tue, 25 Jul 2017 09:26:35 +0000 (09:26 +0000)]
[ELF] - Fix init_fini_priority.s test.
Previously .init_array/.fini_array sections
were not unique and we had 3 .init_array sections +
3 .fini_array input sections passed to linker,
instead of 5 + 5.
Differential revision: https://reviews.llvm.org/D35552
llvm-svn: 308958
Artem Dergachev [Tue, 25 Jul 2017 09:25:10 +0000 (09:25 +0000)]
[analyzer] Further improve suppress-on-sink behavior in incomplete analyses.
If a certain memory leak (or other similar bug) found by the analyzer is known
to be happening only before abnormal termination of the program ("sink", eg.
assertion failure in the code under analysis, or another bug that introduces
undefined behavior), such leak warning is discarded. However, if the analysis
has never reaches completion (due to complexity of the code), it may be
failing to notice the sink.
This commit further extends the partial solution introduced in r290341 to cover
cases when a complicated control flow occurs before encountering a no-return
statement (which anyway inevitably leads to such statement(s)) by traversing
the respective section of the CFG in a depth-first manner. A complete solution
still seems elusive.
rdar://problem/
28157554
Differential Revision: https://reviews.llvm.org/D35673
llvm-svn: 308957
Sam Parker [Tue, 25 Jul 2017 08:51:30 +0000 (08:51 +0000)]
[ARM] Enable partial and runtime unrolling
Enable runtime and partial loop unrolling of simple loops without
calls on M-class cores. The thresholds are calculated based on
whether the target is Thumb or Thumb-2.
Differential Revision: https://reviews.llvm.org/D34619
llvm-svn: 308956
George Rimar [Tue, 25 Jul 2017 08:29:29 +0000 (08:29 +0000)]
[ELF] - Fix calculation of memory region offset.
This is PR33714.
Previously for each input section offset of memory region
was incremented on a size of output section.
That resulted in a wrong error message saying about
overflow. Patch fixes that.
Differential revision: https://reviews.llvm.org/D35803
llvm-svn: 308955
Gabor Horvath [Tue, 25 Jul 2017 06:52:08 +0000 (06:52 +0000)]
[clang-tidy] Handle incomplete types in bugprone-undefined-memory-manipulation
check
Patch by: Reka Nikolett Kovacs
Differential Revision: https://reviews.llvm.org/D35790
llvm-svn: 308954
Martin Storsjo [Tue, 25 Jul 2017 06:10:44 +0000 (06:10 +0000)]
[COFF] Correctly set the thumb bit in DLL export addresses
The same adjustment is already done for the entry point in
Writer.cpp and for relocations that point to executable code
in Chunks.cpp.
Differential Revision: https://reviews.llvm.org/D35767
llvm-svn: 308953
Martin Storsjo [Tue, 25 Jul 2017 06:08:25 +0000 (06:08 +0000)]
[COFF] Add a test for producing DLLs and import libraries for ARM64
This is a test for LLVM SVN r308951.
Differential Revision: https://reviews.llvm.org/D35814
llvm-svn: 308952
Martin Storsjo [Tue, 25 Jul 2017 06:05:49 +0000 (06:05 +0000)]
[COFF] ARM64 support for COFFImportFile
A test will be committed separately in the lld repo.
Differential Revision: https://reviews.llvm.org/D35766
llvm-svn: 308951
Martin Storsjo [Tue, 25 Jul 2017 05:20:01 +0000 (05:20 +0000)]
[AArch64] Reserve a 16 byte aligned amount of fixed stack for win64 varargs
Create a dummy 8 byte fixed object for the unused slot below the first
stored vararg.
Alternative ideas tested but skipped: One could try to align the whole
fixed object to 16, but I haven't found how to add an offset to the stack
frame used in LowerWin64_VASTART.
If only the size of the fixed stack object size is padded but not the offset, via
MFI.CreateFixedObject(alignTo(GPRSaveSize, 16), -(int)GPRSaveSize, false),
PrologEpilogInserter crashes due to "Attempted to reset backwards range!".
This fixes misconceptions about where registers are spilled, since
AArch64FrameLowering.cpp assumes the offset from fixed objects is
aligned to 16 bytes (and the Win64 case there already manually aligns
the offset to 16 bytes).
This fixes cases where local stack allocations could overwrite callee
saved registers on the stack.
Differential Revision: https://reviews.llvm.org/D35720
llvm-svn: 308950
NAKAMURA Takumi [Tue, 25 Jul 2017 05:03:17 +0000 (05:03 +0000)]
DWARFVerifier.cpp: Fix -m32 in r308928. Use PRIx64.
llvm-svn: 308949
Faisal Vali [Tue, 25 Jul 2017 03:15:36 +0000 (03:15 +0000)]
[NFC] Use RAII to un-poison and then re-poison __VA_ARGS__
- This will also be used for the forthcoming __VA_OPT__ feature approved for C++2a.
- recommended by rsmith during his review of the __VA_OPT__ patch (https://reviews.llvm.org/D35782)
llvm-svn: 308948
Kostya Serebryany [Tue, 25 Jul 2017 02:09:46 +0000 (02:09 +0000)]
[libFuzzer] make one test faster, fix compiler warnings in tests
llvm-svn: 308945
Kostya Serebryany [Tue, 25 Jul 2017 02:07:38 +0000 (02:07 +0000)]
[sanitizer-coverage] simplify the code, NFC
llvm-svn: 308944
Spyridoula Gravani [Tue, 25 Jul 2017 01:58:27 +0000 (01:58 +0000)]
[DWARF] Modified test for die ranges verification so that it doesn't fail on windows hosts.
llvm-svn: 308943
NAKAMURA Takumi [Tue, 25 Jul 2017 01:44:38 +0000 (01:44 +0000)]
llvm/test/CMakeLists.txt: Add llvm-rc to LLVM_TEST_DEPENDS.
llvm-svn: 308942
NAKAMURA Takumi [Tue, 25 Jul 2017 00:51:40 +0000 (00:51 +0000)]
llvm-rc: Fixup for r308940. This should use LLVMSupport.
llvm-svn: 308941
Marek Sokolowski [Tue, 25 Jul 2017 00:25:18 +0000 (00:25 +0000)]
Add an empty shell of llvm-rc.
This starts the development on one of MS Visual Studio binutils,
Resource Converter. The tool compiles resource scripts (.rc)
into binary resource files (.res).
The current implementation does nothing but parse the command
line arguments. It is going to be extended in the future.
Differential Revision: https://reviews.llvm.org/D35810
llvm-svn: 308940
Rafael Espindola [Mon, 24 Jul 2017 23:55:33 +0000 (23:55 +0000)]
Make a function static. NFC.
llvm-svn: 308939
Adrian Prantl [Mon, 24 Jul 2017 23:48:51 +0000 (23:48 +0000)]
Debug Info: Avoid completing class types when a definition is in a module.
This patch adds an early exit to CGDebugInfo::completeClassData() when
compiling with -gmodules and the to-be-completed type is available in
a clang module.
rdar://problem/
23599990
llvm-svn: 308938
Eugene Zelenko [Mon, 24 Jul 2017 23:16:33 +0000 (23:16 +0000)]
[Analysis] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 308936
Tom Stellard [Mon, 24 Jul 2017 23:13:31 +0000 (23:13 +0000)]
Fix ObjCPass on big-endian host
Summary:
This fixes test/mach-o/objc-image-info-pass-output.yaml on
big-endian hosts.
Reviewers: lhames, kledzik, ruiu
Reviewed By: ruiu
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D35052
llvm-svn: 308935
Eugene Zemtsov [Mon, 24 Jul 2017 22:52:39 +0000 (22:52 +0000)]
Extend 'target symbols add' to load symbols from a given module
Now -shlib flag can be provided alongside with names of symbols files:
(lldb) target symbols add --shlib stripper-lib.so unstripper-lib.so
This is helpful when default matching mechanisms by name and UUID
can't find a module, and the user needs to explicitly specify
which module the given symbol file belongs to.
Differential Revision: https://reviews.llvm.org/D35607
llvm-svn: 308933
Rachel Craik [Mon, 24 Jul 2017 22:17:05 +0000 (22:17 +0000)]
Remove addtional parameters in function std::next() and std::prev()
Creating a function pointer with proper parameters pointing to std::next() or std::prev() should work.
This change moves the invented paramater for enable_if over to the return type to resolve this QoI issue.
Patch by Jason Liu.
Differential Revision: https://reviews.llvm.org/D34649
llvm-svn: 308932
George Karpenkov [Mon, 24 Jul 2017 21:51:12 +0000 (21:51 +0000)]
Add .pyc files to .gitignore to compiler-rt
During testing .pyc temporary files appear, which may be annoying.
Did not change SVN ignore, as it was heavily out of sync with GIT one.
Differential Revision: D35815
llvm-svn: 308931
Dmitry Mikulin [Mon, 24 Jul 2017 21:27:02 +0000 (21:27 +0000)]
If user requested section alignment is greater than MaxPageSize, propagate it to segment headers correctly.
Differential Revision: https://reviews.llvm.org/D35813
llvm-svn: 308930
Alex Shlyapnikov [Mon, 24 Jul 2017 21:22:59 +0000 (21:22 +0000)]
[Sanitizers] TSan allocator set errno on failure.
Summary:
Set proper errno code on allocation failures and change realloc, pvalloc,
aligned_alloc, memalign and posix_memalign implementation to satisfy
their man-specified requirements.
Modify allocator API implementation to bring it closer to other
sanitizers allocators.
Reviewers: dvyukov
Subscribers: llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D35690
llvm-svn: 308929
Spyridoula Gravani [Mon, 24 Jul 2017 21:04:11 +0000 (21:04 +0000)]
[DWARF] Added verification check for die ranges. If highPC is an address, then it should be greater than lowPC for each range.
Differential Revision: https://reviews.llvm.org/D35733
llvm-svn: 308928
Tobias Grosser [Mon, 24 Jul 2017 20:50:22 +0000 (20:50 +0000)]
Move MemoryAccess::isStride* to isl++
llvm-svn: 308927
Reid Kleckner [Mon, 24 Jul 2017 20:48:15 +0000 (20:48 +0000)]
Revert "[X86][InlineAsm][Ms Compatibility]Prefer variable name over a register when the two collides"
This reverts r308867 and r308866.
It broke the sanitizer-windows buildbot on C++ code similar to the
following:
namespace cl { }
void f() {
__asm {
mov al, cl
}
}
t.cpp(4,13): error: unexpected namespace name 'cl': expected expression
mov al, cl
^
In this case, MSVC parses 'cl' as a register, not a namespace.
llvm-svn: 308926
George Karpenkov [Mon, 24 Jul 2017 20:35:20 +0000 (20:35 +0000)]
Splitting out test for Darwin for print-stack-trace:
New default symbolizer can not symbolize inlined function which appear
under -O3.
llvm-svn: 308925
Kevin Enderby [Mon, 24 Jul 2017 20:33:41 +0000 (20:33 +0000)]
Small tweak to one check in error handling to the dyld compact export
entries in libObject (done in r308690). In the case when the last node
has no children setting State.Current = Children + 1; where that would be past
Trie.end() is actually ok since the pointer is not used with zero children.
rdar://
33490512
llvm-svn: 308924
Tobias Grosser [Mon, 24 Jul 2017 20:30:34 +0000 (20:30 +0000)]
Move MemoryAccess::InvalidDomain to isl++
llvm-svn: 308923
Stephen Hines [Mon, 24 Jul 2017 20:25:08 +0000 (20:25 +0000)]
[mips] Switch asm to __asm__ for non-GNU compiles.
Summary:
Using asm works fine for gnu11, but fails if the compiler uses C11.
Switch to the more consistent __asm__, since that is what the rest of
the source is using.
Reviewers: petarj
Reviewed By: petarj
Subscribers: llvm-commits, sdardis, arichardson, pirama
Differential Revision: https://reviews.llvm.org/D35756
llvm-svn: 308922
Davide Italiano [Mon, 24 Jul 2017 20:18:16 +0000 (20:18 +0000)]
[ELF] Fix a typo introduced in r308915.
Thanks to Rafael for finding it in a post-commit review.
llvm-svn: 308921
Davide Italiano [Mon, 24 Jul 2017 20:15:07 +0000 (20:15 +0000)]
[LTO] Make sure symbol ordering is honoured also for data.
Follow-up to r308915 suggested by Rafael and Peter.
llvm-svn: 308920
Sean Callanan [Mon, 24 Jul 2017 20:11:20 +0000 (20:11 +0000)]
Skip test_lldbmi_var_update on Darwin.
llvm-svn: 308919
Krasimir Georgiev [Mon, 24 Jul 2017 19:52:49 +0000 (19:52 +0000)]
[clang-format] Reorder assignments, NFC
llvm-svn: 308918
James Y Knight [Mon, 24 Jul 2017 19:44:43 +0000 (19:44 +0000)]
Followup to r308890: don't assert the llvm llvm version number.
llvm-svn: 308917
Davide Italiano [Mon, 24 Jul 2017 19:42:13 +0000 (19:42 +0000)]
[ELF] Fix a couple of typos in a test.
llvm-svn: 308916
Davide Italiano [Mon, 24 Jul 2017 19:38:13 +0000 (19:38 +0000)]
[LTO] Make sure symbol ordering is honoured.
We do this emitting a section for every function when LTO is used.
Fixes PR33888.
Differential Revision: https://reviews.llvm.org/D35809
llvm-svn: 308915
Krzysztof Parzyszek [Mon, 24 Jul 2017 19:35:48 +0000 (19:35 +0000)]
[Hexagon] Recognize C4_cmpneqi, C4_cmpltei and C4_cmplteui in NewValueJump
llvm-svn: 308914
Rafael Espindola [Mon, 24 Jul 2017 19:34:26 +0000 (19:34 +0000)]
Move DWARFSectionMap to a .cpp file.
Thanks to Paul Robinson for the suggestion.
llvm-svn: 308913
Tom Stellard [Mon, 24 Jul 2017 19:28:30 +0000 (19:28 +0000)]
test-release.sh: Fix phase2 and phase3 binary comparision
Summary:
scudo_utils.cpp.o from compiler-rt has one of the host compiler's builtin
include paths stored in the .debug_line section. So we need to do
sed 's,Phase1,Phase2,g` on the Phase2 object file so it matches Phase3.
Reviewers: hans
Reviewed By: hans
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34989
llvm-svn: 308912
Greg Clayton [Mon, 24 Jul 2017 18:40:33 +0000 (18:40 +0000)]
Don't allow .debug_types to be parsed as LLDB can crash when enums are not able to be found.
Differential Revision: https://reviews.llvm.org/D35734
llvm-svn: 308911
George Karpenkov [Mon, 24 Jul 2017 18:38:14 +0000 (18:38 +0000)]
Revert "Revert "[libFuzzer] Add a dependency on symbolizer from libFuzzer tests""
This reverts commit
15425f2bc6eac6249ee957a2a280511306c07547.
Should work now that atos is a default symbolizer on Darwin.
llvm-svn: 308910
Michael Zuckerman [Mon, 24 Jul 2017 18:29:56 +0000 (18:29 +0000)]
Adding base test for interleave store VF16 and expand the test for AVX512
This patch doesn't modifay any non test file.
llvm-svn: 308909
George Karpenkov [Mon, 24 Jul 2017 18:24:08 +0000 (18:24 +0000)]
Prefer atos to llvm-symbolizer on Darwin
atos is the default symbolizer on Apple's compiler for quite a few years now.
llvm-symbolizer is quite fragile on Darwin: for example, unless a .dSYM
file was explicitly generated symbolication would not work.
It is also very convenient when the behavior of LLVM open source
compiler matches to that of Apple's compiler on Apple's platform.
Furthermore, llvm-symbolizer is not installed on Apple's platform by
default, which leads to strange behavior during debugging: the test
might fail under lit (where it has llvm-symbolizer) but would run
properly when launched on the command line (where it does not, and atos
would be used).
Indeed, there's a downside: atos does not work properly with inlined
functions, hence the test change.
We do not think that this is a major problem, as users would often
compile with -O0 when debugging, and in any case it is preferable to
symbolizer not being able to symbolize.
Differential Revision: https://reviews.llvm.org/D35745
llvm-svn: 308908
Kostya Kortchinsky [Mon, 24 Jul 2017 18:22:33 +0000 (18:22 +0000)]
[scudo] Fix QuarantineChunksUpToSize failing test on AArch64
Summary:
Warm-up the other 2 sizes used by the tests, which should get rid of a failure
on AArch64.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: aemerson, rengolin, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D35806
llvm-svn: 308907
Matt Arsenault [Mon, 24 Jul 2017 18:07:55 +0000 (18:07 +0000)]
RA: Replace asserts related to empty live intervals
These don't exactly assert the same thing anymore, and
allow empty live intervals with non-empty uses.
Removed in r308808 and r308813.
llvm-svn: 308906
Adrian Prantl [Mon, 24 Jul 2017 18:06:39 +0000 (18:06 +0000)]
RFix PR33875 by distinguishing between DWO and clang modules.
This reapplies https://reviews.llvm.org/D35740 with a tweak to find
the section by name rather than type. Section types don't distinguish
between regular sections and their DWO counterparts.
llvm-svn: 308905
Evandro Menezes [Mon, 24 Jul 2017 18:06:16 +0000 (18:06 +0000)]
[AArch64] Adjust the cost model for Exynos M1 and M2
Fine tune the resources in a couple of ASIMD loads.
llvm-svn: 308904
Matt Arsenault [Mon, 24 Jul 2017 18:06:15 +0000 (18:06 +0000)]
AMDGPU: Fix allocating pseudo-registers
There's no need for these to be part of a class since
they are immediately replaced. New unreachable hit in
existing tests.'
llvm-svn: 308903
Tim Northover [Mon, 24 Jul 2017 17:47:46 +0000 (17:47 +0000)]
Revert "Debug: handle dumping the D language."
Reid beat me to it.
llvm-svn: 308902
Tim Northover [Mon, 24 Jul 2017 17:39:44 +0000 (17:39 +0000)]
Debug: handle dumping the D language.
Mostly just to silence a warning about an unhandled case. There don't seem to
be any tests for this operator (at least that I could find).
llvm-svn: 308901
Leo Li [Mon, 24 Jul 2017 17:26:28 +0000 (17:26 +0000)]
[CMake] Remove redundant logic in runtimes/CMakeList.txt
Summary:
`SUB_CHECK_TARGETS` contains all test targets in `SUB_COMPONENTS` when
we load `Components.cmake`. We don't need to add those targets
again and having duplicate targets will break the cmake policy CMP0002.
Reviewers: phosek
Subscribers: mgorny, llvm-commits, srhines, pirama
Differential Revision: https://reviews.llvm.org/D35692
llvm-svn: 308900
Shoaib Meenai [Mon, 24 Jul 2017 17:16:27 +0000 (17:16 +0000)]
[CodeGen] Propagate dllexport to thunks
Under Windows Itanium, we need to export virtual and non-virtual thunks
if the functions being thunked are exported. These thunks would
previously inherit their dllexport attribute from the declaration, but
r298330 changed declarations to not have dllexport attributes. We
therefore need to add the dllexport attribute to the definition
ourselves now. This is consistent with MinGW GCC's behavior.
This redoes r306770 but limits the logic to Itanium. MicrosoftCXXABI's
setThunkLinkage ensures that thunks aren't exported under that ABI, so
I'm handling this in ItaniumCXXABI's setThunkLinkage for symmetry.
We need to export these thunks because they can be referenced outside
the library they're defined in. For example, if a child class without a
key function inherits from a parent class with a key function, the
parent's thunks will only be defined in the library with the key
function, but the construction vtable for the parent in the child might
be emitted outside the library (since the child doesn't have a key
function), and it needs to reference the parent's thunks.
We don't need to mark these thunks as imported since any references to
them will occur in data, so the compiler can't generate the IAT load
sequence anyway. Instead, we rely on the linker generating import thunks
for the thunks.
Differential Revision: https://reviews.llvm.org/D34972
llvm-svn: 308899
Tim Northover [Mon, 24 Jul 2017 17:06:23 +0000 (17:06 +0000)]
AArch64 & ARM: move TargetInfo functions from .h to .cpp file. NFC.
Most of them are virtual anyway, and the few remaining ones can move to the
.cpp for consistency.
llvm-svn: 308898
Nico Weber [Mon, 24 Jul 2017 16:54:11 +0000 (16:54 +0000)]
Work around an MSVC2017 update 3 codegen bug.
C2017 update 3 produces a clang that crashes when compiling clang. Disabling
optimizations for StmtProfiler::VisitCXXOperatorCallExpr() makes the crash go
away.
Patch from Bruce Dawson <brucedawson@chromium.org>!
https://reviews.llvm.org/D35757
llvm-svn: 308897
Greg Clayton [Mon, 24 Jul 2017 16:47:04 +0000 (16:47 +0000)]
Don't crash when hostname is empty. StringRef will assert and kill your program.
llvm-svn: 308896
Tobias Grosser [Mon, 24 Jul 2017 16:36:34 +0000 (16:36 +0000)]
Move MemoryAccess::getPwAff to isl++
llvm-svn: 308895
Reid Kleckner [Mon, 24 Jul 2017 16:30:44 +0000 (16:30 +0000)]
Add missing case to switch
llvm-svn: 308894
Tobias Grosser [Mon, 24 Jul 2017 16:22:32 +0000 (16:22 +0000)]
Move MemoryAccess::MemoryAccess to isl++
llvm-svn: 308893
Tobias Grosser [Mon, 24 Jul 2017 16:22:27 +0000 (16:22 +0000)]
Move ScopArrayInfo::getFromAccessFunction and getFromId to isl++
llvm-svn: 308892
Benjamin Kramer [Mon, 24 Jul 2017 16:18:09 +0000 (16:18 +0000)]
[CodeGenPrepare] Cut off FindAllMemoryUses if there are too many uses.
This avoids excessive compile time. The case I'm looking at is
Function.cpp from an old version of LLVM that still had the giant memcmp
string matcher in it. Before r308322 this compiled in about 2 minutes,
after it, clang takes infinite* time to compile it. With this patch
we're at 5 min, which is still bad but this is a pathological case.
The cut off at 20 uses was chosen by looking at other cut-offs in LLVM
for user scanning. It's probably too high, but does the job and is very
unlikely to regress anything.
Fixes PR33900.
* I'm impatient and aborted after 15 minutes, on the bug report it was
killed after 2h.
llvm-svn: 308891
Reid Kleckner [Mon, 24 Jul 2017 16:16:42 +0000 (16:16 +0000)]
[codeview] Emit 'D' as the cv source language for D code
This matches DMD:
https://github.com/dlang/dmd/blob/
522263965cf3a27ed16b31f3c3562db86cdeabec/src/ddmd/backend/cv8.c#L199
Fixes PR33899.
llvm-svn: 308890
Reid Kleckner [Mon, 24 Jul 2017 16:16:17 +0000 (16:16 +0000)]
Format some case labels and shrink an anonymous namespace NFC
llvm-svn: 308889
Ilya Biryukov [Mon, 24 Jul 2017 16:02:29 +0000 (16:02 +0000)]
NFC. Fixed typos in the comments.
llvm-svn: 308888
Michael Kruse [Mon, 24 Jul 2017 15:34:03 +0000 (15:34 +0000)]
[ForwardOpTree] Properly indent enumeration in comment. NFC.
llvm-svn: 308887
Michael Kruse [Mon, 24 Jul 2017 15:33:58 +0000 (15:33 +0000)]
[ForwardOpTree] Rename FD_CanForward to FD_CanForwardLeaf. NFC.
To make the meaning and distinction to FD_CanForwardTree clearer.
llvm-svn: 308886
Michael Kruse [Mon, 24 Jul 2017 15:33:53 +0000 (15:33 +0000)]
[ForwardOpTree] Add comments to ForwardingDecision items. NFC.
In particular, explain the difference between FD_CanForward
and FD_CanForwardTree.
llvm-svn: 308885
Kostya Kortchinsky [Mon, 24 Jul 2017 15:29:38 +0000 (15:29 +0000)]
[scudo] Quarantine overhaul
Summary:
First, some context.
The main feedback we get about the quarantine is that it's too memory hungry.
A single MB of quarantine will have an impact of 3 to 4MB of PSS/RSS, and
things quickly get out of hand in terms of memory usage, and the quarantine
ends up disabled.
The main objective of the quarantine is to protect from use-after-free
exploitation by making it harder for an attacker to reallocate a controlled
chunk in place of the targeted freed chunk. This is achieved by not making it
available to the backend right away for reuse, but holding it a little while.
Historically, what has usually been the target of such attacks was objects,
where vtable pointers or other function pointers could constitute a valuable
targeti to replace. Those are usually on the smaller side. There is barely any
advantage in putting the quarantine several megabytes of RGB data or the like.
Now for the patch.
This patch introduces a new way the Quarantine behaves in Scudo. First of all,
the size of the Quarantine will be defined in KB instead of MB, then we
introduce a new option: the size up to which (lower than or equal to) a chunk
will be quarantined. This way, we only quarantine smaller chunks, and the size
of the quarantine remains manageable. It also prevents someone from triggering
a recycle by allocating something huge. We default to 512 bytes on 32-bit and
2048 bytes on 64-bit platforms.
In details, the patches includes the following:
- introduce `QuarantineSizeKb`, but honor `QuarantineSizeMb` if set to fall
back to the old behavior (meaning no threshold in that case);
`QuarantineSizeMb` is described as deprecated in the options descriptios;
documentation update will follow;
- introduce `QuarantineChunksUpToSize`, the new threshold value;
- update the `quarantine.cpp` test, and other tests using `QuarantineSizeMb`;
- remove `AllocatorOptions::copyTo`, it wasn't used;
- slightly change the logic around `quarantineOrDeallocateChunk` to accomodate
for the new logic; rename a couple of variables there as well;
Rewriting the tests, I found a somewhat annoying bug where non-default aligned
chunks would account for more than needed when placed in the quarantine due to
`<< MinAlignment` instead of `<< MinAlignmentLog`. This is fixed and tested for
now.
Reviewers: alekseyshl, kcc
Reviewed By: alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D35694
llvm-svn: 308884
Alexey Bataev [Mon, 24 Jul 2017 14:52:13 +0000 (14:52 +0000)]
[OPENMP] Fix the restrictions for in_reduction clause.
This patch allows to use in_reduction clause even if the innermost
directive is not taskgroup.
llvm-svn: 308883
Krasimir Georgiev [Mon, 24 Jul 2017 14:51:59 +0000 (14:51 +0000)]
[clang-format] Fix comment levels between '} else {' and PPDirective.
Summary:
This fixes a regression exposed by r307795 and rL308725 in which the level of a
comment line between '} else {' and a preprocessor directive is incorrectly set
as the level of the '} else {' line. For example, this :
```
int f(int i) {
if (i) {
++i;
} else {
// comment
#ifdef A
--i;
#endif
}
}
```
was formatted as:
```
int f(int i) {
if (i) {
++i;
} else {
// comment
#ifdef A
--i;
#endif
}
}
```
Reviewers: djasper, klimek
Reviewed By: klimek
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D35794
llvm-svn: 308882
Francis Ricci [Mon, 24 Jul 2017 14:31:01 +0000 (14:31 +0000)]
[compiler-rt] Add missing const specifier to MemoryMappedSegment functions
llvm-svn: 308881
Marshall Clow [Mon, 24 Jul 2017 14:05:10 +0000 (14:05 +0000)]
make sure that we don't call basic_streambuf::gbump with a value bigger than INT_MAX, since it only takes an int. Related to, but not quite the same as PR33725
llvm-svn: 308880
Simon Dardis [Mon, 24 Jul 2017 14:02:09 +0000 (14:02 +0000)]
[mips] Add support for -m(no-)extern-data.
Add support for -m(no-)extern-data when using -mgpopt in the driver. It is
enabled by default in the backend.
Reviewers: atanasyan, slthakur
Differential Revision: https://reviews.llvm.org/D35550
llvm-svn: 308879
Alexandre Isoard [Mon, 24 Jul 2017 12:55:00 +0000 (12:55 +0000)]
[DOTGraphTraits] Propagate Graph template argument, NFC
Propagates the GraphT template argument to the default value of
the AnalysisGraphTraitsT template argument. This allows to specialize
the DefaultAnalysisGraphTraits<AnalysisT,GraphT> for analysis with a
graph type different from the analysis type and it will automatically
get picked-up.
Note: This was probably the intended purpose and should not result in any
functional change.
llvm-svn: 308878
Simon Pilgrim [Mon, 24 Jul 2017 12:44:35 +0000 (12:44 +0000)]
Fix spelling in comments. NFCI.
llvm-svn: 308877
Michael Kruse [Mon, 24 Jul 2017 12:43:27 +0000 (12:43 +0000)]
[ForwardOpTree] Support read-only value uses.
Read-only values (values defined before the SCoP) require special
handing with -polly-analyze-read-only-scalars=true (which is the
default). If active, each use of a value requires a read access.
When a copied value uses a read-only value, we must also ensure that
such a MemoryAccess is available or is created.
Differential Revision: https://reviews.llvm.org/D35764
llvm-svn: 308876
Siddharth Bhat [Mon, 24 Jul 2017 12:40:52 +0000 (12:40 +0000)]
[Polly] [NFC] [ScopDetection] Make `polly-only-func` perform regex scop name match.
Summary:
- We were using `.count` in `StringRef`, which matches substrings.
- We may want to use this for equality as well.
- Generalise this, so allow regexes as a parameter to `polly-only-func`.
Differential Revision: https://reviews.llvm.org/D35728
llvm-svn: 308875
Michael Kruse [Mon, 24 Jul 2017 12:39:46 +0000 (12:39 +0000)]
[ForwardOpTree] Fix mixup in comment. NFC.
The cases DoIt==false and DoIt==true were mixed up.
Thanks to Siddharth for noticing.
llvm-svn: 308874
Michael Kruse [Mon, 24 Jul 2017 12:39:41 +0000 (12:39 +0000)]
[ScopInfo] Fix typo in method name. NFC.
prependInstrunction -> prependInstruction
Thanks Nandini for noticing.
llvm-svn: 308873
Florian Hahn [Mon, 24 Jul 2017 11:41:30 +0000 (11:41 +0000)]
[LoopInterchange] Update code to use range-based for loops (NFC).
Summary:
The remaining non range-based for loops do not iterate over full ranges,
so leave them as they are.
Reviewers: karthikthecool, blitz.opensource, mcrosier, mkuper, aemerson
Reviewed By: aemerson
Subscribers: aemerson, mzolotukhin, llvm-commits
Differential Revision: https://reviews.llvm.org/D35777
llvm-svn: 308872
Momchil Velikov [Mon, 24 Jul 2017 09:19:32 +0000 (09:19 +0000)]
[libunwind] Handle .ARM.exidx tables without sentinel last entry
UnwindCursor<A, R>::getInfoFromEHABISection assumes the last
entry in the index table never corresponds to a real function.
Indeed, GNU ld always inserts an EXIDX_CANTUNWIND entry,
containing the end of the .text section. However, the EHABI specification
(http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038b/IHI0038B_ehabi.pdf)
does not seem to contain text that requires the presence of a sentinel entry.
In that sense the libunwind implementation isn't compliant with the specification.
This patch makes getInfoFromEHABISection examine the last entry in the index
table if upper_bound returns the end iterator.
Fixes https://bugs.llvm.org/show_bug.cgi?id=31091
Differential revision: https://reviews.llvm.org/D35265
llvm-svn: 308871
Siddharth Bhat [Mon, 24 Jul 2017 09:08:21 +0000 (09:08 +0000)]
Convert GPUNodeBuilder::getArraySize to islcpp.
Note: PPCGCodeGeneration::pollyBuildAstExprForStmt is at
https://reviews.llvm.org/D35770
Differential Revision: https://reviews.llvm.org/D35771
llvm-svn: 308870
Siddharth Bhat [Mon, 24 Jul 2017 08:34:24 +0000 (08:34 +0000)]
[NFC] Move PPCGCodeGeneration::pollyBuildAstExprForStmt to isl++.
Differential Revision: https://reviews.llvm.org/D35771
llvm-svn: 308869