platform/upstream/llvm.git
3 years ago[MLIR][SPIRVToLLVM] Conversion for inverse sqrt and tanh
George Mitenkov [Thu, 30 Jul 2020 07:24:10 +0000 (10:24 +0300)]
[MLIR][SPIRVToLLVM] Conversion for inverse sqrt and tanh

This is a second patch on conversion of GLSL ops to LLVM dialect.
It introduces patterns to convert `spv.InverseSqrt` and `spv.Tanh`.

Reviewed By: antiagainst

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

3 years ago[Analyzer] Remove inclusion of uniqueing decl from diagnostic profile.
Balázs Kéri [Thu, 30 Jul 2020 06:36:05 +0000 (08:36 +0200)]
[Analyzer] Remove inclusion of uniqueing decl from diagnostic profile.

The uniqueing decl in PathDiagnostic is the declaration with the
uniqueing loc, as stated by documentation comments.
It is enough to include the uniqueing loc in the profile. It is possible
to have objects with different uniqueing decl but same location, at
least with templates. These belong to the same class and should have
same profile.

Reviewed By: vsavchenko, NoQ

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

3 years ago[SVE][CodeGen] At -O0 fallback to DAG ISel when translating alloca with scalable...
David Sherwood [Tue, 28 Jul 2020 12:28:14 +0000 (13:28 +0100)]
[SVE][CodeGen] At -O0 fallback to DAG ISel when translating alloca with scalable types

When building code at -O0 We weren't falling back to DAG ISel correctly
when encountering alloca instructions with scalable vector types. This
is because the alloca has no operands that are scalable. I've fixed this by
adding a check in AArch64ISelLowering::fallBackToDAGISel for alloca
instructions with scalable types.

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

3 years ago[Concepts] Fix a deserialization crash.
Haojian Wu [Thu, 30 Jul 2020 07:19:58 +0000 (09:19 +0200)]
[Concepts] Fix a deserialization crash.

`TemplateTypeParmDecl::hasTypeConstraint` is not a safe guard for
checking `TemplateTypeParmDecl::getTypeConstraint()` result is null.

in somecases (e.g. implicit deduction guide templates synthesized from the
constructor, immediately-declared constraint is not formed because of an error),
hasTypeConstraint returns false, and getTypeConstraint returns a nullptr.

Fix https://bugs.llvm.org/show_bug.cgi?id=46790

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

3 years ago[MLIR][SPIRVToLLVM] Conversion patterns for GLSL ops
George Mitenkov [Thu, 30 Jul 2020 06:22:44 +0000 (09:22 +0300)]
[MLIR][SPIRVToLLVM] Conversion patterns for GLSL ops

This is the first patch that adds support for GLSL extended
instruction set ops. These are direct conversions, apart from `spv.Tan`
that is lowered to `sin() / cos()`.

Reviewed By: antiagainst

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

3 years ago[clangd] Fix an assertion failure in TargetFinder's heuristic resolution of dependent...
Haojian Wu [Wed, 29 Jul 2020 11:58:12 +0000 (13:58 +0200)]
[clangd] Fix an assertion failure in TargetFinder's heuristic resolution of dependent type.

The assertion is not true anymore after D82739, this patch just removes
it, and rename related functions.

And also fixes a missing cases.

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

3 years ago[X86] Pass the OperandVector to ParseMemOperand instead of returning the operand...
Craig Topper [Thu, 30 Jul 2020 06:19:43 +0000 (23:19 -0700)]
[X86] Pass the OperandVector to ParseMemOperand instead of returning the operand. NFCI

Continue the change made to ParseATTOperand to take the vector by
reference. Let ParseMemOperand add its memory operand to the
vector and just return true/false to indicate error.

3 years ago[X86] Don't pass some many parameters to ParseMemOperand by reference.
Craig Topper [Thu, 30 Jul 2020 05:57:28 +0000 (22:57 -0700)]
[X86] Don't pass some many parameters to ParseMemOperand by reference.

Pointers and SMLocs are cheap to copy. Even though the function
modifies some of these the caller doesn't use them after the call.

3 years ago[Support] Class to facilitate file locking
Serge Pavlov [Wed, 29 Apr 2020 04:26:19 +0000 (11:26 +0700)]
[Support] Class to facilitate file locking

This change define RAII class `FileLocker` and methods `lock` and
`tryLockFor` of the class `raw_fd_stream` to facilitate using file locks.

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

3 years ago[NFC] Remove unused variable
Max Kazantsev [Thu, 30 Jul 2020 06:31:16 +0000 (13:31 +0700)]
[NFC] Remove unused variable

3 years ago[Analyzer] Use of BugType in DereferenceChecker (NFC).
Balázs Kéri [Thu, 30 Jul 2020 06:31:39 +0000 (08:31 +0200)]
[Analyzer] Use of BugType in DereferenceChecker (NFC).

Use of BuiltinBug is replaced by BugType.
Class BuiltinBug seems to have no benefits and is confusing.

Reviewed By: Szelethus, martong, NoQ, vsavchenko

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

3 years ago[AMDGPU] Fix DWARF extensions User Guide table of contents
Tony [Thu, 30 Jul 2020 05:10:21 +0000 (05:10 +0000)]
[AMDGPU] Fix DWARF extensions User Guide table of contents

3 years ago[AMDGPU] DWARF proposal changes
Tony [Fri, 3 Jul 2020 22:31:53 +0000 (22:31 +0000)]
[AMDGPU] DWARF proposal changes

- Clarify that these are extensions to DWARF 5 and not as yet a
  proposal.

Reviewed By: scott.linder

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

3 years ago[X86] Teach the assembler parser to handle a '*' between segment register and base...
Craig Topper [Thu, 30 Jul 2020 04:14:21 +0000 (21:14 -0700)]
[X86] Teach the assembler parser to handle a '*' between segment register and base/index/displacement part of an address

A '*' after the segment is equivalent to a '*' before the segment register. To make the AsmMatcher table work we need to place the '*' token into the operand vector before the full memory operand. To accomplish this I've modified some portions of operand parsing to expose the operand vector to ParseATTOperand so that the token can be pushed to the vector after parsing the segment register and before creating the memory operand using that segment register.

Fixes PR46879

