Commit Graph

359038 Commits

Author SHA1 Message Date
Yuanfang Chen 78c69a00a4 [NFC] Clean up uses of MachineModuleInfoWrapperPass 2020-07-01 09:45:05 -07:00
Nikita Popov 0f6afd946d [CVP] Use different number in test (NFC)
To make it clear that this is not intended to be specific to
mask / bit tests.
2020-07-01 18:43:59 +02:00
Eric Astor 353a169cb8 [ms] [llvm-ml] Use default RIP-relative addressing for x64 MASM.
Summary:
When parsing 64-bit MASM, treat memory operands with unspecified base register as RIP-based.

Documented in several places, including https://software.intel.com/en-us/articles/introduction-to-x64-assembly: "Unfortunately, MASM does not allow this form of opcode, but other assemblers like FASM and YASM do. Instead, MASM embeds RIP-relative addressing implicitly."

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D73227
2020-07-01 12:41:07 -04:00
Guillaume Chatelet 0f9d623b63 [Alignment][NFC] Use Align for BPFAbstractMemberAccess::RecordAlignment
This patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Differential Revision: https://reviews.llvm.org/D82962
2020-07-01 16:23:52 +00:00
Hiroshi Yamauchi 6bd1db08e7 [InstCombine] Don't let an alignment assume prevent new/delete removals.
Remove allocations with alignment assume.

Differential Revision: https://reviews.llvm.org/D81854
2020-07-01 09:22:32 -07:00
David Green ca4c1ad854 [Outliner] Set nounwind for outlined functions
This prevents the outlined functions from pulling in a lot of unnecessary code
in our downstream libraries/linker. Which stops outlining making codesize
worse in c++ code with no-exceptions.

Differential Revision: https://reviews.llvm.org/D57254
2020-07-01 17:18:34 +01:00
Xing GUO 38907b696c [DWARFYAML][debug_abbrev] Emit 0 byte for terminating abbreviations.
The abbreviations for a given compilation unit end with an entry
consisting of a 0 byte for the abbreviation code.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D82933
2020-07-02 00:09:29 +08:00
Simon Pilgrim c83ec0a633 Make dyn_cast results explicitly auto* instead of just auto.
Noticed by clang-tidy llvm-qualified-auto warning.
2020-07-01 16:38:52 +01:00
Simon Pilgrim 0ae989a1fe Pass DebugLoc::appendInlinedAt DebugLoc arg by const reference not value.
Noticed by clang-tidy performance-unnecessary-value-param warning.
2020-07-01 16:38:51 +01:00
Pengxuan Zheng d36f2c6a6c [RISCV] Add mcountinhibit CSR
Summary:
The mcountinhibit CSR is defined in the ratified 1.11 version of the privileged
spec.

Reviewers: apazos, asb, lenary, luismarques

Reviewed By: asb

Subscribers: hiraditya, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, sameer.abuasal, evandro, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82913
2020-07-01 08:27:00 -07:00
Luís Marques b2aa546b07 [RISCV] Temporarily move riscv-expand-pseudo pass to PreEmitPass2
The pass to split atomic and non-atomic RISC-V pseudo-instructions was itself
split into two passes in D79635 / commit rG2cb0644f90b7, with the splitting of
non-atomic instructions being moved to the PreSched2 phase. A comment was
added to D79635 detailing a case where this caused problems, so this commit
moves the non-atomic split pass back to the PreEmitPass2 phase. This allows
the bulk of the changes from D79635 to remain committed, while addressing the
the reported problem (the pass split is now almost NFC). Once the root problem
is fixed we can move the (non-atomic) instruction splitting pass back to
earlier in the pipeline.
2020-07-01 16:26:02 +01:00
Raphael Isemann 9010cef2af [lldb] Replace StringConvert with llvm::to_integer when parsing integer values in CommandObjects
Summary:

This replaces the current use of LLDB's own `StringConvert` with LLVM's
`to_integer` which has a less error-prone API and doesn't use special 'error
values' to designate parsing problems.

