Commit Graph

296005 Commits

Author SHA1 Message Date
Matt Arsenault 96b678427a AMDGPU: Add feature vi-insts
This is necessary to add a VI specific builtin,
__builtin_amdgcn_s_dcache_wb. We already have an
overly specific feature for one of these builtins,
for s_memrealtime. I'm not sure whether it's better
to add more of those, or to get rid of that and merge
it with vi-insts.

Alternatively, maybe this logically goes with scalar-stores?

llvm-svn: 339104
2018-08-07 07:28:46 +00:00
Craig Topper 9de1797c50 [SelectionDAG][X86] Rename MaskedLoadSDNode::getSrc0 to getPassThru.
Src0 doesn't really convey any meaning to what the operand is. Passthru matches what's used in the documentation for the intrinsic this comes from.

llvm-svn: 339101
2018-08-07 06:52:49 +00:00
Martin Storsjo d9fd4a0de6 [COFF] Fix a comment about automatic resolving of dllimports from within a module. NFC.
Differential Revision: https://reviews.llvm.org/D50357

llvm-svn: 339100
2018-08-07 06:42:53 +00:00
Craig Topper 17989208a9 [SelectionDAG][X86] Rename getValue to getPassThru for gather SDNodes.
getValue is more meaningful name for scatter than it is for gather. Split them and use getPassThru for gather.

llvm-svn: 339096
2018-08-07 06:13:40 +00:00
Tobias Grosser 6145b11cd8 Update isl to isl-0.20-48-g13eba5b5
This is a regular maintenance updated.

llvm-svn: 339095
2018-08-07 05:51:21 +00:00
Tobias Grosser b8a55e1eee Make update-isl work with latest isl versions
Latest isl versions require clang to build a 'dist' package. Make sure
we actually ask for it.

While being there, also make sure we build isl on all cores.

llvm-svn: 339094
2018-08-07 05:50:58 +00:00
JF Bastien 8137793a8f Auto var init test fix #2
It turns out that the AVX bots have different alignment for their vectors, and my test mistakenly assumed a particular vector alignent on the stack. Instead, capture the alignment and test for it in subsequent operations.

llvm-svn: 339093
2018-08-07 04:44:13 +00:00
Dean Michael Berris a9d477a6dd [XRay] Improve error reporting when loading traces
Summary:
This change uses a single offset pointer used throughout the
implementation of the individual record parsers. This allows us to
report where in a trace file parsing failed.

We're still in an intermediate step here as we prepare to refactor this
further into a set of types and use object-oriented design principles
for a cleaner implementation. The next steps will be to allow us to
parse/dump files in a streaming fashion and incrementally build up the
structures in memory instead of the current all-or-nothing approach.

Reviewers: kpw, eizan

Reviewed By: kpw

Subscribers: hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D50169

llvm-svn: 339092
2018-08-07 04:42:39 +00:00
Stella Stamenova 9ca5db0904 [lit, tests] Fix failing lit test: shtest-format.py
Summary:
The problem here is that on windows double quotes are used for paths (usually) while single quotes are not. This is not generally a problem for the tests because the lit infrastructure tends to treat both the same. One (and possibly only) exception is when some tests are run in an external shell such as some of the shtest-format tests. In this case on windows the path to python was not created correctly because it had single quotes and the test failed.

This same test is already failing with python 3 which is why our testing missed the new failure. This patch will take care of the immediate failure with python 2 and I'll send a follow up for the python 3 failure.

Reviewers: asmith, zturner

Subscribers: delcypher, llvm-commits

Differential Revision: https://reviews.llvm.org/D50373

llvm-svn: 339091
2018-08-07 04:08:46 +00:00
JF Bastien 1b222cea08 Remove broken command flag
I was using it for testing, r339089 shouldn't have contained it.

llvm-svn: 339090
2018-08-07 04:03:03 +00:00
JF Bastien c70f65e86e [NFC] Test automatic variable initialization
Summary:
r337887 started using memset for automatic variable initialization where sensible. A follow-up discussion leads me to believe that we should better test automatic variable initialization, and that there are probably follow-up patches in clang and LLVM to improve codegen. It’ll be important to measure -O0 compile time, and figure out which transforms should be in the frontend versus the backend.