Reviewed By: MaskRay

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

3 years ago[DebugInfo] Fix to ctor homing to ignore classes with trivial ctors.
Amy Huang [Thu, 30 Jul 2020 02:54:08 +0000 (19:54 -0700)]
[DebugInfo] Fix to ctor homing to ignore classes with trivial ctors.

Previously ctor homing was omitting debug info for classes if they
have both trival and nontrivial constructors, but we should only omit debug
info if the class doesn't have any trivial constructors.

retained types list.

bug: https://bugs.llvm.org/show_bug.cgi?id=46537

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

3 years agoFor some tests targeting SystemZ, -march=z13 ---> -mcpu=z13
Yuanfang Chen [Thu, 30 Jul 2020 01:34:32 +0000 (18:34 -0700)]
For some tests targeting SystemZ, -march=z13 ---> -mcpu=z13

z13 is not a target. It is a CPU.

3 years agoNFC. Fix comments
Yuanfang Chen [Tue, 28 Jul 2020 23:52:13 +0000 (16:52 -0700)]
NFC. Fix comments

3 years ago[llvm-readobj] NFC. Add -help description of --hex-dump and
Yuanfang Chen [Sat, 25 Jul 2020 19:24:37 +0000 (12:24 -0700)]
[llvm-readobj] NFC. Add -help description of --hex-dump and
--string-dump

3 years ago[PowerPC] Fix RM operands for some instructions
Kang Zhang [Thu, 30 Jul 2020 02:10:49 +0000 (02:10 +0000)]
[PowerPC] Fix RM operands for some instructions

Summary:
Some instructions have set the wrong [RM] flag, this patch is to fix it.

Instructions x(v|s)r(d|s)pi[zmp]? and fri[npzm] use fixed rounding
directions without referencing current rounding mode.

Also, the SETRNDi, SETRND, BCLRn, MTFSFI, MTFSB0, MTFSB1, MTFSFb,
MTFSFI, MTFSFI_rec, MTFSF, MTFSF_rec should also fix the RM flag.

Reviewed By: jsji

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

3 years ago[AMDGPU] DWARF proposal changes for expression context
Tony [Fri, 3 Jul 2020 22:31:53 +0000 (22:31 +0000)]
[AMDGPU] DWARF proposal changes for expression context

- Clarify what context is used in DWARF expression evaluation.

- Define location descriptions to fully resolve the context and so
  include the context in their result.

- As a consequence of location descriptions being fully resoved,
  change address spaces so only a swizzled and unswizzled private
  address space is defined. The lane is now part of the location
  description context.

- Clarify how call frame information is used to fully resolve
  expressions that specify registers.

Reviewed By: scott.linder

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

3 years agoGlobalISel: Use result of find rather than rechecking map
Matt Arsenault [Wed, 29 Jul 2020 13:42:03 +0000 (09:42 -0400)]
GlobalISel: Use result of find rather than rechecking map

3 years agoGlobalISel: Handle assorted no-op intrinsics
Matt Arsenault [Wed, 29 Jul 2020 12:55:02 +0000 (08:55 -0400)]
GlobalISel: Handle assorted no-op intrinsics

SelectionDAGBuilder just drops these, so do the same.

3 years ago[lldb] Move finish_swig logic into a function in the binding dir
Jonas Devlieghere [Thu, 30 Jul 2020 00:56:38 +0000 (17:56 -0700)]
[lldb] Move finish_swig logic into a function in the binding dir

Move the finish_swig logic into a function in the bindings directory. By
making this a function I can reuse the logic internally where we ship
two Python versions and therefore need to finish the bindings twice.

3 years agoPR46729: Reject explicit and partial specializations with C linkage.
Richard Smith [Wed, 29 Jul 2020 23:49:05 +0000 (16:49 -0700)]
PR46729: Reject explicit and partial specializations with C linkage.

3 years ago[JumpThreading] Fold br(freeze(undef))
Juneyoung Lee [Thu, 30 Jul 2020 00:38:50 +0000 (09:38 +0900)]
[JumpThreading] Fold br(freeze(undef))

This patch makes JumpThreading fold br(freeze(undef)) if the freeze instruction
is only used by the branch.

Reviewed By: efriedma

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

3 years ago[profile] Add InstrProfilingInternal.c.o to Darwin kext builtins
Vedant Kumar [Thu, 30 Jul 2020 00:22:27 +0000 (17:22 -0700)]
[profile] Add InstrProfilingInternal.c.o to Darwin kext builtins

Fixes a build failure in the Darwin kernel. Tested with:

% nm -m ./lib/libclang_rt.cc_kext_x86_64_osx.a | grep lprofSetProfileDumped

rdar://66249602

3 years ago[Darwin][compiler-rt] kern.osproductversion unavailable pre macOS 10.13
Julian Lettner [Wed, 29 Jul 2020 19:50:49 +0000 (12:50 -0700)]
[Darwin][compiler-rt] kern.osproductversion unavailable pre macOS 10.13

Add a fallback for `sysctl kern.osproductversion` for XNU 17 (macOS
10.13) and below, which do not provide this property.

Unfortunately, this means we have to take the detour via Darwin kernel
version again (at least for the fallback).

Reviewed By: delcypher

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

3 years agoGlobalISel: Handle llvm.roundeven
Matt Arsenault [Sun, 19 Jul 2020 13:56:15 +0000 (09:56 -0400)]
GlobalISel: Handle llvm.roundeven

I still think it's highly questionable that we have two intrinsics
with identical behavior and only vary by the name of the libcall used
if it happens to be lowered that way, but try to reduce the feature
delta between SDAG and GlobalISel for recently added intrinsics. I'm
not sure which opcode should be considered the canonical one, but
lower roundeven back to round.

3 years ago[llvm][NFC] TensorSpec abstraction for ML evaluator
Mircea Trofin [Wed, 29 Jul 2020 23:29:21 +0000 (16:29 -0700)]
[llvm][NFC] TensorSpec abstraction for ML evaluator

Further abstracting the specification of a tensor, to more easily
support different types and shapes of tensor, and also to perform
initialization up-front, at TFModelEvaluator construction time.

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

