platform/upstream/llvm.git
3 years agoAdd a new launch flag option for watchos, WatchComplicationLaunch.
Jason Molenda [Tue, 13 Oct 2020 23:27:05 +0000 (16:27 -0700)]
Add a new launch flag option for watchos, WatchComplicationLaunch.

Link against CarouselServices on watchos, recognize the
WatchComplicationLaunch launch flag option when that framework
is available.

<rdar://problem/62473967>, <rdar://problem/61230088>

3 years ago[DDR] Introduce implicit equality check for the source pattern operands with the...
rdzhabarov [Tue, 13 Oct 2020 23:02:49 +0000 (16:02 -0700)]
[DDR] Introduce implicit equality check for the source pattern operands with the same name.

This CL allows user to specify the same name for the operands in the source pattern which implicitly enforces equality on operands with the same name.
E.g., Pat<(OpA $a, $b, $a) ... > would create a matching rule for checking equality for the first and the last operands. Equality of the operands is enforced at any depth, e.g., OpA ($a, $b, OpB($a, $c, OpC ($a))).

Example usage: Pat<(Reshape $arg0, (Shape $arg0)), (replaceWithValue $arg0)>

Note, this feature only covers operands but not attributes.
Current use cases are based on the operand equality and explicitly add the constraint into the pattern. Attribute equality will be worked out on the different CL.

Differential Revision: https://reviews.llvm.org/D89254

3 years agoRevert "PR47805: Use a single object for a function parameter in the caller and"
Richard Smith [Tue, 13 Oct 2020 22:59:00 +0000 (15:59 -0700)]
Revert "PR47805: Use a single object for a function parameter in the caller and"

The buildbots are displeased.

This reverts commit 8d03a972ce8e92815ffe3d5d86aa027605ed92e2.

3 years agoPR47805: Use a single object for a function parameter in the caller and
Richard Smith [Tue, 13 Oct 2020 17:03:02 +0000 (10:03 -0700)]
PR47805: Use a single object for a function parameter in the caller and
callee in constant evaluation.

We previously made a deep copy of function parameters of class type when
passing them, resulting in the destructor for the parameter applying to
the original argument value, ignoring any modifications made in the
function body. This also meant that the 'this' pointer of the function
parameter could be observed changing between the caller and the callee.

This change completely reimplements how we model function parameters
during constant evaluation. We now model them roughly as if they were
variables living in the caller, albeit with an artificially reduced
scope that covers only the duration of the function call, instead of
modeling them as temporaries in the caller that we partially "reparent"
into the callee at the point of the call. This brings some minor
diagnostic improvements, as well as significantly reduced stack usage
during constant evaluation.

3 years agoRemove unused SideEffectInterfaces header
Geoffrey Martin-Noble [Tue, 13 Oct 2020 22:01:56 +0000 (15:01 -0700)]
Remove unused SideEffectInterfaces header

This change removes an unnecessary header introduced in
https://github.com/llvm/llvm-project/commit/c0b3abd19a3e.

Differential Revision: https://reviews.llvm.org/D89347

3 years agoBasic: Simplify SourceManager::getBuffer overload, NFC
Duncan P. N. Exon Smith [Tue, 13 Oct 2020 21:51:38 +0000 (17:51 -0400)]
Basic: Simplify SourceManager::getBuffer overload, NFC

Avoid duplicating code unnecessarily. No functionality change.

3 years ago[MLIR] Add a foldTrait() mechanism to allow traits to define folding and test it...
ahmedsabie [Tue, 13 Oct 2020 20:58:19 +0000 (20:58 +0000)]
[MLIR] Add a foldTrait() mechanism to allow traits to define folding and test it with an Involution trait

This is the same diff as https://reviews.llvm.org/D88809/ except side effect
free check is removed for involution and a FIXME is added until the dependency
is resolved for shared builds. The old diff has more details on possible fixes.

Reviewed By: rriddle, andyly

Differential Revision: https://reviews.llvm.org/D89333

3 years ago[mlir][Linalg] Lower padding attribute for pooling ops
Alberto Magni [Mon, 12 Oct 2020 23:18:44 +0000 (16:18 -0700)]
[mlir][Linalg] Lower padding attribute for pooling ops

Update linalg-to-loops lowering for pooling operations to perform
padding of the input when specified by the corresponding attribute.

Reviewed By: hanchung

Differential Revision: https://reviews.llvm.org/D88911

3 years ago[AMDGPU] Add MC layer support for v_fmac_legacy_f32
Jay Foad [Fri, 9 Oct 2020 15:37:01 +0000 (16:37 +0100)]
[AMDGPU] Add MC layer support for v_fmac_legacy_f32

This instruction was introduced in GFX10.3, reusing the opcode of
v_mac_legacy_f32 from GFX10.1.

Differential Revision: https://reviews.llvm.org/D89247

3 years ago[gn build] Port f0875971249
LLVM GN Syncbot [Tue, 13 Oct 2020 20:50:32 +0000 (20:50 +0000)]
[gn build] Port f0875971249

3 years ago[AIX] Support two itanium alignment LIT testcases for AIX using regex
Xiangling Liao [Thu, 8 Oct 2020 19:21:02 +0000 (15:21 -0400)]
[AIX] Support two itanium alignment LIT testcases for AIX using regex

AIX has different layout dumping format from other itanium ABIs.
And for these two cases, use regex to match AIX format.

Differential Revision: https://reviews.llvm.org/D89064

3 years agoSupport: Allow use of MemoryBufferRef with line_iterator
Duncan P. N. Exon Smith [Mon, 12 Oct 2020 22:00:55 +0000 (18:00 -0400)]
Support: Allow use of MemoryBufferRef with line_iterator

Split out from https://reviews.llvm.org/D66782, use `Optional<MemoryBufferRef>`
in `line_iterator` so you don't need access to a `MemoryBuffer*`.  Follow up
patches in `clang/` will leverage this.

Differential Revision: https://reviews.llvm.org/D89280

3 years agoSupport: Add operator== for MemoryBufferRef and split out MemoryBufferRef.h
Duncan P. N. Exon Smith [Mon, 12 Oct 2020 22:41:15 +0000 (18:41 -0400)]
Support: Add operator== for MemoryBufferRef and split out MemoryBufferRef.h

As preparation for changing `LineIterator` to work with `MemoryBufferRef`:

- Add an `operator==` that uses buffer pointer identity to ensure two buffers
  are equivalent.