This patch is just a test of the current behavior, no questions asked. Follow-up patches will tune the code generation.

<rdar://problem/42981573>

Subscribers: dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D50361

llvm-svn: 339089
2018-08-07 03:12:52 +00:00
Artem Dergachev afdce6684e [analyzer] pr37204: Take signedness into account in getTruthValue().
It now actually produces a signed APSInt when the QualType passed into it is
signed, which is what any caller would expect.

Fixes a couple of crashes.

Differential Revision: https://reviews.llvm.org/D50363

llvm-svn: 339088
2018-08-07 02:27:38 +00:00
Artem Dergachev 5a5b867422 [analyzer] NFC: Document that we support implicit argument constructors.
The change in the AST in r338135 caused us to accidentally support
inlining constructors of operator implicit arguments. Previously they were
hard to support because they were treated as arguments in expressions
but not in declarations, but now they can be transparently treated as
simple temporaries.

Add tests and comments to explain how it now works.

Differential Revision: https://reviews.llvm.org/D49627

llvm-svn: 339087
2018-08-07 02:22:59 +00:00
Max Kazantsev 640cb00365 [NFC] Factor out implicit control flow logic from GVN
Logic for tracking implicit control flow instructions was added to GVN to
perform PRE optimizations correctly. It appears that GVN is not the only
optimization that sometimes does PRE, so this logic is required in other
places (such as Jump Threading).

This is an NFC patch that encapsulates all ICF-related logic in a dedicated
utility class separated from GVN.

Differential Revision: https://reviews.llvm.org/D40293

llvm-svn: 339086
2018-08-07 01:47:20 +00:00
Balaji V. Iyer 7874e40082 Performing a test commmit as requested by Chris Lattner.
-This line, and those below, will be ignored--

M    TemplateBase.h

llvm-svn: 339085
2018-08-07 00:31:44 +00:00
Heejin Ahn e8653bb89a [WebAssembly] Enable atomic expansion for unsupported atomicrmws
Summary:
Wasm does not have direct counterparts to some of LLVM IR's atomicrmw
instructions (min, max, umin, umax, and nand). This enables atomic
expansion using cmpxchg instruction within a loop for those atomicrmw
instructions.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

Differential Revision: https://reviews.llvm.org/D49440

llvm-svn: 339084
2018-08-07 00:22:22 +00:00
Fangrui Song f66d0ce10b [ELF] Use MathExtras.h llvm::SignExtend64
Summary: To be consistent with other files where only SignExtend64 is used.

Reviewers: ruiu, espindola

Subscribers: emaste, arichardson, llvm-commits

Differential Revision: https://reviews.llvm.org/D50366

llvm-svn: 339083
2018-08-06 23:50:26 +00:00
Derek Schuff 2c78385960 [WebAssembly] Replace SIMD expression types with V128
Summary:
The spec only defines a SIMD expression type of V128 and
leaves interpretation of different vector types to the instructions.

Differential Revision: https://reviews.llvm.org/D50367

Patch by Thomas Lively

llvm-svn: 339082
2018-08-06 23:16:50 +00:00
Max Moroz 84a48271d4 [libFuzzer] Add unstable function printing to print_unstable_stats flag
Summary:
There may be cases in which a user wants to know which part of their code is unstable.
We use ObservedFuncs and UnstableCounters to print at exit which of the ObservedFunctions
are unstable under the -print_unstable_stats flag.

Patch by Kyungtak Woo (@kevinwkt).

Reviewers: Dor1s, metzman, morehouse

Reviewed By: Dor1s, metzman, morehouse

Subscribers: delcypher, #sanitizers, llvm-commits, kcc

Differential Revision: https://reviews.llvm.org/D50264

llvm-svn: 339081
2018-08-06 23:14:13 +00:00
Emmett Neyman 673269edd7 Changed how LLVM IR was generated to increase vectorization
Summary: Changed the structure of the generated IR to make it easier to vectorize

Reviewers: morehouse, kcc

Reviewed By: morehouse

Subscribers: cfe-commits, llvm-commits

