1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

201795 Commits

Author SHA1 Message Date
Kiran Chandramohan
f33b4004b5 [MLIR,OpenMP] Lowering of parallel operation: proc_bind clause 2/n
This patch adds the translation of the proc_bind clause in a
parallel operation.

The values that can be specified for the proc_bind clause are
specified in the OMP.td tablegen file in the llvm/Frontend/OpenMP
directory. From this single source of truth enumeration for
proc_bind is generated in llvm and mlir (used in specification of
the parallel Operation in the OpenMP dialect). A function to return
the enum value from the string representation is also generated.
A new header file (DirectiveEmitter.h) containing definitions of
classes directive, clause, clauseval etc is created so that it can
be used in mlir as well.

Reviewers: clementval, jdoerfert, DavidTruby

Differential Revision: https://reviews.llvm.org/D84347
2020-08-12 08:03:13 +01:00
Craig Topper
acc3d72e97 [X86][GlobalISel] Replace a misuse of SUBREG_TO_REG with INSERT_SUBREG.
SUBREG_TO_REG is supposed to be used when we know the producing
instruction already zeroed the bits we're extending. But that's
not the case here. So INSERT_SUBREG with an IMPLICIT_DEF is the
correct thing to use.
2020-08-11 23:51:02 -07:00
Kyungwoo Lee
2beab8ee7a [NFC] Factor out hasForceAttributes
This is a preparation for https://reviews.llvm.org/D85586.

Differential Revision: https://reviews.llvm.org/D85793
2020-08-12 02:16:57 -04:00
Johannes Doerfert
8755dd12ec [Attributor][NFC] Reformat tests after D85099
Reviewed By: sstefan1

Differential Revision: https://reviews.llvm.org/D85700
2020-08-12 01:04:19 -05:00
Johannes Doerfert
bd4a02e66e [UpdateTestChecks] Match unnamed values like "@[0-9]+" and "![0-9]+"
With this patch we will match most *uses* of "temporary" named things in
the IR via regular expressions, not their name at creation time. The new
"values" we match are:
  - "unnamed" globals: `@[0-9]+`
  - debug metadata: `!dbg ![0-9]+`
  - loop metadata: `!loop ![0-9]+`
  - tbaa metadata: `!tbaa ![0-9]+`
  - range metadata: `!range ![0-9]+`
  - generic metadata: `metadata ![0-9]+`
  - attributes groups: `#[0-9]`

We still don't match the declarations but that can be done later. This
patch can introduce churn when existing check lines contain the old
hardcoded versions of the above "values". We can add a flag to opt-out,
or opt-in, if necessary.

Reviewed By: arichardson, MaskRay

Differential Revision: https://reviews.llvm.org/D85099
2020-08-12 01:04:16 -05:00
Petr Hosek
6abbc429da [CMake] Simplify CMake handling for zlib
Rather than handling zlib handling manually, use find_package from CMake
to find zlib properly. Use this to normalize the LLVM_ENABLE_ZLIB,
HAVE_ZLIB, HAVE_ZLIB_H. Furthermore, require zlib if LLVM_ENABLE_ZLIB is
set to YES, which requires the distributor to explicitly select whether
zlib is enabled or not. This simplifies the CMake handling and usage in
the rest of the tooling.

This is a reland of abb0075 with all followup changes and fixes that
should address issues that were reported in PR44780.

Differential Revision: https://reviews.llvm.org/D79219
2020-08-11 20:22:11 -07:00
Jordan Rupprecht
7059d43168 [NFC] Inline variable only used in debug builds 2020-08-11 19:38:01 -07:00
Sanjay Patel
b6c5255819 [VectorCombine] add safety check for 0-width register
Based on post-commit discussion in D81766, Hexagon sets this to "0".
I'll see if I can come up with a test, but making the obvious
code fix first to unblock that target.
2020-08-11 20:30:02 -04:00
Thomas Lively
77de82e267 [WebAssembly][AsmParser] Name missing features in error message
Rather than just saying that some feature is missing, report the exact
features to make the error message more useful and actionable.