- Split out `MemoryBufferRef.h`, to avoid polluting `LineIterator.h` includers
  with everything from `MemoryBuffer.h`. This also means moving the
  `MemoryBuffer` constructor to a source file.

Differential Revision: https://reviews.llvm.org/D89279

3 years ago[mlir-cuda-runner] Unbreak the build
Benjamin Kramer [Tue, 13 Oct 2020 20:36:08 +0000 (22:36 +0200)]
[mlir-cuda-runner] Unbreak the build

CMake Error at llvm/cmake/modules/AddLLVM.cmake:870 (add_dependencies):
  The dependency target "Core" of target "mlir-cuda-runner" does not exist.
Call Stack (most recent call first):
  llvm/cmake/modules/AddLLVM.cmake:1169 (add_llvm_executable)
  mlir/tools/mlir-cuda-runner/CMakeLists.txt:69 (add_llvm_tool)

CMake Error at llvm/cmake/modules/AddLLVM.cmake:870 (add_dependencies):
  The dependency target "LINK_COMPONENTS" of target "mlir-cuda-runner" does
  not exist.
Call Stack (most recent call first):
  llvm/cmake/modules/AddLLVM.cmake:1169 (add_llvm_executable)
  mlir/tools/mlir-cuda-runner/CMakeLists.txt:69 (add_llvm_tool)

CMake Error at llvm/cmake/modules/AddLLVM.cmake:870 (add_dependencies):
  The dependency target "Support" of target "mlir-cuda-runner" does not
  exist.
Call Stack (most recent call first):
  llvm/cmake/modules/AddLLVM.cmake:1169 (add_llvm_executable)
  mlir/tools/mlir-cuda-runner/CMakeLists.txt:69 (add_llvm_tool)

3 years agoReland [CFGuard] Add address-taken IAT tables and delay-load support
Andrew Paverd [Thu, 1 Oct 2020 09:07:40 +0000 (10:07 +0100)]
Reland [CFGuard] Add address-taken IAT tables and delay-load support

This patch adds support for creating Guard Address-Taken IAT Entry Tables (.giats$y sections) in object files, matching the behavior of MSVC. These contain lists of address-taken imported functions, which are used by the linker to create the final GIATS table.
Additionally, if any DLLs are delay-loaded, the linker must look through the .giats tables and add the respective load thunks of address-taken imports to the GFIDS table, as these are also valid call targets.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D87544

3 years ago[mlir][Python] Add missing capsule->module and Context.create_module.
Stella Laurenzo [Tue, 13 Oct 2020 04:19:13 +0000 (21:19 -0700)]
[mlir][Python] Add missing capsule->module and Context.create_module.

* Extends Context/Operation interning to cover Module as well.
* Implements Module.context, Attribute.context, Type.context, and Location.context back-references (facilitated testing and also on the TODO list).
* Adds method to create an empty Module.
* Discovered missing in npcomp.

Differential Revision: https://reviews.llvm.org/D89294

3 years ago[LICM] Don't require AST in LoopPromoter (NFC)
Nikita Popov [Tue, 13 Oct 2020 19:56:59 +0000 (21:56 +0200)]
[LICM] Don't require AST in LoopPromoter (NFC)

While promotion currently always has an AST available, it is only
relevant for invalidation purposes in LoopPromoter, so we do not
need to have it as a hard dependency.

3 years ago[X86] Add test cases for PR47825. NFC
Craig Topper [Tue, 13 Oct 2020 17:21:30 +0000 (10:21 -0700)]
[X86] Add test cases for PR47825. NFC

3 years ago[MemCpyOpt] Add test scaffolding for MSSA based MemCpyOpt
Nikita Popov [Fri, 2 Oct 2020 18:48:39 +0000 (20:48 +0200)]
[MemCpyOpt] Add test scaffolding for MSSA based MemCpyOpt

This adds an -enable-memcpyopt-memoryssa option that currently does
nothing apart from requiring MSSA as a dependency. The tests are
split to run both with the option disabled and enabled. I went with
this rather than the separate directory DSE uses, as I found it
convenient to have a direct side-by-side comparison of differences.

Differential Revision: https://reviews.llvm.org/D89206

3 years ago[mlir][nfc] Add a func to compute numElements of a shape in Std -> LLVM.
Alexander Belyaev [Tue, 13 Oct 2020 19:31:40 +0000 (21:31 +0200)]
[mlir][nfc] Add a func to compute numElements of a shape in Std -> LLVM.

For some reason the variable `cumulativeSizeInBytes` in
`getCumulativeSizeInBytes` was actually storing number of elements. I decided
to fix it and refactor the function a bit.

Differential Revision: https://reviews.llvm.org/D89336

3 years ago[MemCpyOpt] Fix MemorySSA preservation
Nikita Popov [Sat, 3 Oct 2020 09:26:13 +0000 (11:26 +0200)]
[MemCpyOpt] Fix MemorySSA preservation

moveUp() moves instructions, so we should move the corresponding
memory accesses as well. We should also move the store instruction
itself: Even though we'll end up removing it later, this gives us
a correct MemoryDef to replace.

The implementation is somewhat more complicated than it should be,
because we also handle the case where P does not have a memory
access due to a degnerate AA pipeline. Hopefully, the need for this
will go away in the future, when the rest of the pass is based on
MSSA.

Differential Revision: https://reviews.llvm.org/D88778

3 years agoRevert "DirectoryWatcher: add an implementation for Windows"
Reid Kleckner [Tue, 13 Oct 2020 19:35:22 +0000 (12:35 -0700)]
Revert "DirectoryWatcher: add an implementation for Windows"

This reverts commit 5d74c435117526616d2c2665f030263b8f60da1b.
The gtest tests appear to be flaky, and are failing in various places.

3 years ago[Statepoints] Update statepoint mir tests.
Denis Antrushin [Tue, 13 Oct 2020 18:40:53 +0000 (01:40 +0700)]
[Statepoints] Update statepoint mir tests.

Update few tests after statepoint format change (D87154).
These tests exercise functionality not affected by the format change,
so they left unchanged.

3 years ago[SCEV] BuildConstantFromSCEV(): actually properly handle SExt-of-pointer case
Roman Lebedev [Tue, 13 Oct 2020 19:05:07 +0000 (22:05 +0300)]
[SCEV] BuildConstantFromSCEV(): actually properly handle SExt-of-pointer case

As being pointed out by @efriedma in
https://reviews.llvm.org/rGaaafe350bb65#inline-4883
of course we can't just call ptrtoint in sign-extending case
and be done with it, because it will zero-extend.