Differential Revision: https://reviews.llvm.org/D50342

llvm-svn: 339080
2018-08-06 23:11:38 +00:00
George Karpenkov 4ece68a0a8 [analyzer] Add ASTContext to CheckerManager
Some checkers require ASTContext. Having it in the constructor saves a
lot of boilerplate of having to pass it around.

Differential Revision: https://reviews.llvm.org/D50111

llvm-svn: 339079
2018-08-06 23:09:07 +00:00
Matt Arsenault 08f3fe4fae AMDGPU: cvt_pk_rtz_f16 canonicalizes
llvm-svn: 339078
2018-08-06 23:01:31 +00:00
Matt Arsenault e94ee833f9 AMDGPU: Handle some vector operations in isCanonicalized
llvm-svn: 339077
2018-08-06 22:45:51 +00:00
Stella Stamenova f0db95499b [lit, python] Always add quotes around the python path in lit
Summary:
The issue with the python path is that the path to python on Windows can contain spaces. To make the tests always work, the path to python needs to be surrounded by quotes.

This is a companion change to: https://reviews.llvm.org/D50206

Reviewers: asmith, zturner

Differential Revision: https://reviews.llvm.org/D50280

llvm-svn: 339076
2018-08-06 22:37:53 +00:00
Stella Stamenova 38eee643bd [lit, python] Always add quotes around the python path in lit
Summary:
The issue with the python path is that the path to python on Windows can contain spaces. To make the tests always work, the path to python needs to be surrounded by quotes.

This is a companion change to: https://reviews.llvm.org/D50206

Reviewers: asmith, zturner, espindola

Subscribers: emaste, sbc100, arichardson, aheejin, steven_wu, dexonsmith, llvm-commits

Differential Revision: https://reviews.llvm.org/D50282

llvm-svn: 339075
2018-08-06 22:37:49 +00:00
Stella Stamenova 85be391cb9 [lit, python] Always add quotes around the python path in lit
Summary:
The issue with the python path is that the path to python on Windows can contain spaces. To make the tests always work, the path to python needs to be surrounded by quotes.

This is a companion change to: https://reviews.llvm.org/D50206

Reviewers: asmith, zturner

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D50281

llvm-svn: 339074
2018-08-06 22:37:45 +00:00
Stella Stamenova cc2404c01d [lit, python] Always add quotes around the python path in lit
Summary:
The issue with the python path is that the path to python on Windows can contain spaces. To make the tests always work, the path to python needs to be surrounded by quotes.

This change updates several configuration files which specify the path to python as a substitution and also remove quotes from existing tests.

Reviewers: asmith, zturner, alexshap, jakehehrlich

Reviewed By: zturner, alexshap, jakehehrlich

Subscribers: mehdi_amini, nemanjai, eraman, kbarton, jakehehrlich, steven_wu, dexonsmith, stella.stamenova, delcypher, llvm-commits

Differential Revision: https://reviews.llvm.org/D50206

llvm-svn: 339073
2018-08-06 22:37:44 +00:00
Matt Arsenault a29e76244a AMDGPU: Push fcanonicalize through partially constant build_vector
This usually avoids some re-packing code, and may
help find canonical sources.

llvm-svn: 339072
2018-08-06 22:30:44 +00:00
Stephane Sezer 0c679b7108 Revert "Add a relocation for R_AARCH64_ABS32 in ObjectFileELF"
This reverts commit f055ce7eb893cd0d17ebcfd4125018f46f983aff.

llvm-svn: 339071
2018-08-06 22:21:28 +00:00
Matt Arsenault f2a167fb1d AMDGPU: Refactor fcanonicalize combine
This will make more complex combines easier.

llvm-svn: 339070
2018-08-06 22:10:26 +00:00
Philip Reames 3b35aaacb6 [LICM] Extract a helper function for readability [NFC]
llvm-svn: 339069
2018-08-06 22:07:37 +00:00
Stephane Sezer b015ca6f52 Add a relocation for R_AARCH64_ABS32 in ObjectFileELF
Summary:
.rela.debug_info relocations are being done via
ObjectFileELF::ApplyRelocations for aarch64. Currently, the switch case
that iterates over the relocation type is only implemented for a few
different types and `assert(false)`es over the rest.

