Commit Graph

351862 Commits

Author SHA1 Message Date
Ayke van Laethem 8aad119d93
[AVR] Do not place functions in .progmem.data
Previously, the AVR backend would put functions in .progmem.data. This
is probably a regression from when functions still lived in address
space 0. With this change, only global constants are placed in
.progmem.data.

This is not complete: avr-gcc additionally respects -fdata-sections for
progmem global constants, which LLVM doesn't yet do. But fixing that is
a bit more complicated (and I believe other backends such as RISC-V
might also have similar issues).

Differential Revision: https://reviews.llvm.org/D78212
2020-04-20 13:56:38 +02:00
Ayke van Laethem 9505b5cb66
[AVR] Do not use divmod calls for bigger integers
The avr-libc provides *divmodqi4, *divmodhi4, and *divmodsi4 functions,
but does not provide a *divmoddi4. Instead it provides regular *divdi3
and *moddi3 functions.

Note that avr-libc doesn't support *divti3 or *modti3 for 128-bit
integer manipulation.

Source:
https://github.com/gcc-mirror/gcc/blob/releases/gcc-5.4.0/libgcc/config/avr/lib1funcs.S

Differential Revision: https://reviews.llvm.org/D78437
2020-04-20 13:56:38 +02:00
Georgii Rymar 76e0ab23f6 [FileCheck] - Refactor the code related to string arrays. NFCI.
There are few `std::vector<std::string>` members in
`FileCheckRequest`. This patch changes these arrays to `std::vector<StringRef>`
and refactors the code related to cleanup/improve/simplify it.

Differential revision: https://reviews.llvm.org/D78202
2020-04-20 14:54:49 +03:00
Georgii Rymar 1c57752ff5 [obj2yaml] - Teach obj2yaml to dump SHT_NOBITS sections when dumping program headers.
SHT_NOBITS are a bit special because occupy no physical space.
This patch adds support for them.

Differential revision: https://reviews.llvm.org/D77805
2020-04-20 14:35:28 +03:00
Georgii Rymar e19628fde5 [llvm-readobj] - Fix crashes and misbehaviors when reading strings from broken string tables.
There are cases when we either might print garbage or crash when
reading strings for dumping dynamic tags.

For example when a string table is not null-terminated or goes past the EOF.
This patch fixes issues mentioned.

Differential revision: https://reviews.llvm.org/D77216
2020-04-20 14:14:17 +03:00
Simon Pilgrim 4ba7ae85da X86Subtarget.h - remove unused includes. NFC.
Replace with forward declarations.
2020-04-20 12:10:45 +01:00
Dmitry Preobrazhensky 4a983b25bf [MC][DWARF] Corrected handling of is_stmt flag in .loc directives
According to DWARF standard, is_stmt is a global flag; when set or cleared it should affect subsequent .loc directives.

However llvm assembler handled is_stmt differently: it forced all locations to have is_stmt=1 unless is_stmt was specified explicitly as 0.

The fix utilizes current DWARF state flags to compute correct is_stmt values.

See https://bugs.llvm.org/show_bug.cgi?id=45529 for a detailed issue description.

Reviewers: arsenm, probinson, enderby

Differential Revision: https://reviews.llvm.org/D78102
2020-04-20 13:57:49 +03:00
Simon Pilgrim 2cfcbc52c3 X86Subtarget.cpp - sort includes. NFC
Ensure X86Subtarget.h module header is at the top, and sort the remaining includes.
2020-04-20 11:54:04 +01:00
Simon Pilgrim 179dced13b X86MCTargetDesc.h - remove unnecessary MCStreamer.h include. NFC.
We don't need all of MCStreamer.h, just FormattedStream.h. The rest can be replaced with forward declarations.
X86WinAllocaExpander.cpp had an implicit dependency on MapVector.h which I've added locally.
2020-04-20 11:39:38 +01:00
Simon Pilgrim 44cf9b85ad X86MCAsmInfo.h - remove unnecessary MCAsmInfo.h include. NFC.
We only use the COFF/Darwin/ELF classes directly.
2020-04-20 11:39:38 +01:00
Simon Pilgrim da3bf811be X86InstrFoldTables.h - remove unnecessary include. NFC.
We don't need the limits defines, just the sized integer types so use cstdint system header directly.
2020-04-20 11:39:38 +01:00
Kerry McLaughlin 33ffce5414 [AArch64][SVE] Remove LD1/ST1 dependency on llvm.masked.load/store
Summary:
The SVE masked load and store intrinsics introduced in D76688 rely on
common llvm.masked.load/store nodes. This patch creates new ISD nodes
for LD1(S) & ST1 to remove this dependency.

