1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
Commit Graph

206789 Commits

Author SHA1 Message Date
Heejin Ahn
fb835643a1 [WebAssembly] Rename atomic.notify and *.atomic.wait
- atomic.notify -> memory.atomic.notify
- i32.atomic.wait -> memory.atomic.wait32
- i64.atomic.wait -> memory.atomic.wait64

See https://github.com/WebAssembly/threads/pull/149.

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D91447
2020-11-13 12:04:48 -08:00
Guozhi Wei
e65607b8ff [AlwaysInliner] Call mergeAttributesForInlining after inlining
Like inlineCallIfPossible and InlinerPass, after inlining mergeAttributesForInlining
should be called to merge callee's attributes to caller. But it is not called in
AlwaysInliner, causes caller's attributes inconsistent with inlined code.

Attached test case demonstrates that attribute "min-legal-vector-width"="512" is
not merged into caller without this patch, and it causes failure in SelectionDAG
when lowering the inlined AVX512 intrinsic.

Differential Revision: https://reviews.llvm.org/D91446
2020-11-13 12:01:35 -08:00
Craig Topper
74d7f5951b [RISCV] Add test case for failure to use GREVIW for i32 bswap if result is not sign extended. NFC 2020-11-13 11:59:12 -08:00
Jianzhou Zhao
a69c398ebc Extend the dfsan store/load callback with write/read address
This helped debugging.

Reviewed-by: morehouse

Differential Revision: https://reviews.llvm.org/D91236
2020-11-13 19:46:32 +00:00
Craig Topper
1de19f0131 [RISCV] Add RORW/ROLW/RORIW/ROLIW test cases that don't sign extend the result. NFC
This shows that we currently fail to select RORIW/ROLIW.
2020-11-13 10:59:32 -08:00
Baptiste Saleil
f21e542c3b [PowerPC] Add paired vector load and store builtins and intrinsics
This patch adds the Clang builtins and LLVM intrinsics to load and store vector pairs.

Differential Revision: https://reviews.llvm.org/D90799
2020-11-13 12:35:10 -06:00
Jessica Paquette
ea446fa791 [AArch64][GlobalISel] Select G_SELECT cc, t, (G_SUB 0, x) -> CSNEG t, x, cc
When we see

```
%sub = G_SUB 0, %x
%select = G_SELECT %cc, %t, %sub
```

Fold away the G_SUB by producing

```
%select = CSNEG %t, %x, cc
```

Simple IR example: https://godbolt.org/z/K8TEnh

This is valid on both sides of the select, but for now, just handle one side.
It may make more sense to handle swapping sides during post-legalizer lowering.

Differential Revision: https://reviews.llvm.org/D90723
2020-11-13 10:12:51 -08:00
Nikita Popov
94141ff663 [Local] Emit nsw for inbounds offset calculation
In line with D90708, we can use nsw for the inbounds offset
calculation -- the muls were already using nsw, but the adds were
not.
2020-11-13 18:39:46 +01:00
Jessica Paquette
ea9106c312 [AArch64][GlobalISel] NFC: Use CmpInst::isUnsigned instead of static helper
Reducing some code duplication.

We had a helper for checking if a predicate is unsigned. Remove that and use
the existing function in Instructions.cpp.

Differential Revision: https://reviews.llvm.org/D91288
2020-11-13 09:35:42 -08:00
Wouter van Oortmerssen
fcaec2bb33 [WebAssembly] Added R_WASM_FUNCTION_OFFSET_I64 for use with DWARF DW_AT_low_pc
Needed for wasm64, see discussion in https://reviews.llvm.org/D91203

Differential Revision: https://reviews.llvm.org/D91395
2020-11-13 09:32:31 -08:00
Simon Pilgrim
ba4efb3482 [CostModel][X86] Remove unused CHECK prefixes
Allows us to remove the "CHECK: {{^}}" hack and help simplify D91275
2020-11-13 17:31:48 +00:00
Nikita Popov
aad72ef238 [Local] Clean up EmitGEPOffset
Handle the emission of the add in a single place, instead of three
different ones.

Don't emit an unnecessary add with zero to start with. It will get
dropped by InstCombine, but we may as well not create it in the
first place. This also means that InstCombine does not need to
specially handle this extra add.

This is conceptually NFC, but can affect worklist order etc.
2020-11-13 18:30:56 +01:00
Yuanfang Chen
06613d74b4 [CGProfile] allows bitcast in metadata node storing function pointers
For example,  during RAUW in IRMover, the `Function` ValueAsMetadata in "CG Profile" could become bitcast.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D88433
2020-11-13 09:28:21 -08:00
Jessica Paquette
18f4a04bc7 [GlobalISel] Add matchers for specific constants and a matcher for negations
It's fairly common to need matchers for a specific constant value, or for
common idioms like finding a negated register.

Add

- `m_SpecificICst`, which returns true when matching a specific value..
- `m_ZeroInt`, which returns true when an integer 0 is matched.
- `m_Neg`, which returns when a register is negated.

Also update a few places which use idioms related to the new matchers.