I'm not sure what i was thinking there.

This is very much not an NFC, however looking at the user of
BuildConstantFromSCEV() i'm not sure how to actually show that
it results in a different constant expression.

3 years ago[MemCpyOpt] Don't shorten memset if memcpy operands may be the same
Nikita Popov [Sat, 10 Oct 2020 16:57:23 +0000 (18:57 +0200)]
[MemCpyOpt] Don't shorten memset if memcpy operands may be the same

If the memcpy operands are the same (which is allowed since D86815)
then the memcpy is effectively a no-op and the partially overlapping
memset is not dead.

Differential Revision: https://reviews.llvm.org/D89192

3 years ago[gn build] Port 77bb3ebebbc
LLVM GN Syncbot [Tue, 13 Oct 2020 19:14:10 +0000 (19:14 +0000)]
[gn build] Port 77bb3ebebbc

3 years ago[gn build] Port 662ed9e67ad
LLVM GN Syncbot [Tue, 13 Oct 2020 19:14:09 +0000 (19:14 +0000)]
[gn build] Port 662ed9e67ad

3 years ago[MemCpyOpt] Don't shorten memset if destination observable through unwinding
Nikita Popov [Sat, 10 Oct 2020 15:47:20 +0000 (17:47 +0200)]
[MemCpyOpt] Don't shorten memset if destination observable through unwinding

MemCpyOpt can shorten a memset if it is later partially overwritten
by a memcpy. It checks that the destination is not read in between,
but we also need to make sure that the destination cannot be observed
via unwinding.

Differential Revision: https://reviews.llvm.org/D89190

3 years agoRevert "[analyzer] NFC: Separate PathDiagnosticConsumer options from AnalyzerOptions."
Artem Dergachev [Tue, 13 Oct 2020 19:07:36 +0000 (12:07 -0700)]
Revert "[analyzer] NFC: Separate PathDiagnosticConsumer options from AnalyzerOptions."

This reverts commit fd4b3f123d6e64769881e4c6351d5bbbdac30ce3.

3 years agoRevert "[analyzer] NFC: Move IssueHash to libAnalysis."
Artem Dergachev [Tue, 13 Oct 2020 19:07:28 +0000 (12:07 -0700)]
Revert "[analyzer] NFC: Move IssueHash to libAnalysis."

This reverts commit b76dc111dd02672488df794570d82e3edbbfa5d8.

3 years agoRevert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis."
Artem Dergachev [Tue, 13 Oct 2020 19:03:04 +0000 (12:03 -0700)]
Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis."

This reverts commit 44b7cf2983b6a8373c99a9b254f8c3f944e03f35.

3 years ago[DebugInfo][docs] Document DILabel in LangRef
Scott Linder [Tue, 13 Oct 2020 18:26:39 +0000 (18:26 +0000)]
[DebugInfo][docs] Document DILabel in LangRef

Add some minimal documentation for DILabel, originally introduced in
D45024. Update the name and semantics of the `variables:` field in the
documentation for `DISubprogram`; the field is now called
`retainedNodes:` and is a heterogeneous list of `DILocalVariable` and
`DILabel`.

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D89082

3 years ago[PowerPC] Add assemble disassemble intrinsics for MMA
Ahsan Saghir [Fri, 2 Oct 2020 14:47:43 +0000 (09:47 -0500)]
[PowerPC] Add assemble disassemble intrinsics for MMA

This patch adds support for assemble disassemble intrinsics
for MMA.

Reviewed By: bsaleil, #powerpc

Differential Revision: https://reviews.llvm.org/D88739

3 years ago[gn build] Port b76dc111dd0
LLVM GN Syncbot [Tue, 13 Oct 2020 17:53:40 +0000 (17:53 +0000)]
[gn build] Port b76dc111dd0

3 years ago[gn build] Port 44b7cf2983b
LLVM GN Syncbot [Tue, 13 Oct 2020 17:53:39 +0000 (17:53 +0000)]
[gn build] Port 44b7cf2983b

3 years ago[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis.
Artem Dergachev [Thu, 30 Jul 2020 15:52:22 +0000 (08:52 -0700)]
[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis.

With this change, we're more or less ready to allow users outside
of the Static Analyzer to take advantage of path diagnostic consumers
for emitting their warnings in different formats.

Differential Revision: https://reviews.llvm.org/D67422

3 years ago[analyzer] NFC: Move IssueHash to libAnalysis.
Artem Dergachev [Wed, 15 Jul 2020 03:26:38 +0000 (20:26 -0700)]
[analyzer] NFC: Move IssueHash to libAnalysis.

IssueHash is an attempt to introduce stable warning identifiers
that won't change when code around them gets moved around.
Path diagnostic consumers print issue hashes for the emitted diagnostics.

This move will allow us to ultimately move path diagnostic consumers
to libAnalysis.

Differential Revision: https://reviews.llvm.org/D67421

3 years ago[analyzer] NFC: Separate PathDiagnosticConsumer options from AnalyzerOptions.
Artem Dergachev [Tue, 14 Jul 2020 04:13:31 +0000 (21:13 -0700)]
[analyzer] NFC: Separate PathDiagnosticConsumer options from AnalyzerOptions.

The AnalyzerOptions object contains too much information that's
entirely specific to the Analyzer. It is also being referenced by
path diagnostic consumers to tweak their behavior. In order for path
diagnostic consumers to function separately from the analyzer,
make a smaller options object that only contains relevant options.

Differential Revision: https://reviews.llvm.org/D67420

3 years ago[ASAN] Make sure we are only processing lifetime markers with offset 0 to alloca
Xun Li [Tue, 13 Oct 2020 17:21:45 +0000 (10:21 -0700)]
[ASAN] Make sure we are only processing lifetime markers with offset 0 to alloca

This patch addresses https://bugs.llvm.org/show_bug.cgi?id=47787 (and hence https://bugs.llvm.org/show_bug.cgi?id=47767 as well).
In latter instrumentation code, we always use the beginning of the alloca as the base for instrumentation, ignoring any offset into the alloca.
Because of that, we should only instrument a lifetime marker if it's actually pointing to the beginning of the alloca.

Differential Revision: https://reviews.llvm.org/D89191

3 years ago[LoopVersioningLICM] Fix noalias metadata emission
Nikita Popov [Tue, 13 Oct 2020 16:38:20 +0000 (18:38 +0200)]
[LoopVersioningLICM] Fix noalias metadata emission

The previous code added the scope on each iteration, so that the
same scope was represented many times in the same !noalias metadata.
That's legal, and semantically equivalent to only storing the scope
once, but it's also wasteful and may pessimize further optimization
if AATags get intersected naively, as done by the AliasSetTracker.

3 years ago[mlir] Fix sporadic build failures due to missing dependency
Stella Stamenova [Tue, 13 Oct 2020 16:53:07 +0000 (09:53 -0700)]
[mlir] Fix sporadic build failures due to missing dependency

The build of MLIR occasionally fails (especially on Windows) because there is missing dependency between MLIRLLVMIR and MLIROpenMPOpsIncGen.

1) LLVMDialect.cpp includes LLVMDialect.h
2) LLVMDialect.h includes OpenMPDialect.h
3) OpenMPDialect.h includes OpenMPOpsDialect.h.inc, OpenMPOpsEnums.h.inc and OpenMPOps.h.inc