Additionally, this adds support for sign & zero extending
loads and truncating stores.

Reviewers: sdesmalen, efriedma, cameron.mcinally, c-rhodes, rengolin

Reviewed By: efriedma

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, danielkiss, andwar, cfe-commits, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78204
2020-04-20 11:08:11 +01:00
Valeriy Savchenko 1f67508b7f [analyzer] Do not report CFError null dereference for nonnull params.
We want to trust user type annotations and stop assuming pointers declared
as nonnull still can be null. This functionality is implemented as part
of NonNullParamChecker because it already checks parameter attributes.
Whenever we start analyzing a new function, we assume that all parameters
with 'nonnull' attribute are indeed non-null.

Patch by Valeriy Savchenko!

Differential Revision: https://reviews.llvm.org/D77806
2020-04-20 12:33:01 +03:00
Valeriy Savchenko 09a1f09050 [analyzer] Do not report NSError null dereference for _Nonnull params.
We want to trust user type annotations and stop assuming pointers declared
as _Nonnull still can be null. This functionality is implemented as part
of NullabilityChecker as it already tracks non-null types.

Patch by Valeriy Savchenko!

Differential Revision: https://reviews.llvm.org/D77722
2020-04-20 12:33:01 +03:00
Florian Hahn fa284e136e [VPlan] Clean up tryToCreate(Widen)Recipe. (NFC)
This patch includes some clean-ups to tryToCreateRecipe, suggested in
D77973.

It includes:
  * Renaming tryToCreateRecipe to tryToCreateWidenRecipe.
  * Move VPBB insertion logic to caller of tryToCreateWidenRecipe.
  * Hoists instruction checks to tryToCreateWidenRecipe, making it
    clearer which instructions are handled by which recipe, simplifying
    the checks by using early exits.
  * Split up handling of induction PHIs and truncates using inductions.

Reviewers: gilr, rengolin, Ayal, hsaito

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D78287
2020-04-20 10:06:35 +01:00
Sam Parker 62f97123fb [ARM][MVE] Add patterns for VRHADD
Add patterns which use standard add nodes along with arm vshr imm
nodes.

Differential Revision: https://reviews.llvm.org/D77069
2020-04-20 10:05:21 +01:00
Mark Murray 3ce0ad1b33 [ARM][MC][Thumb] Revert relocation for some pc-relative fixups.
Summary:
This commit reverts https://reviews.llvm.org/D75039. Concensus appears to
be in favour of assembly-time resolution of these ADR and LDR relocations,
in line with GNU.

Reviewers: psmith

Subscribers: kristof.beyls, hiraditya, danielkiss, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78301
2020-04-20 09:38:12 +01:00
Florian Hahn 4331b3812a [PredicateInfo] Use new Instruction::comesBefore instead of OI (NFC).
The recently added Instruction::comesBefore can be used instead of
OrderedInstructions.

Reviewers: rnk, nikic, efriedma

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D78452
2020-04-20 09:22:21 +01:00
Alexander Belyaev def3e10eac [MLIR] Add #include "llvm/ADT/SmallPtrSet.h" back to LoopUtils.h. 2020-04-20 10:21:18 +02:00
Sam Parker e3056ae9a0 [NFC][TTI] Explicit use of VectorType
The API for shuffles and reductions uses generic Type parameters,
instead of VectorType, and so assertions and casts are used a lot.
This patch makes those types explicit, which means that the clients
can't be lazy, but results in less ambiguity, and that can only be a
good thing.

Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=45562

