1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
Commit Graph

197976 Commits

Author SHA1 Message Date
Sanjay Patel
b868a972c1 [InstCombine] add tests for bitmask of casted shift; NFC (PR46013) 2020-06-07 09:33:18 -04:00
Simon Pilgrim
320b88c87c AlignmentFromAssumptions.h - reduce includes to forward declarations. NFC. 2020-06-07 13:51:48 +01:00
Simon Pilgrim
fa03afb24a MemorySSAUpdater.h - reduce includes to forward declarations. NFC. 2020-06-07 13:16:31 +01:00
Simon Pilgrim
2b3e248011 DependenceAnalysis.h - reduce AliasAnalysis.h include to forward declaration. NFC.
This requires the replacement of legacy class AliasAnalysis usages with AAResults (which it typedefs to anyhow)
2020-06-07 12:47:37 +01:00
Simon Pilgrim
abbce6f7c9 MustExecute.h - remove unnecessary Instruction.h include. NFC.
We already have the Instruction forward declaration.
2020-06-07 12:10:50 +01:00
Simon Pilgrim
5f8966d8e8 ObjCARCAnalysisUtils.h - remove unused LLVMContext.h include. NFC. 2020-06-07 11:48:46 +01:00
Simon Pilgrim
7ab3b616d7 OrderedInstructions.h - reduce includes to forward declarations. NFC. 2020-06-07 11:44:43 +01:00
Simon Pilgrim
a1faba689a [X86][SSE] Extend ICMP(MOVMSK(BITCAST(X))) tests to allof patterns as well as the existing noneof/anyof patterns. 2020-06-07 11:44:43 +01:00
Simon Pilgrim
b965f99cbd [X86][SSE] Attempt to widen MOVMSK vector input if the signbits are splatted.
As shown on PR37087, if we have a MOVMSK(BICAST(X)) from a wider vector, then by using MOVMSK from the wider type (32/64-bit elements) we can improve the chances of further combines with SimplifyDemandedBits/Elts and on some targets (skylake) can be more efficient.
2020-06-07 11:44:43 +01:00
Florian Hahn
0121122c2a [Matrix] Implement * binary operator for MatrixType.
This patch implements the * binary operator for values of
MatrixType. It adds support for matrix * matrix, scalar * matrix and
matrix * scalar.

For the matrix, matrix case, the number of columns of the first operand
must match the number of rows of the second. For the scalar,matrix variants,
the element type of the matrix must match the scalar type.

Reviewers: rjmccall, anemet, Bigcheese, rsmith, martong

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D76794
2020-06-07 11:11:27 +01:00
Simon Pilgrim
34905f2907 [X86][SSE] Add MOVMSK tests where we're using a more narrow vector elements than necessary
First step towards fixing PR37087
2020-06-07 10:48:11 +01:00
Xing GUO
897dc4d341 [ObjectYAML][DWARF] Support emitting .debug_ranges section in ELFYAML.
This patch enables yaml2elf to emit the .debug_ranges section.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D81217
2020-06-07 15:47:47 +08:00
Fangrui Song
a7a8160485 [gcov] Improve tests and lower the minimum supported version to gcov 3.4
global-ctor.ll no longer checks what it intended to check
(@_GLOBAL__sub_I_global-ctor.ll needs a !dbg to work).
Rewrite it.

gcov 3.4 and gcov 4.2 use the same format, thus we can lower the version
requirement to 3.4
2020-06-06 23:11:32 -07:00
Fangrui Song
c36c2475a2 [gcov] Delete unneeded code 2020-06-06 20:36:46 -07:00
James Y Knight
ae071ee9e2 Simplify MachineVerifier's block-successor verification.
There's two properties we want to verify:

1. That the successors returned by analyzeBranch are in the CFG
   successor list, and
2. That there are no extraneous successors are in the CFG successor
   list.

The previous implementation mostly accomplished this, but in a very
convoluted manner.

Differential Revision: https://reviews.llvm.org/D79793
2020-06-06 22:30:51 -04:00
James Y Knight
f92fad214d MachineBasicBlock::updateTerminator now requires an explicit layout successor.
Previously, it tried to infer the correct destination block from the
successor list, but this is a rather tricky propspect, given the
existence of successors that occur mid-block, such as invoke, and
potentially in the future, callbr/INLINEASM_BR. (INLINEASM_BR, in
particular would be problematic, because its successor blocks are not
distinct from "normal" successors, as EHPads are.)