The OpenMP .inc files are generated by MLIROpenMPOpsIncGen, so MLIRLLVMIR which builds LLVMDialect.cpp should depend on MLIROpenMPOpsIncGen

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D89275

3 years ago[mlir][Linalg] Fix TensorConstantOp bufferization in Linalg.
Nicolas Vasilache [Tue, 13 Oct 2020 12:30:08 +0000 (12:30 +0000)]
[mlir][Linalg] Fix TensorConstantOp bufferization in Linalg.

TensorConstantOp bufferization currently uses the vector dialect to store constant data into memory.
Due to natural vector size and alignment properties, this is problematic with n>1-D vectors whose most minor dimension is not naturally aligned.

Instead, this revision linearizes the constant and introduces a linalg.reshape to go back to the desired shape.

Still this is still to be considered a workaround and a better longer term solution will probably involve `llvm.global`.

Differential Revision: https://reviews.llvm.org/D89311

3 years ago[libc++] Allow passing relative paths to the Apple install script
Louis Dionne [Tue, 13 Oct 2020 16:27:22 +0000 (12:27 -0400)]
[libc++] Allow passing relative paths to the Apple install script

3 years agoLLD/AMDGPU: Infer os abi based on input llvm bitcode
Konstantin Zhuravlyov [Tue, 13 Oct 2020 15:54:30 +0000 (11:54 -0400)]
LLD/AMDGPU: Infer os abi based on input llvm bitcode

Differential Revision: https://reviews.llvm.org/D89042

3 years agoAMDGPU: Remove -mamdgpu-debugger-abi option
Konstantin Zhuravlyov [Tue, 13 Oct 2020 15:52:57 +0000 (11:52 -0400)]
AMDGPU: Remove -mamdgpu-debugger-abi option

It has been unsupported for few years now.

Differential Revision: https://reviews.llvm.org/D89125

3 years ago[compiler-rt] Allow override of 'emulator' value from lit_config.
Hafiz Abid Qadeer [Tue, 13 Oct 2020 16:08:19 +0000 (17:08 +0100)]
[compiler-rt] Allow override of 'emulator' value from lit_config.

Currently the 'emulator' value is fixed at build time. This patch allows changing the emulator
at testing time and enables us to run the tests on different board or simulators without needing
to run CMake again to change the value of emulator.

With this patch in place, the value of 'emulator' can be changed at test time from the command
line like this:

$ llvm-lit --param=emulator="..."

Reviewed By: delcypher

Differential Revision: https://reviews.llvm.org/D84708

3 years ago[NFC][Regalloc] Use MCRegister in MachineCopyPropagation
Mircea Trofin [Mon, 12 Oct 2020 16:36:01 +0000 (09:36 -0700)]
[NFC][Regalloc] Use MCRegister in MachineCopyPropagation

Differential Revision: https://reviews.llvm.org/D89250

3 years ago[CostModel] rearrange basic intrinsic cost implementation
Sanjay Patel [Tue, 13 Oct 2020 15:52:00 +0000 (11:52 -0400)]
[CostModel] rearrange basic intrinsic cost implementation

This is bigger/uglier than before, but it should allow fixing
all of the broken paths more easily. Test coverage added with
rGfab028b and other commits.

This is not NFC - the scalable vector test would crash
without this patch.

3 years ago[x86] add cost model test for memcpy; NFC
Sanjay Patel [Tue, 13 Oct 2020 14:55:06 +0000 (10:55 -0400)]
[x86] add cost model test for memcpy; NFC

This is treated as a special-case in the base class
implementation of getIntrinsicInstrCost().

3 years ago[mlir][gpu] Add `gpu.wait` op.
Christian Sigg [Tue, 13 Oct 2020 15:21:59 +0000 (17:21 +0200)]
[mlir][gpu] Add `gpu.wait` op.

This combines two separate ops (D88972: `gpu.create_token`, D89043: `gpu.host_wait`) into one.

I do after all like the idea of combining the two ops, because it matches exactly the pattern we are
going to have in the other gpu ops that will implement the AsyncOpInterface (launch_func, copies, alloc):

If the op is async, we return a !gpu.async.token. Otherwise, we synchronize with the host and don't return a token.

The use cases for `gpu.wait async` and `gpu.wait` are further apart than those of e.g. `gpu.h2d async` and `gpu.h2d`,
but I like the consistent meaning of the `async` keyword in GPU ops.

Reviewed By: herhut

Differential Revision: https://reviews.llvm.org/D89160

3 years ago[AMDGPU][GlobalISel] Compute known bits for zero-extending loads
Jay Foad [Tue, 13 Oct 2020 13:40:27 +0000 (14:40 +0100)]
[AMDGPU][GlobalISel] Compute known bits for zero-extending loads

Implement computeKnownBitsForTargetInstr for G_AMDGPU_BUFFER_LOAD_UBYTE
and G_AMDGPU_BUFFER_LOAD_USHORT. This allows generic combines to remove
some unnecessary G_ANDs.

Differential Revision: https://reviews.llvm.org/D89316

3 years ago[lldb][cmake] Remove custom logic for finding VCS file to fix LLDB's VCSVersion.inc...
Raphael Isemann [Tue, 13 Oct 2020 15:13:23 +0000 (17:13 +0200)]
[lldb][cmake] Remove custom logic for finding VCS file to fix LLDB's VCSVersion.inc generation

We are still implementing our own logic for this that looks for a VCS file in
the place where it was before the monorepo migration. This removes this logic
and just uses the CMake function that LLVM/Clang are using.

Reviewed By: JDevlieghere, kastiglione

