Commit Graph

356475 Commits

Author SHA1 Message Date
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
Nico Weber f029c165f9 [gn build] (manually) merge 5eedf07ab9 2020-06-05 14:39:04 -04:00
Yaxun (Sam) Liu ee60847862 Attempt to fix hip-include-path.hip 2020-06-05 14:36:36 -04:00
Matt Arsenault 43bb1c239c AMDGPU: Fix incorrect selection of buffer atomic fadd
There were additional standalone patterns for these nodes which were
missing the subtarget predicate.
2020-06-05 14:34:15 -04:00
Matt Arsenault a080e345e4 AMDGPU: Fix missing immarg on buffer.atomic.fadd intrinsic 2020-06-05 14:34:07 -04:00
Craig Topper 7c9a89fed8 [X86] Teach combineVectorShiftImm to constant fold undef elements to 0 not undef.
Shifts are supposed to always shift in zeros or sign bits regardless of their inputs. It's possible the input value may have been replaced with undef by SimplifyDemandedBits, but the shift in zeros are still demanded.

This issue was reported to me by ispc from 10.0. Unfortunately their failing test does not fail on trunk. Seems to be because the shl is optimized out earlier now and doesn't become VSHLI.

ispc bug https://github.com/ispc/ispc/issues/1771

Differential Revision: https://reviews.llvm.org/D81212
2020-06-05 11:29:55 -07:00
Dan Gohman 931fcd3ba0 [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.

Differential Revision: https://reviews.llvm.org/D59520
2020-06-05 11:27:51 -07:00
Evgenii Stepanov d1a6e4d2db [hwasan] Disable malloc-fill by default.
Summary: Non-zero malloc fill is causing way too many hard to debug issues.

Reviewers: kcc, pcc, hctim

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D81284
2020-06-05 11:27:16 -07:00
Marco Elver 866ee2353f [KernelAddressSanitizer] Make globals constructors compatible with kernel
Summary:
This makes -fsanitize=kernel-address emit the correct globals
constructors for the kernel. We had to do the following:

- Disable generation of constructors that rely on linker features such
  as dead-global elimination.

- Only emit constructors for globals *not* in explicit sections. The
  kernel uses sections for special globals, which we should not touch.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203493

Tested:
1. With 'clang/test/CodeGen/asan-globals.cpp'.
2. With test_kasan.ko, we can see:

  	BUG: KASAN: global-out-of-bounds in kasan_global_oob+0xb3/0xba [test_kasan]

Reviewers: glider, andreyknvl

Reviewed By: glider

Subscribers: cfe-commits, nickdesaulniers, hiraditya, llvm-commits

Tags: #llvm, #clang

Differential Revision: https://reviews.llvm.org/D80805
2020-06-05 20:20:46 +02:00
Nikita Popov d370088611 [LiveDebugValues] Fix output stream (NFC)
This should dump to the provided Out, rather than dbgs(), though
they coincide in current usage.
2020-06-05 20:02:22 +02:00
Nikita Popov 6a53264926 [LiveDebugValues] Remove PendingInLocs (NFC)
PendingInLocs ends up having the same value as InLocs, just computed
a bit more indirectly. It is a leftover of a previous implementation
approach.

This patch drops PendingInLocs, as well as the Diff and Removed
calulations, which are no longer needed.

Differential Revision: https://reviews.llvm.org/D80868
2020-06-05 20:01:29 +02:00
Matt Arsenault 5ee2a1e476 AMDGPU/GlobalISel: Fix some broken YAML in MIR test
Different tools seem to be more or less strict with the markers
between different functions.
2020-06-05 13:59:46 -04:00
Matt Arsenault 3b5d4aa258 GlobalISel: Infer nofpexcept flag during selection for non-strict ops
Match SelectionDAG's behavior of adding nofpexcept to out instructions
that may raise fp exceptions that are selected from instructions that
do not.
2020-06-05 13:59:46 -04:00
Alex Lorenz 5eedf07ab9 [apple clang] disable in-process CC1 to preserve crashlog compatibility
The in-process CC1 currently doesn't interoperate with the macOS crash analytics,
which we would like to keep enabled for Apple clang. This commit restores the
out-of-process CC1 to the Apple clang CMake configuration for now.

Differential Revision: https://reviews.llvm.org/D80849
2020-06-05 10:55:42 -07:00
Sameer Arora 12e5b02687 [llvm-objcopy] Reorder --dump-section for MachO
Reorder `DumpSection` under `handleArgs` in file `MachOObjcopy.cpp`. The
operation to dump a section is now performed before both add and remove
section operations for MachO file format.

Change for the ELF format at D81097. Together fixes
https://bugs.llvm.org/show_bug.cgi?id=44283

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D81123
2020-06-05 10:49:22 -07:00
Nicolas Vasilache eb7db879af [mlir][test][CPU] Reduce the size of mlir-cpu-runner-tests
Two tests regularly show up on the long tail when testing MLIR.
This revision reduces their size.
2020-06-05 13:47:29 -04:00
Sameer Arora a018b538a6 [llvm-objcopy] Reorder --dump-section before --remove-section for ELF
Reorder `DumpSection` under `handleArgs` in file `ELFObjcopy.cpp`.
`DumpSection` is placed before `replaceAndRemoveSections` and is
therefore now the first operation under `handleArgs`. Thus, it is now
performed before both `add` and `remove` section operations.

Change for the MachO format at D81123. Together fixes https://bugs.llvm.org/show_bug.cgi?id=44283.

Reviewed By: alexshap, jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D81097
2020-06-05 10:45:51 -07:00
Louis Dionne 339156ad63 [libc++] Avoid passing -xc++ in Lit feature detection
Otherwise, if %{flags} contain other files like static libraries, those
files are treated as C++ source files instead of object files, and the
compiler gets all confused.
2020-06-05 13:41:48 -04:00
David Green e73bb45c2b [ARM] VQMOVN demand bits analysis
Similar to VMOVN, a VQMOVN will only demand the top/bottom lanes of it's
first input. However unlike VMOVN it will need access to the entire
second argument, as that value is saturated not just moved in place.

Differential Revision: https://reviews.llvm.org/D80515
2020-06-05 18:41:02 +01:00
Sameer Arora 99e1b0dc8f [llvm-ar] Update error messages and tests as per latest preferred style
It updates two error messages under `performOperation` in the file
llvm-ar.cpp. Furthermore, it also updates tests that print out these
error messages: `llvm/test/Object/ar-create.test` and
`llvm/test/tools/llvm-ar/print.test`.

Reviewed By: jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D80846
2020-06-05 10:37:26 -07:00
Sameer Arora 399b12700b [llvm-ar] Add more tests for errors in opening archives
Add 2 more tests for the function performOperation under llvm-ar.cpp. It
tests the scenario when the archive could not be opened for reasons
other than `no_such_file_or_directory` In particular, it tests for the
cases `permission_denied` and `is_a_directory` for the target archive.

Reviewed By: alexshap, jhenderson, smeenai, MaskRay

Differential Revision: https://reviews.llvm.org/D80838
2020-06-05 10:36:58 -07:00
Nicolas Vasilache b56bf30d3c [mlir][Vector] Add folding of memref_cast into vector_transfer ops
Summary:
This revision adds a common folding pattern that starts appearing on
vector_transfer ops.

Differential Revision: https://reviews.llvm.org/D81281
2020-06-05 13:27:00 -04:00
LLVM GN Syncbot e7cc6896f6 [gn build] Port 11d06b9511 2020-06-05 17:22:19 +00:00
Yaxun (Sam) Liu e987c37218 Fix lit tests hip-include-path.hip and hip-host-cpu-macros.cu 2020-06-05 13:21:35 -04:00
Sander de Smalen 937cb7a8c7 Reland D80640: [CodeGen][SVE] Calculate correct type legalization for scalable vectors.
This reverts commit 9bcef270d7.
2020-06-05 18:09:31 +01:00
Louis Dionne d520dfec3b [libc++abi] Properly fix XFAILs for exception alignment
Since <unwind.h> is in the SDK, not in /usr/include, the XFAILs must
be predicated on the compiler version (ideally even on the SDK version)
instead of the target system version.
2020-06-05 13:08:46 -04:00
Nicolas Vasilache 56ce65e2b6 [mlir][Linalg] NFC - Cleanup debug, address post-commit review. 2020-06-05 13:02:34 -04:00
Jacques Pienaar b0921f68e1 [mlir] Add verify method to adaptor
This allows verifying op-indepent attributes (e.g., attributes that do not require the op to have been created) before constructing an operation. These include checking whether required attributes are defined or constraints on attributes (such as I32 attribute). This is not perfect (e.g., if one had a disjunctive constraint where one part relied on the op and the other doesn't, then this would not try and extract the op independent from the op dependent).

The next step is to move these out to a trait that could be verified earlier than in the generated method. The first use case is for inferring the return type while constructing the op. At that point you don't have an Operation yet and that ends up in one having to duplicate the same checks, e.g., verify that attribute A is defined before querying A in shape function which requires that duplication. Instead this allows one to invoke a method to verify all the traits and, if this is checked first during verification, then all other traits could use attributes knowing they have been verified.

It is a little bit funny to have these on the adaptor, but I see the adaptor as a place to collect information about the op before the op is constructed (e.g., avoiding stringly typed accessors, verifying what is possible to verify before the op is constructed) while being cheap to use even with constructed op (so layer of indirection between the op constructed/being constructed). And from that point of view it made sense to me.

Differential Revision: https://reviews.llvm.org/D80842
2020-06-05 09:47:37 -07:00
Louis Dionne f57dd41562 [CMake] Do not append -lm to CMAKE_REQUIRED_LIBRARIES on Apple
On Apple platforms, linking against libSystem.dylib is sufficient, and
some Apple platforms don't provide libm.dylib. On those platforms, adding
-lm to CMAKE_REQUIRED_LIBRARIES causes all subsequent compile-flag checks
to fail due to the missing library.

Differential Revision: https://reviews.llvm.org/D81265
2020-06-05 12:45:30 -04:00
Yaxun (Sam) Liu 11d06b9511 [HIP] Add default header and include path
To support std::complex and some other standard C/C++ functions in HIP device code,
they need to be forced to be __host__ __device__ functions by pragmas. This is done
by some clang standard C++ wrapper headers which are shared between cuda-clang and hip-Clang.

For these standard C++ wapper headers to work properly, specific include path order
has to be enforced:

  clang C++ wrapper include path
  standard C++ include path
  clang include path

Also, these C++ wrapper headers require device version of some standard C/C++ functions
must be declared before including them. This needs to be done by including a default
header which declares or defines these device functions. The default header is always
included before any other headers are included by users.

This patch adds the the default header and include path for HIP.

Differential Revision: https://reviews.llvm.org/D81176
2020-06-05 12:44:57 -04:00
Simon Pilgrim a3597ecae9 ScalarEvolutionNormalization.h - reduce ScalarEvolutionExpressions.h include to forward declaration. NFC. 2020-06-05 17:40:33 +01:00
Simon Pilgrim ea0880ddef TypeMetadataUtils.h - reduce Instructions.h include to forward declaration. NFC.
Move implicit include dependencies down to source file.
2020-06-05 17:40:33 +01:00
Sanjay Patel e50059f6b6 [x86] form reduction intrinsics from vectorizers instead of raw IR
Motivating examples are seen in the PhaseOrdering tests based on:
https://bugs.llvm.org/show_bug.cgi?id=43953#c2 - if we have
intrinsics there, some pass can fold them.

The intrinsics are still named "experimental" at this point, but
if there is no fallout from this patch, that will be a good
indicator that it is safe to finalize them.

Differential Revision: https://reviews.llvm.org/D80867
2020-06-05 12:38:49 -04:00