Commit Graph

282949 Commits

Author SHA1 Message Date
Lang Hames 1cd3dd0bd8 [ORC] Consolidate RTDyldObjectLinkingLayer GetMemMgr and GetResolver into a
unified GetResources callback.

Having a single 'GetResources' callback will simplify adding new resources in
the future.

llvm-svn: 325180
2018-02-14 22:13:02 +00:00
Lang Hames e833fe8ec3 [ORC] Switch to shared_ptr ownership for AsynchronousSymbolQueries.
Queries need to stay alive until each owner has set the values they are
responsible for.

llvm-svn: 325179
2018-02-14 22:12:56 +00:00
Craig Topper 675752166d [X86] Don't swap argument on BOUND instruction in at&t syntax.
The bound instruction does not have reversed operands in gas.

Fixes PR27653.

Patch by Maya Madhavan.

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

llvm-svn: 325178
2018-02-14 21:54:58 +00:00
Rafael Espindola f6074ed9f6 Change the BugDriver to store the current module with std::unique_ptr.
While there, change a bunch of helper functions to take references to
avoid adding calls to get().

This should conclude the bugpoint yak shaving.

llvm-svn: 325177
2018-02-14 21:44:34 +00:00
Rafael Espindola d702241c98 Use std::uniue_ptr. NFC.
llvm-svn: 325176
2018-02-14 21:25:07 +00:00
Matt Davis b8402ef658 [Debug] Annotate compiler generated range-for loop variables.
Summary:
This change aims to simplify debugging by annotating the range-for loop artificial variables (range, begin, end) with the scope depth. 


Reviewers: rsmith, dblaikie

Reviewed By: dblaikie

Subscribers: dblaikie, cfe-commits

Tags: #debug-info

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

llvm-svn: 325175
2018-02-14 21:22:11 +00:00
Rafael Espindola 54c64ed3c0 Use std::unique_ptr. NFC.
llvm-svn: 325174
2018-02-14 21:17:36 +00:00
Rafael Espindola a7b0794042 Use std::unique_ptr. NFC.
llvm-svn: 325173
2018-02-14 21:10:29 +00:00
Rafael Espindola 02a3fb1503 Use std::unique_ptr. NFC.
llvm-svn: 325172
2018-02-14 20:59:39 +00:00
Eric Fiselier a06ca4bd90 Clean up -fdiscard-value-name handling
llvm-svn: 325171
2018-02-14 20:56:52 +00:00
Rafael Espindola 2911841fba Use std::unique_ptr. NFC.
llvm-svn: 325170
2018-02-14 20:53:38 +00:00
Krzysztof Parzyszek ad83ce4cb4 [Hexagon] Split HVX vector pair loads/stores, expand unaligned loads
llvm-svn: 325169
2018-02-14 20:46:06 +00:00
Simon Pilgrim 668664889c Removed superfluous semicolon to fix -Wpedantic gcc warning. NFCI.
llvm-svn: 325168
2018-02-14 20:43:47 +00:00
Rafael Espindola 19d8655ce4 Use std::unique_ptr. NFC.
llvm-svn: 325167
2018-02-14 20:25:18 +00:00
Francis Visoiu Mistrih afad84e676 [CodeGen] Print predecessors, successors, then liveins in -debug printing
Reorder them to match MIR.

Predecessors are only comments, and they're not usually printed in MIR.

llvm-svn: 325166
2018-02-14 20:23:05 +00:00
Rafael Espindola 15647b778b Use std::unique_ptr. NFC.
llvm-svn: 325165
2018-02-14 20:21:20 +00:00
Rafael Espindola 8b8d980bb9 Use std::unique_ptr. NFC.
llvm-svn: 325164
2018-02-14 20:13:01 +00:00
Rafael Espindola 2c8bcab607 Use std::unique_ptr. NFC.
llvm-svn: 325163
2018-02-14 19:58:41 +00:00
Volkan Keles 02bb1747a3 GlobalISel: Add templated functions and pattern matcher support for some more opcodes
Summary:
This patch adds templated functions to MachineIRBuilder for some opcodes
and adds pattern matcher support for G_AND and G_OR.

Reviewers: aditya_nandakumar

Reviewed By: aditya_nandakumar

Subscribers: rovka, kristof.beyls, llvm-commits

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

llvm-svn: 325162
2018-02-14 19:58:36 +00:00
Sanjay Patel af5d499cb9 [InstCombine] add tests and comments for fdiv X, C; NFC
llvm-svn: 325161
2018-02-14 19:54:51 +00:00
Rafael Espindola 7186753218 Pass a module reference to CloneModule.
It can never be null and most callers were already using references or
std::unique_ptr.

llvm-svn: 325160
2018-02-14 19:50:40 +00:00
Krasimir Georgiev 76064a4b1e [clang-format] Recognize percents as format specifiers in protos
Summary:
Frequently, a percent in protos denotes a formatting specifier for string replacement.
Thus it is desirable to keep the percent together with what follows after it.

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 325159
2018-02-14 19:47:58 +00:00
Sam Clegg ab31b7759d Convert an assert to a static_assert. NFC.
Differential Revision: https://reviews.llvm.org/D43305