Differential Revision: https://reviews.llvm.org/D88950

3 years ago[lldb] Allow limiting the number of error diagnostics when parsing an expression
Raphael Isemann [Tue, 13 Oct 2020 15:12:07 +0000 (17:12 +0200)]
[lldb] Allow limiting the number of error diagnostics when parsing an expression

While debugging another bug I found out that we currently don't set any limit
for the number of diagnostics Clang emits. If a user does something that
generates a lot of errors (like including some long header file from within the
expression function), then we currently spam the LLDB output with potentially
thousands of Clang error diagnostics.

Clang sets a default limit of 20 errors, but given that LLDB is often used
interactively for small expressions I would say a limit of 5 is enough. The
limit is implemented as a setting, so if a user cares about seeing having a
million errors printed to their terminal then they can just increase the
settings value.

Reviewed By: shafik, mib

Differential Revision: https://reviews.llvm.org/D88889

3 years ago[lldb] Remove all the RegisterInfo name constification code
Raphael Isemann [Tue, 13 Oct 2020 15:10:10 +0000 (17:10 +0200)]
[lldb] Remove all the RegisterInfo name constification code

RegisterInfo's `reg_name`/`reg_alt_name` fields are C-Strings and are supposed
to only be generated from a ConstString. The reason for that is that
`DynamicRegisterInfo::GetRegisterInfo` and
`RegInfoBasedABI::GetRegisterInfoByName` try to optimise finding registers by
name by only comparing the C string pointer values instead of the underlying
strings. This only works if both C strings involved in the comparison come from
a ConstString. If one of the two C strings doesn't come from a ConstString the
comparison won't work (and most likely will silently fail).

I added an assert in b0060c3a7868ef026d95d0cf8a076791ef74f474 which checks that
both strings come from a ConstString. Apparently not all ABI plugins are
generating their register names via ConstString, so this code is now not just
silently failing but also asserting.

In D88375 we did a shady fix for the MIPS plugins by just copying the
ConstString setup code to that plugin, but we still need to fix ABISysV_arc,
ABISysV_ppc and ABISysV_ppc64 plugins.

I would say we just fix the remaining plugins by removing the whole requirement
to have the register names coming from ConstStrings. I really doubt that we
actually save any time with the whole ConstString search trick (searching ~50
strings that have <4 characters doesn't sound more expensive than calling the
really expensive ConstString constructor + comparing the same amount of pointer
values). Also whatever small percentage of LLDB's runtime is actually spend in
this function is anyway not worth the complexity of this approach.

This patch just removes all this and just does a normal string comparison.

Reviewed By: JDevlieghere, labath

Differential Revision: https://reviews.llvm.org/D88490

3 years ago[lldb][NFC] Remove property predicate matcher
Raphael Isemann [Tue, 13 Oct 2020 15:08:22 +0000 (17:08 +0200)]
[lldb][NFC] Remove property predicate matcher

That's supposed to be used to implement things such as `settings set target.run-args{basename==test&&arch==x86_64} arg1`
but it's not actually fully implemented or tested anywhere.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D88910

3 years ago[lldb] Add targets for running test suite against Watch/TV/iPhone simulators
Raphael Isemann [Tue, 13 Oct 2020 14:50:40 +0000 (16:50 +0200)]
[lldb] Add targets for running test suite against Watch/TV/iPhone simulators

This patch adds several build system targets that run the normal test suite but
against the Watch/TV/iPhone simulators.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D89224

3 years ago[WebAssembly] Added .tabletype to asm and multiple table support in obj files
Paulo Matos [Tue, 13 Oct 2020 14:13:10 +0000 (07:13 -0700)]
[WebAssembly] Added .tabletype to asm and multiple table support in obj files

Adds more testing in basic-assembly.s and a new test tables.s.
Adds support to yaml reading and writing of tables as well.

Differential Revision: https://reviews.llvm.org/D88815

3 years ago[SyntaxTree] Fix rtti for `Expression`.
Eduardo Caldas [Fri, 9 Oct 2020 16:34:01 +0000 (16:34 +0000)]
[SyntaxTree] Fix rtti for `Expression`.

Differential Revision: https://reviews.llvm.org/D89146

3 years ago[AArch64] fix spacing in test's RUN lines; NFC
Sanjay Patel [Tue, 13 Oct 2020 14:43:41 +0000 (10:43 -0400)]
[AArch64] fix spacing in test's RUN lines; NFC

3 years ago[InstructionSimplify] Precommit tests for D89317. NFC.
Sjoerd Meijer [Tue, 13 Oct 2020 14:39:34 +0000 (15:39 +0100)]
[InstructionSimplify] Precommit tests for D89317. NFC.

3 years ago[x86] add tests for cost model kinds of intrinsics; NFC
Sanjay Patel [Tue, 13 Oct 2020 14:27:20 +0000 (10:27 -0400)]
[x86] add tests for cost model kinds of intrinsics; NFC

This provides coverage for existing special-cases and
a sampling of other intrinsics. Current output appears
to be wrong in several cases.

3 years ago[MLIR][SPIRV] Support identified and recursive structs.
ergawy [Tue, 13 Oct 2020 13:52:20 +0000 (09:52 -0400)]
[MLIR][SPIRV] Support identified and recursive structs.

This PR adds support for identified and recursive structs.
This includes: parsing, printing, serializing, and
deserializing such structs.

The following C struct:

```C
struct A {
  A* next;
};
```

which is translated to the following MLIR code as:

```mlir
!spv.struct<A, (!spv.ptr<!spv.struct<A>, Generic>)>
```

would be represented in the SPIR-V module as:

```spirv
OpName %A "A"
OpTypeForwardPointer %APtr Generic
%A = OpTypeStruct %APtr
%APtr = OpTypePointer Generic %A
```

In particular the following changes are included:
- SPIR-V structs can now be either identified or literal
  (i.e. non-identified).
- All structs now have their members surrounded by a ()-pair.
- For recursive references,
  (1) an OpTypeForwardPointer instruction is emitted before
  the OpTypeStruct instruction defining the recursive struct
  (2) an OpTypePointer instruction is emitted after the
  OpTypeStruct instruction which actually defines the recursive
  pointer to struct type.

Reviewed By: antiagainst, rriddle, ftynse

Differential Revision: https://reviews.llvm.org/D87206

3 years ago[mlir-vulkan-runner] Clean up some stale CMake configurations
Lei Zhang [Tue, 13 Oct 2020 14:14:54 +0000 (10:14 -0400)]
[mlir-vulkan-runner] Clean up some stale CMake configurations