3 years ago[DFSan] Remove dfsan_use_fast16labels from abilist.
Matt Morehouse [Wed, 29 Jul 2020 23:18:07 +0000 (23:18 +0000)]
[DFSan] Remove dfsan_use_fast16labels from abilist.

Its implementation was scrapped in the final fast16labels
instrumentation patch.

3 years agoRevert "build: always add support for assembly targets on Darwin"
Francis Visoiu Mistrih [Wed, 29 Jul 2020 22:41:04 +0000 (15:41 -0700)]
Revert "build: always add support for assembly targets on Darwin"

This reverts commit d8e8e32d85f1cbde2a6b67af010fba3c3a3c86e9.

This breaks the build on GreenDragon:
http://green.lab.llvm.org/green/job/clang-stage1-RA/13171/console

3 years ago[lldb] Fix llvm-lit in standalone builds
Jonas Devlieghere [Wed, 29 Jul 2020 22:37:11 +0000 (15:37 -0700)]
[lldb] Fix llvm-lit in standalone builds

LLVM's make_paths_relative uses Python3_EXECUTABLE which isn't set in
standalone LLDB builds.

3 years ago[darwin] build and link with a separate compiler-rt builtins library
Alex Lorenz [Fri, 24 Jul 2020 23:01:48 +0000 (16:01 -0700)]
[darwin] build and link with a separate compiler-rt builtins library
for device simulators

This change separates out the iOS/tvOS/watchOS simulator slices from the "libclang_rt.<os>.a"
fat archive, by moving them out to their own "libclang_rt.<os>sim.a" static archive.
This allows us to build and to link with an arm64 device simulator slice for the simulators running
on Apple Silicons, and to distribute it in one archive alongside the Intel simulator slices.

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

3 years agoRevert "[PGO] Include the mem ops into the function hash."
Hiroshi Yamauchi [Wed, 29 Jul 2020 22:04:57 +0000 (15:04 -0700)]
Revert "[PGO] Include the mem ops into the function hash."

This reverts commit 120e66b3418b37b95fc1dbbb23e296a602a24fa8.

Due to a buildbot failure.

3 years ago[LLDB] Add checks for ValueObjectSP in Cocoa summary providers
shafik [Wed, 29 Jul 2020 20:29:16 +0000 (13:29 -0700)]
[LLDB] Add checks for ValueObjectSP in Cocoa summary providers

We saw a crash recently (rdar://problem/65276489) that looks related to an invalid ValueObjectSP in a summary providers in Cocoa.cpp e.g. NSBundleSummaryProvider(...).
This adds checks before we use them usually by calling NSStringSummaryProvider.

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

3 years ago[X86] Remove unused argument from HandleAVX512Operand in the assembly parser.
Craig Topper [Wed, 29 Jul 2020 20:08:14 +0000 (13:08 -0700)]
[X86] Remove unused argument from HandleAVX512Operand in the assembly parser.

3 years ago[opt][NewPM] Fix typo
Arthur Eubanks [Wed, 29 Jul 2020 21:13:08 +0000 (14:13 -0700)]
[opt][NewPM] Fix typo

From https://reviews.llvm.org/D84872.

3 years ago[InstSimplify] fold min/max intrinsic with undef operand
Sanjay Patel [Wed, 29 Jul 2020 20:42:11 +0000 (16:42 -0400)]
[InstSimplify] fold min/max intrinsic with undef operand

3 years ago[InstSimplify] fold min/max with opposite of limit value
Sanjay Patel [Wed, 29 Jul 2020 17:43:33 +0000 (13:43 -0400)]
[InstSimplify] fold min/max with opposite of limit value

3 years agobuild: always add support for assembly targets on Darwin
Saleem Abdulrasool [Wed, 22 Jul 2020 15:54:36 +0000 (08:54 -0700)]
build: always add support for assembly targets on Darwin

When attempting to build compiler-rt on a developer transition kit, the
build would fail due to `.S` files not being handled properly by the
Ninja generator.  Rather than conditionalising on Xcode, conditionalise
to Darwin.  Because we know that the system compiler is clang based, it
will always properly handle the pre-processing based on the extension.

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

3 years ago[PGO] Include the mem ops into the function hash.
Hiroshi Yamauchi [Tue, 28 Jul 2020 17:09:49 +0000 (10:09 -0700)]
[PGO] Include the mem ops into the function hash.

To avoid hash collisions when the only difference is in mem ops.

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

3 years ago[NewPM][opt] Revert to legacy PM when any codegen passes are specified
Arthur Eubanks [Wed, 22 Jul 2020 15:40:30 +0000 (08:40 -0700)]
[NewPM][opt] Revert to legacy PM when any codegen passes are specified

This reduces the number of check-llvm failures by 500.

Ideally we'd have a codegen version of PassRegistry.def, or have all the
codegen passes ported and put into PassRegistry.def. But since that
doesn't exist yet, hardcode the list of codegen IR passes.

There are still codegen passes missing from this list, I'll add them
later as I stumble upon them.

Reviewed By: asbirlea, ychen

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

3 years ago[OpenMP] Fix D83281 issue on windows by allowing `dso_local` in CHECK [2/1]
Johannes Doerfert [Wed, 29 Jul 2020 20:46:43 +0000 (15:46 -0500)]
[OpenMP] Fix D83281 issue on windows by allowing `dso_local` in CHECK [2/1]

The problem with 8723280b68b1e5ed97a699466720b36a32a9e406 was that the
`dso_local` is *before* the void not after. Hope this works.

3 years ago[libc] Adds fuzz test for strstr and alphabetizes string fuzz CMakeList.
cgyurgyik [Wed, 29 Jul 2020 20:29:19 +0000 (16:29 -0400)]
[libc] Adds fuzz test for strstr and alphabetizes string fuzz CMakeList.

Reviewed By: sivachandra

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

3 years ago[Statepoint] Enable cross block relocates w/vreg lowering
Philip Reames [Wed, 29 Jul 2020 20:28:26 +0000 (13:28 -0700)]
[Statepoint] Enable cross block relocates w/vreg lowering

This change is mechanical, it just removes the restriction and updates tests.  The key building blocks were submitted in 31342eb and 8fe2abc.

Note that this (and preceeding changes) entirely subsumes D83965.  I did includes a couple of it's tests.

From the codegen changes, an interesting observation: this doesn't actual reduce spilling, it just let's the register allocator do it's job.  That results in a slightly different overall result which has both pros and cons over the eager spill lowering.  (i.e. We'll have some perf tuning to do once this is stable.)