Where needed I also added missing error handling code that prints a parsing
error instead of continuing with the error value returned from `StringConvert`
(which either gave a cryptic error message or just took the error value
performed an incorrect action with it. For example, `frame recognizer delete -1`
just deleted the frame recognizer at index 0).

Reviewers: #lldb, labath

Reviewed By: labath

Subscribers: labath, abidh, JDevlieghere

Differential Revision: https://reviews.llvm.org/D82297
2020-07-01 17:19:31 +02:00
Luís Marques a61fa1a4b9 Revert "[RISCV] Temporarily move riscv-expand-pseudo pass to PreEmitPass2"
This reverts commit 05a20a9e9a.
2020-07-01 16:01:40 +01:00
Pavel Labath 1276855f2b [lldb] Attempt to fix TestLimitDebugInfo on windows
The test fails due to link errors. I believe this change should fix
that.
2020-07-01 16:56:56 +02:00
Kazushi (Jam) Marukawa 1952055892 [VE] Support symbol with offset value
Summary: Support symbol with offset value as a VEMCExpr.

Reviewers: simoll, k-ishizaka

Reviewed By: simoll

Subscribers: hiraditya, llvm-commits

Tags: #llvm, #ve

Differential Revision: https://reviews.llvm.org/D82734
2020-07-01 23:55:27 +09:00
Sam McCall c5263a4e84 [clangd] Fix race in FileIndex that sometimes temporarily lost updates.
Summary:
FileIndex was built out of threadsafe components, so update() didn't have data
races, but wasn't actually correct.

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82891
2020-07-01 16:47:04 +02:00
Luís Marques 05a20a9e9a [RISCV] Temporarily move riscv-expand-pseudo pass to PreEmitPass2
The pass to split atomic and non-atomic RISC-V pseudo-instructions was itself
split into two passes in D79635 / commit rG2cb0644f90b7, with the splitting of
non-atomic instructions being moved to the PreSched2 phase. A comment was
added to D79635 detailing a case where this caused problems, so this commit
moves the non-atomic split pass back to the PreEmitPass2 phase. This allows
the bulk of the changes from D79635 to remain committed, while addressing the
the reported problem (the pass split is now almost NFC). Once the root problem
is fixed we can move the (non-atomic) instruction splitting pass back to
earlier in the pipeline.
2020-07-01 15:42:18 +01:00
Erich Keane 19c35526d9 Limit x86 test to require target to fix buildbot (from 2831a317b)
The modification of the features apparently requires the backend to be
instantiated, so make sure this is required to fix the ARM build bots.
2020-07-01 07:35:39 -07:00
Guillaume Chatelet ef36f5143d [Alignment] TargetLowering::hasPairedLoad must use Align for RequiredAlignment
As per documentation of `hasPairLoad`:
"`RequiredAlignment` gives the minimal alignment constraints that must be met to be able to select this paired load."
In this sense, `0` is strictly equivalent to `1`. We make this obvious by using `Align` instead of unsigned.
There is only one implementor of this interface.

Differential Revision: https://reviews.llvm.org/D82958
2020-07-01 14:32:30 +00:00
Guillaume Chatelet d3085c2501 [Alignment][NFC] Transition and simplify calls to DL::getABITypeAlignment
This patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Differential Revision: https://reviews.llvm.org/D82956
2020-07-01 14:31:56 +00:00
Guillaume Chatelet 27bbc8ede1 [Alignment][NFC] Migrate TargetTransformInfo::CreateVariableSizedObject to Align
This patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Differential Revision: https://reviews.llvm.org/D82939
2020-07-01 14:31:21 +00:00
rojamd 63eddb679a [cmake][Windows] Add libpath to CMAKE_MODULE_LINKER_FLAGS too
Followup to b8000c0ce8, the library path needs to go in
CMAKE_MODULE_LINKER_FLAGS too, for the sake of a few files
like LLVMHello.dll.

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D82888
2020-07-01 10:19:19 -04:00
Erich Keane 2831a317b6 Implement AVX ABI Warning/error
The x86-64 "avx" feature changes how >128 bit vector types are passed,
instead of being passed in separate 128 bit registers, they can be
passed in 256 bit registers.

