Commit Graph

356557 Commits

Author SHA1 Message Date
Tres Popp cf72027b35 [mlir] Move attr-dict to end of Shape dialect ops
Summary: This is to be consistent with most other assemblyFormat examles in MLIR.

Differential Revision: https://reviews.llvm.org/D81245
2020-06-06 10:05:55 +02:00
Lang Hames e429cffd4f [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
Wen-Heng (Jack) Chung 47073ccd4e [mlir][mlir-rocm-runner] Detect HIP version and AMD ISA version.
Summary:
Prior to ROCm / HIP 3.5, HSA code object V2 is the default binary format.
Starting from ROCm 3.5, HSA code object V3 becomes default.

Also invoke `rocm_agent_enumerator` to detect proper AMD ISA version on the
system. Use `gfx900` as the fallback value.

Reviewers: jerryyin yaxunl

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

Tags: #mlir

Differential Revision: https://reviews.llvm.org/D81309
2020-06-05 22:15:23 -05:00
LLVM GN Syncbot 473220c4df [gn build] Port 2920348063 2020-06-06 01:50:36 +00:00
Nico Weber 2920348063 Revert "recommit "[HIP] Add default header and include path""
This reverts commit 1fa43e0b34.
Still breaks tests on several bots, see https://reviews.llvm.org/D81176
2020-06-05 21:50:04 -04:00
Nico Weber 101fbc0138 Revert "Migrate the rest of COFFObjectFile to Error"
This reverts commit b5289656b8.
__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 d81b76cfe6 [gn build] Port 1fa43e0b34 2020-06-06 00:47:43 +00:00
Jessica Paquette 8f262a686e [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 7d59f49bda [mlir] Fix representation of BF16 constants
This patch is a follow-up on https://reviews.llvm.org/D81127

BF16 constants were represented as 64-bit floating point values due to the lack
of support for BF16 in APFloat. APFloat was recently extended to support
BF16 so this patch is fixing the BF16 constant representation to be 16-bit.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D81218
2020-06-05 17:43:06 -07:00
Yaxun (Sam) Liu 1fa43e0b34 recommit "[HIP] Add default header and include path"
recommit 11d06b9511 with
fix for lit tests.
2020-06-05 20:41:15 -04:00
Diego Caballero a2588948fe 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 f39e12a06b 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
stevewan 61cd264068 [PowerPC] Do not special case Darwin on PowerPC in target cpu handling
Summary: This patch removes the special handling for Darwin on PowerPC in the default target cpu handling, because Darwin is no longer supported on the PowerPC platform.

Reviewers: hubert.reinterpretcast, daltenty

Reviewed By: hubert.reinterpretcast

Subscribers: wuzish, nemanjai, shchenz, steven.zhang, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D81115
2020-06-05 19:55:28 -04:00
Philip Reames 32c09d527c [Tests] Migrate a number of tests to gc-live bundle representation 2020-06-05 16:44:04 -07:00
Reid Kleckner b5289656b8 Migrate the rest of COFFObjectFile to Error 2020-06-05 16:29:05 -07:00
Reid Kleckner e03a135be8 Re-land "Migrate Binary::checkOffset from error_code to Error, NFC"
This reverts commit 38f3ba591e.

Fix the XCOFF error handling. Unlike std::error_code, Error must be
consumed or handled.
2020-06-05 16:27:31 -07:00
Fangrui Song 1c44ace1e5 Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after ebcbd5ba39 2020-06-05 16:16:49 -07:00
Richard Smith 825e3bb580 PR46209: properly determine whether a copy assignment operator is
trivial.

We previously took a shortcut by assuming that if a subobject had a
trivial copy assignment operator (with a few side-conditions), we would
always invoke it, and could avoid going through overload resolution.
That turns out to not be correct in the presenve of ref-qualifiers (and
also won't be the case for copy-assignments with requires-clauses
either). Use the same logic for lazy declaration of copy-assignments
that we use for all other special member functions.

Previously committed as c57f8a3a20. This
now also includes an extension of LLDB's workaround for handling special
members without the help of Sema to cover copy assignments.
2020-06-05 16:05:32 -07:00
Richard Smith ebcbd5ba39 Set the captures on a CXXRecordDecl representing a lambda closure type
before marking it complete.

No functionality change intended.

Previously committed as c13dd74e31.
2020-06-05 16:05:32 -07:00
Fangrui Song ac6abc99e2 [ELF] Don't cause assertion failure if --dynamic-list or --version-script takes an empty file
Fixes PR46184
Report line 1 of the last memory buffer.
2020-06-05 15:59:54 -07:00
Alex Lorenz 2ba016cd5c [arm][darwin] Don't generate libcalls for wide shifts on Darwin
Similar to ceb801612a.

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
Davide Italiano c3f0d9f3d2 [IRExecutionUnit] Early returns for clarity. NFCI. 2020-06-05 14:52:36 -07:00
Nicolas Vasilache b54a4d0f8f [mlir][Linalg] NFC - Make useFullTileBuffersByDefault option take a boolean. 2020-06-05 17:44:29 -04:00
Dan Gohman 0d4e243456 [WebAssembly] Improve clang diagnostics for wasm attributes
This patch addresses the review comments on r352930:

 - Removes redundant diagnostic checking code
 - Removes errnoneous use of diag::err_alias_is_definition, which
   turned out to be ineffective anyway since functions can be defined later
   in the translation unit and avoid detection.
 - Adds a test for various invalid cases for import_name and import_module.

This reapplies D59520, with the addition of adding
`InGroup<IgnoredAttributes>` to the new warnings, to fix the
Misc/warning-flags.c failure.

Differential Revision: https://reviews.llvm.org/D59520
2020-06-05 14:32:51 -07:00
Craig Topper 8b05b6d533 [X86] Add test cases for PR46203. NFC 2020-06-05 14:27:13 -07:00
Nicolas Vasilache b6c88549bc [mlir] Fix spurious f64 -> f16 change in CPU runner test 2020-06-05 17:23:21 -04:00
Nikita Popov cb5724c71e [CGP] Remove unnecessary MaybeAlign use (NFC)
Stores now always have an alignment.
2020-06-05 23:18:26 +02:00
Nikita Popov bff94a8e2b [LoopIdiomRecognize] Remove unnecessary MaybeAlign use (NFC)
Loads and stores always have an alignment now.
2020-06-05 23:11:57 +02:00
Marco Elver 2dd83a9230 [ASan][Test] Fix globals test for Mach-O
Summary: Use a portable section name, as for the test's purpose any name will do.

Reviewers: nickdesaulniers, thakis

Reviewed By: thakis

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D81306
2020-06-05 23:08:11 +02:00
Nico Weber 38f3ba591e Revert "Migrate Binary::checkOffset from error_code to Error, NFC"
This reverts commit 74bd98829d.
Breaks LLVM::section-headers.test everywhere, see e.g.
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/29940/steps/test-check-all/logs/FAIL%3A%20LLVM%3A%3Asection-headers.test
2020-06-05 17:00:20 -04:00
Adrian Prantl ad4e7b9dc8 Fix an oversight in GetXcodeContentsDirectory()
Since FindXcodeContentsDirectoryInPath expects the *.app/Contents and
DEVELOPER_DIR is supposed to point to Xcode.app, we need to append the
Contents path first.

Differential Revision: https://reviews.llvm.org/D81290
2020-06-05 13:50:37 -07:00
Adrian Prantl f28177dbe8 Factor out GetEnvDeveloperDir() (NFC)
Differential Revision: https://reviews.llvm.org/D81289
2020-06-05 13:50:37 -07:00
Craig Topper 3408dcbdf0 [X86] Fold undef elts to 0 in getTargetVShiftByConstNode.
Similar to D81212.

Differential Revision: https://reviews.llvm.org/D81292
2020-06-05 13:39:40 -07:00
Reid Kleckner 74bd98829d Migrate Binary::checkOffset from error_code to Error, NFC
In my use case, this saved 100ms of time doing one-time-initialization
for std::error_code().
2020-06-05 13:38:56 -07:00
Stanislav Mekhanoshin 5d62606f90 AMDGPU/GlobalISel: cmp/select method for extract element
Differential Revision: https://reviews.llvm.org/D80749
2020-06-05 12:57:40 -07:00
Reid Kleckner 672ed53860 [codeview] Put !heapallocsite on calls to operator new
Clang marks calls to operator new as heap allocation sites, but the
operator declared at global scope returns a void pointer. There is no
explicit cast in the code, so the compiler has to write down the
allocated type itself.

Also generalize a cast to use CallBase, so that we mark heap alloc sites
when exceptions are enabled.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D80966
2020-06-05 12:52:38 -07:00
LLVM GN Syncbot 7e7ec2b325 [gn build] Port 8a8c6913a9 2020-06-05 19:48:20 +00:00
Stanislav Mekhanoshin 1e9a0a4e04 SROA: Remove pointer from visited along with instruction
If an instruction is erased we also need to remove it from
Visited set. There is a very small chance that an another
newly created instruction will be created with the same
pointer value in place of an erased one.

Differential Revision: https://reviews.llvm.org/D80958
2020-06-05 12:47:23 -07:00
Yaxun (Sam) Liu 8a8c6913a9 Revert "[HIP] Add default header and include path"
This reverts commit 11d06b9511.
2020-06-05 15:42:57 -04:00
Yaxun (Sam) Liu 392843617a Attempt to fix hip-include-path.hip 2020-06-05 15:31:53 -04:00
Saleem Abdulrasool e78431354b lld: use modern library search ordering
This merges the static and shared library and behaves as if
`-search_paths_first` was specified which is also the default behaviour
on ld64 (and now lld). Unify the paths, and use `llvm::sys::path` to
deal with the path to be truly agnostic to the host.
2020-06-05 12:12:26 -07:00
Alexandre Ganea b67f860208 [llvm-pdbutil] Add missing --id-stats to dump the IPI stream
Before this patch, llvm-pdbutil supported only --type-stats to dump stats about a PDB TPI stream.
Adding --id-stats for completion.
2020-06-05 15:10:54 -04:00
Matt Arsenault eaa8af9322 GlobalISel: Add helper for constructing load from offset 2020-06-05 15:06:03 -04:00
Adrian Prantl 79daa3d896 Teach GetXcodeSDK to look in the Xcode that contains LLDB
instead of preferring the one chosen with xcode-select.

<rdar://problem/64000666>

Differential Revision: https://reviews.llvm.org/D81210
2020-06-05 11:59:22 -07:00
Adrian Prantl 3d7b926dd1 Move GetXcode*Directory into HostInfo (NFC)
These functions really don't belong into PlatformDarwin, since they
actualy query state of the Host and not of the remote platform.
2020-06-05 11:59:22 -07:00
Matt Arsenault 45e1a22a92 GlobalISel: Make known bits/alignment API more consistent
Just computing the alignment makes sense without caring about the
general known bits, such as for non-integral pointers. Separate the
two and start calling into the TargetLowering hooks for frame indexes.

Start calling the TargetLowering implementation for FrameIndexes,
which improves the AMDGPU matching for stack addressing modes. Also
introduce a new hook for returning known alignment of target
instructions. For AMDGPU, it would be useful to report the known
alignment implied by certain intrinsic calls.

Also stop using MaybeAlign.
2020-06-05 14:57:22 -04:00
Matt Arsenault 6c570f789d GlobalISel: Add G_EXTRACT/G_INSERT offset to legalize info
Immediate legalize fields were added for G_SEXT_INREG. Simiarly, these
are likely not legal except for certain offsets.
2020-06-05 14:54:40 -04:00
Dan Gohman 3aec298349 Revert "[WebAssembly] Improve clang diagnostics for wasm attributes"
It broke clang-check.

This reverts commit 931fcd3ba0.
2020-06-05 11:52:11 -07:00
Jay Foad 72e4da45bd Correctly report modified status for AMDGPUUnifyDivergentExitNodes
Related to https://reviews.llvm.org/D80916

Differential Revision: https://reviews.llvm.org/D81271
2020-06-05 19:49:37 +01:00
Fangrui Song d2bd075e8d Fix -Wunused-variable after D80515 2020-06-05 11:46:50 -07:00