3 years ago[lldb] implement 'up' and 'down' shortcuts in lldb gui
Luboš Luňák [Sat, 5 Oct 2019 19:14:01 +0000 (21:14 +0200)]
[lldb] implement 'up' and 'down' shortcuts in lldb gui

Also add a unittest.

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

3 years ago[lldb] change shortcut for 'step out' from 'o' to 'f'
Luboš Luňák [Fri, 11 Oct 2019 19:59:50 +0000 (21:59 +0200)]
[lldb] change shortcut for 'step out' from 'o' to 'f'

This makes it consistent with gdb tui, where 'f' is 'finish'.
See the discussion at https://reviews.llvm.org/D68541 .

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

3 years ago[lldb] remove somewhat dangerous 'd'(etach) and 'k'(ill) shortcuts
Luboš Luňák [Fri, 11 Oct 2019 19:42:56 +0000 (21:42 +0200)]
[lldb] remove somewhat dangerous 'd'(etach) and 'k'(ill) shortcuts

'd' would be much better used for up/down shortcuts, and this also removes
the possibility of ruining the whole debugging session by accidentally
hitting 'd' or 'k'. Also change menu to have both 'detach and resume'
and 'detach suspended' to make it clear which one is which. See
discussion at https://reviews.llvm.org/D68541 .

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

3 years ago[mlir] [VectorOps] [integration_test] Sparse matrix times vector (jagged SAXPY version)
aartbik [Wed, 29 Jul 2020 20:25:31 +0000 (13:25 -0700)]
[mlir] [VectorOps] [integration_test] Sparse matrix times vector (jagged SAXPY version)

Transposed jagged diagonal storage yields longer vector lengths. Also, in
contrast with naive SAXPY (one gather/scatter), this only performs one gather.

Reviewed By: reidtatge

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

3 years ago[OpenMP] Fix D83281 issue on windows by allowing `dso_local` in CHECK
Johannes Doerfert [Wed, 29 Jul 2020 20:18:20 +0000 (15:18 -0500)]
[OpenMP] Fix D83281 issue on windows by allowing `dso_local` in CHECK

3 years ago[ConstantRange] Add API for intrinsics (NFC)
Nikita Popov [Sat, 25 Jul 2020 14:21:55 +0000 (16:21 +0200)]
[ConstantRange] Add API for intrinsics (NFC)

This adds a common API for compute constant ranges of intrinsics.
The intention here is that
a) we can reuse the same code across different passes that handle
   constant ranges, i.e. this can be reused in SCCP
b) we only have to add knowledge about supported intrinsics to
   ConstantRange, not any consumers.

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

3 years ago[mlir] fix error handling in rocm runtime wrapper
Tobias Gysi [Wed, 29 Jul 2020 20:00:48 +0000 (22:00 +0200)]
[mlir] fix error handling in rocm runtime wrapper

The patch fixes minor issues in the rocm runtime wrapper due to api differences between CUDA and HIP.

Reviewed By: herhut

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

3 years agoFix invalid attempted explicit instantiation, which Clang now rejects.
Richard Smith [Wed, 29 Jul 2020 20:06:52 +0000 (13:06 -0700)]
Fix invalid attempted explicit instantiation, which Clang now rejects.

3 years ago[ELF][test] Fix ppc64-reloc-pcrel34-overflow.s
Fangrui Song [Wed, 29 Jul 2020 20:01:31 +0000 (13:01 -0700)]
[ELF][test] Fix ppc64-reloc-pcrel34-overflow.s

3 years ago[PowerPC] Support for R_PPC64_REL24_NOTOC calls where the caller has no TOC and the...
Victor Huang [Wed, 29 Jul 2020 18:38:55 +0000 (18:38 +0000)]
[PowerPC] Support for R_PPC64_REL24_NOTOC calls where the caller has no TOC and the callee is not DSO local

This patch supports the situation where caller does not have a valid TOC and
calls using the R_PPC64_REL24_NOTOC relocation and the callee is not DSO local.
In this case the call cannot be made directly since the callee may or may not
require a valid TOC pointer. As a result this situation require a PC-relative
plt stub to set up r12.

Reviewed By: sfertile, MaskRay, stefanp

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

3 years ago[X86][AVX] isHorizontalBinOp - relax no-lane-crossing limit for AVX1-only targets.
Simon Pilgrim [Wed, 29 Jul 2020 18:52:11 +0000 (19:52 +0100)]
[X86][AVX] isHorizontalBinOp - relax no-lane-crossing limit for AVX1-only targets.

Instead of never accepting v8f32/v4f64 FHADD/FHSUB if the input shuffle masks cross lanes, perform the matching and determine if the post shuffle mask simplifies to a 'whole lane shuffle' mask - in which case we are guaranteed to cheaply perform this as a VPERM2F128 shuffle.

3 years ago[Tests] Split a file for ease of update
Philip Reames [Wed, 29 Jul 2020 19:44:49 +0000 (12:44 -0700)]
[Tests] Split a file for ease of update

3 years agoReland "[SCEVExpander] Add option to preserve LCSSA directly."
Florian Hahn [Wed, 29 Jul 2020 18:35:14 +0000 (19:35 +0100)]
Reland "[SCEVExpander] Add option to preserve LCSSA directly."

This reverts the revert commit dc2867576886247cbe351e7c63618c09ab6af808.

It includes a fix for Polly, which uses SCEVExpander on IR that is not
in LCSSA form. Set PreserveLCSSA = false in that case, to ensure we do
not introduce LCSSA phis where there were none before.

3 years agoPR46231: Promote diagnostic for 'template<...>;' from ExtWarn to Error.
Richard Smith [Wed, 29 Jul 2020 19:29:05 +0000 (12:29 -0700)]
PR46231: Promote diagnostic for 'template<...>;' from ExtWarn to Error.

No other compiler accepts this as an extension, not even in permissive
mode. We're not doing anyone any favors by allowing this, and it's
unlikely to be at all common, even in Clang-only code, in the wild.