3 years agoFix all the CMake code that can only handle -stdlib= but not --stdlib=
Raphael Isemann [Tue, 13 Oct 2020 14:05:00 +0000 (16:05 +0200)]
Fix all the CMake code that can only handle -stdlib= but not --stdlib=

There are several places in LLVM's CMake setup that try to remove the
`stdlib=...` flag from the CMake flags. All this code however only considered
the `-stdlib=` variant of the flag but not the alternative spelling with a
double dash. This causes that when one adds `--stdlib=...` to the user-provided
CMake flags that this gets transformed into just `-` which ends up causing the
build system to think it should read the source from stdin (which then lead to
very confusing build errors).

This just adds the alternative spelling before the`-stdlib=` variant in all
these places

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D87133

3 years ago[lldb][NFC] Fix some invalid escapes sequences in Python strings
Raphael Isemann [Tue, 13 Oct 2020 14:02:47 +0000 (16:02 +0200)]
[lldb][NFC] Fix some invalid escapes sequences in Python strings

I recently had to run the test suite with a debug Python which got started
warning about some invalid escape sequences in LLDB's Python code. They all
attempt to add a backslash by doing a single backslash instead of a double
backslash in a normal string. This seems to work fine for now, but Python says
this behaviour is deprecated, so this patch turns all those strings into raw
strings (where a single backslash is actually a single backslash)

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D88289

3 years ago[TableGen] Add new section to the TableGen Programmer's Reference.
Paul C. Anagnostopoulos [Mon, 12 Oct 2020 22:17:02 +0000 (18:17 -0400)]
[TableGen] Add new section to the TableGen Programmer's Reference.
Fix typos in it and the TableGen Backend Developer's Guide.

3 years ago[ThinLTO][Documentation] Mention possible values for concurrency flags
Alexandre Ganea [Tue, 13 Oct 2020 13:57:48 +0000 (09:57 -0400)]
[ThinLTO][Documentation] Mention possible values for concurrency flags

Differential Revision: https://reviews.llvm.org/D89309

3 years ago[InstCombine] visitTrunc - pass through undefs for trunc(shift(trunc/ext(x),c)) patterns
Simon Pilgrim [Tue, 13 Oct 2020 13:35:02 +0000 (14:35 +0100)]
[InstCombine] visitTrunc - pass through undefs for trunc(shift(trunc/ext(x),c)) patterns

Based on the recent patches D88475 and D88429 where we are losing undef values due to extension/comparisons.

I've added a Constant::mergeUndefsWith method that merges the undef scalar/elements from another Constant into a specific Constant.

Differential Revision: https://reviews.llvm.org/D88687

3 years ago[Analysis] findAffectedValues - remove unused ConstantInt argument. NFCI.
Simon Pilgrim [Tue, 13 Oct 2020 11:16:12 +0000 (12:16 +0100)]
[Analysis] findAffectedValues - remove unused ConstantInt argument. NFCI.

We can use m_ConstantInt without a result value as we don't ever use it.

3 years agoRevert "Raise the timeout in DirectoryWatcherTest to 10 s"
Hans Wennborg [Tue, 13 Oct 2020 13:21:06 +0000 (15:21 +0200)]
Revert "Raise the timeout in DirectoryWatcherTest to 10 s"

It didn't help.

This reverts commit bddef54c502811fa1406d1161d4baa15b56ebc32.

3 years ago[clangd] Propagate CollectMainFileRefs to BackgroundIndex
Nathan Ridge [Tue, 13 Oct 2020 00:41:13 +0000 (20:41 -0400)]
[clangd] Propagate CollectMainFileRefs to BackgroundIndex

This appears to have been an omission in D83536.

Differential Revision: https://reviews.llvm.org/D89284

3 years ago[libc++] Update the <version> header in-place from generate_feature_test_macro_components
Louis Dionne [Tue, 13 Oct 2020 13:16:40 +0000 (09:16 -0400)]
[libc++] Update the <version> header in-place from generate_feature_test_macro_components

This simplifies the workflow for adding new feature-test macros for
contributors. Previously, they would have to move the generated <version>
header from a temporary directory to libc++'s include directory by hand.
This makes the behavior for the <version> header consistent with what's
done for the tests and the documentation.

3 years ago[clang] Improve handling of physical registers in inline assembly operands.
Jonas Paulsson [Tue, 8 Sep 2020 11:06:41 +0000 (13:06 +0200)]
[clang] Improve handling of physical registers in inline assembly operands.

Change EmitAsmStmt() to

- Not tie physregs with the "+r" constraint, but instead add the hard
  register as an input constraint. This makes "+r" and "=r":"r" look the same
  in the output.

  Background: Macro intensive user code may contain inline assembly
  statements with multiple operands constrained to the same physreg. Such a
  case (with the operand constraints "+r" : "r") currently triggers the
  TwoAddressInstructionPass assertion against any extra use of a tied
  register. Furthermore, TwoAddress will insert a COPY to that physreg even
  though isel has already done so (for the non-tied use), which may lead to a
  second redundant instruction currently. A simple fix for this is to not
  emit tied physreg uses in the first place for the "+r" constraint, which is
  what this patch does.

- Give an error on multiple outputs to the same physical register.

  This should be reported and this is also what GCC does.

Review: Ulrich Weigand, Aaron Ballman, Jennifer Yu, Craig Topper

Differential Revision: https://reviews.llvm.org/D87279

3 years ago[lldb] Don't add no-sandbox entitlement when running tests on simulator
Raphael Isemann [Tue, 13 Oct 2020 13:08:20 +0000 (15:08 +0200)]
[lldb] Don't add no-sandbox entitlement when running tests on simulator

It seems that if codesigning the test executables with the
`com.apple.private.security.no-sandbox` entitlement then the simulator refuses
to launch them and every test fails with `Process launch failed: process exited
with status -1 (no such process.)`.

This patch checks if we're trying to run the test suite on the simulator and
then avoids signing the executable with `no-sandbox`.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D89052

3 years ago[lldb] Don't let dotest silently fall back to default SDK if the specified one can...
Raphael Isemann [Tue, 13 Oct 2020 13:07:33 +0000 (15:07 +0200)]
[lldb] Don't let dotest silently fall back to default SDK if the specified one can't be found

If the SDK name passed to dotest can't be found by `xcrun` we silently fall back
to the default SDK. This leads to rather cryptic errors being reported later on
when linking the actual test executables.

