Matthias Braun [Tue, 13 Dec 2016 19:08:17 +0000 (19:08 +0000)]
Revert "AArch64CollectLOH: Rewrite as block-local analysis."
This is not always behaving as expected as it turns out block live-in
lists are only correct most of the time. Still waiting for reviews on
https://reviews.llvm.org/D27559 to have them correct all of the time.
See also http://llvm.org/PR31361, rdar://
25117107
This reverts commit r288567.
This reverts commit r288561.
llvm-svn: 289570
Alexei Starovoitov [Tue, 13 Dec 2016 19:07:08 +0000 (19:07 +0000)]
[bpf] change llvm-objdump to print dec instead of hex
since bpf instruction stream is multiple of 8 change llvm-objdump
to print decimal instruction number instead of hex address, so that
users don't have to do this math manually to match kernel verifier output
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
llvm-svn: 289569
Reid Kleckner [Tue, 13 Dec 2016 19:01:41 +0000 (19:01 +0000)]
Fix warning for noreturn function
llvm-svn: 289568
Reid Kleckner [Tue, 13 Dec 2016 18:58:09 +0000 (18:58 +0000)]
__uuidof() and declspec(uuid("...")) should be allowed on enumeration types
Although not specifically mentioned in the documentation, MSVC accepts
__uuidof(…) and declspec(uuid("…")) attributes on enumeration types in
addition to structs/classes. This is meaningful, as such types *do* have
associated UUIDs in ActiveX typelibs, and such attributes are included
by default in the wrappers generated by their #import construct, so they
are not particularly unusual.
clang currently rejects the declspec with a –Wignored-attributes
warning, and errors on __uuidof() with “cannot call operator __uuidof on
a type with no GUID” (because it rejected the uuid attribute, and
therefore finds no value). This is causing problems for us while trying
to use clang-tidy on a codebase that makes heavy use of ActiveX.
I believe I have found the relevant places to add this functionality,
this patch adds this case to clang’s implementation of these MS
extensions. patch is against r285994 (or actually the git mirror
80464680ce).
Both include an update to test/Parser/MicrosoftExtensions.cpp to
exercise the new functionality.
This is my first time contributing to LLVM, so if I’ve missed anything
else needed to prepare this for review just let me know!
__uuidof: https://msdn.microsoft.com/en-us/library/zaah6a61.aspx
declspec(uuid("…")): https://msdn.microsoft.com/en-us/library/3b6wkewa.aspx
#import: https://msdn.microsoft.com/en-us/library/8etzzkb6.aspx
Reviewers: aaron.ballman, majnemer, rnk
Differential Revision: https://reviews.llvm.org/D26846
llvm-svn: 289567
Tim Northover [Tue, 13 Dec 2016 18:25:38 +0000 (18:25 +0000)]
GlobalISel: fix GOT accesses on AArch64.
We were using the correct pseudo-instruction, but because the operand's flags
weren't set correctly we still ended up emitting incorrect relocations during
MC lowering.
llvm-svn: 289566
Greg Clayton [Tue, 13 Dec 2016 18:25:19 +0000 (18:25 +0000)]
Make a DWARFDIE class that can help avoid using the wrong DWARFUnit when extracting attributes
Many places pass around a DWARFDebugInfoEntryMinimal and a DWARFUnit. It is easy to get things wrong by using the wrong DWARFUnit with a DWARFDebugInfoEntryMinimal. This patch creates a DWARFDie class that contains the DWARFUnit and DWARFDebugInfoEntryMinimal objects so that they can't get out of sync. All attribute extraction has been moved out of DWARFDebugInfoEntryMinimal and into DWARFDie. DWARFDebugInfoEntryMinimal was also renamed to DWARFDebugInfoEntry.
DWARFDie objects are temporary objects that are used by clients and contain 2 pointers that you always need to have anyway. Keeping them grouped will avoid errors and simplify many of the attribute extracting APIs by not having to pass in a DWARFUnit.
Differential Revision: https://reviews.llvm.org/D27634
llvm-svn: 289565
Marcos Pividori [Tue, 13 Dec 2016 17:46:48 +0000 (17:46 +0000)]
[libFuzzer] Add missing header needed for Windows.
llvm-svn: 289564
Marcos Pividori [Tue, 13 Dec 2016 17:46:40 +0000 (17:46 +0000)]
[libFuzzer] Avoid name collision with Windows API.
Windows uses some macros to replace DeleteFile() by DeleteFileA() or
DeleteFileW(). This was causing an error at link time.
DeleteFile was renamed to RemoveFile().
Differential Revision: https://reviews.llvm.org/D27577
llvm-svn: 289563
Marcos Pividori [Tue, 13 Dec 2016 17:46:32 +0000 (17:46 +0000)]
[libFuzzer] Implement DirName() for Windows.
Implement DirName from scratch to avoid dependencies on external libraries.
It's based on MSDN documentation for Naming Files, Paths, and Namespaces.
The algorithm can't simply start from the end and look backwards for the
first separator, because we need to preserve the prefix that represent
the root location. We shouldn't remove anything there. In Windows we
have many different options, like:
\\Server\Share\ , \ , C: , C:\ , \\?\C:\ , \\?\UNC\Server\Share\
We remove the last separator in the rest of the path, if it exists.
It was implemented to have a similar behaviour to dirname() in linux,
removing trailing separators, returning "." when the path doesn't
contain separators, etc.
Differential Revision: https://reviews.llvm.org/D27579
llvm-svn: 289562
Marcos Pividori [Tue, 13 Dec 2016 17:46:25 +0000 (17:46 +0000)]
[libFuzzer] Fix bug in detecting timeouts when input string is empty.
I added a new flag RunningCB to know if the Fuzzer's main thread is
running the CB function, instead of using (!CurrentUnitSize).
(!CurrentUnitSize) doesn't work properly. For example, in FuzzerLoop.cpp,
inside ShuffleAndMinimize() function, we execute the callback with an
empty string (size=0). Previous implementation failed to detect timeouts
in that execution.
Also, I add a regression test for that case.
Differential Revision: https://reviews.llvm.org/D27433
llvm-svn: 289561
Marcos Pividori [Tue, 13 Dec 2016 17:46:11 +0000 (17:46 +0000)]
[libFuzzer] Clean up headers and file formatting of LibFuzzer files.
Reorganize #includes to follow LLVM Coding Standards.
Include some missing headers. Required to use `Printf()`.
Aside from that, this patch contains no functional change.
It is purely a re-organization.
Differential Revision: https://reviews.llvm.org/D27363
llvm-svn: 289560
Marcos Pividori [Tue, 13 Dec 2016 17:45:53 +0000 (17:45 +0000)]
[libFuzzer] Properly use unsigned for workers, jobs and NumberOfCpuCores.
std::thread::hardware_concurrency() returns an unsigned, so I modify
NumberOfCpuCores() to return unsigned too.
The number of cpus is used to define the number of workers, so I decided
to update the worker and jobs flags to be declared as unsigned too.
Differential Revision: https://reviews.llvm.org/D27685
llvm-svn: 289559
Marcos Pividori [Tue, 13 Dec 2016 17:45:44 +0000 (17:45 +0000)]
[libFuzzer] Properly use unsigned for Process ID.
Use unsigned for PID instead of signed int. GetCurrentProcessId() returns
an unsigned (DWORD) so we must be sure we can deal with all possible values.
I use a long unsigned to be sure it can hold a 32 bit unsigned (DWORD).
Differential Revision: https://reviews.llvm.org/D27281
llvm-svn: 289558
Marcos Pividori [Tue, 13 Dec 2016 17:45:20 +0000 (17:45 +0000)]
[libFuzzer] Improve Signal Handler interface.
Add new flags to FuzzingOptions to represent the different conditions
on the signal handling. These options are passed when calling
SetSignalHandler().
This changes simplify the implementation of Windows's exception
handling. Now we can define a unique handler for all the exceptions.
Differential Revision: https://reviews.llvm.org/D27238
llvm-svn: 289557
Rong Xu [Tue, 13 Dec 2016 17:34:29 +0000 (17:34 +0000)]
Fix the test cases committed in r289521.
llvm-svn: 289556
Simon Pilgrim [Tue, 13 Dec 2016 17:22:39 +0000 (17:22 +0000)]
[X86][SSE] Regenerate vector of pointers tests
llvm-svn: 289555
Artem Dergachev [Tue, 13 Dec 2016 17:19:18 +0000 (17:19 +0000)]
[analyzer] Detect ObjC properties that are both (copy) and Mutable.
When an Objective-C property has a (copy) attribute, the default setter
for this property performs a -copy on the object assigned.
Calling -copy on a mutable NS object such as NSMutableString etc.
produces an immutable object, NSString in our example.
Hence the getter becomes type-incorrect.
rdar://problem/
21022397
Differential Revision: https://reviews.llvm.org/D27535
llvm-svn: 289554
Zachary Turner [Tue, 13 Dec 2016 17:10:16 +0000 (17:10 +0000)]
Update for clang after llvm::StringLiteral.
llvm-svn: 289553
Neil Hickey [Tue, 13 Dec 2016 17:04:33 +0000 (17:04 +0000)]
Fixing build failure by adding triple option to new test condition.
Adding -triple option to ensure target supports double for fpmath test.
llvm-svn: 289552
Zachary Turner [Tue, 13 Dec 2016 17:03:49 +0000 (17:03 +0000)]
[ADT] Add llvm::StringLiteral.
StringLiteral is a wrapper around a string literal useful for
replacing global tables of char arrays with global tables of
StringRefs that can initialized in a constexpr context, avoiding
the invocation of a global constructor.
Differential Revision: https://reviews.llvm.org/D27686
llvm-svn: 289551
Rafael Espindola [Tue, 13 Dec 2016 16:59:19 +0000 (16:59 +0000)]
Refactor duplicated expression. NFC.
llvm-svn: 289550
Alexander Kornienko [Tue, 13 Dec 2016 16:49:10 +0000 (16:49 +0000)]
Fix sphinx build.
llvm-svn: 289549
David Callahan [Tue, 13 Dec 2016 16:42:18 +0000 (16:42 +0000)]
[ADCE] Add code to remove dead branches
Summary:
This is last in of a series of patches to evolve ADCE.cpp to support
removing of unnecessary control flow.
This patch adds the code to update the control and data flow graphs
to remove the dead control flow.
Also update unit tests to test the capability to remove dead,
may-be-infinite loop which is enabled by the switch
-adce-remove-loops.
Previous patches:
D23824 [ADCE] Add handling of PHI nodes when removing control flow
D23559 [ADCE] Add control dependence computation
D23225 [ADCE] Modify data structures to support removing control flow
D23065 [ADCE] Refactor anticipating new functionality (NFC)
D23102 [ADCE] Refactoring for new functionality (NFC)
Reviewers: dberlin, majnemer, nadav, mehdi_amini
Subscribers: llvm-commits, david2050, freik, twoh
Differential Revision: https://reviews.llvm.org/D24918
llvm-svn: 289548
Alexander Kornienko [Tue, 13 Dec 2016 16:38:45 +0000 (16:38 +0000)]
Remove trailing whitespace in docs and clang-tidy sources.
llvm-svn: 289547
Alexander Kornienko [Tue, 13 Dec 2016 16:38:18 +0000 (16:38 +0000)]
[Clang-tidy] check for malloc, realloc and free calls
Summary:
This checker flags the use of C-style memory management functionality and notes about modern alternatives.
In an earlier revision it tried to autofix some kind of patterns, but that was a bad idea. Since memory management can be so widespread in a program, manual updating is most likely necessary.
Maybe for special cases, there could be later additions to this basic checker.
This is the first checker I wrote and I never did something with clang (only compiling programs). So whenever I missed conventions or did plain retarded stuff, feel free to point it out! I am willing to fix them and write a better checker.
I hope the patch does work, I never did this either. On a testapply in my repository it did, but I am pretty unconfident in my patching skills :)
Reviewers: aaron.ballman, hokein, alexfh, malcolm.parsons
Subscribers: cfe-commits, JDevlieghere, nemanjai, Eugene.Zelenko, Prazek, mgorny, modocache
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D26167
Patch by Jonas Toth!
llvm-svn: 289546
Artur Pilipenko [Tue, 13 Dec 2016 16:26:15 +0000 (16:26 +0000)]
Use more detailed assertion messages in the code introduced by r289538
llvm-svn: 289545
Neil Hickey [Tue, 13 Dec 2016 16:22:50 +0000 (16:22 +0000)]
Improve handling of floating point literals in OpenCL to only use double precision if the target supports fp64.
This change makes sure single-precision floating point types are used if the
cl_fp64 extension is not supported by the target.
Also removed the check to see whether the OpenCL version is >= 1.2, as this has
been incorporated into the extension setting code.
Differential Revision: https://reviews.llvm.org/D24235
llvm-svn: 289544
Alexander Kornienko [Tue, 13 Dec 2016 16:19:34 +0000 (16:19 +0000)]
Remove deprecated methods ast_matchers::BoundNodes::{getStmtAs,getDeclAs}
llvm-svn: 289543
Alexander Kornienko [Tue, 13 Dec 2016 16:19:19 +0000 (16:19 +0000)]
Remove deprecated methods ast_matchers::BoundNodes::{getStmtAs,getDeclAs}
llvm-svn: 289542
Haojian Wu [Tue, 13 Dec 2016 15:35:47 +0000 (15:35 +0000)]
[clang-move] Fix incorrect EndLoc for declarations in macros.
Reviewers: ioeric
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D27713
llvm-svn: 289541
Artur Pilipenko [Tue, 13 Dec 2016 14:55:31 +0000 (14:55 +0000)]
Fix a buildbot failure introduced by r289538
Build failed because of unused variable in product mode.
llvm-svn: 289540
Ulrich Weigand [Tue, 13 Dec 2016 14:44:25 +0000 (14:44 +0000)]
[sancov] Disable failing test on SystemZ as well
This doesn't work at all on big-endian systems, even just reading in the
magic bytes in the binary .sancov file header gets byte order wrong.
llvm-svn: 289539
Artur Pilipenko [Tue, 13 Dec 2016 14:21:14 +0000 (14:21 +0000)]
[DAGCombiner] Match load by bytes idiom and fold it into a single load
Match a pattern where a wide type scalar value is loaded by several narrow loads and combined by shifts and ors. Fold it into a single load or a load and a bswap if the targets supports it.
Assuming little endian target:
i8 *a = ...
i32 val = a[0] | (a[1] << 8) | (a[2] << 16) | (a[3] << 24)
=>
i32 val = *((i32)a)
i8 *a = ...
i32 val = (a[0] << 24) | (a[1] << 16) | (a[2] << 8) | a[3]
=>
i32 val = BSWAP(*((i32)a))
This optimization was discussed on llvm-dev some time ago in "Load combine pass" thread. We came to the conclusion that we want to do this transformation late in the pipeline because in presence of atomic loads load widening is irreversible transformation and it might hinder other optimizations.
Eventually we'd like to support folding patterns like this where the offset has a variable and a constant part:
i32 val = a[i] | (a[i + 1] << 8) | (a[i + 2] << 16) | (a[i + 3] << 24)
Matching the pattern above is easier at SelectionDAG level since address reassociation has already happened and the fact that the loads are adjacent is clear. Understanding that these loads are adjacent at IR level would have involved looking through geps/zexts/adds while looking at the addresses.
The general scheme is to match OR expressions by recursively calculating the origin of individual bits which constitute the resulting OR value. If all the OR bits come from memory verify that they are adjacent and match with little or big endian encoding of a wider value. If so and the load of the wider type (and bswap if needed) is allowed by the target generate a load and a bswap if needed.
Reviewed By: hfinkel, RKSimon, filcab
Differential Revision: https://reviews.llvm.org/D26149
llvm-svn: 289538
Artur Pilipenko [Tue, 13 Dec 2016 14:16:02 +0000 (14:16 +0000)]
Move BaseIndexOffset in DAGCombiner.cpp so it will be available for the upcoming user
llvm-svn: 289537
Egor Churaev [Tue, 13 Dec 2016 14:07:23 +0000 (14:07 +0000)]
[OpenCL] Improve address space diagnostics.
Reviewers: Anastasia
Subscribers: bader, yaxunl, cfe-commits
Differential Revision: https://reviews.llvm.org/D27671
llvm-svn: 289536
Egor Churaev [Tue, 13 Dec 2016 14:02:35 +0000 (14:02 +0000)]
[OpenCL] Enable unroll hint for OpenCL 1.x.
Summary: Although the feature was introduced only in OpenCL C v2.0 spec., it's useful for OpenCL 1.x too and doesn't require HW support.
Reviewers: Anastasia
Subscribers: yaxunl, cfe-commits, bader
Differential Revision: https://reviews.llvm.org/D27453
llvm-svn: 289535
Simon Pilgrim [Tue, 13 Dec 2016 13:36:27 +0000 (13:36 +0000)]
[SelectionDAG] computeKnownBits - simplified knownbits sign extension. NFCI.
We don't need to extract+test the sign bit of the known ones/zeros, we can use sext which will handle all of this.
llvm-svn: 289534
Tobias Grosser [Tue, 13 Dec 2016 12:44:00 +0000 (12:44 +0000)]
Adjust clang-format formatting to r289531
clang-format has been updated in r289531 to keep labels and values on
the same line. This change updates Polly to the new formatting style.
llvm-svn: 289533
Simon Dardis [Tue, 13 Dec 2016 11:39:18 +0000 (11:39 +0000)]
[mips][rtdyld] Move MIPS relocation resolution to a subclass and implement N32 relocations
N32 relocations are only correct for individual relocations at the moment.
Support for relocation composition will follow in a later patch.
Patch By: Daniel Sanders
Reviwers: vkalintiris, atanasyan
Differential Revision: https://reviews.llvm.org/D27467
llvm-svn: 289532
Daniel Jasper [Tue, 13 Dec 2016 11:16:42 +0000 (11:16 +0000)]
clang-format: Keep string-literal-label + value pairs on a line.
We have previously done that for <<-operators. This patch also adds
this logic for "," and "+".
Before:
string v = "
aaaaaaaaaaaaaaaa: " +
aaaaaaaaaaaaaaaa + "
aaaaaaaaaaaaaaaa: " +
aaaaaaaaaaaaaaaa + "
aaaaaaaaaaaaaaaa: " +
aaaaaaaaaaaaaaaa;
string v = StrCat("
aaaaaaaaaaaaaaaa: ",
aaaaaaaaaaaaaaaa, "
aaaaaaaaaaaaaaaa: ",
aaaaaaaaaaaaaaaa, "
aaaaaaaaaaaaaaaa: ",
aaaaaaaaaaaaaaaa);
After:
string v = "
aaaaaaaaaaaaaaaa: " +
aaaaaaaaaaaaaaaa +
"
aaaaaaaaaaaaaaaa: " +
aaaaaaaaaaaaaaaa +
"
aaaaaaaaaaaaaaaa: " +
aaaaaaaaaaaaaaaa;
string v = StrCat("
aaaaaaaaaaaaaaaa: ",
aaaaaaaaaaaaaaaa,
"
aaaaaaaaaaaaaaaa: ",
aaaaaaaaaaaaaaaa,
"
aaaaaaaaaaaaaaaa: ",
aaaaaaaaaaaaaaaa);
llvm-svn: 289531
Simon Dardis [Tue, 13 Dec 2016 11:10:53 +0000 (11:10 +0000)]
[mips] Fix comment to respect 80 chars per line; NFC
llvm-svn: 289530
Simon Dardis [Tue, 13 Dec 2016 11:07:51 +0000 (11:07 +0000)]
[mips] Fix compact branch hazard detection
In certain cases it is possible that transient instructions such as
%reg = IMPLICIT_DEF as a single instruction in a basic block to reach
the MipsHazardSchedule pass. This patch teaches MipsHazardSchedule to
properly look through such cases.
Reviewers: vkalintiris, zoran.jovanovic
Differential Revision: https://reviews.llvm.org/D27209
llvm-svn: 289529
Diana Picus [Tue, 13 Dec 2016 10:46:12 +0000 (10:46 +0000)]
[GlobalISel] Move extendRegister where it belongs. NFCI
Apparently I missed this one when I moved ValueHandler back in r288658. Sorry!
llvm-svn: 289528
Peter Smith [Tue, 13 Dec 2016 10:42:05 +0000 (10:42 +0000)]
[ELF] Add R_ARM_RELATIVE to relocations that can be applied to GotSection
When compiling -fpie and linking with the --pie option the R_ARM_GOTBREL
relocation to D is resolved by writing the value of D into the .got slot
and emitting an R_ARM_RELATIVE relocation for it.
This changes adds the R_ARM_RELATIVE relocation to the switch in
relocateOne() so we can process the GotSection relocation to write the
value of the variable as well as emitting the dynamic relocation.
Differential revision: https://reviews.llvm.org/D27678
llvm-svn: 289527
Renato Golin [Tue, 13 Dec 2016 10:22:49 +0000 (10:22 +0000)]
[sancov] Mark as unstable on ARM, not XFAIL, since it does pass on some config
llvm-svn: 289526
Daniel Jasper [Tue, 13 Dec 2016 10:05:03 +0000 (10:05 +0000)]
clang-format: Improve braced-list detection.
Before:
vector<int> v { 12 }
GUARDED_BY(mutex);
After:
vector<int> v{12} GUARDED_BY(mutex);
llvm-svn: 289525
Malcolm Parsons [Tue, 13 Dec 2016 08:04:11 +0000 (08:04 +0000)]
[clang-tidy] Add check for redundant function pointer dereferences
Reviewers: alexfh, aaron.ballman, hokein
Subscribers: mgorny, JDevlieghere, cfe-commits
Differential Revision: https://reviews.llvm.org/D27520
llvm-svn: 289524
Craig Topper [Tue, 13 Dec 2016 07:45:45 +0000 (07:45 +0000)]
[X86][InstCombine] Fix SimplifyDemandedVectorElts to handle frcz scalar intrinsics correctly.
Only the lower bits of the input element are used. And only the lower element can be undef since the upper bits are zeroed.
Have InstCombineCalls call SimplifyDemandedVectorElts for these intrinsics to reuse this support.
llvm-svn: 289523
NAKAMURA Takumi [Tue, 13 Dec 2016 07:04:03 +0000 (07:04 +0000)]
llvm/test/Transforms/PGOProfile/noreturncall.ll REQUIRES asserts due to -debug-only.
llvm-svn: 289522
Rong Xu [Tue, 13 Dec 2016 06:41:14 +0000 (06:41 +0000)]
[PGO] Fix insane counts due to nonreturn calls
Summary:
Since we don't break BBs for function calls. We might get some insane counts
(wrap of unsigned) in the presence of noreturn calls.
This patch sets these counts to zero instead of the wrapped number.
Reviewers: davidxl
Subscribers: xur, eraman, llvm-commits
Differential Revision: https://reviews.llvm.org/D27602
llvm-svn: 289521
Jason Molenda [Tue, 13 Dec 2016 05:59:24 +0000 (05:59 +0000)]
Small tweaks to the markup in StructuredDataPlugins.
llvm-svn: 289520
Davide Italiano [Tue, 13 Dec 2016 05:56:04 +0000 (05:56 +0000)]
[SCCP] Debug diagnostic goes under DEBUG(). NFCI.
llvm-svn: 289519
Jason Molenda [Tue, 13 Dec 2016 05:54:17 +0000 (05:54 +0000)]
Touch-up the markup of the DarwinLog.md documentation.
llvm-svn: 289518
Dylan McKay [Tue, 13 Dec 2016 05:53:14 +0000 (05:53 +0000)]
[AVR] Add an 'relax memory operation' pass
Summary:
This pass will be used to relax instructions which use out of bounds
memory accesses to equivalent operations that can work with the
addresses.
The pass currently implements relaxation for the STDWPtrQRr instruction.
Without this pass, an assertion error would be hit in the pseudo expansion pass.
In the future, we will need to add more instructions to this pass. We can do
that on a case-by-case basic.
Reviewers: arsenm, kparzysz
Subscribers: wdng, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D27650
llvm-svn: 289517
Mike Aizatsky [Tue, 13 Dec 2016 05:24:57 +0000 (05:24 +0000)]
[sanitizers] dso order is random, test shouldnt depend on it
llvm-svn: 289516
Mike Aizatsky [Tue, 13 Dec 2016 05:21:19 +0000 (05:21 +0000)]
[sanitizers] powerpc4 is also unsupported platform
llvm-svn: 289515
Saleem Abdulrasool [Tue, 13 Dec 2016 03:27:35 +0000 (03:27 +0000)]
CodeGen: clean up -Wpedantic warning (NFC)
lib/CodeGen/CGExpr.cpp:2511:2: warning: extra ';' [-Wpedantic]
};
^
Clean up warning from gcc 6.
llvm-svn: 289514
Shoaib Meenai [Tue, 13 Dec 2016 02:43:04 +0000 (02:43 +0000)]
[libc++abi] Mark failing test on Darwin as XFAIL
The macOS thread-local variable finalizer routines do not handle the
case where a termination function registers another termination function
correctly, causing this test to fail. I've filed a radar for this;
mark the test XFAIL in the meantime. See [1] for more details.
[1] http://lists.llvm.org/pipermail/cfe-dev/2016-November/051376.html
Differential Revision: https://reviews.llvm.org/D27434
llvm-svn: 289513
Stephan T. Lavavej [Tue, 13 Dec 2016 01:54:58 +0000 (01:54 +0000)]
[libcxx] [test] Fix size_t-to-int truncation warnings in syserr.hash.
After r289363, these tests were triggering MSVC x64 warning C4267
"conversion from 'size_t' to 'int', possible loss of data" by taking 0, 2, and 10
as std::size_t, then constructing error_code(int, const error_category&) or
error_condition(int, const error_category&) from that (N4618 19.5.3.2
[syserr.errcode.constructors]/3, 19.5.4.2 [syserr.errcondition.constructors]/3).
The fix is simple: take these ints as int, pass them to the int-taking
constructor, and perform a value-preserving static_cast<std::size_t>
when comparing them to `std::size_t result`.
Fixes D27691.
llvm-svn: 289512
Dominic Chen [Tue, 13 Dec 2016 01:40:41 +0000 (01:40 +0000)]
[analyzer] Run clang-format and fix style
Summary: Split out formatting and style changes from D26061
Reviewers: zaks.anna, dcoughlin
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26691
llvm-svn: 289511
Philip Reames [Tue, 13 Dec 2016 01:38:41 +0000 (01:38 +0000)]
[peephole] Enhance folding logic to work for STATEPOINTs
The general idea here is to get enough of the existing restrictions out of the way that the already existing folding logic in foldMemoryOperand can kick in for STATEPOINTs and fold references to immutable stack slots. The key changes are:
Support for folding multiple operands at once which reference the same load
Support for folding multiple loads into a single instruction
Walk all the operands of the instruction for varidic instructions (this is a bug fix!)
Once this lands, I'll post another patch which refactors the TII interface here. There's nothing actually x86 specific about the x86 code used here.
Differential Revision: https://reviews.llvm.org/D24103
llvm-svn: 289510
Philip Reames [Tue, 13 Dec 2016 01:21:15 +0000 (01:21 +0000)]
[Statepoints] Reuse stack slots more than once within a basic block
The stack slot reuse code had a really amusing bug. We ended up only reusing a stack slot exact once (initial use + reuse) within a basic block. If we had a third statepoint to process, we ended up allocating a new set of stack slots. If we crossed a basic block boundary, the set got cleared. As a result, code which is invoke heavy doesn't see the problem, but multiple calls within a basic block does. Net result: as we optimize invokes into calls, lowering gets worse.
The root error here is that the bitmap uses by the custom allocator wasn't kept in sync. The result was that we ended up resizing the bitmap on the next statepoint (to handle the cross block case), reset the bit once, but then never reset it again.
Differential Revision: https://reviews.llvm.org/D25243
llvm-svn: 289509
Mike Aizatsky [Tue, 13 Dec 2016 01:11:46 +0000 (01:11 +0000)]
[sanitizers] disabling dso test as well where appropriate
llvm-svn: 289508
Mike Aizatsky [Tue, 13 Dec 2016 01:10:21 +0000 (01:10 +0000)]
[sanitizers] trace-pc-guard doesn't work on mac as well
fatal error: error in backend: Global variable '__sancov_gen_' has an
invalid section specifier '__sancov_guards': mach-o section specifier
requires a segment and section separated by a comma.
llvm-svn: 289507
Kostya Serebryany [Tue, 13 Dec 2016 00:40:47 +0000 (00:40 +0000)]
[libFuzzer] don't require extra flags with -minimize_crash=1 (default to -max_total_time=600). Also respect exact_artifact_path when outputting the end result
llvm-svn: 289506
Mike Aizatsky [Tue, 13 Dec 2016 00:34:33 +0000 (00:34 +0000)]
[sanitizers] sancov really works on x86 only
llvm-svn: 289505
Chris Bieneman [Tue, 13 Dec 2016 00:32:43 +0000 (00:32 +0000)]
Missed a file in r289503.
llvm-svn: 289504
Chris Bieneman [Tue, 13 Dec 2016 00:29:56 +0000 (00:29 +0000)]
[LIT] Fix system-windows
Turns out if you were on windows and your default target wasn't windows the system-windows feature wasn't getting enabled.
This fixes that and updates the coff-dwarf test to rely on the new "target-windows" feature. That test was the reason why system-windows was changed to not always be enabled on Windows hosts.
llvm-svn: 289503
Chris Bieneman [Tue, 13 Dec 2016 00:29:51 +0000 (00:29 +0000)]
Revert "Suppress LLVM::tools/llvm-symbolizer/coff-dwarf.test for mingw, for now."
This reverts commit r249937.
llvm-svn: 289502
Dean Michael Berris [Tue, 13 Dec 2016 00:17:31 +0000 (00:17 +0000)]
[XRay][compiler-rt] Use explicit comparisons in unit tests.
Summary:
This should improve the error messages generated providing a bit more
information when the failures are printed out. One example of a
contrived error looks like:
```
Expected: (Buffers.getBuffer(Buf)) != (std::error_code()), actual:
system:0 vs system:0
```
Because we're using error codes, the default printing gets us more
useful information in case of failure.
This is a follow-up on D26232.
Reviewers: rSerge
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27495
llvm-svn: 289501
Rafael Espindola [Mon, 12 Dec 2016 23:52:21 +0000 (23:52 +0000)]
Simplify the test. NFC.
llvm-svn: 289499
Mike Aizatsky [Mon, 12 Dec 2016 23:45:38 +0000 (23:45 +0000)]
[sancov] __sanitizer_dump_coverage api
Subscribers: kubabrecka, mgorny
Differential Revision: https://reviews.llvm.org/D26758
llvm-svn: 289498
Chris Bieneman [Mon, 12 Dec 2016 23:42:08 +0000 (23:42 +0000)]
[llvm-config] Unsupported should be win32
Hopefully this will fix the failing Windows bot.
llvm-svn: 289497
Tim Northover [Mon, 12 Dec 2016 23:29:07 +0000 (23:29 +0000)]
Stop lying about pointers' required alignments.
These extra specializations were added in the depths of history (r67984 from
2009) and are clearly problematic now. The pointers actually are aligned to the
default (8 bytes), since otherwise UBsan would be complaining loudly.
I *think* it originally made sense because there was no "alignof" to infer the
correct value so the generic case went with what malloc returned (8-byte
aliged objects), and on 32-bit machines this specialization was correct. It
became wrong when we started compiling for 64-bit, and caused a UBSan failure
when we tried to put a ValueHandle into a DenseMap.
Should fix the Green Dragon UBSan bot.
llvm-svn: 289496
Marcos Pividori [Mon, 12 Dec 2016 23:25:11 +0000 (23:25 +0000)]
[libFuzzer] Implement Timers for Windows.
Implemented timeouts for Windows using TimerQueueTimers.
Timers are used to supervise the time of execution of the
callback function that is being fuzzed.
Differential Revision: https://reviews.llvm.org/D27237
llvm-svn: 289495
Bruno Cardoso Lopes [Mon, 12 Dec 2016 23:22:30 +0000 (23:22 +0000)]
Revert "[Modules] Make header inclusion order from umbrella dirs deterministic"
Reverts commit r289478.
This broke
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/2070
(and maybe
http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules-2/builds/2246)
llvm-svn: 289494
Sanjay Patel [Mon, 12 Dec 2016 23:16:35 +0000 (23:16 +0000)]
[x86] fix test specifications
llvm-svn: 289493
Sanjay Patel [Mon, 12 Dec 2016 23:15:15 +0000 (23:15 +0000)]
[x86] fix test specifications and auto-generate checks
llvm-svn: 289492
Petr Hosek [Mon, 12 Dec 2016 23:15:10 +0000 (23:15 +0000)]
[CMake] Multi-target builtins build
This change enables building builtins for multiple different targets
using LLVM runtimes directory.
To specify the builtin targets to be built, use the LLVM_BUILTIN_TARGETS
variable, where the value is the list of targets. To pass a per target
variable to the builtin build, you can set BUILTINS_<target>_<variable>
where <variable> will be passed to the builtin build for <target>.
Differential Revision: https://reviews.llvm.org/D26652
llvm-svn: 289491
Chris Bieneman [Mon, 12 Dec 2016 23:14:58 +0000 (23:14 +0000)]
Revert "Disable all llvm-config tests for now, will investigate later"
This reverts commit r260386.
These tests all pass for me locally. I have no idea if they will pass on all configurations, so I'll watch the bots closely.
llvm-svn: 289490
Petr Hosek [Mon, 12 Dec 2016 23:14:02 +0000 (23:14 +0000)]
[compiler-rt] Support building builtins for a single target
This is used when building builtins for multiple targets as part
of LLVM runtimes.
Differential Revision: https://reviews.llvm.org/D26653
llvm-svn: 289489
Dan Liew [Mon, 12 Dec 2016 23:07:22 +0000 (23:07 +0000)]
[llvm-config] Fix bug where `--libfiles` and `--names` would produce
incorrect output when LLVM is built with `LLVM_BUILD_LLVM_DYLIB`.
`llvm-config` previously produced output like this
```
$ llvm-config --libfiles
/usr/lib/liblibLLVM-4.0svn.so.so
$ llvm-config --libnames
liblibLLVM-4.0svn.so.so
```
The library prefix and shared library extension were added to
the library name twice which was wrong.
I wanted to write a test cases for this but it looks like **all**
`llvm-config` tests were disabled by r260386 so I'll leave this for
now.
Subscribers: llvm-commits, tstellarAMD
Reviewers: beanz, DiamondLovesYou, axw
Differential Revision: https://reviews.llvm.org/D27393
llvm-svn: 289488
Bruno Cardoso Lopes [Mon, 12 Dec 2016 23:06:58 +0000 (23:06 +0000)]
Revert "[Headers] Add #include_next for tgmath.h on Darwin"
Reverts r289181: it's currently breaking modules using simd.h in
10.12 SDK.
This reverts commit
6e73e3464e96a4e00492c24aa790d36e1adb5702.
llvm-svn: 289487
Andrew Kaylor [Mon, 12 Dec 2016 23:05:38 +0000 (23:05 +0000)]
Avoid infinite loops in branch folding
Differential Revision: https://reviews.llvm.org/D27582
llvm-svn: 289486
Chris Bieneman [Mon, 12 Dec 2016 23:05:15 +0000 (23:05 +0000)]
clang-format to fix post-commit feedback
Thanks dblaikie!
llvm-svn: 289485
Chris Bieneman [Mon, 12 Dec 2016 23:03:28 +0000 (23:03 +0000)]
[llvm-config] Fix cflags test looking for "error"
This test is (I think) actually trying to make sure no errors are printed, but it hits on the string "error" in flags.
llvm-svn: 289484
Chris Bieneman [Mon, 12 Dec 2016 23:03:01 +0000 (23:03 +0000)]
Revert "Remove system-libs.test for now"
This reverts commit r260281.
llvm-svn: 289483
Sanjoy Das [Mon, 12 Dec 2016 23:00:12 +0000 (23:00 +0000)]
Revert "[SCEVExpander] Use llvm data structures; NFC"
This reverts r289215 (git SHA1
cb7b86a1). It breaks the ubsan build
because a DenseMap that keys off of `AssertingVH<T>` will hit UB when it
tries to cast the empty and tombstone keys to `T *` (due to insufficient
alignment).
This is the relevant stack trace (thanks to Mike Aizatsky):
#0 0x25cf100 in llvm::AssertingVH<llvm::PHINode>::getValPtr() const llvm/include/llvm/IR/ValueHandle.h:212:39
#1 0x25cea20 in llvm::AssertingVH<llvm::PHINode>::operator=(llvm::AssertingVH<llvm::PHINode> const&) llvm/include/llvm/IR/ValueHandle.h:234:19
#2 0x25d0092 in llvm::DenseMapBase<llvm::DenseMap<llvm::AssertingVH<llvm::PHINode>, llvm::detail::DenseSetEmpty, llvm::DenseMapInfo<llvm::AssertingVH<llvm::PHINode> >, llvm::detail::DenseSetPair<llvm::AssertingVH<llvm::PHINode> > >, llvm::AssertingVH<llvm::PHINode>, llvm::detail::DenseSetEmpty, llvm::DenseMapInfo<llvm::AssertingVH<llvm::PHINode> >, llvm::detail::DenseSetPair<llvm::AssertingVH<llvm::PHINode> > >::clear() llvm/include/llvm/ADT/DenseMap.h:113:23
llvm-svn: 289482
Kostya Serebryany [Mon, 12 Dec 2016 22:55:25 +0000 (22:55 +0000)]
[libFuzzer] split one slow test into several, for more parallel testing
llvm-svn: 289481
Nico Weber [Mon, 12 Dec 2016 22:46:40 +0000 (22:46 +0000)]
Fix MSVC build after 289461; MSVC isn't sure if this is std:: or llvm::
llvm-svn: 289480
Todd Fiala [Mon, 12 Dec 2016 22:42:00 +0000 (22:42 +0000)]
Removing myself from code ownership file
I'm transitioning away from my current employer, and I do not foresee myself
spending much time on LLDB in the near future. Ideally somebody on the Google
Android team takes over the gdb-remote protocol tests, and somebody with decent
familiarity with the test suite infrastructure takes over the parallel test
runner and test event stream portions of the Python test suite.
llvm-svn: 289479
Bruno Cardoso Lopes [Mon, 12 Dec 2016 22:41:20 +0000 (22:41 +0000)]
[Modules] Make header inclusion order from umbrella dirs deterministic
Sort the headers by name before adding the includes in
collectModuleHeaderIncludes. This makes the include order for building
umbrellas deterministic across different filesystems and also guarantees
that the ASTWriter always dump top headers in the same order.
There's currently no good way to test for this behavior.
rdar://problem/
28116411
llvm-svn: 289478
Kostya Serebryany [Mon, 12 Dec 2016 22:39:33 +0000 (22:39 +0000)]
[libFuzzer] make SimpleCmpTest a bit simpler to crack and more verbose
llvm-svn: 289477
Sanjay Patel [Mon, 12 Dec 2016 22:31:01 +0000 (22:31 +0000)]
[x86] fix formatting; NFC
llvm-svn: 289476
Eugene Zelenko [Mon, 12 Dec 2016 22:23:53 +0000 (22:23 +0000)]
[AMDGPU, PowerPC, TableGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 289475
Tim Shen [Mon, 12 Dec 2016 22:16:08 +0000 (22:16 +0000)]
[APFloatTest] Use std::make_tuple to make GCC 4.8 happy
Differential Revision: https://reviews.llvm.org/D26817
llvm-svn: 289474
Guozhi Wei [Mon, 12 Dec 2016 22:09:02 +0000 (22:09 +0000)]
[PPC] Prefer direct move on power8 if load 1 or 2 bytes to VSR
Power8 has MTVSRWZ but no LXSIBZX/LXSIHZX, so move 1 or 2 bytes to VSR through MTVSRWZ is much faster than store the extended value into stack and load it with LXSIWZX.
This patch fixes pr31144.
Differential Revision: https://reviews.llvm.org/D27287
llvm-svn: 289473
Tim Shen [Mon, 12 Dec 2016 21:59:30 +0000 (21:59 +0000)]
[APFloat] Implement PPCDoubleDouble add and subtract.
Summary:
I looked at libgcc's implementation (which is based on the paper,
Software for Doubled-Precision Floating-Point Computations", by Seppo Linnainmaa,
ACM TOMS vol 7 no 3, September 1981, pages 272-283.) and made it generic to
arbitrary IEEE floats.
Differential Revision: https://reviews.llvm.org/D26817
llvm-svn: 289472
Simon Atanasyan [Mon, 12 Dec 2016 21:34:11 +0000 (21:34 +0000)]
[ELF][MIPS] Calculate default _gp value relative to the GPREL section with the lowest address
llvm-svn: 289471
Matthew Simpson [Mon, 12 Dec 2016 21:11:04 +0000 (21:11 +0000)]
[SLP] Fix sign-extends for type-shrinking
This patch ensures the correct minimum bit width during type-shrinking.
Previously when type-shrinking, we always sign-extended values back to their
original width. However, if we are going to sign-extend, and the sign bit is
unknown, we have to increase the minimum bit width by one bit so the
sign-extend will fill the upper bits correctly. If the sign bit is known to be
zero, we can perform a zero-extend instead. This should fix PR31243.
Reference: https://llvm.org/bugs/show_bug.cgi?id=31243
Differential Revision: https://reviews.llvm.org/D27466
llvm-svn: 289470