"avx512f" does the same thing, except it switches from 256 bit registers
to 512 bit registers.

The result of both of these is an ABI incompatibility between functions
compiled with and without these features.

This patch implements a warning/error pair upon an attempt to call a
function that would run afoul of this. First, if a function is called
that would have its ABI changed, we issue a warning.

Second, if said call is made in a situation where the caller and callee
are known to have different calling conventions (such as the case of
'target'), we instead issue an error.

Differential Revision: https://reviews.llvm.org/D82562
2020-07-01 07:14:31 -07:00
David Sherwood 97a7a9abb2 [CodeGen] Fix up warnings in visitEXTRACT_SUBVECTOR
It's perfectly valid to do certain DAG combines where we extract
subvectors from a concat vector when we have scalable vector types.
However, we can do this in a way that avoids generating compiler
warnings by replacing calls to getVectorNumElements() with
getVectorMinNumElements(). Due to the way subvector extracts are
designed to work with scalable vector types this is ok.

This eliminates some warnings from existing tests in this file:

  llvm/test/CodeGen/AArch64/sve-intrinsics-loads.ll

Differential Revision: https://reviews.llvm.org/D82655
2020-07-01 15:10:53 +01:00
Raphael Isemann f3b5bf3eb7 [lldb] Fix NSDate test after Scalar change
The formatter was requesting an unsigned integer from the ValueObject,
but CFAbsoluteTime is a signed double, so in the NSDate test the formatter
actually just printed the 'error value' date which is the Cocoa epoch. This
started failing after the recent Scalar changes.

This patch just changes the logic to use a signed value which fits to the data
we try to read and avoids this issue.
2020-07-01 16:00:10 +02:00
Nicolas Vasilache 7d9518c800 [mlir][Linalg] Add an option to use Alloca instead of malloc/free pairs.
Summary: A relevant test is also added.

Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, Kayjukh, jurahul, msifontes

Tags: #mlir

Differential Revision: https://reviews.llvm.org/D82959
2020-07-01 09:44:01 -04:00
Pavel Labath a03dc8c9fa [lldb] Add basic -flimit-debug-info support to expression evaluator
Summary:
This patch adds support for evaluation of expressions referring to types
which were compiled in -flimit-debug-info (a.k.a -fno-standalone-debug)
in clang. In this mode it's possible that the debug information needed
to fully describe a c++ type is not present in a single shared library
-- for example debug info for a base class or a member of a type can
only be found in another shared library.  This situation is not
currently handled well within lldb as we are limited to searching within
a single shared library (lldb_private::Module) when searching for the
definition of these types.

The way that this patch gets around this limitation is by doing the
search at a later stage -- during the construction of the expression ast
context. This works by having the parser (currently SymbolFileDWARF, but
a similar approach is probably needed for PDBs too) mark a type as
"forcefully completed". What this means is that the parser has marked
the type as "complete" in the module ast context (as this is necessary
to e.g. derive classes from it), but its definition is not really there.
This is done via a new field on the ClangASTMetadata struct.

Later, when we are importing such a type into the expression ast, we
check this flag. If the flag is set, we try to find a better definition
for the type in other shared libraries. We do this by initiating a
new lookup for the "forcefully completed" classes, which then imports the
type from a module with a full definition.

This patch only implements this handling for base classes, but other
cases (members, array element types, etc.). The changes for that should
be fairly simple and mostly revolve around marking these types as
"forcefully completed" at an approriate time -- the importing logic is
generic already.

Another aspect, which is also not handled by this patch is viewing these
types via the "frame variable" command. This does not use the AST
importer and so it will need to handle these types on its own -- that
will be the subject of another patch.