3 years ago[AMDGPU] Fixed formatting in GCNHazardRecognizer.cpp. NFC.
Stanislav Mekhanoshin [Wed, 29 Jul 2020 19:21:28 +0000 (12:21 -0700)]
[AMDGPU] Fixed formatting in GCNHazardRecognizer.cpp. NFC.

3 years ago[AMDGPU] prefer non-mfma in post-RA schedule
Stanislav Mekhanoshin [Wed, 29 Jul 2020 18:47:18 +0000 (11:47 -0700)]
[AMDGPU] prefer non-mfma in post-RA schedule

MFMA instructions shall not be scheduled back to back
to avoid MAI SIMD stall. Tell post-RA schedule we would
prefer some other instruction instead.

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

3 years ago[libc++] Re-enable tests for C11 math macros in <float.h> and <cfloat>
Louis Dionne [Wed, 29 Jul 2020 18:24:02 +0000 (14:24 -0400)]
[libc++] Re-enable tests for C11 math macros in <float.h> and <cfloat>

Fixes http://llvm.org/PR38572.

3 years agoGlobalISel: Fix insert point in CSEMIRBuilder unit test
Matt Arsenault [Wed, 29 Jul 2020 18:40:51 +0000 (14:40 -0400)]
GlobalISel: Fix insert point in CSEMIRBuilder unit test

This was using invalid MIR for the test instructions. The test add was
the first instruction in the block, before the trunc inputs or copies
from physical registers which I assume was not intended.

3 years ago[lldb/Breakpoint] Rename StoppointLocation to StoppointSite and drop its relationship...
Tatyana Krasnukha [Thu, 23 Jul 2020 15:41:14 +0000 (18:41 +0300)]
[lldb/Breakpoint] Rename StoppointLocation to StoppointSite and drop its relationship with BreakpointLocation

Both of BreakpointLocation and BreakpointSite were inherited from StoppointLocation. However, the only thing
they shared was hit counting logic. The patch encapsulates those logic into StoppointHitCounter, renames
StoppointLocation to StoppointSite, and stops BreakpointLocation's inheriting from it.

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

3 years agoPR46859: Fix crash if declaring a template in a DeclScope with no DeclContext.
Richard Smith [Wed, 29 Jul 2020 19:01:47 +0000 (12:01 -0700)]
PR46859: Fix crash if declaring a template in a DeclScope with no DeclContext.

This can happen during error recovery; it could also happen at block
scope if we ever parsed a template declaration at block scope.

3 years ago[PowerPC] Add options to control paired vector memops support
Baptiste Saleil [Tue, 28 Jul 2020 21:02:50 +0000 (16:02 -0500)]
[PowerPC] Add options to control paired vector memops support

Adds frontend and backend options to enable and disable the
PowerPC paired vector memory operations added in ISA 3.1.
Instructions using these options will be added in subsequent patches.

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

3 years ago[DFSan] Add efficient fast16labels instrumentation mode.
Matt Morehouse [Wed, 29 Jul 2020 18:58:14 +0000 (18:58 +0000)]
[DFSan] Add efficient fast16labels instrumentation mode.

Adds the -fast-16-labels flag, which enables efficient instrumentation
for DFSan when the user needs <=16 labels.  The instrumentation
eliminates most branches and most calls to __dfsan_union or
__dfsan_union_load.

Reviewed By: vitalybuka

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

3 years ago[lldb/BreakpointSite] Handle all ways of control flow
Tatyana Krasnukha [Wed, 29 Jul 2020 18:52:40 +0000 (21:52 +0300)]
[lldb/BreakpointSite] Handle all ways of control flow

3 years ago[GlobalISel] Add G_INTRINSIC_LRINT and translate from llvm.lrint
Amara Emerson [Fri, 24 Jul 2020 20:00:12 +0000 (13:00 -0700)]
[GlobalISel] Add G_INTRINSIC_LRINT and translate from llvm.lrint

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

3 years ago[Statepoint] Consolidate relocation type tracking [NFC]
Philip Reames [Wed, 29 Jul 2020 18:41:40 +0000 (11:41 -0700)]
[Statepoint] Consolidate relocation type tracking [NFC]

Change the way we track how a particular pointer was relocated at a statepoint in selection dag.  Previously, we used an optional<location> for the spill lowering, and a block local Register for the newly introduced vreg lowering.  Combine all three lowerings (norelocate, spill, and vreg) into a single helper class, and keep a single copy of the information.

This is submitted separately as it really does make the code more readible on it's own, but the indirect motivation is to move vreg tracking from StatepointLowering to FunctionLoweringInfo.  This is the last piece needed to support cross block relocations with vregs; that will follow in a separate (non-NFC) patch.

3 years ago[AArch64][GlobalISel] Selection support for vector DUP[X]lane instructions.
Amara Emerson [Wed, 29 Jul 2020 07:21:15 +0000 (00:21 -0700)]
[AArch64][GlobalISel] Selection support for vector DUP[X]lane instructions.

In future, we'd like to use the perfect-shuffle mechanism to deal with these
shuffle permutations. For now, this improves performance by avoiding the
super-expensive const-pool load + tbl instruction.

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

3 years ago[lldb] Don't use hardware index to determine whether a breakpoint site is hardware
Tatyana Krasnukha [Tue, 21 Jul 2020 18:04:36 +0000 (21:04 +0300)]
[lldb] Don't use hardware index to determine whether a breakpoint site is hardware

Most process plugins (if not all) don't set hardware index for breakpoints. They even
are not able to determine this index.

This patch makes StoppointLocation::IsHardware pure virtual and lets BreakpointSite
override it using more accurate BreakpointSite::Type.

It also adds assertions to be sure that a breakpoint site is hardware when this is required.

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

3 years ago[lldb] Make process plugins check whether a hardware breakpoint is required
Tatyana Krasnukha [Wed, 22 Jul 2020 11:52:52 +0000 (14:52 +0300)]
[lldb] Make process plugins check whether a hardware breakpoint is required

Remove @skipIfWindows as process should report the error correctly on Windows now.

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