Differential Revision: https://reviews.llvm.org/D91397
2020-11-13 09:24:54 -08:00
Nikita Popov
318f4a3446 [SCEV] Fix nsw flags for GEP expressions
The SCEV code for constructing GEP expressions currently assumes
that the addition of the base and all the offsets is nsw if the GEP
is inbounds. While the addition of the offsets is indeed nsw, the
addition to the base address is not, as the base address is
interpreted as an unsigned value.

Fix the GEP expression code to not assume nsw for the base+offset
calculation. However, do assume nuw if we know that the offset is
non-negative. With this, we use the same behavior as the
construction of GEP addrecs does. (Modulo the fact that we
disregard SCEV unification, as the pre-existing FIXME points out).

Differential Revision: https://reviews.llvm.org/D90648
2020-11-13 18:19:32 +01:00
Arthur Eubanks
27a2f57976 [gn build] Port 8741a76f 2020-11-13 09:17:52 -08:00
Nikita Popov
e77af18e2d [ValueTracking] Don't set nsw flag for inbounds addition
When computing the known bits for a GEP, don't set the nsw flag
when adding an offset to an address. The nsw flag only applies to
pure offset additions (see also D90708).

The nsw flag is only used in a very minor way by the code, to the
point that I was not able to come up with a test case where it
makes a difference.

Differential Revision: https://reviews.llvm.org/D90637
2020-11-13 17:58:21 +01:00
Nikita Popov
effaed5675 [LangRef] Clarify GEP inbounds wrapping semantics
Clarify the semantics of GEP inbounds, in particular with regard
to what it means for wrapping. This cleans up some confusion on
when it is legal to apply nuw/nsw flags to various parts of the
GEP calculation.

Differential Revision: https://reviews.llvm.org/D90708
2020-11-13 17:49:41 +01:00
Simon Pilgrim
88d2ac2817 [KnownBits] Merge the minimum shift amount and leading/trailing shift value bits handling.
By starting with the source shift value minimum leading/trailing bits, we can then add the minimum known shift amount to more accurately predict the minimum leading/trailing bits of the result.

This is currently only covered by the exhaustive unit tests in KnownBitsTests.cpp, but will help with some of the regressions encountered in D90479 (PR44526).
2020-11-13 16:40:20 +00:00
Matt Arsenault
3cd3307a93 AMDGPU/GlobalISel: Regenerate some checks
Fixes indentation confusing diff in future patch.
2020-11-13 11:29:15 -05:00
Matt Arsenault
b3aa28b9d4 AMDGPU: Factor out large flat offset splitting 2020-11-13 11:22:13 -05:00
Nico Weber
79a7d81750 [gn build] (semi-manually) Port 6a8099e0f61 2020-11-13 11:20:23 -05:00
Matt Arsenault
7cce5d6f46 GlobalISel: Directly expose getDefSrcRegIgnoringCopies utility
It's useful to get both the instruction and register at the same time.
2020-11-13 11:07:04 -05:00
Sam Clegg
258639659d [WebAssembly] Add new relocation type for TLS data symbols
These relocations represent offsets from the __tls_base symbol.

Previously we were just using normal MEMORY_ADDR relocations and relying
on the linker to select a segment-offset rather and absolute value in
Symbol::getVirtualAddress().  Using an explicit relocation type allows
allow us to clearly distinguish absolute from relative relocations based
on the relocation information alone.

One place this is useful is being able to reject absolute relocation in
the PIC case, but still accept TLS relocations.

Differential Revision: https://reviews.llvm.org/D91276
2020-11-13 07:59:29 -08:00
Matt Arsenault
5020d4daa4 AMDGPU: Refactor getBaseWithOffsetUsingSplitOR usage 2020-11-13 10:58:17 -05:00
Djordje Todorovic
45f4cb27da [NFC][IntrRefLDV] Remove dead code from transferSpillOrRestoreInst()
Differential Revision: https://reviews.llvm.org/D90852
2020-11-13 07:53:54 -08:00
David Zarzycki
415068acba Revert "[NFC] Move code between functions as a preparation step for further improvement"
This reverts commit 08016ac32b746b27be43d92255bf22a12012e244.

A bunch of tests are failing my local two stage builder.
2020-11-13 10:52:49 -05:00
Sam Clegg
fe7aa827bd [lld][WebAssembly] Add test for TLS BSS data. NFC.
Differential Revision: https://reviews.llvm.org/D91231
2020-11-13 07:52:18 -08:00
Nico Weber
351cccb545 [gn build] more hotfix after 17df195f70 to unbreak llvm-config tests 2020-11-13 10:03:05 -05:00
Paul C. Anagnostopoulos
82f80b36cd [TableGen] Enhance the six comparison bang operators.
Update the Programmer's Reference.