Implement the relocation for R_AARCH64_ABS32 in ApplyRelocations

Reviewers: sas, xiaobai, peter.smith, clayborg, javed.absar, espindola

Differential Revision: https://reviews.llvm.org/D49407

Change by Nathan Lanza <lanza@fb.com>

llvm-svn: 339068
2018-08-06 22:04:08 +00:00
Reka Kovacs d9f66ba340 [analyzer] InnerPointerChecker: fix displayed checker name.
For InnerPointerChecker to function properly, both the checker itself
and parts of MallocChecker that handle relevant use-after-free problems
need to be turned on. So far, the latter part has been developed within
MallocChecker's NewDelete sub-checker, often causing warnings to appear
under that name. This patch defines a new CheckKind within MallocChecker
for the inner pointer checking functionality, so that the correct name
is displayed in warnings and in the ExplodedGraph.

Tested on clang-tidy.

Differential Review: https://reviews.llvm.org/D50211

llvm-svn: 339067
2018-08-06 22:03:42 +00:00
Peter Collingbourne 69dd7cd45e MC: Redirect .addrsig directives referring to private (.L) symbols to the section symbol.
This matches our behaviour for regular (i.e. relocated) references to
private symbols and therefore avoids needing to unnecessarily write
address-significant .L symbols to the object file's symbol table,
which can interfere with stack traces.

Fixes check-cfi after r339050.

llvm-svn: 339066
2018-08-06 21:59:58 +00:00
Matt Arsenault d49ab0b214 AMDGPU: Treat more custom operations as canonicalizing
Everything should quiet, and I think everything should
flush.

I assume the min3/med3/max3 follow the same rules
as regular min/max for flushing, which should at
least be conservatively correct.

There are still more operations that need to
be handled.

llvm-svn: 339065
2018-08-06 21:58:11 +00:00
Matt Arsenault ce6d61fba8 AMDGPU: Conversions always produce canonical results
Not sure why this was checking for denormals for f16.
My interpretation of the IEEE standard is conversions
should produce a canonical result, and the ISA manual
says denormals are created when appropriate.