Differential Revision: https://reviews.llvm.org/D85795
2020-08-11 17:26:14 -07:00
Vedant Kumar
60a6ae1b59 Revert "[Instruction] Add updateLocationAfterHoist helper"
This reverts commit 4a646ca9e2caf70d6312714770f516fb83b7e3cb.

This is causing some bots to fail with "!dbg attachment points at wrong
subprogram for function", like:

http://lab.llvm.org:8011/builders/sanitizer-windows/builds/67958/steps/stage%201%20check/logs/stdio
2020-08-11 14:54:09 -07:00
Amy Huang
ae7dfdd3ba [globalopt] Change so that emitting fragments doesn't use the type size of DIVariables
When turning on -debug-info-kind=constructor we ran into a "fragment covers
entire variable" error during thinlto. The fragment is currently always
emitted if there is no type size, but sometimes the variable has a
forward declared struct type which doesn't have a size.

This changes the code to get the type size from the GlobalVariable instead.

Differential Revision: https://reviews.llvm.org/D85572
2020-08-11 14:50:56 -07:00
Kazu Hirata
88e8651c48 [Instcombine] Fix uses of undef (PR46940)
Without this patch, we attempt to distribute And over Xor even in
unsafe circumstances like so:

  undef & (true ^ true)  ==>  (undef & true) ^ (undef & true)

and evaluate it to undef instead of false.  Note that "true ^ true"
may show up implicitly with one true being part of a PHI node.

This patch fixes the problem by teaching SimplifyUsingDistributiveLaws
to not use undef as part of simplifications.

Reviewers: spatel, aqjune, nikic, lebedev.ri, fhahn, jdoerfert

Differential Revision: https://reviews.llvm.org/D85687
2020-08-11 14:13:32 -07:00
Vedant Kumar
62d3804379 [Instruction] Add updateLocationAfterHoist helper
Introduce a helper on Instruction which can be used to update the debug
location after hoisting.

Use this in GVN and LICM, where we were mistakenly introducing new line
0 locations after hoisting (the docs recommend dropping the location in
this case).

For more context, see the discussion in https://reviews.llvm.org/D60913.

Differential Revision: https://reviews.llvm.org/D85670
2020-08-11 14:05:20 -07:00
Jian Cai
6985687166 [AARCH64] [MC] add memtag as an alias of mte architecture extension
Add memtag as an alis of met architectture extesion to be consistent
with GNU as.

LINK:https://sourceware.org/bugzilla/show_bug.cgi?id=26339

Reviewed By: nickdesaulniers, MaskRay

Differential Revision: https://reviews.llvm.org/D85620
2020-08-11 13:28:47 -07:00
Nikita Popov
587bdc1d95 [InstSimplify] Respect CanUseUndef in more places
Similar to what we do in IIQ, add an isUndefValue() helper that
checks for undef values while respective CanUseUndef. This makes
it much easier to search for places that don't respect the flag
yet.
2020-08-11 21:53:33 +02:00
Roman Lebedev
415270824a [NFC][InstCombine] Add tests for PHI merging/aggregate reconstruction (PR47060)
We should be able to see that the new aggregate we have produced
is identical to the source aggregate from which we've extracted
the elements that we used to form a new aggregate.

This happens (a lot) in clang C++ exception code on unwind branch.
2020-08-11 22:40:29 +03:00
Arthur Eubanks
38b62da11d [gn build] Fix CodeGenTests
Missing dependency required by https://reviews.llvm.org/D67687.