Differential Revision: https://reviews.llvm.org/D81561
2020-07-01 14:50:14 +02:00
Alexey Bataev e35a5876e4 Revert "[StackSafety,NFC] Remove unneded constexpr"
This reverts commit 38470baa54 because it
breaks builds with lld and gold linkers.
2020-07-01 08:41:45 -04:00
Nathan James 669494e9c0
[clang-tidy] fix cppcoreguidelines-init-variables with catch variables
Ignore catch statement var decls.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D82924
2020-07-01 13:40:20 +01:00
Georgii Rymar 37dd8b6ce5 [llvm-readobj] - Simplify the symbols.test
We are able to use YAML macros to avoid having
4 independent YAML descriptions.

Differential revision: https://reviews.llvm.org/D82942
2020-07-01 15:26:05 +03:00
Simon Pilgrim 65647ed1e5 Pass DIEnumerator APInt args by const reference not value.
Noticed by clang-tidy performance-unnecessary-value-param warning.
2020-07-01 13:16:07 +01:00
Stefan Pintilie b294e00fb0 [PowerPC] Fix for PC Relative call protocol
The situation where the caller uses a TOC and the callee does not
but is marked as clobbers the TOC (st_other=1) was not being compiled
correctly if both functions where in the same object file.

The call site where we had `callee` was missing a nop after the call.
This is because it was assumed that since the two functions where in
the same DSO they would be sharing a TOC. This is not the case if the
callee uses PC Relative because in that case it may clobber the TOC.
This patch makes sure that we add the cnop correctly so that the
linker has a place to restore the TOC.

Reviewers: sfertile, NeHuang, saghir

Differential Revision: https://reviews.llvm.org/D81126
2020-07-01 07:08:41 -05:00
Simon Pilgrim 2c7af6dffc Pass stripNonLineTableDebugInfo remapDebugLoc lambda DebugLoc arg by const reference not value.
Noticed by clang-tidy performance-unnecessary-value-param warning.
2020-07-01 12:37:47 +01:00
Simon Pilgrim b485586482 [X86][SSE] Fix targetShrinkDemandedConstant constant vector sign extensions
D82257/rG3521ecf1f8a3 was incorrectly sign-extending a constant vector from the lsb, this is fine if all the constant elements are 'allsignbits' in the active bits, but if only some of the elements are, then we are corrupting the constant values for those elements.

This fix ensures we sign extend from the msb of the active/demanded bits instead.
2020-07-01 12:12:53 +01:00
gbreynoo 41ca82cbe8 [llvm-size] Output REL, RELA and STRTAB sections when allocatable
gnu size has a number of special cases regarding REL, RELA and STRTAB
sections being considered in size output. To avoid unnecessary
complexity this commit makes llvm size outputs these sections in cases
they have the SHF_ALLOC flag.

Differential Revision: https://reviews.llvm.org/D82479
2020-07-01 12:02:32 +01:00
Simon Pilgrim 93707fe309 [X86][SSE] Add test showing incorrect sign-extension by targetShrinkDemandedConstant 2020-07-01 12:01:19 +01:00
Simon Pilgrim cfb5b144cf Fix Wdocumentation warnings by only tagging a param id once per doxygen comment block. NFC. 2020-07-01 12:01:19 +01:00
Simon Pilgrim 36aaffbf56 Fix Wdocumentation warnings due to outdated parameter list. NFC. 2020-07-01 12:01:18 +01:00
Simon Pilgrim 0144f501a6 AttrBuilder::merge/remove - use const& for iterator values in for-range loops.
Noticed by clang-tidy performance-for-range-copy warning.
2020-07-01 12:01:18 +01:00
Sam Elliott 7dc892661e [RISCV] Implement Hooks to avoid chaining SELECT
Summary:
This implements two hooks that attempt to avoid control flow for RISC-V. RISC-V
will lower SELECTs into control flow, which is not a great idea.

The hook `hasMultipleConditionRegisters()` turns off the following
DAGCombiner folds:
    select(C0|C1, x, y) <=> select(C0, x, select(C1, x, y))
    select(C0&C1, x, y) <=> select(C0, select(C1, x, y), y)

The second hook `setJumpIsExpensive` controls a flag that has a similar purpose
and is used in CodeGenPrepare and the SelectionDAGBuilder.

Both of these have the effect of ensuring more logic is done before fewer jumps.