llvm-svn: 325158
2018-02-14 19:28:46 +00:00
Rafael Espindola 24be43d22b Update examples for API change. NFC.
llvm-svn: 325157
2018-02-14 19:23:27 +00:00
Rafael Espindola 76c8f82e08 Update for llvm change. NFC.
llvm-svn: 325156
2018-02-14 19:11:37 +00:00
Rafael Espindola 6a86e25d90 Pass a reference to a module to the bitcode writer.
This simplifies most callers as they are already using references or
std::unique_ptr.

llvm-svn: 325155
2018-02-14 19:11:32 +00:00
Bruno Cardoso Lopes 6d9cf8aa9d [Modules] Add more language features to be used with requires-declaration
Features added: c99, c11, c17, cplusplus14 and cplusplus17.

rdar://problem/36328787
rdar://problem/36668431

llvm-svn: 325154
2018-02-14 19:01:03 +00:00
Craig Topper 6a09aab294 [RegisterClassInfo] Invalidate the register pressure set limit cache when reserved regs or callee saved regs change
Previously we only invalidated the pressure set limit cached when the TargetRegisterInfo pointer changes. But as reserved regs and callee saved regs are used as part of calculating the limits we should invalidate when those change too.

I encountered this when reverting a patch from the 6.0 branch. One of the x86 test files had a function that used rbp as a frame pointer, making it reserved. It was followed by another function which didn't use rbp but had the same TRI so the pressure set limit cache was not invalidated. If i removed the function that used rbp as a frame pointer from the file, the remaining function then got a different register pressure limit for the GR16 pressure set. This caused the machine scheduler to change the scheduling for the function. This was an unexpected change from just deleting a function.

I don't have a test case for trunk because the particular x86 test case is different enough from the 6.0 branch to not be affected now.

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

llvm-svn: 325153
2018-02-14 18:53:29 +00:00
Rui Ueyama 5e52022af6 Make --export-dynamic-symbol to add undefined symbols even if --export-dynamic is given.
This patch addresses a minor compatibility issue with GNU linkers.
Previously, --export-dynamic-symbol is completely ignored if you
pass --export-dynamic together.

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

llvm-svn: 325152
2018-02-14 18:38:33 +00:00
David Green 0d5f9651f2 Move llvm::computeLoopSafetyInfo from LICM.cpp to LoopUtils.cpp. NFC
Move computeLoopSafetyInfo, defined in Transforms/Utils/LoopUtils.h,
into the corresponding LoopUtils.cpp, as opposed to LICM where it resides
at the moment. This will allow other functions from Transforms/Utils
to reference it.

llvm-svn: 325151
2018-02-14 18:34:53 +00:00
Sam Clegg dfb0b2c78f [WebAssembly] Use a Symbol class heirarchy. NFC.
This brings wasm into line with ELF and COFF in terms of
symbol types are represented.

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

llvm-svn: 325150
2018-02-14 18:27:59 +00:00
Simon Pilgrim 2ec8373633 [X86][SSE] truncateVectorWithPACK - Use src type instead of dst to select between PACK*SDW/PACK*SWB
Try to keep PACK*SDW/PACK*SWB as wide as possible, this helps ComputeNumSignBits as it can only peek through bitcasts to wider types, pre-AVX2 codegen was already doing this as it could peek through bitcasts/subvectors more easily than AVX2 could through shuffles.

This shouldn't affect existing results as calls to truncateVectorWithPACK ensure we have enough sign bits to pack to the same value, but it should make it possible to use truncateVectorWithPACK chains to perform saturation in combineTruncateWithSat with a future patch.

llvm-svn: 325149
2018-02-14 18:23:58 +00:00
Craig Topper 1c19cc1745 [InstCombine] Don't fold select(C, Z, binop(select(C, X, Y), W)) -> select(C, Z, binop(Y, W)) if the binop is rem or div.
The select may have been preventing a division by zero or INT_MIN/-1 so removing it might not be safe.

Fixes PR36362.

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

llvm-svn: 325148
2018-02-14 18:08:33 +00:00
Marshall Clow 36c4862a37 Add a catch for std::length_error for the case where the string can't handle 2GB. (like say 32-bit big-endian)
llvm-svn: 325147
2018-02-14 18:05:25 +00:00
Stanislav Mekhanoshin c078ca92eb [AMDGPU] Remove non-temporal flag from argument loads
Kernel arguments likely read by all workitems and should not bypass
cache. Fixes performance hit in sub-dword argument loads.

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