Differential Revision: https://reviews.llvm.org/D78357
2020-04-20 09:16:52 +01:00
Kang Zhang a8e15ee04a [CodeGen] Support freeze expand for ppc_fp128
Summary:
The patch D29014 has added the new ISD::FREEZE and can deal with the
integer.
The patch D76980 has added SoftenFloatRes_FREEZE for float point.
But we still lack of expand for ppc_fp128, this will cause assertion for
some cases.
This patch is to support freeze expand for ppc_fp128.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D78278
2020-04-20 07:27:41 +00:00
Alexander Belyaev ad9988f4da [MLIR] Move `replaceAllUsesExcept` from LoopUtil.h to Value.h.
Differential Revision: https://reviews.llvm.org/D78426
2020-04-20 09:21:06 +02:00
Craig Topper 53ee8fbc23 [CallSite removal][SCCP] Use CallBase instead of CallSite. NFC
Differential Revision: https://reviews.llvm.org/D78470
2020-04-20 00:16:09 -07:00
Kadir Cetinkaya 3be73dfde7
[clangd][test] Make sed git bash compliant 2020-04-20 08:27:15 +02:00
Craig Topper e13c0b650a [CallSite removal][Analysis] Use CallBase instead of CallSite in SparsePropagation unit test. NFC 2020-04-19 22:39:24 -07:00
Craig Topper 4cf6d4ab48 [CallSite removal][CalledValuePropagation] Use CallBase instead of CallSite. NFC
Differential Revision: https://reviews.llvm.org/D78467
2020-04-19 22:05:40 -07:00
David Blaikie 12489b5474 llvm-dwarfdump: Fix UB (unsequenced writes) introduced in e0fd87cc64
Unsequenced write due to "x &= f()" where 'f()' modifies 'x'.

Detected by the llvm-clang-x86_64-expensive-checks-win buildbot.
Investigated/identified by Galina - thanks!
2020-04-19 21:35:04 -07:00
Max Kazantsev 204c0bbe7f [Test] Fix test failure: platform-dependent printout 2020-04-20 10:27:50 +07:00
Xiang1 Zhang 0980038a5e Handle CET for -exception-model sjlj
Summary:
In SjLj exception mode, the old landingpad BB will create a new landingpad BB and use indirect branch jump to the old landingpad BB in lowering.
So we should add 2 endbr for this exception model.

Reviewers: hjl.tools, craig.topper, annita.zhang, LuoYuanke, pengfei, efriedma

Reviewed By: LuoYuanke

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77124
2020-04-20 11:13:40 +08:00
Bill Wendling edcfc391e1 [Object] Use BFD name for little-endian PowerPC64
Summary:
Little-endian PowerPC object files should report "elf64-powerpcle" instead of
"elf64-powerpc".

Reviewers: jhenderson, MaskRay, espindola, alexshap, rupprecht, #powerpc

Reviewed By: MaskRay

Subscribers: wuzish, emaste, nemanjai, shchenz, steven.zhang, llvm-commits

Tags: #llvm, #powerpc

Differential Revision: https://reviews.llvm.org/D78344
2020-04-19 20:10:05 -07:00
Max Kazantsev 80cd36ed63 [Test] Add a test showing how CFG analyses are invalidated after LV
It demonstrates that, even if LV does no actual vectorization and only
forms LCSSA, CFG analyses get dropped.
2020-04-20 09:38:49 +07:00
Shengchen Kan b78c3c89c2 [X86][MC][NFC] Reduce the parameters of functions in X86MCCodeEmitter(Part III)
Summary:
When we encode an instruction, we need to know the number of bytes being
emitted to determine the fixups in `X86MCCodeEmitter::emitImmediate`.
There are only two callers for `emitImmediate`: `emitMemModRMByte` and
`encodeInstruction`.

Before this patch, we kept track of the current byte being emitted
by passing a reference parameter `CurByte` across all the `emit*`
funtions, which is ugly and unnecessary. For example, we don't have any
fixups when emitting prefixes, so we don't need to track this value.

In this patch, we use `StartByte` to record the initial status of the
streamer, and use `OS.tell()` to get the current status of the streamer
when we need to know the number of bytes being emitted. On one hand,
this eliminates the parameter `CurByte` for most `emit*` functions, on
the other hand, this make things clear: Only pass the parameter when we
really need it.