Note: with the `B` extension, we may be able to lower select into a conditional
move instruction, so at some point these hooks will need to be guarded based on
enabled extensions.

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D79268
2020-07-01 11:56:31 +01:00
Sam Elliott c44266dc48 [RISCV][NFC] Add Test for (select (or B1, B2), X, Y)
Summary:
As shown, LLVM is keen to avoid logic and introduce selects (in DAGCombiner, and
other places). This leads to control flow on RISC-V which we should attempt to
avoid.

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D79267
2020-07-01 11:56:11 +01:00
Adam Balogh c79745ed48 [Analyzer] Quick fix for broken tests on Windows 2020-07-01 12:52:47 +02:00
Kirill Bobyrev 22a3e4055f [clangd] Set gRPC deadlines to all remote index requests
Summary: "TL;DR: Always set a deadline.", https://grpc.io/blog/deadlines/

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82844
2020-07-01 12:46:29 +02:00
Med Ismail Bennani f70cad2612
[lldb/api] Improve error reporting in SBBreakpoint::AddName (NFCI)
This patch improves the error reporting for SBBreakpoint::AddName by
adding a new method `SBBreakpoint::AddNameWithErrorHandling` that returns
a SBError instead of a boolean.

This way, if the breakpoint naming failed in the backend, the client
(i.e. Xcode), will be able to report the reason of that failure to the
user.

rdar://64765461

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2020-07-01 12:45:05 +02:00
Med Ismail Bennani a61f62a7b6 Revert "[lldb/api] Improve error reporting in SBBreakpoint::AddName (NFCI)"
This reverts commit 56bb1d1755.
2020-07-01 12:41:32 +02:00
Med Ismail Bennani 56bb1d1755 [lldb/api] Improve error reporting in SBBreakpoint::AddName (NFCI)
This patch improves the error reporting for SBBreakpoint::AddName by
adding a new method `SBBreakpoint::AddNameWithErrorHandling` that returns
a SBError instead of a boolean.

This way, if the breakpoint naming failed in the backend, the client
(i.e. Xcode), will be able to report the reason of that failure to the
user.

rdar://64765461

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2020-07-01 12:37:00 +02:00
Daniel Kiss 070acb1d1e [Driver][ARM] parse version of arm/thumb architecture correctly
Summary:
If you execute the following commandline multiple times, the behavior was not always the same:
  clang++ --target=thumbv7em-none-windows-eabi-coff -march=armv7-m -mcpu=cortex-m7 -o temp.obj -c -x c++ empty.cpp

Most of the time the compilation succeeded, but sometimes clang reported this error:
  clang++: error: the target architecture 'thumbv7em' is not supported by the target 'thumbv7em-none-windows-eabi'

The cause of the inconsistent behavior was the uninitialized variable Version.

With these commandline arguments, the variable Version was not set by getAsInteger(),
because it cannot parse a number from the substring "7em" (of "thumbv7em").
To get a consistent behaviour, it's enough to initialize the variable Version to zero.
Zero is smaller than 7, so the comparison will be true.
Then the command always fails with the error message seen above.

By using consumeInteger() instead of getAsInteger() we get 7 from the substring "7em"
and the command does not fail.

Reviewers: compnerd, danielkiss

Reviewed By: danielkiss

Subscribers: danielkiss, kristof.beyls, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D75453
2020-07-01 12:13:52 +02:00
Vitaly Buka 8180a39965 [StackSafety,NFC] Remove expensive assert
Differential Revision: https://reviews.llvm.org/D80908
2020-07-01 02:54:27 -07:00
Vitaly Buka 38470baa54 [StackSafety,NFC] Remove unneded constexpr
Differential Revision: https://reviews.llvm.org/D80908
2020-07-01 02:54:27 -07:00
Petar Avramovic 4b9ae1b7e5 AMDGPU/GlobalISel: Select init_exec intrinsic
Change imm with timm in pattern for SI_INIT_EXEC_LO and
remove regbank mappings for non register operands.

Differential Revision: https://reviews.llvm.org/D82885
2020-07-01 11:50:59 +02:00