Instead just directly log and abort when this situation is encountered and
inform the user about the invalid argument.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D89053

3 years ago[lldb] Fill Watch/AppleTV simulator gaps in PlatformDarwin
Raphael Isemann [Tue, 13 Oct 2020 12:35:55 +0000 (14:35 +0200)]
[lldb] Fill Watch/AppleTV simulator gaps in PlatformDarwin

When running the test suite against the Watch/AppleTV simulator we currently hitting
the unimplemented parts of PlatformDarwin for the respective simulator platforms.

This just adds the respective switch cases.

This whole code path depends on having a valid Target, so can't just unittest this code
without refactoring it. So instead this is tested by just running the testsuite against
the respective simulators (which is how I found this).

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D89106

3 years ago[AArch64] add cost model test for scalable vector math; NFC
Sanjay Patel [Tue, 13 Oct 2020 12:35:43 +0000 (08:35 -0400)]
[AArch64] add cost model test for scalable vector math; NFC

Testing for the various cost model "TargetCostKind" is limited,
and testing for scalable vectors is limited. The motivating
example of an intrinsic is not included here yet because that
just crashes.

3 years agoRaise the timeout in DirectoryWatcherTest to 10 s
Hans Wennborg [Tue, 13 Oct 2020 12:24:02 +0000 (14:24 +0200)]
Raise the timeout in DirectoryWatcherTest to 10 s

After D88666, which implemented DirectoryWatcher on Windows, we're
seeing test failures on Chromium's Windows bots.

Try raising the timeout in case the test is failing due to high load on
the machine.

3 years agoFix Windows/MSVC build after 6e56046f65
Evgeny Leviant [Tue, 13 Oct 2020 12:24:58 +0000 (15:24 +0300)]
Fix Windows/MSVC build after 6e56046f65

Commit 6e56046f65 may trigger SEGV in llvm-tablegen if the latter
is built with -DLLVM_OPTIMIZED_TABLEGEN=OFF. The reason of SEGV was
accessing stale memory after expansion of std::vector.

3 years ago[ConstraintElimination] Add add/sub/and/or test cases.
Florian Hahn [Wed, 5 Aug 2020 14:21:52 +0000 (15:21 +0100)]
[ConstraintElimination] Add add/sub/and/or test cases.

This adds a new set of tests for upcoming constraint elimination
changes.

3 years ago[clang-tidy] Add an example for misc-unused-alias-decls
Sylvestre Ledru [Mon, 12 Oct 2020 21:32:40 +0000 (23:32 +0200)]
[clang-tidy] Add an example for misc-unused-alias-decls

Differential Revision: https://reviews.llvm.org/D89270

3 years ago[AST] Change return type of getTypeInfoInChars to a proper struct instead of std...
Bevin Hansson [Mon, 24 Aug 2020 08:19:29 +0000 (10:19 +0200)]
[AST] Change return type of getTypeInfoInChars to a proper struct instead of std::pair.

Followup to D85191.

This changes getTypeInfoInChars to return a TypeInfoChars
struct instead of a std::pair of CharUnits. This lets the
interface match getTypeInfo more closely.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D86447

3 years ago[Fixed Point] Add fixed-point to floating point cast types and consteval.
Bevin Hansson [Wed, 26 Aug 2020 14:46:57 +0000 (16:46 +0200)]
[Fixed Point] Add fixed-point to floating point cast types and consteval.

Reviewed By: leonardchan

Differential Revision: https://reviews.llvm.org/D86631

3 years ago[GlobalISel] Avoid making G_PTR_ADD with nullptr
Mirko Brkusanin [Tue, 13 Oct 2020 10:54:59 +0000 (12:54 +0200)]
[GlobalISel] Avoid making G_PTR_ADD with nullptr

When the first operand is a null pointer we can avoid making a G_PTR_ADD and
make a G_INTTOPTR with the offset operand.
This helps us avoid making add with 0 later on for targets such as AMDGPU.

Differential Revision: https://reviews.llvm.org/D87140

3 years ago[Test] Add test showing that SCEV cannot compute IV's range
Max Kazantsev [Tue, 13 Oct 2020 10:51:47 +0000 (17:51 +0700)]
[Test] Add test showing that SCEV cannot compute IV's range

3 years ago[AArch64] Identify SAD pattern
Vinay Madhusudan [Tue, 13 Oct 2020 09:48:30 +0000 (15:18 +0530)]
[AArch64] Identify SAD pattern

(ABS (SUB (EXTEND a), (EXTEND b))) to ZERO_EXTEND((UABD a, b))
(ABS (SUB (SIGN_EXTEND a), (SIGN_EXTEND b))) to ZERO_EXTEND((SABD a, b))

This partially solves the bug: https://bugs.llvm.org/show_bug.cgi?id=46888
Meta ticket: https://bugs.llvm.org/show_bug.cgi?id=46929

Differential Revision: https://reviews.llvm.org/D88742

3 years agoRevert " Enable LSAN for Android"
Vitaly Buka [Tue, 13 Oct 2020 10:02:30 +0000 (03:02 -0700)]
Revert "    Enable LSAN for Android"

Breaks android build.
asan_malloc_dispatch_k needs memalign interceptor disabled in this patch.

This reverts commit a2291a58bf1c860d026581fee6fe96019dc25440.

3 years agoRevert "[VPlan] Use VPValue def for VPMemoryInstructionRecipe."
Vitaly Buka [Tue, 13 Oct 2020 10:00:35 +0000 (03:00 -0700)]
Revert "[VPlan] Use VPValue def for VPMemoryInstructionRecipe."

It introduced a memory leak.

This reverts commit 525b085a65d30a5f2ae2af38c0be252fe8d4781b.

3 years ago[AArch64] Implement .variant_pcs directive
Cullen Rhodes [Thu, 8 Oct 2020 14:51:10 +0000 (14:51 +0000)]
[AArch64] Implement .variant_pcs directive

A dynamic linker with lazy binding support may need to handle variant
PCS function symbols specially, so an ELF symbol table marking
STO_AARCH64_VARIANT_PCS [1] was added to address this.

Function symbols that follow the vector PCS are marked via the
.variant_pcs assembler directive, which takes a single parameter
specifying the symbol name and sets the STO_AARCH64_VARIANT_PCS st_other
flag in the object file.

[1] https://github.com/ARM-software/abi-aa/blob/master/aaelf64/aaelf64.rst#st-other-values

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D89138