Differential Revision: https://reviews.llvm.org/D91036
2020-11-13 09:57:27 -05:00
serge-sans-paille
f115c30ea5 llvmbuildectomy - remove conflict file 2020-11-13 15:56:05 +01:00
Nico Weber
5a29fda5e7 [gn build] Port 8bb6347939b 2020-11-13 09:55:24 -05:00
serge-sans-paille
4616e3954c llvmbuildectomy - support disabled native target 2020-11-13 15:50:13 +01:00
Nico Weber
bc1485d26a [gn build] (manually) merge 1d0676b54c4e3 2020-11-13 09:41:19 -05:00
Nico Weber
843410425e [gn build] Hotfix to unbreak build after 9218ff50f9308 2020-11-13 09:26:43 -05:00
Piotr Sobczak
b363f67c95 [DivergenceAnalysis] Use addRequiredTransitive
For querying divergence the chained analysis passes are required
to be alive, for instance LoopInfoWrapperPass.

Ensure that by using addRequiredTransitive.

Differential Revision: https://reviews.llvm.org/D91335
2020-11-13 14:40:00 +01:00
serge-sans-paille
ae7304bdea llvmbuildectomy - compatibility with ocaml bindings
Use exact component name in add_ocaml_library.
Make expand_topologically compatible with new architecture.
Fix quoting in is_llvm_target_library.
Fix LLVMipo component name.
Write release note.
2020-11-13 14:35:52 +01:00
Florian Hahn
041da6277f Add !annotation metadata and remarks pass.
This patch adds a new !annotation metadata kind which can be used to
attach annotation strings to instructions.

It also adds a new pass that emits summary remarks per function with the
counts for each annotation kind.

The intended uses cases for this new metadata is annotating
'interesting' instructions and the remarks should provide additional
insight into transformations applied to a program.

To motivate this, consider these specific questions we would like to get answered:

* How many stores added for automatic variable initialization remain after optimizations? Where are they?
* How many runtime checks inserted by a frontend could be eliminated? Where are the ones that did not get eliminated?

Discussed on llvm-dev as part of 'RFC: Combining Annotation Metadata and Remarks'
(http://lists.llvm.org/pipermail/llvm-dev/2020-November/146393.html)

Reviewed By: thegameg, jdoerfert

Differential Revision: https://reviews.llvm.org/D91188
2020-11-13 13:24:10 +00:00
Hans Wennborg
5404bc49f5 Revert "[AsmPrinter] fix -disable-debug-info option"
The test fails on Mac, see comment on the code review.

> This option was in a rather convoluted place, causing global parameters
> to be set in awkward and undesirable ways to try to account for it
> indirectly. Add tests for the -disable-debug-info option and ensure we
> don't print unintended markers from unintended places.
>
> Reviewed By: dstenb
>
> Differential Revision: https://reviews.llvm.org/D91083

This reverts commit 9606ef03f03904cec213db031b5ea6fd6052dc5d.
2020-11-13 13:46:13 +01:00
Jan Svoboda
506cd0f5d7 Reland [clang][cli] Port ObjCMTAction to new option parsing system
Merge existing marhsalling info kinds and add some primitives to
express flag options that contribute to a bitfield.

Depends on D82574

Original patch by Daniel Grumberg.

Reviewed By: Bigcheese

Differential Revision: https://reviews.llvm.org/D82860
2020-11-13 13:42:54 +01:00
Simon Atanasyan
7f523a31e8 [MC][mips] Remove unused check prefixes. NFC 2020-11-13 14:31:13 +03:00
Simon Atanasyan
f7aab6bccf [mips] Add tests to check disassembling of add.ps/mul.ps/sub.ps instructions 2020-11-13 14:31:12 +03:00
Yvan Roux
61b6c3664a [UpdateTestChecks] Fix $ in function test for ARM.
Removes AArch64 target checking inside 32bit ARM test to bring back
buildbots to a green state.  But $ are not well handled for ARM and it
still need to be fixed.
2020-11-13 12:26:56 +01:00
Kerry McLaughlin
c26a89a1b4 [SVE][CodeGen] Improve codegen of scalable masked scatters
If the scatter store is able to perform the sign/zero extend of
its index, this is folded into the instruction with refineIndexType().
Additionally, refineUniformBase() will return the base pointer and index
from an add + splat_vector.

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D90942
2020-11-13 11:19:36 +00:00
Max Kazantsev
69f353da9d [NFC] Move code between functions as a preparation step for further improvement 2020-11-13 18:12:45 +07:00
Simon Pilgrim
fe58ed0a0d [ValueTracking] computeKnownBitsFromShiftOperator use KnownBits direct for constant shift amounts.
Let KnownBits shift handlers deal with out-of-range shift amounts.
2020-11-13 10:54:35 +00:00
Max Kazantsev
cc07518ff3 [NFC] Refactor lambda into static function 2020-11-13 17:42:23 +07:00
Simon Pilgrim
16ce8e35dd Fix MSVC signed/unsigned comparison warning. NFCI. 2020-11-13 10:20:48 +00:00
Kazushi (Jam) Marukawa
c5d772e8d0 [VE] Add vst intrinsic instructions
Add vst intrinsic instructions and a regression test.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D91406
2020-11-13 19:11:57 +09:00
Max Kazantsev
74132baa0c [NFC] Move lambdae into static functions 2020-11-13 17:07:25 +07:00