Chih-Hung Hsieh [Thu, 6 Apr 2017 20:19:26 +0000 (20:19 +0000)]
[clang-tidy] Reuse FileID in getLocation
One FileID per warning will increase and overflow NextLocalOffset
when input file is large with many warnings.
Reusing FileID avoids this problem.
This requires changes in getColumnNumber, D31406, rL299681.
Differential Revision: http://reviews.llvm.org/D31406
llvm-svn: 299700
Mehdi Amini [Thu, 6 Apr 2017 20:09:31 +0000 (20:09 +0000)]
Turn some C-style vararg into variadic templates
Module::getOrInsertFunction is using C-style vararg instead of
variadic templates.
From a user prospective, it forces the use of an annoying nullptr
to mark the end of the vararg, and there's not type checking on the
arguments. The variadic template is an obvious solution to both
issues.
Patch by: Serge Guelton <serge.guelton@telecom-bretagne.eu>
Differential Revision: https://reviews.llvm.org/D31070
llvm-svn: 299699
Evgeniy Stepanov [Thu, 6 Apr 2017 19:55:52 +0000 (19:55 +0000)]
[asan] Fix dead stripping of globals on Linux (compiler-rt).
This is a re-land of r298173, r298169, r298159.
llvm-svn: 299698
Evgeniy Stepanov [Thu, 6 Apr 2017 19:55:17 +0000 (19:55 +0000)]
[asan] Fix dead stripping of globals on Linux.
Use a combination of !associated, comdat, @llvm.compiler.used and
custom sections to allow dead stripping of globals and their asan
metadata. Sometimes.
Currently this works on LLD, which supports SHF_LINK_ORDER with
sh_link pointing to the associated section.
This also works on BFD, which seems to treat comdats as
all-or-nothing with respect to linker GC. There is a weird quirk
where the "first" global in each link is never GC-ed because of the
section symbols.
At this moment it does not work on Gold (as in the globals are never
stripped).
This is a re-land of r298158 rebased on D31358. This time,
asan.module_ctor is put in a comdat as well to avoid quadratic
behavior in Gold.
llvm-svn: 299697
Evgeniy Stepanov [Thu, 6 Apr 2017 19:55:13 +0000 (19:55 +0000)]
[asan] Put ctor/dtor in comdat.
When possible, put ASan ctor/dtor in comdat.
The only reason not to is global registration, which can be
TU-specific. This is not the case when there are no instrumented
globals. This is also limited to ELF targets, because MachO does
not have comdat, and COFF linkers may GC comdat constructors.
The benefit of this is a lot less __asan_init() calls: one per DSO
instead of one per TU. It's also necessary for the upcoming
gc-sections-for-globals change on Linux, where multiple references to
section start symbols trigger quadratic behaviour in gold linker.
This is a rebase of r298756.
llvm-svn: 299696
Evgeniy Stepanov [Thu, 6 Apr 2017 19:55:09 +0000 (19:55 +0000)]
[asan] Delay creation of asan ctor.
Create the constructor in the module pass.
This in needed for the GC-friendly globals change, where the constructor can be
put in a comdat in some cases, but we don't know about that in the function
pass.
This is a rebase of r298731 which was reverted due to a false alarm.
llvm-svn: 299695
Peter Collingbourne [Thu, 6 Apr 2017 19:39:24 +0000 (19:39 +0000)]
Bitcode: Do not create FNENTRYs for aliases of functions.
There doesn't seem to be any point in doing this.
Differential Revision: https://reviews.llvm.org/D31691
llvm-svn: 299694
Rafael Espindola [Thu, 6 Apr 2017 19:38:24 +0000 (19:38 +0000)]
Replace a few uses of basename.
This replaces a few uses of basename with the recently introduced lit
replacements.
llvm-svn: 299693
Keno Fischer [Thu, 6 Apr 2017 19:26:22 +0000 (19:26 +0000)]
[StripDeadDebugInfo] Drop dead CUs entirely
Summary:
Prior to this while it would delete the dead DIGlobalVariables, it would
leave dead DICompileUnits and everything referenced therefrom. For a bit
bitcode file with thousands of compile units those dead nodes easily
outnumbered the real ones. Clean that up.
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D31720
llvm-svn: 299692
Yaxun Liu [Thu, 6 Apr 2017 19:18:36 +0000 (19:18 +0000)]
[AMDGPU] Temporarily change constant address space from 4 to 2 for the new address space mapping
Change constant address space from 4 to 2 for the new address space mapping in Clang.
Differential Revision: https://reviews.llvm.org/D31771
llvm-svn: 299691
Yaxun Liu [Thu, 6 Apr 2017 19:17:32 +0000 (19:17 +0000)]
[AMDGPU] Temporarily change constant address space from 4 to 2
Our final address space mapping is to let constant address space to be 4 to match nvptx.
However for now we will make it 2 to avoid unnecessary work in FE/BE/devlib
about intrinsics returning constant pointers.
Differential Revision: https://reviews.llvm.org/D31770
llvm-svn: 299690
Yi Kong [Thu, 6 Apr 2017 19:16:14 +0000 (19:16 +0000)]
Revert "[ARM] Add Kryo to available targets"
This reverts commit
942d6e6f58bf7e63810dd7cbcbce1fdfa5ebc6d4.
Build breakage.
llvm-svn: 299689
Nirav Dave [Thu, 6 Apr 2017 19:05:41 +0000 (19:05 +0000)]
[SDAG] Fix visitAND optimization to deal with vector extract case again.
Summary:
Fix case elided by rL298920.
Fixes PR32545.
Reviewers: eli.friedman, RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31759
llvm-svn: 299688
Craig Topper [Thu, 6 Apr 2017 18:59:08 +0000 (18:59 +0000)]
[InstSimplify] Remove unreachable default from SimplifyBinOp.
We have dedicated handlers for every opcode so nothing can get here anymore. The switch doesn't get detected as fully covered because Opcode is an unsigned. Casting to Instruction::BinaryOps still doesn't detect it because BinaryOpsEnd is in the enum and 1 past the last opcode.
llvm-svn: 299687
Marshall Clow [Thu, 6 Apr 2017 18:54:37 +0000 (18:54 +0000)]
Some of Eric's buildbots don't like this test. Disable it while I figure out why.
llvm-svn: 299686
Daniel Berlin [Thu, 6 Apr 2017 18:52:58 +0000 (18:52 +0000)]
NewGVN: Rename some functions for consistency
llvm-svn: 299685
Daniel Berlin [Thu, 6 Apr 2017 18:52:55 +0000 (18:52 +0000)]
NewGVN: Fixup some small issues
llvm-svn: 299684
Daniel Berlin [Thu, 6 Apr 2017 18:52:53 +0000 (18:52 +0000)]
NewGVN: Fix a small formatting issue in performSymbolicLoadEvaluation.
llvm-svn: 299683
Daniel Berlin [Thu, 6 Apr 2017 18:52:50 +0000 (18:52 +0000)]
NewGVN: This patch makes memory congruence work for all types of
memorydefs, not just stores. Along the way, we audit and fixup issues
about how we were tracking memory leaders, and improve the verifier
to notice more memory congruency issues.
llvm-svn: 299682
Chih-Hung Hsieh [Thu, 6 Apr 2017 18:36:50 +0000 (18:36 +0000)]
[Basic] getColumnNumber returns location of CR+LF on Windows
When fixing a Clang-Tidy bug in D31406,
reuse of FileID enabled the missing highlightRange function.
Assertion in highlightRange failed because the end-of-range column
number was 2 + the last column of a line on Windows.
This fix is required to enable D31406.
Differential Revision: https://reviews.llvm.org/D31713
llvm-svn: 299681
Marshall Clow [Thu, 6 Apr 2017 18:34:36 +0000 (18:34 +0000)]
Recommit awk tests with warnings removed. Initial commit r299652, reverted r299656.
llvm-svn: 299680
Ivan Krasin [Thu, 6 Apr 2017 18:22:25 +0000 (18:22 +0000)]
Revert r299672: Add a virtual destructor to a class with virtual methods.
Reason: breaks sanitizers builds.
Original Differential Revision: https://reviews.llvm.org/D317
llvm-svn: 299679
Stanislav Mekhanoshin [Thu, 6 Apr 2017 18:15:44 +0000 (18:15 +0000)]
[AMDGPU] Translate reqd_work_group_size into amdgpu_flat_work_group_size
These two attributes specify the same info in a different way.
AMGPU BE only checks the latter as a target specific attribute
as opposed to language specific reqd_work_group_size.
This change produces amdgpu_flat_work_group_size out of
reqd_work_group_size if specified.
Differential Revision: https://reviews.llvm.org/D31728
llvm-svn: 299678
Tamas Berghammer [Thu, 6 Apr 2017 18:15:43 +0000 (18:15 +0000)]
XFAIL TestDataFormatterLibcxxVBool on Linux & Android
The skipping logic for the test have been fixed recently but the test is
very flakey on the buildbot.
llvm-svn: 299677
Zachary Turner [Thu, 6 Apr 2017 18:12:24 +0000 (18:12 +0000)]
iwyu fixes on lldbUtility.
This patch makes adjustments to header file includes in
lldbUtility based on recommendations by the iwyu tool
(include-what-you-use). The goal here is to make sure that
all files include the exact set of headers which are needed
for that file only, to eliminate cases of dead includes (e.g.
someone deleted some code but forgot to delete the header
includes that that code necessitated), and to eliminate the
case where header includes are picked up transitively.
llvm-svn: 299676
Dimitry Andric [Thu, 6 Apr 2017 18:12:02 +0000 (18:12 +0000)]
Add __ffssi2 implementation to compiler-rt builtins
Summary:
During MIPS implementation work for FreeBSD, John Baldwin (jhb@FreeBSD.org)
found that gcc 6.x emits calls to __ffssi2() when compiling libc and some
userland programs in the base system.
Add it to compiler-rt's builtins, based off of the existing __ffsdi2()
implementation. Also update the CMake files and add a test case.
Reviewers: howard.hinnant, weimingz, rengolin, compnerd
Reviewed By: weimingz
Subscribers: dberris, mgorny, llvm-commits, emaste
Differential Revision: https://reviews.llvm.org/D31721
llvm-svn: 299675
Yi Kong [Thu, 6 Apr 2017 18:10:08 +0000 (18:10 +0000)]
[ARM] Add Kryo to available targets
Summary:
Host CPU detection now supports Kryo, so we need to recognize it in ARM
target.
Reviewers: mcrosier, t.p.northover, rengolin, echristo, srhines
Reviewed By: t.p.northover, echristo
Subscribers: aemerson
Differential Revision: https://reviews.llvm.org/D31775
llvm-svn: 299674
Adrian Prantl [Thu, 6 Apr 2017 17:59:50 +0000 (17:59 +0000)]
Add DEBUGGER and CHECKs back to dbg-arg.c
When this testcase was migrated from IR to source the DEBUGGER
commands were not migrated together with the rest of the testcase. It
was also compiling without debug info.
Make the testcase slightly less useless by adding them back in :-)
llvm-svn: 299673
Ivan Krasin [Thu, 6 Apr 2017 17:58:45 +0000 (17:58 +0000)]
Add a virtual destructor to a class with virtual methods.
Summary:
Recently, Clang enabled the check for virtual destructors
in the presence of virtual methods. That broke the bootstrap
build. Fixing it.
Reviewers: pcc
Reviewed By: pcc
Subscribers: llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D31776
llvm-svn: 299672
Ivan Krasin [Thu, 6 Apr 2017 17:42:05 +0000 (17:42 +0000)]
Fix unused lambda capture. Follow up to r299653.
llvm-svn: 299671
Francis Ricci [Thu, 6 Apr 2017 17:41:26 +0000 (17:41 +0000)]
Enable builds of darwin lsan by default
Summary: Testing and asan leak detection are disabled by default.
Reviewers: kubamracek, kcc
Subscribers: srhines, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D31307
llvm-svn: 299669
Adrian Prantl [Thu, 6 Apr 2017 17:40:31 +0000 (17:40 +0000)]
Add a testcase for variable-length arrays.
VLAs are special-cased in the frontend. This testcase ensures that the
contract between clang and llvm won't be accidentally broken by future
refactorings.
llvm-svn: 299668
Matt Arsenault [Thu, 6 Apr 2017 17:37:27 +0000 (17:37 +0000)]
AMDGPU: Stop using CCAssignToRegWithShadow
This does not do what it is attempting to use it for
and requires working around in LowerFormalArguments.
llvm-svn: 299667
Ivan Krasin [Thu, 6 Apr 2017 17:35:35 +0000 (17:35 +0000)]
Fix unused typedef. Follow up to r299575.
llvm-svn: 299666
Craig Topper [Thu, 6 Apr 2017 17:33:37 +0000 (17:33 +0000)]
[InstSimplify] Teach SimplifyMulInst to recognize vectors of i1 as And. Not just scalar i1.
llvm-svn: 299665
Krzysztof Parzyszek [Thu, 6 Apr 2017 17:28:21 +0000 (17:28 +0000)]
[Hexagon] Change the vector scaling for vector offsets
Keep full offset value on MI-level instructions, but have it scaled down
in the MC-level instructions.
llvm-svn: 299664
Roman Gareev [Thu, 6 Apr 2017 17:25:08 +0000 (17:25 +0000)]
[FIX] Fix ScheduleTreeOptimizer::optimizeMatMulPattern
Use new values of the dimensions during their permutation.
llvm-svn: 299663
Roman Gareev [Thu, 6 Apr 2017 17:09:54 +0000 (17:09 +0000)]
Restore the initial ordering of dimensions before applying the pattern matching
Dimensions of band nodes can be implicitly permuted by the algorithm applied
during the schedule generation.
For example, in case of the following matrix-matrix multiplication,
for (i = 0; i < 1024; i++)
for (k = 0; k < 1024; k++)
for (j = 0; j < 1024; j++)
C[i][j] += A[i][k] * B[k][j];
it can produce the following schedule tree
domain: "{ Stmt_for_body6[i0, i1, i2] : 0 <= i0 <= 1023 and 0 <= i1 <= 1023 and
0 <= i2 <= 1023 }"
child:
schedule: "[{ Stmt_for_body6[i0, i1, i2] -> [(i0)] },
{ Stmt_for_body6[i0, i1, i2] -> [(i1)] },
{ Stmt_for_body6[i0, i1, i2] -> [(i2)] }]"
permutable: 1
coincident: [ 1, 1, 0 ]
The current implementation of the pattern matching optimizations relies on the
initial ordering of dimensions. Otherwise, it can produce the miscompilation
(e.g., [1]).
This patch helps to restore the initial ordering of dimensions by recreating
the band node when the corresponding conditions are satisfied.
Refs.:
[1] - https://bugs.llvm.org/show_bug.cgi?id=32500
Reviewed-by: Michael Kruse <llvm@meinersbur.de>
Differential Revision: https://reviews.llvm.org/D31741
llvm-svn: 299662
Craig Topper [Thu, 6 Apr 2017 17:09:08 +0000 (17:09 +0000)]
[TSan] Adjust expectation for check_analyze.sh
r299658 fixed a case where InstCombine was replicating instructions instead of combining. Fixing this reduced the number of pushes and pops in the __tsan_read and __tsan_write functions.
Adjust the expectations to account for this after talking to Dmitry Vyukov.
llvm-svn: 299661
Davide Italiano [Thu, 6 Apr 2017 17:03:04 +0000 (17:03 +0000)]
[ADT] Add a generic breadth-first-search graph iterator.
This will be used in LCSSA to speed up the canonicalization.
Differential Revision: https://reviews.llvm.org/D31694
llvm-svn: 299660
Stanislav Mekhanoshin [Thu, 6 Apr 2017 16:48:30 +0000 (16:48 +0000)]
[AMDGPU] Eliminate barrier if workgroup size is not greater than wavefront size
If a workgroup size is known to be not greater than wavefront size
the s_barrier instruction is not needed since all threads are guarantied
to come to the same point at the same time.
Differential Revision: https://reviews.llvm.org/D31731
llvm-svn: 299659
Craig Topper [Thu, 6 Apr 2017 16:42:46 +0000 (16:42 +0000)]
[InstCombine] Fix a case where we weren't checking that an instruction had a single use resulting in extra instructions being created.
llvm-svn: 299658
Gabor Horvath [Thu, 6 Apr 2017 15:58:57 +0000 (15:58 +0000)]
[clang-tidy] Temporarily disable a test-case that does not work on windows.
llvm-svn: 299657
Mehdi Amini [Thu, 6 Apr 2017 15:56:55 +0000 (15:56 +0000)]
Revert "Restore Missing awk regex tests. Thanks to dexonsmith for noticing, and proposing this as https://reviews.llvm.org/D16541"
This reverts commit r299652, 32bits MacOS is broken.
llvm-svn: 299656
James Henderson [Thu, 6 Apr 2017 15:22:58 +0000 (15:22 +0000)]
Revert r299635 because it exposed a latent bug.
llvm-svn: 299655
Sam Kolton [Thu, 6 Apr 2017 15:03:28 +0000 (15:03 +0000)]
[AMDGPU] Resubmit SDWA peephole: enable by default
Reviewers: vpykhtin, rampitec, arsenm
Subscribers: qcolombet, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye
Differential Revision: https://reviews.llvm.org/D31671
llvm-svn: 299654
Artem Dergachev [Thu, 6 Apr 2017 14:34:07 +0000 (14:34 +0000)]
[analyzer] Reland r299544 "Add a modular constraint system to the CloneDetector"
Hopefully fix crashes by unshadowing the variable.
Original commit message:
A big part of the clone detection code is functionality for filtering clones and
clone groups based on different criteria. So far this filtering process was
hardcoded into the CloneDetector class, which made it hard to understand and,
ultimately, to extend.
This patch splits the CloneDetector's logic into a sequence of reusable
constraints that are used for filtering clone groups. These constraints
can be turned on and off and reodreder at will, and new constraints are easy
to implement if necessary.
Unit tests are added for the new constraint interface.
This is a refactoring patch - no functional change intended.
Patch by Raphael Isemann!
Differential Revision: https://reviews.llvm.org/D23418
llvm-svn: 299653
Marshall Clow [Thu, 6 Apr 2017 14:32:42 +0000 (14:32 +0000)]
Restore Missing awk regex tests. Thanks to dexonsmith for noticing, and proposing this as https://reviews.llvm.org/D16541
llvm-svn: 299652
Alexander Kornienko [Thu, 6 Apr 2017 14:27:00 +0000 (14:27 +0000)]
[clang-tidy] Update docs and help message
llvm-svn: 299651
Alex Lorenz [Thu, 6 Apr 2017 14:03:25 +0000 (14:03 +0000)]
Avoid the -Wdocumentation-unknown-command warning in Clang's C API docs
rdar://
20441985
llvm-svn: 299650
Alexander Kornienko [Thu, 6 Apr 2017 13:41:29 +0000 (13:41 +0000)]
[clang-tidy] Add FormatStyle configuration option.
llvm-svn: 299649
Alex Lorenz [Thu, 6 Apr 2017 13:06:34 +0000 (13:06 +0000)]
[ObjC++] Conversions from specialized to non-specialized Objective-C generic
object types should be preferred over conversions to other object pointers
This change ensures that Clang will select the correct overload for the
following code sample:
void overload(Base *b);
void overload(Derived *d);
void test(Base<Base *> b) {
overload(b); // Select overload(Base *), not overload(Derived *)
}
rdar://
20124827
Differential Revision: https://reviews.llvm.org/D31597
llvm-svn: 299648
Jonas Paulsson [Thu, 6 Apr 2017 13:00:37 +0000 (13:00 +0000)]
[SelectionDAG] NFC patch removing a redundant check.
Since the BUILD_VECTOR has already been checked by
isBuildVectorOfConstantSDNodes() in SelectionDAG::getNode() for a
SIGN_EXTEND_INREG, it can be assumed that Op is always either undef or a
ConstantSDNode, and Ops.size() will always equal VT.getVectorNumElements().
llvm-svn: 299647
Alex Lorenz [Thu, 6 Apr 2017 12:53:43 +0000 (12:53 +0000)]
Fix lambda to block conversion in C++17 by avoiding copy elision for the
lambda capture used by the created block
The commit r288866 introduced guaranteed copy elision to C++ 17. This
unfortunately broke the lambda to block conversion in C++17 (the compiler
crashes when performing IRGen). This commit fixes the conversion by avoiding
copy elision for the capture that captures the lambda that's used in the block
created by the lambda to block conversion process.
rdar://
31385153
Differential Revision: https://reviews.llvm.org/D31669
llvm-svn: 299646
Gabor Horvath [Thu, 6 Apr 2017 12:49:35 +0000 (12:49 +0000)]
Attempt to fix build bots after r299638.
llvm-svn: 299645
Dean Michael Berris [Thu, 6 Apr 2017 11:27:53 +0000 (11:27 +0000)]
[XRay][compiler-rt] Remove unused local variable
The local was only referenced in assertions.
Follow-up to D31345.
llvm-svn: 299644
Simon Dardis [Thu, 6 Apr 2017 11:12:14 +0000 (11:12 +0000)]
[Sema] Retarget test to a specific platform for consistent datasizes
Attempt to satisfy llvm-clang-x86_64-expensive-checks-win by targeting
x86_64-apple-darwin10 for Sema/vector-ops.c. The underlying failure is
due to datatype differences between platforms.
llvm-svn: 299643
Simon Pilgrim [Thu, 6 Apr 2017 10:49:02 +0000 (10:49 +0000)]
Wdocumentation fix
llvm-svn: 299642
Simon Dardis [Thu, 6 Apr 2017 10:38:03 +0000 (10:38 +0000)]
[Sema] Extend GetSignedVectorType to deal with non ExtVector types
This improves some error messages which would otherwise refer to
ext_vector_type types in contexts where there are no such types.
Factored out from D25866 at reviewer's request.
Reviewers: bruno
Differential Revision: https://reviews.llvm.org/D31667
llvm-svn: 299641
Simon Pilgrim [Thu, 6 Apr 2017 10:32:30 +0000 (10:32 +0000)]
[X86][MMX] Test showing failure to create MMX non-temporal store
llvm-svn: 299640
Vassil Vassilev [Thu, 6 Apr 2017 10:05:46 +0000 (10:05 +0000)]
PR16106: Correct the docs to reflect the actual behavior of the interface.
llvm-svn: 299639
Gabor Horvath [Thu, 6 Apr 2017 09:56:42 +0000 (09:56 +0000)]
[clang-tidy] Check for forwarding reference overload in constructors.
Patch by AndrĂ¡s Leitereg!
Differential Revision: https://reviews.llvm.org/D30547
llvm-svn: 299638
Daniel Sanders [Thu, 6 Apr 2017 09:49:34 +0000 (09:49 +0000)]
[globalisel][tablegen] Move <Target>InstructionSelector declarations to anonymous namespaces
Summary: This resolves the issue of tablegen-erated includes in the headers for non-GlobalISel builds in a simpler way than before.
Reviewers: qcolombet, ab
Reviewed By: ab
Subscribers: igorb, ab, mgorny, dberris, rovka, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D30998
llvm-svn: 299637
James Henderson [Thu, 6 Apr 2017 09:40:03 +0000 (09:40 +0000)]
[ELF] Remove unnecessary cast and fix comments. NFC.
llvm-svn: 299636
James Henderson [Thu, 6 Apr 2017 09:29:08 +0000 (09:29 +0000)]
[ELF] Pad x86 executable sections with 0xcc int3 instructions
Executable sections should not be padded with zero by default. On some
architectures, 0x00 is the start of a valid instruction sequence, so can confuse
disassembly between InputSections (and indeed the start of the next InputSection
in some situations). Further, in the case of misjumps into padding, padding may
start to be executed silently.
On x86, the "0xcc" byte represents the int3 trap instruction. It is a single
byte long so can serve well as padding. This change switches x86 (and x86_64) to
use this value for padding in executable sections, if no linker script directive
overrides it. It also puts the behaviour into place making it easy to change the
behaviour of other targets when desired. I do not know the relevant instruction
sequences for trap instructions on other targets however, so somebody should add
this separately.
Because the old behaviour simply wrote padding in the whole section before
overwriting most of it, this change also modifies the padding algorithm to write
padding only where needed. This in turn has caused a small behaviour change with
regards to what values are written via Fill commands in linker scripts, bringing
it into line with ld.bfd. The fill value is now written starting from the end of
the previous block, which means that it always starts from the first byte of the
fill, whereas the old behaviour meant that the padding sometimes started mid-way
through the fill value. See the test changes for more details.
Reviewed by: ruiu
Differential Revision: https://reviews.llvm.org/D30886
Bugzilla: http://bugs.llvm.org/show_bug.cgi?id=32227
llvm-svn: 299635
David Green [Thu, 6 Apr 2017 08:32:47 +0000 (08:32 +0000)]
[ARM] Remove a dead ADD during the creation of TBBs
During the optimisation of jump tables in the constant island pass,
an extra ADD could be left over, now dead but not removed.
Differential Revision: https://reviews.llvm.org/D31389
llvm-svn: 299634
Siddharth Bhat [Thu, 6 Apr 2017 08:20:22 +0000 (08:20 +0000)]
[Polly] [ScheduleOptimizer] Prevent incorrect tile size computation
Because Polly exposes parameters that directly influence tile size
calculations, one can setup situations like divide-by-zero.
Check against a possible divide-by-zero in getMacroKernelParams
and return early.
Also assert at the end of getMacroKernelParams that the block sizes
computed for matrices are positive (>= 1).
Tags: #polly
Differential Revision: https://reviews.llvm.org/D31708
llvm-svn: 299633
Maxim Ostapenko [Thu, 6 Apr 2017 08:17:09 +0000 (08:17 +0000)]
Try to fix MAC buildbot after r299630
llvm-svn: 299632
Maxim Ostapenko [Thu, 6 Apr 2017 07:53:26 +0000 (07:53 +0000)]
Try to fix windows buildbot after r299630
llvm-svn: 299631
Maxim Ostapenko [Thu, 6 Apr 2017 07:42:27 +0000 (07:42 +0000)]
[lsan] Avoid segfaults during threads destruction under high load
This patch addresses two issues:
* It turned out that suspended thread may have dtls->dtv_size == kDestroyedThread (-1)
and LSan wrongly assumes that DTV is available. This leads to SEGV when LSan tries to
iterate through DTV that is invalid.
* In some rare cases GetRegistersAndSP can fail with errno 3 (ESRCH). In this case LSan
assumes that the whole stack of a given thread is available. This is wrong because ESRCH
can indicate that suspended thread was destroyed and its stack was unmapped. This patch
properly handles ESRCH from GetRegistersAndSP in order to avoid invalid accesses to already
unpapped threads stack.
Differential Revision: https://reviews.llvm.org/D30818
llvm-svn: 299630
Dean Michael Berris [Thu, 6 Apr 2017 07:14:43 +0000 (07:14 +0000)]
[XRay] [compiler-rt] Unwriting FDR mode buffers when functions are short.
Summary:
"short" is defined as an xray flag, and buffer rewinding happens for both exits
and tail exits.
I've made the choice to seek backwards finding pairs of FunctionEntry, TailExit
record pairs and erasing them if the FunctionEntry occurred before exit from the
currently exiting function. This is a compromise so that we don't skip logging
tail calls if the function that they call into takes longer our duration.
This works by counting the consecutive function and function entry, tail exit
pairs that proceed the current point in the buffer. The buffer is rewound to
check whether these entry points happened recently enough to be erased.
It is still possible we will omit them if they call into a child function that
is not instrumented which calls a fast grandchild that is instrumented before
doing other processing.
Reviewers: pelikan, dberris
Reviewed By: dberris
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31345
llvm-svn: 299629
Weiming Zhao [Thu, 6 Apr 2017 06:13:39 +0000 (06:13 +0000)]
[Builtins] Fix div0 error in udivsi3
Summary: Need to save `lr` before bl to aeabi_div0
Reviewers: rengolin, compnerd
Reviewed By: compnerd
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31716
llvm-svn: 299628
Craig Topper [Thu, 6 Apr 2017 05:48:06 +0000 (05:48 +0000)]
[InstSimplify] Add test cases for mixing add/sub i1 with xor of i1. Seems we can simplify in one direction but not the other.
llvm-svn: 299627
Craig Topper [Thu, 6 Apr 2017 05:28:41 +0000 (05:28 +0000)]
[InstSimplify] Teach SimplifyAddInst and SimplifySubInst that vectors of i1 can be treated as Xor too.
llvm-svn: 299626
Shoaib Meenai [Thu, 6 Apr 2017 04:47:49 +0000 (04:47 +0000)]
[libc++] Respect Windows Store app CRT restrictions
Some CRT APIs are unavailable for Windows Store apps [1]. Detect when
we're targeting the Windows Store and don't try to refer to non-existent
CRT functions in that case. (This would otherwise lead to a compile
error when using the libc++ headers and compiling for Windows Store.)
[1] https://docs.microsoft.com/en-us/cpp/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps
Differential Revision: https://reviews.llvm.org/D31737
llvm-svn: 299625
Dean Michael Berris [Thu, 6 Apr 2017 04:26:26 +0000 (04:26 +0000)]
[XRay][docs] Fix hyperlink to XRay doc
llvm-svn: 299624
Lang Hames [Thu, 6 Apr 2017 04:12:47 +0000 (04:12 +0000)]
[Orc] Add missing header include for r299611.
llvm-svn: 299623
Craig Topper [Thu, 6 Apr 2017 04:04:10 +0000 (04:04 +0000)]
Revert accidental commit of r299619.
llvm-svn: 299622
Craig Topper [Thu, 6 Apr 2017 04:03:34 +0000 (04:03 +0000)]
Revert accidental commit of r299618
llvm-svn: 299621
Craig Topper [Thu, 6 Apr 2017 04:02:33 +0000 (04:02 +0000)]
[IR] Add commutable matchers for Add and Mul to go with the logic operations that are already present. NFC
llvm-svn: 299620
Craig Topper [Thu, 6 Apr 2017 04:02:31 +0000 (04:02 +0000)]
bar
llvm-svn: 299619
Craig Topper [Thu, 6 Apr 2017 04:02:28 +0000 (04:02 +0000)]
foo
llvm-svn: 299618
Tobias Grosser [Thu, 6 Apr 2017 03:41:47 +0000 (03:41 +0000)]
Update to isl-0.18-417-gb9e7334
This is a regular maintenance update.
llvm-svn: 299617
Keith Wyss [Thu, 6 Apr 2017 03:32:01 +0000 (03:32 +0000)]
[XRay] - Fix spelling error to test commit access.
Just a spelling change in a comment intended to test svn commit access.
llvm-svn: 299616
Rui Ueyama [Thu, 6 Apr 2017 03:30:51 +0000 (03:30 +0000)]
Create GOT and PLT entries early in scanRelocs().
scanRelocs() does a lot of things. It fills InputSection's Relocations vector,
making a decision whether a TLS relocation should be relaxed or not,
and making a decision whether a GOT/PLT slot needs to be created or not.
They don't actually have to be done in a single loop. I want to separate
them so that some of them can be run concurently. As a first step, this
patch moves PLT/GOT slot assignment to beginning of the loop, so that
they just fall through to the next statements. This should make it clear
that that code doesn't affect other parts of the loop.
llvm-svn: 299615
Rui Ueyama [Thu, 6 Apr 2017 03:30:32 +0000 (03:30 +0000)]
Remove Target::isTlsGlobalDynamicRel()
Relocations are abstracted as platform-independent R_TLS_* relocations,
so we don't need to check platform-specific ones to see if a relocation
is TLS GD.
llvm-svn: 299614
Jason Molenda [Thu, 6 Apr 2017 03:16:44 +0000 (03:16 +0000)]
Update unittests/Host/SocketTest.cpp to also use the new
one-socket API.
llvm-svn: 299613
Jason Molenda [Thu, 6 Apr 2017 01:50:11 +0000 (01:50 +0000)]
Some old mach-o core files have an LC_IDENT load command
and there's a string in there that can be helpful in locating
the kernel binary. Use it.
<rdar://problem/
31444711>
llvm-svn: 299612
Lang Hames [Thu, 6 Apr 2017 01:49:21 +0000 (01:49 +0000)]
[Orc] Break QueueChannel out into its own header and add a utility,
createPairedQueueChannels, to simplify channel creation in the RPC unit tests.
llvm-svn: 299611
Lang Hames [Thu, 6 Apr 2017 01:35:13 +0000 (01:35 +0000)]
[Orc] Make orcError return an error_code rather than Error.
This will allow orcError to be used in convertToErrorCode implementations,
which will help in transitioning Orc RPC to Error.
llvm-svn: 299610
Jim Ingham [Thu, 6 Apr 2017 01:33:38 +0000 (01:33 +0000)]
getAsInteger is not a equivalent replacement for strtol
work around that fact for CommandObjectMemoryWrite.
<rdar://problem/
31457148>
llvm-svn: 299609
Jason Molenda [Thu, 6 Apr 2017 01:21:44 +0000 (01:21 +0000)]
Change how UDP sockets are set up -- use the same one socket for
both sending and receiving information, instead of using one socket
to send and another to receive. The two socket arrangement fails over
when a firewall is between the two systems.
<rdar://problem/
31286757>
llvm-svn: 299608
Mehdi Amini [Thu, 6 Apr 2017 01:14:57 +0000 (01:14 +0000)]
Fix remote test execution in lit
Can be used as such:
$ python /path/to/lit.py -sv /path/to/llvm/build/projects/libcxx/test/ \
--param=use_system_cxx_lib=true \
--param=executor='SSHExecutor("remote.domain", "username")'
llvm-svn: 299607
Mehdi Amini [Thu, 6 Apr 2017 01:10:22 +0000 (01:10 +0000)]
Use alternate string layout for ARMv7k
llvm-svn: 299606
Reid Kleckner [Thu, 6 Apr 2017 00:38:28 +0000 (00:38 +0000)]
[lit] Implement timeouts and max_time for process pool testing
This is necessary to pass the lit test suite at llvm/utils/lit/tests.
There are some pre-existing failures here, but now switching to pools
doesn't regress any tests.
I had to change test-data/lit.cfg to import DummyConfig from a module to
fix pickling problems, but I think it'll be OK if we require test
formats to be written in real .py modules outside lit.cfg files.
I also discovered that in some circumstances AsyncResult.wait() will not
raise KeyboardInterrupt in a timely manner, but you can pass a non-zero
timeout to work around this. This makes threading.Condition.wait use a
polling loop that runs through the interpreter, so it's capable of
asynchronously raising KeyboardInterrupt.
llvm-svn: 299605
Evgeniy Stepanov [Thu, 6 Apr 2017 00:34:45 +0000 (00:34 +0000)]
[cfi] Fix symbol lookup hack in cross-dso cfi to handle LLD binaries.
llvm-svn: 299604
George Burgess IV [Thu, 6 Apr 2017 00:23:31 +0000 (00:23 +0000)]
[Sema] Update CheckOverload docs
- Replace documented return values (true/false) with what's actually
returned
- Doxygenify the comment
- Reflow said comment to 80 cols
Not overly familiar with Doxygen, so nits are welcome. :)
llvm-svn: 299603
Peter Collingbourne [Thu, 6 Apr 2017 00:10:17 +0000 (00:10 +0000)]
StringTableBuilder: Don't assert when writing an empty raw string table.
llvm-svn: 299602
George Burgess IV [Thu, 6 Apr 2017 00:08:35 +0000 (00:08 +0000)]
Simplify. NFC.
Two simplifications:
- We check `!Previous.empty()` above and only use `Previous` in const
contexts after that check, so the `!Previous.empty()` check seems
redundant.
- The null check looks pointless, as well: AFAICT, `LookupResults`
should never contain null entries, and `OldDecl` should always be
non-null if `Redeclaration` is true.
llvm-svn: 299601
Rui Ueyama [Wed, 5 Apr 2017 23:22:11 +0000 (23:22 +0000)]
Return Optional<uint64_t> from readInteger instead of returning just success/failure.
llvm-svn: 299600