Reviewers: craig.topper, pengfei, MaskRay

Reviewed By: craig.topper, MaskRay

Subscribers: hiraditya, llvm-commits, annita.zhang

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78419
2020-04-20 10:03:41 +08:00
Craig Topper 4ecc8fb7eb [CallSite removal][WebAssembly] Replace CallSite with CallBase in WebAssemblyOptimizeReturned.
Differential Revision: https://reviews.llvm.org/D78451
2020-04-19 18:32:52 -07:00
Craig Topper 252873879e [CallSite removal][Analysis] Replace CallSite with CallBase in MemoryBuiltins. NFC
Differential Revision: https://reviews.llvm.org/D78449
2020-04-19 18:32:48 -07:00
Craig Topper dff18c79f2 [CallSite removal][Lint] Replace visitCallSite with visitCallBase. NFC
Drop visitCallInst/visitInvokeInst since the generic implementation
will delegate to visitCallBase. They appear to be from a time
before visitCallSite existed in the InstVisitor system.

Differential Revision: https://reviews.llvm.org/D78448
2020-04-19 18:32:40 -07:00
Craig Topper d7e2d937bc [X86] Add X86ISD nodes for PDEP and PEXT.
This will allow use to add DAG combines for these instructions.
2020-04-19 16:14:13 -07:00
Craig Topper 744eaa7a3f [CallSite removal][AMDGPU] Use CallBase instead of CallSite in AMDGPUFixFunctionBitcasts. NFC 2020-04-19 15:21:02 -07:00
Simon Pilgrim a938c7b9ed X86CallLowering.h - remove unnecessary ArrayRef.h include. NFC. 2020-04-19 21:25:10 +01:00
Simon Pilgrim 69062a1cf6 SectionMemoryManager.h - remove unnecessary StringRef.h include. NFC. 2020-04-19 21:25:10 +01:00
Nikita Popov f52e050757 [LVI] Use Optional instead of out parameter (NFC)
As suggested on D76788, this switches the LVI implementation to
return Optional<ValueLatticeElement> from various methods, instead
of passing in a ValueLatticeElement reference and returning a boolean.

Differential Revision: https://reviews.llvm.org/D78383
2020-04-19 21:17:43 +02:00
Florian Hahn a7aaadc135 [TTI] Clean up includes (NFC).
Remove some unnecessary includes, replace some with forward
declarations.

This also exposed a few places that were missing some includes.
2020-04-19 20:11:59 +01:00
Florian Hahn 32af48cdcf [IVDescriptors] Clean up includes.
Some includes are not required and forward declarations can be used
instead. This also exposed a few places that were not directly including
required files.
2020-04-19 20:07:47 +01:00
Florian Hahn 7a87e8f90b [LoopUtils] Clean up includes, use forward decls if appropriate (NFC).
Most of the includes in LoopUtils.h are not required in the header and
they can be replaced by forward declarations.

Unfortunately includes of TargetTransformInfo.h and IVDescriptors.h pull
in a bunch of additional things, but there is no easy way to get rid of
them at the moment I think.
2020-04-19 19:44:29 +01:00
Mehdi Amini 73c33fcf56 Fix one more link for a Rationale doc moved under Rationale/ 2020-04-19 17:03:35 +00:00
Simon Pilgrim 330162c5a6 DependenceGraphBuilder.h - remove unused includes. NFC.
Replace with forward declarations.
2020-04-19 17:58:17 +01:00
Mehdi Amini 9909424544 Fix documentation link to MlirSpirvAbi
Differential Revision: https://reviews.llvm.org/D78394
2020-04-19 16:53:19 +00:00
Mehdi Amini 040fd340fa Fix one more doc links after moving the document under Tutorials 2020-04-19 16:52:05 +00:00
Mehdi Amini 0f5440cfaf Fix more broken doc links after some moved under the Rationale category 2020-04-19 16:49:30 +00:00
Simon Pilgrim 8859c7f6eb X86MachineFunctionInfo.h - remove unused include. NFC. 2020-04-19 16:58:59 +01:00
Simon Pilgrim c27fdc84df X86InstrInfo.h - remove unused forward declarations. NFC. 2020-04-19 16:58:59 +01:00