3 years ago[lldb] Skip overlapping hardware and external breakpoints when writing memory
Tatyana Krasnukha [Wed, 22 Jul 2020 11:45:10 +0000 (14:45 +0300)]
[lldb] Skip overlapping hardware and external breakpoints when writing memory

This fixes the assertion `assert(intersects);` in the Process::WriteMemory function.

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

3 years agoAMDGPU/GlobalISel: Handle llvm.amdgcn.reloc.constant
Matt Arsenault [Tue, 21 Jul 2020 23:41:24 +0000 (19:41 -0400)]
AMDGPU/GlobalISel: Handle llvm.amdgcn.reloc.constant

3 years ago[compiler-rt][Darwin] Disable EXC_GUARD exceptions
Julian Lettner [Wed, 29 Jul 2020 16:55:52 +0000 (09:55 -0700)]
[compiler-rt][Darwin] Disable EXC_GUARD exceptions

ASan/TSan use mmap in a way that creates “deallocation gaps” which
triggers EXC_GUARD exceptions on macOS 10.15+ (XNU 19.0+).  Let's
suppress those.

3 years ago[lldb/test] Put hardware breakpoint tests together, NFC
Tatyana Krasnukha [Wed, 22 Jul 2020 11:41:15 +0000 (14:41 +0300)]
[lldb/test] Put hardware breakpoint tests together, NFC

Create a common base class for them to re-use supports_hw_breakpoints function in decorators.

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

3 years agoRevert "[SCEVExpander] Add option to preserve LCSSA directly."
Florian Hahn [Wed, 29 Jul 2020 18:17:24 +0000 (19:17 +0100)]
Revert "[SCEVExpander] Add option to preserve LCSSA directly."

This reverts commit 99166fd4fb422351f131fb1265cb85d5f6c5b8da, because it
breaks the polly builders.

polly/test/Isl/CodeGen/invariant_load_escaping_second_scop.ll fails
because a apparently unnecessary LCSSA phi node is introduced.

Make the bots green again, while I take a closer look.

3 years ago[libc++] Remove c++98 from the possible Standards of the test suite
Louis Dionne [Wed, 29 Jul 2020 18:17:57 +0000 (14:17 -0400)]
[libc++] Remove c++98 from the possible Standards of the test suite

Clang treats C++98 and C++03 as the same anyway, so it's no use having
two different settings for the same standard.

3 years ago[libc++][pstl] Remove c++98 from UNSUPPORTED annotations
Louis Dionne [Wed, 29 Jul 2020 18:16:51 +0000 (14:16 -0400)]
[libc++][pstl] Remove c++98 from UNSUPPORTED annotations

c++98 isn't used by the test suite anymore, only c++03 is.

3 years agoGlobalISel: Implement lower for G_EXTRACT_VECTOR_ELT
Matt Arsenault [Mon, 27 Jul 2020 01:25:10 +0000 (21:25 -0400)]
GlobalISel: Implement lower for G_EXTRACT_VECTOR_ELT

Use the basic store to stack and reload.

3 years agoAdd more debug code for https://github.com/google/sanitizers/issues/1193 (getting...
Kostya Serebryany [Wed, 29 Jul 2020 17:34:07 +0000 (10:34 -0700)]
Add more debug code for https://github.com/google/sanitizers/issues/1193 (getting desperate, not being able to reproduce it for a few months, but the users are seeing it)

mode debug code

Reviewed By: vitalybuka

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

3 years ago[AArch64][GlobalISel] Select XRO addressing mode with wide immediates
Jessica Paquette [Tue, 28 Jul 2020 18:33:39 +0000 (11:33 -0700)]
[AArch64][GlobalISel] Select XRO addressing mode with wide immediates

Port the wide immediate case from AArch64DAGToDAGISel::SelectAddrModeXRO.

If we have a wide immediate which can't be represented in an add, we can end up
with code like this:

```
mov  x0, imm
add x1, base, x0
ldr  x2, [x1, 0]
```

If we use the [base, xN] addressing mode instead, we can produce this:

```
mov  x0, imm
ldr  x2, [base, x0]
```

This saves 0.4% code size on 7zip at -O3, and gives a geomean code size
improvement of 0.1% on CTMark.

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

3 years agoAMDGPU: Relax restriction on folding immediates into physregs
Matt Arsenault [Mon, 20 Jul 2020 02:57:24 +0000 (22:57 -0400)]
AMDGPU: Relax restriction on folding immediates into physregs

I never completed the work on the patches referenced by
f8bf7d7f42f28fa18144091022236208e199f331, but this was intended to
avoid folding immediate writes into m0 which the coalescer doesn't
understand very well. Relax this to allow simple SGPR immediates to
fold directly into VGPR copies. This pattern shows up routinely in
current GlobalISel code since nothing is smart enough to emit VGPR
constants yet.

3 years ago[MLIR][NFC] Move Shape::WitnessType Declaration.
Tres Popp [Wed, 29 Jul 2020 14:03:53 +0000 (16:03 +0200)]
[MLIR][NFC] Move Shape::WitnessType Declaration.

This moves it from ShapeOps.td to ShapeBase.td

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

3 years agoGloblaISel: Remove unreachable condition
Matt Arsenault [Wed, 29 Jul 2020 17:31:59 +0000 (13:31 -0400)]
GloblaISel: Remove unreachable condition

Fixes bug 46882

3 years ago[gn build] Port 276f9e8cfaf
LLVM GN Syncbot [Wed, 29 Jul 2020 17:37:10 +0000 (17:37 +0000)]
[gn build] Port 276f9e8cfaf

3 years ago[WebAssembly] Fix getBottom for loops
Heejin Ahn [Wed, 29 Jul 2020 08:19:36 +0000 (01:19 -0700)]
[WebAssembly] Fix getBottom for loops

When it was first created, CFGSort only made sure BBs in each
`MachineLoop` are sorted together. After we added exception support,
CFGSort now also sorts BBs in each `WebAssemblyException`, which
represents a `catch` block, together, and
`Region` class was introduced to be a thin wrapper for both
`MachineLoop` and `WebAssemblyException`.