Fixes
lld-link: error: undefined symbol: public: __cdecl llvm::PipelineTuningOptions::PipelineTuningOptions(void)
>>> referenced by C:\src\llvm-project\llvm\unittests\CodeGen\PassManagerTest.cpp:215
>>>               obj/llvm/unittests/CodeGen/CodeGenTests.PassManagerTest.obj:(private: virtual void __cdecl `anonymous namespace'::PassManagerTest_Basic_Test::TestBody(void))

Differential Revision: https://reviews.llvm.org/D85682
2020-08-11 12:31:42 -07:00
Thomas Lively
3f29056047 [WebAssembly][NFC] Replace WASM with standard Wasm
The officially specified abbreviation for WebAssembly is Wasm and the
spec explicitly calls out WASM as being an incorrect spelling. This
patch fixes a few comments and error messages to use the
spec-compliant abbreviation.

Differential Revision: https://reviews.llvm.org/D85764
2020-08-11 12:27:59 -07:00
diggerlin
b434098ac8 [AIX][XCOFF] change the operand of branch instruction from symbol name to qualified symbol name for function declarations
SUMMARY:

1. in the patch  , remove setting storageclass in function .getXCOFFSection and construct function of class MCSectionXCOFF
there are

XCOFF::StorageMappingClass MappingClass;
XCOFF::SymbolType Type;
XCOFF::StorageClass StorageClass;
in the MCSectionXCOFF class,
these attribute only used in the XCOFFObjectWriter, (asm path do not need the StorageClass)

we need get the value of StorageClass, Type,MappingClass before we invoke the getXCOFFSection every time.

actually , we can get the StorageClass of the MCSectionXCOFF  from it's delegated symbol.

2. we also change the oprand of branch instruction from symbol name to qualify symbol name.
for example change
bl .foo
extern .foo
to
bl .foo[PR]
extern .foo[PR]

3. and if there is reference indirect call a function bar.
we also add
  extern .bar[PR]

Reviewers:  Jason liu, Xiangling Liao

Differential Revision: https://reviews.llvm.org/D84765
2020-08-11 15:26:19 -04:00
Thomas Lively
8ddb9f38f8 Reland "[SLPVectorizer] Pre-commit a test for D85759"
This reverts commit 52b71aa8b1a019403b0ecc184744b2f8ca2f7cba.

The problem was a missing lit.local.cfg file, which was causing the
test to be incorrectly run on bots that had not built the WebAssembly
target.
2020-08-11 12:18:33 -07:00
Thomas Lively
1fbdc03295 Revert "[SLPVectorizer] Pre-commit a test for D85759"
This reverts commit 94791970de109eb9a6b296825ddb0fc2a196b366.

The test is failing on multiple bots, event though it passes for me
locally. Reverting while I investigate further.
2020-08-11 12:11:24 -07:00
Yuanfang Chen
a7a84877c6 NFC. Constify MachineVerifier::verify parameter 2020-08-11 11:59:45 -07:00
Dávid Bolvanský
ee8d84179f [BPI] Teach BPI about bcmp function
bcmp is similar to memcmp
2020-08-11 20:44:53 +02:00
Jessica Paquette
9e2fede73a Update AMDGPU testcases after bebe6a6449811e877f7eba3f1798ddd1fa83e440
I didn't build AMDGPU locally so I didn't see this.

```
(logic_op (op x...), (op y...)) -> (op (logic_op x, y))
```

kicks in here.

Differential Revision: https://reviews.llvm.org/D85761
2020-08-11 11:32:36 -07:00
Thomas Lively
5b54f97dfb [SLPVectorizer] Pre-commit a test for D85759
8cc911fa5b06 refactored the `getIntrinsicInstrCost` function and was
meant to be a nonfunctional change, but it accidentally changed how
costs were calculated in the SLP vectorizer, which regressed
WebAssembly codegen and resulted in a downstream bug report at
https://github.com/emscripten-core/emscripten/issues/11449.

The fix for this regression is in D85759, and this patch just
pre-commits the test from that patch to demonstrate the regressed
behavior first.
2020-08-11 11:30:09 -07:00
Jessica Paquette
8e321c8c5a [GlobalISel] Combine (logic_op (op x...), (op y...)) -> (op (logic_op x, y))
This implements

```
(logic_op (op x...), (op y...)) -> (op (logic_op x, y))
```

when `op` is an extend, a shift, or an and.

This is similar to `DAGCombiner::hoistLogicOpWithSameOpcodeHands`
(with a bunch of missing cases, e.g. G_TRUNC, G_BITCAST, etc.)

This is implemented so it works both pre and post-legalization.

This also adds a general way to add a series of instructions in a combine.
(`applyBuildInstructionSteps`).

Differential Revision: https://reviews.llvm.org/D85050
2020-08-11 10:40:06 -07:00
Jordan Rupprecht
97e61228e0 [NFC][llvm-objcopy] Fix redundant config checks.
The check for unsupported options checks some configs twice in a || expression. Fixes PR47107.
2020-08-11 10:37:19 -07:00
jasonliu
5a22f2e49a [XCOFF][llvm-readobj] Move XCOFF test to XCOFF directory
Summary:
COFF and XCOFF in llvm are very different and serves different platform.
Since we have different Dumper.cpp file in llvm-readobj's
implementation, we should have separate testing directory for them too.

Reviewed By: jhenderson, DiggerLin

Differential Revision: https://reviews.llvm.org/D85675
2020-08-11 17:31:59 +00:00
Simon Pilgrim
91051f84c0 [X86][SSE] combineShuffleWithHorizOp - canonicalize SHUFFLE(HOP(X,Y),HOP(Y,X)) -> SHUFFLE(HOP(X,Y))
Attempt to canonicalize binary shuffles of HOPs with commuted operands to an unary shuffle.
2020-08-11 18:13:03 +01:00
Matt Arsenault
1c0be51aa1 GlobalISel: Fix typo 2020-08-11 13:08:56 -04:00
Lang Hames
f0d37fd69e [ORC] Move file-descriptor based raw byte channel into a public header.
This will enable re-use in other llvm tools.
2020-08-11 09:50:58 -07:00
Lang Hames
ab36f344d6 [llvm-jitlink] Fix a file comment. 2020-08-11 09:50:58 -07:00
Nikita Popov
577d874016 [InstSimplify] Forbid undef folds in expandBinOp
This is the replacement for D84250 based on D84792. As we recursively
fold with the same value twice, we need to disable undef folds,
to prevent an undef from being folded to two different values.

Reverting rG00f3579aea6e3d4a4b7464c3db47294f71cef9e4 and using the
test case from https://reviews.llvm.org/D83360#2145793, it no longer
performs the incorrect fold.

Differential Revision: https://reviews.llvm.org/D85684
2020-08-11 18:39:24 +02:00
Eric Christopher
0cfc3980c2 Fold Opcode into assert uses to fix an unused variable warning without asserts. 2020-08-11 09:30:51 -07:00
Xing GUO
774d3cafca [DWARFYAML] Teach yaml2obj emit the correct line table program.
The following issues are addressed in this patch.

1. The operands of DW_LNE_set_discriminator should be an ULEB128 number
   rather than an address.
2. Test the emitted opcodes.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D85717
2020-08-12 00:18:54 +08:00
Simon Pilgrim
16e7bf9043 [X86][SSE] combineShuffleWithHorizOp - avoid unnecessary subtraction. NFCI.
We can safely replace ((M - NumElts) % NumEltsPerLane) with (M % NumEltsPerLane) as the modulo result will be the same.
2020-08-11 17:07:32 +01:00
Matt Arsenault
3333ddf27a AMDGPU/GlobalISel: Manually select llvm.amdgcn.writelane
Fixup the special case constant bus handling pre-gfx10.
2020-08-11 11:56:16 -04:00
Whitney Tsang
2b7d760be9 [NFC][LoopUnrollAndJam] Use BasicBlock::replacePhiUsesWith instead of
static function updatePHIBlocks.

Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D85673
2020-08-11 15:35:14 +00:00
Jay Foad
928c1dd7ef [GlobalISel] Add G_ABS
This is equivalent to the new llvm.abs intrinsic added by D84125 with
is_int_min_poison=0.

Differential Revision: https://reviews.llvm.org/D85718
2020-08-11 16:34:37 +01:00
Sanjay Patel
5b7d18ac79 [InstSimplify] fold min/max with matching min/max operands
I think this is the last remaining translation of an existing
instcombine transform for the corresponding cmp+sel idiom.

This interpretation is more general though - we can remove
mismatched signed/unsigned combinations in addition to the
more obvious cases.

min/max(X, Y) must produce X or Y as the result, so this is
just another clause in the existing transform that was already
matching a min/max of min/max.
2020-08-11 11:23:15 -04:00
Sanjay Patel
66663f8432 [InstSimplify] add tests for min/max intrinsics with common operands; NFC
There are 4*4*4 = 64 variations. We currently handle some, but not all,
of the alternative patterns with cmp+sel in instcombine.
2020-08-11 11:23:15 -04:00
Sanjay Patel
48886146f5 [InstCombine] add tests for pointer casts with insertelement; NFC 2020-08-11 11:23:15 -04:00
Simon Pilgrim
77924cfcc9 [X86][SSE] Add HADD/SUB support to combineHorizOpWithShuffle
Handles some HOP(SHUFFLE,SHUFFLE) patterns and sets us up to improve some of the cases mentioned in PR41813.
2020-08-11 16:14:14 +01:00
Matt Arsenault
462335211d AMDGPU/GlobalISel: Prepare for more custom load lowerings
Slight restructuring of the code to avoid formatting changes when more
cases are handled here.
2020-08-11 11:09:05 -04:00
Matt Arsenault
eadb6d5dac AMDGPU/GlobalISel: Fix test bugs and add a few more cases
The wrong alignment or addrspace was used. Also add various cases to
stress a future patch.
2020-08-11 11:09:05 -04:00
Fangrui Song
367b809d42 [split-file] Fix sys::fs::remove() on Solaris after D83834
where stdio.h ::remove() may set errno to EEXIST instead of ENOTEMPTY.

POSIX.1-2017 allows EEXIST for unlink() (which is called by remove()):

> [EEXIST] or [ENOTEMPTY]
> The flag parameter has the AT_REMOVEDIR bit set and the path argument names a directory that is not an empty directory, or there are hard links to the directory other than dot or a single entry in dot-dot.

Reviewed By: ro

Differential Revision: https://reviews.llvm.org/D85690
2020-08-11 08:05:10 -07:00
David Stenberg
9857b3e63f [DebugInfo] Allow GNU macro extension to be emitted
Allow the GNU .debug_macro extension to be emitted for DWARF versions
earlier than 5. The extension is basically what became DWARF 5's format,
except that a DW_AT_GNU_macros attribute is emitted, and some entries
like the strx entries are missing. In this patch I emit GNU's indirect
entries, which are the same as DWARF 5's strp entries.

This patch adds the extension behind a hidden LLVM flag,
-use-gnu-debug-macro. I would later want to enable it by default when
tuning for GDB and targeting DWARF versions earlier than 5.

The size of a Clang 8.0 binary built with RelWithDebInfo and the flags
"-gdwarf-4 -fdebug-macro" reduces from 1533 MB to 1349 MB with
.debug_macro (compared to 1296 MB without -fdebug-macro).

Reviewed By: SouraVX, dblaikie

Differential Revision: https://reviews.llvm.org/D82975
2020-08-11 17:00:25 +02:00
David Stenberg
9a1cd64d35 [DebugInfo] Simplify DwarfDebug::emitMacro
Broken out from a review comment on D82975. This is an NFC expect for
that the Macinfo macro string is now emitted using a single emitBytes()
invocation, so it can be done using a single string directive.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D83557
2020-08-11 17:00:25 +02:00
Benjamin Kramer
783c3b3ec3 [GlobalISel] Remove unused variable. NFC. 2020-08-11 16:56:45 +02:00
Xing GUO
6392103bc7 [DWARFYAML] Let the address size of line tables inferred from the object file.
Currently, the line table uses the first compilation unit's address size
as its address size. It's not the right behavior. The address size should be
inferred from the target machine.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D85707
2020-08-11 22:45:55 +08:00