llvm-svn: 339064
2018-08-06 21:51:52 +00:00
Simon Marchi ddbabc6b7c [VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name
Summary:
InMemoryFileSystem::status behaves differently than
RealFileSystem::status.  The Name contained in the Status returned by
RealFileSystem::status will be the path as requested by the caller,
whereas InMemoryFileSystem::status returns the normalized path.

For example, when requested the status for "../src/first.h",
RealFileSystem returns a Status with "../src/first.h" as the Name.
InMemoryFileSystem returns "/absolute/path/to/src/first.h".

The reason for this change is that I want to make a unit test in the
clangd testsuite (where we use an InMemoryFileSystem) to reproduce a
bug I get with the clangd program (where a RealFileSystem is used).
This difference in behavior "hides" the bug in the unit test version.

An indirect impact of this change is that a -Wnonportable-include-path
warning is now emitted in test PCH/case-insensitive-include.c.  This is
because the real path of the included file (with the wrong case) was not
available previously, whereas it is now.

Reviewers: malaperle, ilya-biryukov, bkramer

Reviewed By: ilya-biryukov

Subscribers: eric_niebler, malaperle, omtcyfz, hokein, bkramer, ilya-biryukov, ioeric, cfe-commits

Differential Revision: https://reviews.llvm.org/D48903

llvm-svn: 339063
2018-08-06 21:48:20 +00:00
Philip Reames 94b29601ef [LICM] Further strengthen tests for hoisting guards and invariant.starts [NFC]
llvm-svn: 339062
2018-08-06 21:39:43 +00:00
Matt Arsenault f8768bfc84 AMDGPU: Fix implementation of isCanonicalized
If denormals are enabled, denormals are canonical.
Also fix a few other issues. minnum/maxnum are supposed
to canonicalize. Temporarily improve workaround for the
instruction behavior change in gfx9.

Handle selects and fcopysign.

The tests were also largely broken, since they were
checking for a flush used on some targets after the
store of the result.

llvm-svn: 339061
2018-08-06 21:38:27 +00:00
Rui Ueyama e262bb1afb Add TARGET(foo) linker script directive.
GNU ld's manual says that TARGET(foo) is basically an alias for
`--format foo` where foo is a BFD target name such as elf64-x86-64.

Unlike GNU linkers, lld doesn't allow arbitrary BFD target name for
--format. We accept only "default", "elf" or "binary". This makes
situation a bit tricky because we can't simply make TARGET an alias for
--target.

A quick code search revealed that the usage number of TARGET is very
small, and the only meaningful usage is to switch to the binary mode.
Thus, in this patch, we handle only TARGET(elf.*) and TARGET(binary).

Differential Revision: https://reviews.llvm.org/D48153

llvm-svn: 339060
2018-08-06 21:29:41 +00:00
Reid Kleckner 5327805d7c Fix a -Wsign-compare
llvm-svn: 339059
2018-08-06 21:26:47 +00:00
Martin Storsjo 21858a9b63 [COFF] Treat .xdata/.pdata$<sym> as implicitly associative to <sym> for MinGW
MinGW configurations don't use associative comdats, as GNU ld doesn't
support that. Instead they produce normal comdats named .text$sym,
.xdata$sym and .pdata$sym.

GNU ld doesn't discard any comdats starting with .xdata or .pdata,
even if --gc-sections is used (while it does discard other unreferenced
comdats), regardless of what symbol name is used after the $ separator.

For LLD, treat any such comdat as implicitly associative to the base
symbol. This requires maintaining a map from symbol name to section
number, but that is only maintained when the MinGW flag has been
enabled.

Differential Revision: https://reviews.llvm.org/D49700

llvm-svn: 339058
2018-08-06 21:26:09 +00:00
Philip Reames 9d7bb2f700 [LICM] Strengthen invariant.start hoisting tests [NFC]
llvm-svn: 339057
2018-08-06 21:18:34 +00:00
Reid Kleckner 15e91c3235 [X86] Fix assertion in subreg extraction
This assert fires when attempting to extract a subregister from the
global PIC base register. This virtual register SD node is not in the
VRBaseMap, so we shouldn't call getVR to look it up there. If this is a
RegisterSDNode, we should be able to use the virtual register directly.

Fixes PR38385

llvm-svn: 339056
2018-08-06 21:16:16 +00:00
Philip Reames 81c7dc93d2 [LICM] Add tests highlighting missing hoists for intrinsics [NFC]
llvm-svn: 339054
2018-08-06 21:06:15 +00:00
Vedant Kumar 9452359887 [IRMemoryMap] Avoid redundant zero-init in the Allocation constructor (NFC)
In the lldb-bench/arithmetic benchmark, 1.7% of the total running time
is spent zero-initializing a std::vector that has already been zeroed.

llvm-svn: 339051
2018-08-06 20:13:52 +00:00
Peter Collingbourne 82a7f144a4 ELF: Enable address-significance tables during LTO.
This allows safe ICF to work when linking with LTO.

Differential Revision: https://reviews.llvm.org/D50221

llvm-svn: 339050
2018-08-06 20:12:12 +00:00
Martin Storsjo 214d69975c [COFF] Remove a superfluous warning about aligncomm for non-common symbols
It's not an error if a common symbol (uninitialized data, with alignment
specified via the aligncomm directive) is replaced with a regular
one with initialized data (with alignment specified via the section
chunk).

Differential Revision: https://reviews.llvm.org/D50268

llvm-svn: 339049
2018-08-06 19:49:18 +00:00
Martin Storsjo 434ef8335e [MinGW] Predefine UNICODE if -municode is specified during compilation
Differential Revision: https://reviews.llvm.org/D50199

llvm-svn: 339048
2018-08-06 19:48:44 +00:00
Sam Clegg cb06300ad2 [WebAssembly] --export should fetch lazy symbols
--export now implies --undefined

This is really a requirement from emscripten but I think it
makes sense in general too.

Differential Revision: https://reviews.llvm.org/D50287

llvm-svn: 339047
2018-08-06 19:45:12 +00:00