But how we compute those loops and exceptions is different.
`MachineLoopInfo` is constructed using the standard loop computation
algorithm in LLVM; the definition of loop is "a set of BBs that are
dominated by a loop header and have a path back to the loop header". So
even if some BBs are semantically contained by a loop in the original
program, or in other words dominated by a loop header, if they don't
have a path back to the loop header, they are not considered a part of
the loop. For example, if a BB is dominated by a loop header but
contains `call abort()` or `rethrow`, it wouldn't have a path back to
the header, so it is not included in the loop.

But `WebAssemblyException` is wasm-specific data structure, and its
algorithm is simple: a `WebAssemblyException` consists of an EH pad and
all BBs dominated by the EH pad. So this scenario is possible: (This is
also the situation in the newly added test in cfg-stackify-eh.ll)

```
Loop L: header, A, ehpad, latch
Exception E: ehpad, latch, B
```
(B contains `abort()`, so it does not have a path back to the loop
header, so it is not included in L.)

And it is sorted in this order:
```
header
A
ehpad
latch
B
```

And when CFGStackify places `end_loop` or `end_try` markers, it
previously used `WebAssembly::getBottom()`, which returns the latest BB
in the sorted order, and placed the marker there. So in this case the
marker placements will be like this:
```
loop
  header
  try
    A
  catch
    ehpad
    latch
end_loop         <-- misplaced!
    B
  end_try
```
in which nesting between the loop and the exception is not correct.
`end_loop` marker has to be placed after `B`, and also after `end_try`.

Maybe the fundamental way to solve this problem is to come up with our
own algorithm for computing loop region too, in which we include all BBs
dominated by a loop header in a loop. But this takes a lot more effort.
The only thing we need to fix is actually, `getBottom()`. If we make it
return the right BB, which means in case of a loop, the latest BB of the
loop itself and all exceptions contained in there, we are good.

This renames `Region` and `RegionInfo` to `SortRegion` and
`SortRegionInfo` and extracts them into their own file. And add
`getBottom` to `SortRegionInfo` class, from which it can access
`WebAssemblyExceptionInfo`, so that it can compute a correct bottom
block for loops.

Reviewed By: dschuff

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

3 years ago[lldb] Improve platform handling in CreateTargetInternal
Jonas Devlieghere [Wed, 29 Jul 2020 15:59:57 +0000 (08:59 -0700)]
[lldb] Improve platform handling in CreateTargetInternal

Currently, `target create` has no --platform option. However,
TargetList::CreateTargetInternal which is called under the hood, will
return an error when either no platform or multiple matching platforms
are found, saying that a platform should be specified with --platform.

This patch adds the platform option, but that doesn't solve either of
these errors.

 - If more than one platform matches, specifying the platform isn't
   going to fix that. The current code will only look at the
   architecture instead. I've updated the error message to ask the user
   to specify an architecture.

 - If no architecture is found, specifying a new one via platform isn't
   going to change that either because we already try to find one that
   matches the given architecture.

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

3 years ago[Scudo][CMake] Add -fno-lto to Scudo libraries
Arthur Eubanks [Tue, 28 Jul 2020 21:29:13 +0000 (14:29 -0700)]
[Scudo][CMake] Add -fno-lto to Scudo libraries

-fno-lto is in SANITIZER_COMMON_CFLAGS but not here.
Don't use SANITIZER_COMMON_CFLAGS because of performance issues.
See https://bugs.llvm.org/show_bug.cgi?id=46838.

Fixes
$ ninja TScudoCUnitTest-i386-Test
on an LLVM build with -DLLVM_ENABLE_LTO=Thin.
check-scudo now passes.

Reviewed By: cryptoad

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

3 years ago[PGO] Remove insignificant function hash values from some tests.
Hiroshi Yamauchi [Wed, 29 Jul 2020 16:13:37 +0000 (09:13 -0700)]
[PGO] Remove insignificant function hash values from some tests.

This is to avoid the need to update a bunch of test files when the PGO
instrumentation function hashing changes.

Split off of D84782.

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

3 years ago[X86] Add custom lowering for llvm.roundeven with sse4.1.
Craig Topper [Wed, 29 Jul 2020 17:08:12 +0000 (10:08 -0700)]
[X86] Add custom lowering for llvm.roundeven with sse4.1.

We can use the roundss/sd/ps/pd instructions like we do for
ceil/floor/trunc/rint/nearbyint.

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

3 years ago[LV] Add abs/smin/smax/umin/umax intrinsics to isTriviallyVectorizable
Craig Topper [Wed, 29 Jul 2020 17:05:25 +0000 (10:05 -0700)]
[LV] Add abs/smin/smax/umin/umax intrinsics to isTriviallyVectorizable

This patch adds support for vectorizing these intrinsics.

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

3 years ago[DFSan][NewPM] Port DataFlowSanitizer to NewPM
Arthur Eubanks [Mon, 27 Jul 2020 21:19:12 +0000 (14:19 -0700)]
[DFSan][NewPM] Port DataFlowSanitizer to NewPM

Reviewed By: ychen, morehouse

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

3 years ago[InstSimplify] try constant folding intrinsics before general simplifications
Sanjay Patel [Wed, 29 Jul 2020 17:12:51 +0000 (13:12 -0400)]
[InstSimplify] try constant folding intrinsics before general simplifications

This matches the behavior of simplify calls for regular opcodes -
rely on ConstantFolding before spending time on folds with variables.

I am not aware of any diffs from this re-ordering currently, but there was
potential for unintended behavior from the min/max intrinsics because that
code is implicitly assuming that only 1 of the input operands is constant.

3 years ago[DAG][AMDGPU][X86] Add SimplifyMultipleUseDemandedBits handling for SIGN/ZERO_EXTEND...
Simon Pilgrim [Wed, 29 Jul 2020 16:33:56 +0000 (17:33 +0100)]
[DAG][AMDGPU][X86] Add SimplifyMultipleUseDemandedBits handling for SIGN/ZERO_EXTEND + SIGN/ZERO_EXTEND_VECTOR_INREG

Peek through multiple use ops like we already do for ANY_EXTEND/ANY_EXTEND_VECTOR_INREG

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

3 years ago[SimplifyCFG][LoopRotate] SimplifyCFG: disable common instruction hoisting by default...
Roman Lebedev [Wed, 29 Jul 2020 16:54:33 +0000 (19:54 +0300)]
[SimplifyCFG][LoopRotate] SimplifyCFG: disable common instruction hoisting by default, enable late in pipeline