Instead, require the caller to pass in the expected fallthrough
successor explicitly. In most callers, the correct block is
immediately clear. But, in MachineBlockPlacement, we do need to record
the original ordering, before starting to reorder blocks.

Unfortunately, the goal of decoupling the behavior of end-of-block
jumps from the successor list has not been fully accomplished in this
patch, as there is currently no other way to determine whether a block
is intended to fall-through, or end as unreachable. Further work is
needed there.

Differential Revision: https://reviews.llvm.org/D79605
2020-06-06 22:30:51 -04:00
Ben Shi
1bcdec3cb9 [RISCV] Fix a typo in RISCVISelLowering.cpp
The 9th parameter of "static bool CC_RISCV(...)" is isFixed, not isRet.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D81333
2020-06-06 18:41:00 -07:00
Mike Edwards
1e5cc34a44 [LIT] NFC adding max-failures option to lit documentation.
Differential Revision: https://reviews.llvm.org/D81337
2020-06-06 18:26:45 -07:00
Craig Topper
a6f53c3183 [X86] Correct some isel patterns for v1i1 KNOT/KANDN/KXNOR.
The KNOT pattern was missing. The others were
looking for a v1i1 -1 instead of a vector all ones.
2020-06-06 17:25:56 -07:00
Fangrui Song
6a5c7ac5ca [gcov] Delete XFAIL: host-byteorder-big-endian for test/Transforms/GCOVProfiling/{exit-block.ll,function-numbering.ll} 2020-06-06 11:59:31 -07:00
LLVM GN Syncbot
34ec4ad872 [gn build] Port 8422bc9efcb 2020-06-06 18:22:19 +00:00
Fangrui Song
b665acc337 [gcov] Support big-endian .gcno and simplify version handling in .gcda 2020-06-06 11:01:47 -07:00
Jonas Paulsson
27037aea90 [SystemZ] Implement -fstack-clash-protection
Probing of allocated stack space is now done when this option is passed. The
purpose is to protect against the stack clash attack (see
https://www.qualys.com/2017/06/19/stack-clash/stack-clash.txt).

Review: Ulrich Weigand

Differential Revision: https://reviews.llvm.org/D78717
2020-06-06 18:38:36 +02:00
Matt Arsenault
6e2d326243 AMDGPU/GlobalISel: Fix test failure in release build
The annoying behavior where the output is different due to the
legality check struck again, plus the subtarget predicate wasn't
really correctly set for DS FP atomics.

Some of the FP min/max instructions seem to be in the gfx6/gfx7
manuals, but IIRC this might have been one of the cases where the
manual got ahead of the actual hardware support, but I've left these
as-is for now since the assembler tests seem to expect them.
2020-06-06 11:01:18 -04:00
Simon Pilgrim
55c9e54358 EHPersonalities.h - reduce Triple.h include to forward declaration. NFC.
Move implicit include dependencies down to source files.
2020-06-06 15:48:31 +01:00
Sanjay Patel
4644aeb774 [DAGCombiner] clean-up FMA+FMUL folds; NFC
D80801 suggests some readability improvements before mocing this block.
2020-06-06 10:32:54 -04:00
Simon Pilgrim
ebc9b15b28 CFG.h - add missing GraphTraits.h include. NFC.
MSVC doesn't care that this isn't declared for default template args but gcc (sometimes) does.
2020-06-06 15:18:25 +01:00
Simon Pilgrim
a7c2eb4745 CFG.h - reduce includes to forward declarations. NFC.
Remove unnecessary includes from CFG.cpp.

Fix implicit include dependency in X86WinEHState.cpp.
2020-06-06 15:06:42 +01:00
Matt Arsenault
e6d19839c9 AMDGPU/GlobalISel: Start rewriting load/store legality rules
The current set is an incomprehensible mess riddled with ordering
hacks for various limitations in the legalizer at the time of writing,
many of which have been fixed. This takes a very small step in
correcting this.

The core first change is to start checking for fully legal cases
first, rather than trying to figure out all of the actions that could
need to be performed. It's recommended to check the legal cases first
for faster legality checks in the common case. This still has a table
listing some common cases, but it needs measuring whether this really
helps or not.

More significantly, stop trying to allow any arbitrary type with a
legal bitwidth as a legal memory type, and start using the bitcast
legalize action for them. Allowing loads of these weird vector types
produced new burdens we don't need for handling all of the
legalization artifacts. Unlike the SelectionDAG handling, this is
still not casting 64 or 16-bit element vectors to 32-bit
vectors. These cases should still be handled by increasing/decreasing
the number of 16-bit elements. This is primarily to fix 8-bit element
vectors.

Another change is to stop trying to handle the load-widening based on
a higher alignment. We should still do this, but the way it was
handled wasn't really correct. We really need to modify the MMO's size
at the same time, and not just increase the result type. The
LegalizerHelper does not do this, and I think this would really
require a separate WidenMemory action (or to add a memory action
payload to the LegalizeMutation). These will now fail to legalize.

The structure of the legalizer rules makes writing concise rules here
difficult. It would be easier if the same function could answer the
query the query, and report the action to perform at the same
time. Instead these two are split into distinct predicate and action
functions. This is mostly tolerable for other cases, but the
load/store rules get pretty complicated so it's difficult to keep two
versions of these functions in sync.
2020-06-06 09:59:46 -04:00
dfukalov
cf9aab289e [AMDGPU] Increase max iterations count to analyze complete unroll
Summary: In some cases inner loops may not get boosts so try to analyze them deeper.

Reviewers: rampitec, mzolotukhin

Reviewed By: rampitec

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, zzheng, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81204
2020-06-06 16:32:45 +03:00
Simon Pilgrim
c66ff992b5 LoopPassManager.h - add missing MemorySSA.h include
Fix buildbot failure due to rG5006e551d310 - oddly I can't reproduce this locally on my msvc expensive checks build.
2020-06-06 14:23:08 +01:00
Simon Pilgrim
4dedca4724 LoopAnalysisManager.h - reduce includes to forward declarations. NFC.
Move implicit include dependencies down to header/source files.
2020-06-06 14:06:46 +01:00
Simon Pilgrim
233c72af48 LegacyDivergenceAnalysis.h - reduce DivergenceAnalysis.h include to forward declaration. NFC.
Move implicit include dependencies down to source file.
2020-06-06 13:30:00 +01:00
Simon Pilgrim
d451ab2c9a LoopInfoImpl.h - remove unused SetVector.h include. NFC. 2020-06-06 12:59:22 +01:00
Roman Lebedev
5eab84fa29 [SCEV] ScalarEvolution::createSCEV(): Instruction::Or: drop bogus no-wrap flag detection
Summary:
That's just really wrong. While sure, if LHS is AddRec, and we could
propagate it's no-wrap flags, that doesn't make, because as long as
the operands of `or` had no common bits set, then the `add`
of these operands will never overflow: http://volta.cs.utah.edu:8080/z/gmt7Sy
IOW we need no propagation/detection, we are free to just set NUW+NSW.

But as rG39e3683534c83573da5c8b70c8adfb43948f601f shows,
even when the old code failed to "deduce" flags,
we'd eventually re-deduce them somewhere, later.

So let's just set them.

Reviewers: mkazantsev, reames, sanjoy, efriedma

Reviewed By: efriedma

Subscribers: efriedma, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81246
2020-06-06 13:02:07 +03:00
Roman Lebedev
ab22644f5b [SCEV] ScalarEvolution::createSCEV(): clarify no-wrap flag propagation for shift by bitwidth-1
Summary:
There was this comment here previously:
```
-        // It is currently not resolved how to interpret NSW for left
-        // shift by BitWidth - 1, so we avoid applying flags in that
-        // case. Remove this check (or this comment) once the situation
-        // is resolved. See
-        // http://lists.llvm.org/pipermail/llvm-dev/2015-April/084195.html
-        // and http://reviews.llvm.org/D8890 .
```
But langref was fixed in rL286785, and the behavior is pretty obvious:
http://volta.cs.utah.edu:8080/z/MM4WZP
^ nuw can always be propagated. nsw can be propagated if
either nuw is specified, or the shift is by *less* than bitwidth-1.

This mimics similar D81189 Reassociate change, alive2 is happy about that one.

I'm not sure `NUW` isn't being printed, but that seems unrelated.

Reviewers: mkazantsev, reames, sanjoy, nlopes, craig.topper, efriedma

Reviewed By: efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81243
2020-06-06 13:02:07 +03:00
Nikita Popov
d7322429a2 [NewGVN] Remove alignment from LoadExpression (NFC)
The alignment is not actually used.
2020-06-06 11:49:20 +02:00
Nikita Popov
572dc75e22 [InstCombine] Remove unnecessary MaybeAlign use (NFC)
Alloca align is required now.
2020-06-06 11:44:01 +02:00
Lang Hames
1291eb9615 [ORC] Always use ObjectLinkingLayer/JITLink for MachO on x86-64 and arm64.
JITLink supports all code and relocation models, so there's no reason to
conditionalize using JITLink on the code or relocation model settings.

Clients wanting to use RTDyldObjectLinkingLayer/RuntimeDyld will now
need to use a custom object linking layer creator.
2020-06-05 21:02:29 -07:00
LLVM GN Syncbot
6b15e2e8e3 [gn build] Port 29203480632 2020-06-06 01:50:36 +00:00
Nico Weber
e905d3fcf1 Revert "Migrate the rest of COFFObjectFile to Error"
This reverts commit b5289656b865d2a73cf90819e20a96fb8414ab0b.
__attribute__((optnone)) doesn't build with msvc, see
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/16326
2020-06-05 21:20:11 -04:00
LLVM GN Syncbot
79ef3ae68a [gn build] Port 1fa43e0b34d 2020-06-06 00:47:43 +00:00
Jessica Paquette
8a73b047ac [AArch64][GlobalISel] Move dup optimization into post-legalizer combiner
Since all of the other G_SHUFFLE_VECTOR transforms are going there, let's do
this with dup as well. This is nice, because it lets us split up the original
code into matching, register bank selection, and instruction selection.

- Create G_DUP, make it equivalent to AArch64dup

- Add a post-legalizer combine which is 90% a copy-and-paste from
  tryOptVectorDup, except with shuffle matching closer to what SelectionDAG
  does in `ShuffleVectorSDNode::isSplatMask`.

- Teach RegBankSelect about G_DUP. Since dup selection relies on the correct
  register bank for FP/GPR dup selection, this is necessary.

- Kill `tryOptVectorDup`, since it's now entirely handled by G_DUP.

- Add testcases for the combine, RegBankSelect, and selection. The selection
  test gives the same selection results as the old test.

Differential Revision: https://reviews.llvm.org/D81221
2020-06-05 17:46:28 -07:00
Diego Caballero
09d4df00f3 Fix convertBFloatAPFloatToAPInt for NaN/Inf values
Bfloat type has an 8-bit exponent so the exponent of NaN/Inf numbers
must be 0xff instead of 0x1f. This is probably a copy-paste mistake
from the half float type.

Reviewed By: lattner

Differential Revision: https://reviews.llvm.org/D81302
2020-06-05 17:22:43 -07:00
Richard Smith
418500e026 PR34581: Don't remove an 'if (p)' guarding a call to 'operator delete(p)' under -Oz.
Summary:
This transformation is correct for a builtin call to 'free(p)', but not
for 'operator delete(p)'. There is no guarantee that a user replacement
'operator delete' has no effect when called on a null pointer.

However, the principle behind the transformation *is* correct, and can
be applied more broadly: a 'delete p' expression is permitted to
unconditionally call 'operator delete(p)'. So do that in Clang under
-Oz where possible. We do this whether or not 'p' has trivial
destruction, since the destruction might turn out to be trivial after
inlining, and even for a class-specific (but non-virtual,
non-destroying, non-array) 'operator delete'.

Reviewers: davide, dnsampaio, rjmccall

Reviewed By: dnsampaio

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D79378
2020-06-05 17:13:43 -07:00
Philip Reames
18d652b933 [Tests] Migrate a number of tests to gc-live bundle representation 2020-06-05 16:44:04 -07:00
Reid Kleckner
ce815b34d8 Migrate the rest of COFFObjectFile to Error 2020-06-05 16:29:05 -07:00
Reid Kleckner
ef44ae63c3 Re-land "Migrate Binary::checkOffset from error_code to Error, NFC"
This reverts commit 38f3ba591e3a64fa5bbe684b3171c7bda6c5b527.

Fix the XCOFF error handling. Unlike std::error_code, Error must be
consumed or handled.
2020-06-05 16:27:31 -07:00
Alex Lorenz
e8f8b62f7f [arm][darwin] Don't generate libcalls for wide shifts on Darwin
Similar to ceb801612a678bdffe7e7bf163bd0eed9c9b73a2.

Darwin doesn't always use compiler-rt, and so we can't assume that these
functions are available on arm.
2020-06-05 15:41:23 -07:00
Craig Topper
ecc953fc36 [X86] Add test cases for PR46203. NFC 2020-06-05 14:27:13 -07:00