llvm-svn: 325146
2018-02-14 18:05:14 +00:00
Alexey Bataev cbecfdfefe [OpenMP] Fix trailing space when printing pragmas, by Joel. E. Denny
Summary:
-ast-print prints omp pragmas with a trailing space.  While this
behavior is likely of little concern to most users, surely it's
unintentional, and it's annoying for some source-level work I'm
pursuing.  This patch focuses on omp pragmas, but it also fixes
init_seg and loop hint pragmas because they share implementation.

The testing strategy here is to add usually just one '{{$}}' per
relevant -ast-print test file.  This seems to achieve good code
coverage.  However, this strategy is probably easy to forget as the
tests evolve.  That's probably fine as this fix is far from critical.
The main goal of the testing is to aid the initial review.

This patch also adds a fixme for "#pragma unroll", which prints as
"#pragma unroll (enable)", which is invalid syntax.

Reviewers: ABataev

Reviewed By: ABataev

Subscribers: guansong, cfe-commits

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

llvm-svn: 325145
2018-02-14 17:38:47 +00:00
Sanjay Patel 48f671bb27 [InstCombine] regenerate checks; NFC
llvm-svn: 325144
2018-02-14 17:37:32 +00:00
Paul Robinson ee88ed6753 [DWARF] Fix incorrect prologue end line record.
The prologue-end line record must be emitted after the last
instruction that is part of the function frame setup code and before
the instruction that marks the beginning of the function body.

Patch by Carlos Alberto Enciso!

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

llvm-svn: 325143
2018-02-14 17:35:52 +00:00
Sanjay Patel 5df4d8892f [InstCombine] simplify isFMulOrFDivWithConstant(); NFCI
llvm-svn: 325142
2018-02-14 17:16:33 +00:00
Sanjay Patel 58dab856f7 [InstCombine] replace isa/cast with dyn_cast; NFC
llvm-svn: 325141
2018-02-14 16:56:44 +00:00
Sanjay Patel 604cb9e3ed [InstCombine] refactor folds for mul with negated operands; NFCI
This keeps with our current usage of 'match' and is easier to see that
the optional NSW only applies in the non-constant operand case. 

llvm-svn: 325140
2018-02-14 16:50:55 +00:00
Rafael Espindola 22c38a0748 Store defined macros in MCContext.
So that macros defined in inline assembly blocks are available to the
whole file.

This provides a consistent behavior with other assembly directives,
since equations for example are already preserved between inline
assembly blocks.

PR: 36110

Patch by Roger!

llvm-svn: 325139
2018-02-14 16:34:27 +00:00
Sanjay Patel 3f60b0b3f4 [x86] add baseline vector compare tests for D42948; NFC
llvm-svn: 325138
2018-02-14 16:15:15 +00:00
Pavel Labath ec303134ef Remove vestigial remnants of the test crash info hook
llvm-svn: 325137
2018-02-14 16:08:26 +00:00
Jonas Hahnfeld ee47d8cb96 [CUDA] Allow external variables in separate compilation
According to the CUDA Programming Guide this is prohibited in
whole program compilation mode. This makes sense because external
references cannot be satisfied in that mode anyway. However,
such variables are allowed in separate compilation mode which
is a valid use case.

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

llvm-svn: 325136
2018-02-14 16:04:03 +00:00
Alexander Ivchenko 7e5d525bd5 [SelectionDAG][X86] Fix incorrect offset generated for VMASKMOV
When creating high MachineMemOperand for MSTORE/MLOAD we supply
it with the original PointerInfo, while the pointer itself had been incremented.
The patch adds the proper offset to the PointerInfo.

llvm-svn: 325135
2018-02-14 15:55:24 +00:00
Alexey Bataev 7f246e003a [SLP] Allow vectorization of reversed loads.
Summary:
Reversed loads are handled as gathering. But we can just reshuffle
these values. Patch adds support for vectorization of reversed loads.

Reviewers: RKSimon, spatel, mkuper, hfinkel

Subscribers: llvm-commits

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

llvm-svn: 325134
2018-02-14 15:29:15 +00:00
Hans Wennborg 00f4598ec5 Revert r324991 "Fix for PR32992. Static const classes not exported."
This broke the Chromium build on Windows; see https://crbug.com/812231

> Fix for PR32992. Static const classes not exported.
>
> Patch by zahiraam!
>
> Differential Revision: https://reviews.llvm.org/D42968

llvm-svn: 325133
2018-02-14 15:19:46 +00:00
Ilya Biryukov 12aa52fe22 [clangd] Fix data race in ClangdThreadingTest.StressTest
Prior to this patch, same instance of VFS was shared for concurrent
processing of the files in ClangdThreadingTest.StressTest.

It caused a data race as the same instance of InMemoryFileSystem was
mutated from multiple threads using setCurrentWorkingDirectory().

llvm-svn: 325132
2018-02-14 15:19:20 +00:00
Jonas Hahnfeld cc6d29d72c [OMPT][test] Correct warning about added wrapper functions
This affects all outlined functions, not just tasks! Only show warning
when using Clang 5.0 or later.

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

llvm-svn: 325131
2018-02-14 15:15:24 +00:00