I've been looking at missed vectorizations in one codebase.
One particular thing that stands out is that some of the loops
reach vectorizer in a rather mangled form, with weird PHI's,
and some of the loops aren't even in a rotated form.

After taking a more detailed look, that happened because
the loop's headers were too big by then. It is evident that
SimplifyCFG's common code hoisting transform is at fault there,
because the pattern it handles is precisely the unrotated
loop basic block structure.

Surprizingly, `SimplifyCFGOpt::HoistThenElseCodeToIf()` is enabled
by default, and is always run, unlike it's friend, common code sinking
transform, `SinkCommonCodeFromPredecessors()`, which is not enabled
by default and is only run once very late in the pipeline.

I'm proposing to harmonize this, and disable common code hoisting
until //late// in pipeline. Definition of //late// may vary,
here currently i've picked the same one as for code sinking,
but i suppose we could enable it as soon as right after
loop rotation happens.

Experimentation shows that this does indeed unsurprizingly help,
more loops got rotated, although other issues remain elsewhere.

Now, this undoubtedly seriously shakes phase ordering.
This will undoubtedly be a mixed bag in terms of both compile- and
run- time performance, codesize. Since we no longer aggressively
hoist+deduplicate common code, we don't pay the price of said hoisting
(which wasn't big). That may allow more loops to be rotated,
so we pay that price. That, in turn, that may enable all the transforms
that require canonical (rotated) loop form, including but not limited to
vectorization, so we pay that too. And in general, no deduplication means
more [duplicate] instructions going through the optimizations. But there's still
late hoisting, some of them will be caught late.

As per benchmarks i've run {F12360204}, this is mostly within the noise,
there are some small improvements, some small regressions.
One big regression i saw i fixed in rG8d487668d09fb0e4e54f36207f07c1480ffabbfd, but i'm sure
this will expose many more pre-existing missed optimizations, as usual :S

llvm-compile-time-tracker.com thoughts on this:
http://llvm-compile-time-tracker.com/compare.php?from=e40315d2b4ed1e38962a8f33ff151693ed4ada63&to=c8289c0ecbf235da9fb0e3bc052e3c0d6bff5cf9&stat=instructions
* this does regress compile-time by +0.5% geomean (unsurprizingly)
* size impact varies; for ThinLTO it's actually an improvement

The largest fallout appears to be in GVN's load partial redundancy
elimination, it spends *much* more time in
`MemoryDependenceResults::getNonLocalPointerDependency()`.
Non-local `MemoryDependenceResults` is widely-known to be, uh, costly.
There does not appear to be a proper solution to this issue,
other than silencing the compile-time performance regression
by tuning cut-off thresholds in `MemoryDependenceResults`,
at the cost of potentially regressing run-time performance.
D84609 attempts to move in that direction, but the path is unclear
and is going to take some time.

If we look at stats before/after diffs, some excerpts:
* RawSpeed (the target) {F12360200}
  * -14 (-73.68%) loops not rotated due to the header size (yay)
  * -272 (-0.67%) `"Number of live out of a loop variables"` - good for vectorizer
  * -3937 (-64.19%) common instructions hoisted
  * +561 (+0.06%) x86 asm instructions
  * -2 basic blocks
  * +2418 (+0.11%) IR instructions
* vanilla test-suite + RawSpeed + darktable  {F12360201}
  * -36396 (-65.29%) common instructions hoisted
  * +1676 (+0.02%) x86 asm instructions
  * +662 (+0.06%) basic blocks
  * +4395 (+0.04%) IR instructions

It is likely to be sub-optimal for when optimizing for code size,
so one might want to change tune pipeline by enabling sinking/hoisting
when optimizing for size.

Reviewed By: mkazantsev

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

3 years ago[PowerPC] Set v1i128 to expand for SETCC to avoid crash
Kang Zhang [Wed, 29 Jul 2020 16:39:27 +0000 (16:39 +0000)]
[PowerPC] Set v1i128 to expand for SETCC to avoid crash

Summary:
PPC only supports the instruction selection for v16i8, v8i16, v4i32,
v2i64, v4f32 and v2f64 for ISD::SETCC, don't support the v1i128, so
v1i128 for ISD::SETCC will crash.

This patch is to set v1i128 to expand to avoid crash.

Reviewed By: steven.zhang

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

3 years ago[Statepoint] When using the tied def lowering, unconditionally use vregs [almost...
Philip Reames [Wed, 29 Jul 2020 16:13:15 +0000 (09:13 -0700)]
[Statepoint] When using the tied def lowering, unconditionally use vregs [almost NFC]

This builds on 3da1a96 on the path towards supporting invokes and cross block relocations. The actual change attempts to be NFC, but does fail in one corner-case explained below.

The change itself is fairly mechanical. Rather than remember SDValues - which are inherently block local - immediately produce a virtual register copy and remember that.

Once this lands, we'll update the FunctionLoweringInfo::StatepointSpillMap map to allow register based lowerings, delete VirtRegs from StatepointLowering, and drop the restriction against cross block relocations. I deliberately separate the semantic part into it's own change for easy of understanding and fault isolation.

The corner-case which isn't quite NFC is that the old implementation implicitly CSEd gc.relocates of the same SDValue regardless of type. The new implementation still only relocates once, but it produces distinct vregs for the bitcast and it's source, whereas SelectionDAG's generic CSE was able to remove the bitcast in the old implementation. Note that the final assembly doesn't change (at least in the test), as our MI level optimizations catch the duplication.

I assert that this is an uninteresting corner-case. It's functionally correct, and if we find a case where this influences performance, we should really be canonicalizing types to i8* at the IR level.

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

3 years ago[OpenMP] Implement TR8 `present` motion modifier in runtime (2/2)
Joel E. Denny [Wed, 29 Jul 2020 16:18:50 +0000 (12:18 -0400)]
[OpenMP] Implement TR8 `present` motion modifier in runtime (2/2)

This patch implements OpenMP runtime support for the OpenMP TR8
`present` motion modifier for `omp target update` directives.  The
previous patch in this series implements Clang front end support.

Reviewed By: grokos

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