3 years ago[TableGen][SchedModels] Fix aliasing of SchedWriteVariant
Evgeny Leviant [Tue, 13 Oct 2020 10:05:24 +0000 (13:05 +0300)]
[TableGen][SchedModels] Fix aliasing of SchedWriteVariant

Differential revision: https://reviews.llvm.org/D89114

3 years ago[SVE] Add ISel patterns for "insert undef_nxv#f##, f##, 0"
Paul Walker [Mon, 12 Oct 2020 11:36:43 +0000 (12:36 +0100)]
[SVE] Add ISel patterns for "insert undef_nxv#f##, f##, 0"

Differential Revision: https://reviews.llvm.org/D89235

3 years ago[ARM] Follow AACPS standard for volatile bit-fields access width
Ties Stuij [Wed, 30 Sep 2020 13:44:27 +0000 (14:44 +0100)]
[ARM] Follow AACPS standard for volatile bit-fields access width

This patch resumes the work of D16586.
According to the AAPCS, volatile bit-fields should
be accessed using containers of the widht of their
declarative type. In such case:
```
struct S1 {
  short a : 1;
}
```
should be accessed using load and stores of the width
(sizeof(short)), where now the compiler does only load
the minimum required width (char in this case).
However, as discussed in D16586,
that could overwrite non-volatile bit-fields, which
conflicted with C and C++ object models by creating
data race conditions that are not part of the bit-field,
e.g.
```
struct S2 {
  short a;
  int  b : 16;
}
```
Accessing `S2.b` would also access `S2.a`.

The AAPCS Release 2020Q2
(https://documentation-service.arm.com/static/5efb7fbedbdee951c1ccf186?token=)
section 8.1 Data Types, page 36, "Volatile bit-fields -
preserving number and width of container accesses" has been
updated to avoid conflict with the C++ Memory Model.
Now it reads in the note:
```
This ABI does not place any restrictions on the access widths of bit-fields where the container
overlaps with a non-bit-field member or where the container overlaps with any zero length bit-field
placed between two other bit-fields. This is because the C/C++ memory model defines these as being
separate memory locations, which can be accessed by two threads simultaneously. For this reason,
compilers must be permitted to use a narrower memory access width (including splitting the access into
multiple instructions) to avoid writing to a different memory location. For example, in
struct S { int a:24; char b; }; a write to a must not also write to the location occupied by b, this requires at least two
memory accesses in all current Arm architectures. In the same way, in struct S { int a:24; int:0; int b:8; };,
writes to a or b must not overwrite each other.
```

I've updated the patch D16586 to follow such behavior by verifying that we
only change volatile bit-field access when:
 - it won't overlap with any other non-bit-field member
 - we only access memory inside the bounds of the record
 - avoid overlapping zero-length bit-fields.

Regarding the number of memory accesses, that should be preserved, that will
be implemented by D67399.

Reviewed By: ostannard

Differential Revision: https://reviews.llvm.org/D72932

3 years ago[SCEV] BuildConstantFromSCEV(): properly handle SCEVSignExtend from ptr
Roman Lebedev [Tue, 13 Oct 2020 09:19:02 +0000 (12:19 +0300)]
[SCEV] BuildConstantFromSCEV(): properly handle SCEVSignExtend from ptr

Much similar to the ZExt/Trunc handling.
Thanks goes to Alexander Richardson for nudging towards noticing this one proactively.

The appropriate (currently crashing) test coverage added.

3 years ago[AMDGPU] v_mac_legacy_f32 does not support DPP
Jay Foad [Mon, 12 Oct 2020 14:49:55 +0000 (15:49 +0100)]
[AMDGPU] v_mac_legacy_f32 does not support DPP

Differential Revision: https://reviews.llvm.org/D89245

3 years agoAdd expected response time and escalation path to the security docs
Pietro Albini [Tue, 13 Oct 2020 08:51:26 +0000 (10:51 +0200)]
Add expected response time and escalation path to the security docs

Following up on the discussion within the group during the roundtable at
the 2020 LLVM Developers Meeting, this commit adds to the security docs:

* How long we expect acknowledging security reports will take
* The escalation path the reporter can follow if they get no response

A temporary line inviting reporters to directly follow the escalation
path while the mailing list is being setup is also added.

Differential Revision: https://reviews.llvm.org/D89068

3 years ago[SCEV] BuildConstantFromSCEV(): properly handle SCEVZeroExtend from ptr
Roman Lebedev [Tue, 13 Oct 2020 08:45:33 +0000 (11:45 +0300)]
[SCEV] BuildConstantFromSCEV(): properly handle SCEVZeroExtend from ptr

As being reported in https://reviews.llvm.org/D88806#2326944,
this is pretty much the sibling problem of https://reviews.llvm.org/D88806#2325340,
with root cause being that SCEV now models `ptrtoint` as trunc/zext/self of unknown.

The appropriate (currently crashing) test coverage added.

3 years ago[X86] Convert integer _mm_reduce_* intrinsics to emit llvm.reduction intrinsics ...
Simon Pilgrim [Tue, 13 Oct 2020 08:28:21 +0000 (09:28 +0100)]
[X86] Convert integer _mm_reduce_* intrinsics to emit llvm.reduction intrinsics (PR47506)

Emit the equivalent integer reduction intrinsics in IR instead of expanding to shuffle+arithmetic sequences.

The fadd/fmul reductions might be trickier as they assume a similar bisection reduction while the generic intrinsics assume a sequential reduction (intel docs are ambiguous on the correct approach) - I'm not sure if we want to always tag them with reassoc? Anyway, that issue can wait until a separate fp patch along with the fmin/fmax reductions.

Differential Revision: https://reviews.llvm.org/D87604

3 years ago[InstCombine] Support uniform vector splats in ((((X >> C) & CC) + Y) << C) folds.
Simon Pilgrim [Mon, 12 Oct 2020 17:55:11 +0000 (18:55 +0100)]
[InstCombine] Support uniform vector splats in ((((X >> C) & CC) + Y) << C) folds.

Add support for uniform vector splats (no undefs).

3 years ago[Test] Use generated auto-checks to make further changes more visible
Max Kazantsev [Tue, 13 Oct 2020 08:16:00 +0000 (15:16 +0700)]
[Test] Use generated auto-checks to make further changes more visible

3 years ago[AMDGPU] Use lowercase for subtarget feature names in RUN lines
Jay Foad [Tue, 13 Oct 2020 08:01:45 +0000 (09:01 +0100)]
[AMDGPU] Use lowercase for subtarget feature names in RUN lines