platform/upstream/llvm.git
3 years ago[OpenMP] Disabled profiling in `libomp` by default to unblock link errors
Shilei Tian [Thu, 28 Jan 2021 12:24:19 +0000 (07:24 -0500)]
[OpenMP] Disabled profiling in `libomp` by default to unblock link errors

Link error occurred when time profiling in libomp is enabled by default
because `libomp` is assumed to be a C library but the dependence on
`libLLVMSupport` for profiling is a C++ library. Currently the issue blocks all
OpenMP tests in Phabricator.

This patch set a new CMake option `OPENMP_ENABLE_LIBOMP_PROFILING` to
enable/disable the feature. By default it is disabled. Note that once time
profiling is enabled for `libomp`, it becomes a C++ library.

Reviewed By: jdoerfert

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

3 years ago[X86][AVX] canonicalizeLaneShuffleWithRepeatedOps - don't merge VPERMILPD ops with...
Simon Pilgrim [Thu, 28 Jan 2021 12:11:31 +0000 (12:11 +0000)]
[X86][AVX] canonicalizeLaneShuffleWithRepeatedOps - don't merge VPERMILPD ops with different low/high masks.

Unlike VPERMILPS, VPERMILPD can have non-repeating masks in each 128-bit subvector, we weren't accounting for this when folding vperm2f128(vpermilpd(x,c),vpermilpd(y,c)) -> vpermilpd(vperm2f128(x,y),c).

I'm intending to add support for this but wanted to get a minimal fix in first for merging into 12.xx.

Fixes PR48908

3 years ago[X86][AVX] Add PR48908 shuffle test case
Simon Pilgrim [Thu, 28 Jan 2021 11:21:21 +0000 (11:21 +0000)]
[X86][AVX] Add PR48908 shuffle test case

3 years agoFix "32-bit shift result used in 64-bit comparison" MSVC warning. NFCI.
Simon Pilgrim [Thu, 28 Jan 2021 11:10:04 +0000 (11:10 +0000)]
Fix "32-bit shift result used in 64-bit comparison" MSVC warning. NFCI.

3 years ago[Support] Add some missing namespace closure comments. NFCI.
Simon Pilgrim [Wed, 27 Jan 2021 18:37:19 +0000 (18:37 +0000)]
[Support] Add some missing namespace closure comments. NFCI.

Fixes some clang-tidy warnings.

3 years ago[DebugInfo] Remove some unused includes. NFCI.
Simon Pilgrim [Wed, 27 Jan 2021 16:11:30 +0000 (16:11 +0000)]
[DebugInfo] Remove some unused includes. NFCI.

Mainly removing a lot of <vector> includes from files that don't explicitly use std::vector

3 years ago[OpenCL] Hide sampler-less read_image builtins before CL1.2
Sven van Haastregt [Thu, 28 Jan 2021 11:14:19 +0000 (11:14 +0000)]
[OpenCL] Hide sampler-less read_image builtins before CL1.2

Ensure sampler-less image read functions are not available with
`-fdeclare-opencl-builtins` before OpenCL 1.2.

3 years ago[CodeGen][DwarfEHPrepare] Preserve Dominator Tree
Roman Lebedev [Thu, 28 Jan 2021 10:45:53 +0000 (13:45 +0300)]
[CodeGen][DwarfEHPrepare] Preserve Dominator Tree

Now that D94827 has flipped the switch, and SimplifyCFG is officially marked
as production-ready regarding Dominator Tree preservation,
we can update this user pass to also preserve Dominator Tree.

This is a geomean compile-time win of `-0.05%`..`-0.08%`.
https://llvm-compile-time-tracker.com/compare.php?from=51a25846c198cff00abad0936f975167357afa6f&to=082499aac236a5c141e50a9e77870d5be2de5f0b&stat=instructions

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

3 years ago[SimplifyCFG] If provided, preserve Dominator Tree
Roman Lebedev [Thu, 28 Jan 2021 10:02:22 +0000 (13:02 +0300)]
[SimplifyCFG] If provided, preserve Dominator Tree

SimplifyCFG is an utility pass, and the fact that it does not
preserve DomTree's, forces it's users to somehow workaround that,
likely by not preserving DomTrees's themselves.

Indeed, simplifycfg pass didn't know how to preserve dominator tree,
it took me just under a month (starting with e1133179587dd895962a2fe4d6eb0cb1e63b5ee2)
do rectify that, now it fully knows how to,
there's likely some problems with that still,
but i've dealt with everything i can spot so far.

I think we now can flip the switch.

Note that this is functionally an NFC change,
since this doesn't change the users to pass in the DomTree,
that is a separate question.

Reviewed By: kuhar, nikic

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

3 years ago[mlir][Linalg] Improve codegen strategy
Nicolas Vasilache [Thu, 28 Jan 2021 09:29:09 +0000 (09:29 +0000)]
[mlir][Linalg] Improve codegen strategy

This revision improves the usage of the codegen strategy by adding a few flags that
make it easier to control for the CLI.
Usage of ModuleOp is replaced by FuncOp as this created issues in multi-threaded mode.

A simple benchmarking capability is added for linalg.matmul as well as linalg.matmul_column_major.
This latter op is also added to linalg.

Now obsolete linalg integration tests that also take too long are deleted.

Correctness checks are still missing at this point.

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

3 years ago[MLIR][LinAlg][Docs] Add missing example code and other small fixes.
KareemErgawy-TomTom [Thu, 28 Jan 2021 10:43:47 +0000 (11:43 +0100)]
[MLIR][LinAlg][Docs] Add missing example code and other small fixes.

Fixes a few small issues in the docs. It seems one of the examples was missing
the expected MLIR output due to a copy-paste typo.

Reviewed By: nicolasvasilache

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

3 years ago[ARM] Regenerate constant hoisting test. NFC
David Green [Thu, 28 Jan 2021 10:37:16 +0000 (10:37 +0000)]
[ARM] Regenerate constant hoisting test. NFC

3 years ago[NFC] Move scavenge-lr.mir From AArch64 to Thumb2 test directory.
Tomas Matheson [Thu, 28 Jan 2021 10:20:39 +0000 (10:20 +0000)]
[NFC] Move scavenge-lr.mir From AArch64 to Thumb2 test directory.

3 years ago[AMDGPU][GlobalISel] Remove redundant cmp when copying constant to vcc
Mirko Brkusanin [Thu, 28 Jan 2021 10:12:12 +0000 (11:12 +0100)]
[AMDGPU][GlobalISel] Remove redundant cmp when copying constant to vcc

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

3 years ago[AMDGPU][GlobalISel] Handle G_PTR_ADD when looking for constant offset
Mirko Brkusanin [Thu, 28 Jan 2021 10:08:11 +0000 (11:08 +0100)]
[AMDGPU][GlobalISel] Handle G_PTR_ADD when looking for constant offset

Look throught G_PTRTOINT and G_PTR_ADD nodes when looking for constant
offset for buffer stores. This also helps with merging of these instructions
later on.

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

3 years ago[PowerPC] Do not emit XXSPLTI32DX for sub 64-bit constants
Nemanja Ivanovic [Thu, 28 Jan 2021 05:08:39 +0000 (23:08 -0600)]
[PowerPC] Do not emit XXSPLTI32DX for sub 64-bit constants

If the APInt returned by BuildVectorSDNode::isConstantSplat() is narrower than
64 bits, the result produced by XXSPLTI32DX is incorrect. The result returned
by the function appears to be incorrect and we'll investigate/fix it in a
follow-up commit. However, since this causes miscompiles, we must
temporarily disable emitting this instruction for such values.

3 years ago[RISCV] Add support for RVV int<->fp & fp<->fp conversions
Fraser Cormack [Fri, 22 Jan 2021 14:54:00 +0000 (14:54 +0000)]
[RISCV] Add support for RVV int<->fp & fp<->fp conversions

This patch adds support for the full range of vector int-to-float,
float-to-int, and float-to-float conversions on legal types.

Many conversions are supported natively in RVV so are lowered with
patterns. These include conversions between (element) types of the same
size, and those that are half/double the size of the input. When
conversions take place between types that are less than half or more
than double the size we must lower them using sequences of instructions
which go via intermediate types.

Reviewed By: craig.topper

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

3 years agoRevert "[clang][cli] Use variadic macros for parsing/generating"
Jan Svoboda [Thu, 28 Jan 2021 09:48:26 +0000 (10:48 +0100)]
Revert "[clang][cli] Use variadic macros for parsing/generating"

This reverts commit 374862d7.

Some build bots are failing with:
clang/Driver/Options.inc(4315): warning C4003: not enough arguments for function-like macro invocation 'PARSE_OPTION_WITH_MARSHALLING'
clang/Driver/Options.inc(4315): warning C4003: not enough arguments for function-like macro invocation 'NO_PREFIX'
clang/Driver/Options.inc(4315): error C2059: syntax error: ')'
clang/Driver/Options.inc(4315): error C2143: syntax error: missing ';' before '{'
clang/Driver/Options.inc(4315): error C2059: syntax error: '='

3 years agoUse DataExtractor to decode SLEB128 in android_relas.
Rahman Lavaee [Fri, 22 Jan 2021 17:13:30 +0000 (09:13 -0800)]
Use DataExtractor to decode SLEB128 in android_relas.

A simple refactoring patch which let us use `DataExtractor::getSLEB128` rather than using a lambda function.

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

3 years ago[clang][cli] Use variadic macros for parsing/generating
Jan Svoboda [Thu, 28 Jan 2021 09:18:46 +0000 (10:18 +0100)]
[clang][cli] Use variadic macros for parsing/generating

This patch makes all macros forwarding to `PARSE_OPTION_WITH_MARSHALLING` and `GENERATE_OPTION_WITH_MARSHALLING` variadic.

Sice we will be splitting up all CompilerInvocation parts, this will allow us to avoid a lot of boilerplate code.

The local macros prefix forwarded arguments with local variables required by the main macros. The `{THIS,NO}_PREFIX` macros make it possible for forwarding macros in member functions (`parseSimpleArgs`, `generateCC1CommandLine`) to prefix keypaths with `this->`. (Some build bots seem to require that.)

Reviewed By: dexonsmith

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

3 years ago[ARM][RegisterScavenging] Don't consider LR liveout if it is not reloaded
Tomas Matheson [Wed, 20 Jan 2021 15:55:26 +0000 (15:55 +0000)]
[ARM][RegisterScavenging] Don't consider LR liveout if it is not reloaded

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

When PrologEpilogInserter writes callee-saved registers to the stack, LR is not reloaded but is instead loaded directly into PC.
This was not taken into account when determining if each callee-saved register was liveout for the block.
When frame elimination inserts virtual registers, and the register scavenger tries to scavenge LR, it considers it liveout and tries to spill again.
However there is no emergency spill slot to use, and it fails with an error:

    fatal error: error in backend: Error while trying to spill LR from class GPR: Cannot scavenge register without an emergency spill slot!

This patch pervents any callee-saved registers which are not reloaded (including LR) from being marked liveout.
They are therefore available to scavenge without requiring an extra spill.

3 years ago[Clang][Codegen] Truncate initializers of union bitfield members
Tomas Matheson [Mon, 7 Dec 2020 17:14:06 +0000 (17:14 +0000)]
[Clang][Codegen] Truncate initializers of union bitfield members

If an initial value is given for a bitfield that does not fit in the
bitfield, the value should be truncated. Constant folding for
expressions did not account for this truncation in the case of union
member functions, despite a warning being emitted. In some contexts,
evaluation of expressions was not enabled unless C++11, ROPI or RWPI
was enabled.

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

3 years ago[NFC][IR][AsmWriter] Fix Wreturn-type gcc warning
Yang Fan [Thu, 28 Jan 2021 07:57:54 +0000 (15:57 +0800)]
[NFC][IR][AsmWriter] Fix Wreturn-type gcc warning

GCC warning:
```
/llvm-project/llvm/lib/IR/AsmWriter.cpp:3175:1: warning: control reaches end of non-void function [-Wreturn-type]
 3175 | }
      | ^
```

3 years ago[NFC][Transforms][Coroutines] Remove unused variable
Yang Fan [Thu, 28 Jan 2021 07:45:44 +0000 (15:45 +0800)]
[NFC][Transforms][Coroutines] Remove unused variable

3 years ago[X86][AMX] Prevent shape def being scheduled across ldtilecfg.
Luo, Yuanke [Thu, 28 Jan 2021 02:25:17 +0000 (10:25 +0800)]
[X86][AMX] Prevent shape def being scheduled across ldtilecfg.

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

3 years ago[yaml2obj] - Allow empty SectionHeaderTable definitions.
Georgii Rymar [Mon, 25 Jan 2021 10:56:54 +0000 (13:56 +0300)]
[yaml2obj] - Allow empty SectionHeaderTable definitions.

Currently we don't allow the following definition:

```
Sections:
  - Type: SectionHeaderTable
  - Name: .foo
    Type: SHT_PROGBITS
```

We report an error: "SectionHeaderTable can't be empty. Use 'NoHeaders' key to drop the section header table".

It was implemented in this way earlier, when `SectionHeaderTable`
was a dedicated key outside of the `Sections` list. And we did not
allow to select where the table is written.

Currently it makes sense to allow it, because a user might
want to place the default section header table at an arbitrary position,
e.g. before other sections. In this case it is not convenient and error prone
to require specifying all sections:

```
Sections:
  - Type: SectionHeaderTable
    Sections:
      - Name: .foo
      - Name: .strtab
      - Name: .shstrtab
  - Name: .foo
    Type: SHT_PROGBITS
```

This patch allows empty SectionHeaderTable definitions.

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

3 years ago[AMDGPU] Avoid an illegal operand in si-shrink-instructions
Piotr Sobczak [Wed, 27 Jan 2021 15:02:49 +0000 (16:02 +0100)]
[AMDGPU] Avoid an illegal operand in si-shrink-instructions

Before the patch it was possible to trigger a constant bus
violation when folding immediates into a shrunk instruction.

The patch adds a check to enforce the legality of the new operand.

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

3 years ago[llvm] Use append_range (NFC)
Kazu Hirata [Thu, 28 Jan 2021 07:25:41 +0000 (23:25 -0800)]
[llvm] Use append_range (NFC)

3 years ago[llvm] Use llvm::is_sorted (NFC)
Kazu Hirata [Thu, 28 Jan 2021 07:25:39 +0000 (23:25 -0800)]
[llvm] Use llvm::is_sorted (NFC)

3 years ago[DebugInfo] Forward-declare PDBFile (NFC)
Kazu Hirata [Thu, 28 Jan 2021 07:25:38 +0000 (23:25 -0800)]
[DebugInfo] Forward-declare PDBFile (NFC)

NativeEnumInjectedSources.h needs PDBFile but relies on a
forward declaration of PDBFile in InjectedSourceStream.h.
This patch adds a forward declaration right in
NativeEnumInjectedSources.h.

While we are at it, this patch removes the one in
InjectedSourceStream.h, where it is unnecessary.

3 years ago[AVR] Optimize 16-bit int shift
Ben Shi [Thu, 28 Jan 2021 07:10:11 +0000 (15:10 +0800)]
[AVR] Optimize 16-bit int shift

Reviewed By: dylanmckay

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

3 years ago[CSSPGO] Support of CS profiles in extended binary format.
Hongtao Yu [Thu, 28 Jan 2021 00:04:11 +0000 (16:04 -0800)]
[CSSPGO] Support of CS profiles in extended binary format.

This change brings up support of context-sensitive profiles in the format of extended binary. Existing sample profile reader/writer/merger code is being tweaked to reflect the fact of bracketed input contexts, like (`[...]`). The paired brackets are also needed in extbinary profiles because we don't yet have an otherwise good way to tell calling contexts apart from regular function names since the context delimiter `@` can somehow serve as a part of the C++ mangled names.

Reviewed By: wmi, wenlei

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

3 years ago[RISCV] Copy isUnneededShiftMask from X86.
Craig Topper [Thu, 28 Jan 2021 04:36:21 +0000 (20:36 -0800)]
[RISCV] Copy isUnneededShiftMask from X86.

In d2927f786e877410d90c1e6f0e0c7d99524529c5, I added patterns
to remove (and X, 31) from sllw/srlw/sraw shift amounts.

There is code in SelectionDAGISel.cpp that knows to use
computeKnownBits to fill in bits of the mask that were removed
by SimplifyDemandedBits based on bits being known zero.

The non-W shift patterns use immbottomxlenset which allows the
mask to have more than log2(xlen) trailing ones, but doesn't
have a call to computeKnownBits to fill in bits of the mask that may
have been cleared by SimplifyDemandedBits.

This patch copies code from X86 to handle more than log2(xlen)
bottom bits set and uses computeKnownBits to fill in missing bits
before counting.

Reviewed By: luismarques

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

3 years agoIntrinsicEmitter: Change IntrinsicsToAttributesMap from uint8_t[] to uint16_t[]
Fangrui Song [Thu, 28 Jan 2021 04:34:35 +0000 (20:34 -0800)]
IntrinsicEmitter: Change IntrinsicsToAttributesMap from uint8_t[] to uint16_t[]

We need at least 252 UniqAttributes now, which will soon overflow.
Actually with downstream backends we can easily use up the last few values.
So bump to uint16_t.

3 years ago[Support] Fix build for Haiku
Serge Pavlov [Wed, 27 Jan 2021 04:10:34 +0000 (11:10 +0700)]
[Support] Fix build for Haiku

This change fixes two issues with building LLVM on Haiku. The first issue is
that LLVM requires wait4(), which on Haiku is hidden behind the _BSD_SOURCE
feature flag when using the --std=c++14 flag. Additionally, the wait4()
function is only available in libbsd.so, so this is now a dependency.

The other fix is that Haiku does not have the (non-standard) rusage.maxrss
member, so by default the used memory info will be set to 0 on this platform.

Reviewed By: sepavloff

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

Patch by Niels Sascha Reedijk.

3 years ago[AMDGPU][NFC] Pre-commit test for D95509
Carl Ritson [Thu, 28 Jan 2021 03:36:10 +0000 (12:36 +0900)]
[AMDGPU][NFC] Pre-commit test for D95509

3 years ago[libomptarget][NFC] Link plugins with threads support library due to std::call_once...
Vyacheslav Zakharin [Wed, 27 Jan 2021 23:41:44 +0000 (15:41 -0800)]
[libomptarget][NFC] Link plugins with threads support library due to std::call_once usage.

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

3 years ago[AMDGPU][NFC] Generate llvm.amdgcn.set.inactive tests
Carl Ritson [Thu, 28 Jan 2021 02:34:09 +0000 (11:34 +0900)]
[AMDGPU][NFC] Generate llvm.amdgcn.set.inactive tests

This is a pre-commit for D95509.

3 years agoDebugInfo: Fix bug in addr+offset exprloc to use DWARFv5 addrx op instead of DWARFv4...
David Blaikie [Thu, 28 Jan 2021 02:39:07 +0000 (18:39 -0800)]
DebugInfo: Fix bug in addr+offset exprloc to use DWARFv5 addrx op instead of DWARFv4 GNU extension

3 years ago[OpenMP][Libomptarget] Fix conditional in CMake for remote plugin
Atmn Patel [Wed, 27 Jan 2021 23:49:41 +0000 (18:49 -0500)]
[OpenMP][Libomptarget] Fix conditional in CMake for remote plugin

The remote offloading plugin's CMakeLists was trying to build if its
flag was enabled even if it didn't find gRPC/protobuf. The conditional
was wrong, it's fixed by this.

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

3 years ago[mlir][PassManager] Only reinitialize the pass manager if the context registry changes
River Riddle [Wed, 27 Jan 2021 00:54:25 +0000 (16:54 -0800)]
[mlir][PassManager] Only reinitialize the pass manager if the context registry changes

This prevents needless reinitialization for clients that want to reuse a pass manager multiple times. A new `getRegisryHash` function is exposed by the context to give a rough indicator of when the context registry has changed.

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

3 years ago[clangd] Parse Diagnostics block, and nest ClangTidy block under it.
Sam McCall [Mon, 25 Jan 2021 15:16:22 +0000 (16:16 +0100)]
[clangd] Parse Diagnostics block, and nest ClangTidy block under it.

(ClangTidy configuration block hasn't been in any release, so we should be OK
to move it around like this)

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

3 years ago[clangd] Log warning when using legacy (theia) semantic highlighting.
Sam McCall [Wed, 20 Jan 2021 11:38:32 +0000 (12:38 +0100)]
[clangd] Log warning when using legacy (theia) semantic highlighting.

The legacy protocol will be removed on trunk after the 12 branch cut,
and gone in clangd 13.

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

3 years ago[AMDGPU] Do not reassign spilled registers
Stanislav Mekhanoshin [Wed, 27 Jan 2021 21:02:43 +0000 (13:02 -0800)]
[AMDGPU] Do not reassign spilled registers

We cannot call LRM::unassign() if LRM::assign() was never called
before, these are symmetrical calls. There are two ways of
assigning a physical register to virtual, via LRM::assign() and
via VRM::assignVirt2Phys(). LRM::assign() will call the VRM to
assign the register and then update LiveIntervalUnion. Inline
spiller calls VRM directly and thus LiveIntervalUnion never gets
updated. A call to LRM::unassign() then asserts about inconsistent
liveness.

We have to note that not all callers of the InlineSpiller even
have LRM to pass, RegAllocPBQP does not have it, so we cannot
always pass LRM into the spiller.

The only way to get into that spiller LRE_DidCloneVirtReg() call
is from LiveRangeEdit::eliminateDeadDefs if we split an LI.

This patch refuses to reassign a LiveInterval created by a split
to workaround the problem. In fact we cannot reassign a spill
anyway as all registers of the needed class are occupied and we
are spilling.

Fixes: SWDEV-267996

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

3 years ago[llvm-c] Move LLVMX86_AMXTypeKind & LLVMPoisonValueValueKind to the bottom to avoid...
Fangrui Song [Thu, 28 Jan 2021 00:28:04 +0000 (16:28 -0800)]
[llvm-c] Move LLVMX86_AMXTypeKind & LLVMPoisonValueValueKind to the bottom to avoid value changes compared with LLVM<=11

Fixes PR48905

3 years ago[cxx_status] Mark P0732R2 as only 'partial', not 'Clang 12', as some of
Richard Smith [Thu, 28 Jan 2021 00:07:51 +0000 (16:07 -0800)]
[cxx_status] Mark P0732R2 as only 'partial', not 'Clang 12', as some of
the changes were reverted.

3 years ago[LTO] Prevent devirtualization for symbols dynamically exported
Teresa Johnson [Wed, 30 Dec 2020 23:56:53 +0000 (15:56 -0800)]
[LTO] Prevent devirtualization for symbols dynamically exported

Identify dynamically exported symbols (--export-dynamic[-symbol=],
--dynamic-list=, or definitions needed to preempt shared objects) and
prevent their LTO visibility from being upgraded.
This helps avoid use of whole program devirtualization when there may
be overrides in dynamic libraries.

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

3 years ago[flang] Search for #include "file" in right directory (take 2)
peter klausler [Tue, 26 Jan 2021 21:57:44 +0000 (13:57 -0800)]
[flang] Search for #include "file" in right directory (take 2)

Make the #include "file" preprocessing directive begin its
search in the same directory as the file containing the directive,
as other preprocessors and our Fortran INCLUDE statement do.

Avoid current working directory for all source files except the original.

Resolve tests.

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

3 years agoclang: Fix static_assert in a few contexts in microsoft mode
Nico Weber [Wed, 27 Jan 2021 21:51:27 +0000 (16:51 -0500)]
clang: Fix static_assert in a few contexts in microsoft mode

Follow-up to D17444. Fixes PR48904. See bug for details.

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

3 years ago[CodeGen] IndirectBrExpandPass: preserve Dominator Tree, if available
Roman Lebedev [Wed, 27 Jan 2021 22:24:19 +0000 (01:24 +0300)]
[CodeGen] IndirectBrExpandPass: preserve Dominator Tree, if available

This fully de-pessimizes the common case of no indirectbr's,
(where we don't actually need to do anything to preserve domtree)
and avoids domtree recomputation in the case there were indirectbr's.

Note that two indirectbr's could have a common successor, and not all
successors of an indirectbr's are meant to survive the expansion.

Though, the code assumes that an indirectbr's doesn't have
duplicate successors, those *should* have been deduplicated
by simplifycfg or something already.

3 years ago[AArch64][GlobalISel] Allow vector store legalization into 128-bit-wide types
Jessica Paquette [Thu, 21 Jan 2021 01:30:17 +0000 (17:30 -0800)]
[AArch64][GlobalISel] Allow vector store legalization into 128-bit-wide types

We are allowed to store 128-bit-wide values using the q registers on AArch64.

GlobalISel was clamping the number of elements in vector stores into 64 bits
instead.

This results in some poor codegen like below:

https://godbolt.org/z/E56dq8

```
; SDAG uses a stp + q registers in both cases here.
define void @float(<16 x float> %val, <16 x float>* %ptr) {
 store <16 x float> %val, <16 x float>* %ptr
 ret void
}

define void @double(<8 x double> %val, <8 x double>* %ptr) {
 store <8 x double> %val, <8 x double>* %ptr
 ret void
}
```

This adds similar legalization for vector stores with s8 and s16 elements.

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

3 years ago[OpenMP][NVPTX] Disable building NVPTX deviceRTL by default on a non-CUDA system
Shilei Tian [Wed, 27 Jan 2021 22:06:05 +0000 (17:06 -0500)]
[OpenMP][NVPTX] Disable building NVPTX deviceRTL by default on a non-CUDA system

D95466 dropped CUDA to build NVPTX deviceRTL and enabled it by default.
However, the building requires some libraries that are not available on non-CUDA
system by default, which could break the compilation. This patch disabled the
build by default. It can be enabled with `LIBOMPTARGET_BUILD_NVPTX_BCLIB=ON`.

Reviewed By: kparzysz

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

3 years agoDebugInfo: Deduplicate addresses in debug_addr
David Blaikie [Fri, 25 Oct 2019 02:48:42 +0000 (19:48 -0700)]
DebugInfo: Deduplicate addresses in debug_addr

Experimental, using non-existent DWARF support to use an expr for the
location involving an addr_index (to compute address + offset so
addresses can be reused in more places).

The global variable debug info had to be deferred until the end of the
module (so bss variables would all be emitted first - so their labels
would have the relevant section). Non-bss variables seemed to not have
their label assigned to a section even at the end of the module, so I
didn't know what to do there.

Also, the hashing code is broken - doesn't know how to hash these
expressions (& isn't hashing anything inside subprograms, which seems
problematic), so for test purposes this change just skips the hash
computation. (GCC's actually overly sensitive in its hash function, it
seems - I'm forgetting the specific case right now - anyway, we might
want to just use the frontend-known file hash and give up on optimistic
.dwo/.dwp reuse)

3 years agoItanium Mangling: In 'enable_if', omit X/E around <expr-primary>.
James Y Knight [Sun, 24 Jan 2021 21:23:58 +0000 (16:23 -0500)]
Itanium Mangling: In 'enable_if', omit X/E around <expr-primary>.

The Clang enable_if extension is mangled as an <extended-qualifier>,
which is supposed to contain <template-args>. However, we were
unconditionally emitting X/E around its arguments, neglecting the fact
that <expr-primary> should be emitted directly without the surrounding
X/E.

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

3 years agoItanium Mangling: Fix handling of <expr-primary> in <template-arg>.
James Y Knight [Sun, 24 Jan 2021 20:50:15 +0000 (15:50 -0500)]
Itanium Mangling: Fix handling of <expr-primary> in <template-arg>.

Previously, we were emitting an extraneous X .. E in <template-arg>
around an <expr-primary> if the template argument was constructed from
an expression (rather than an already-evaluated literal value).  In
such a case, we would then e.g. emit 'XLi0EE' instead of 'Li0E'.

We had one special-case for DeclRefExpr expressions, in particular, to
omit them the mangled-name without the surrounding X/E. However,
unfortunately, that special case also triggered for ParmVarDecl (a
subtype of VarDecl), and _incorrectly_ emitted 'L_Z .. E' instead of
the proper 'Xfp_E'.

This change causes mangleExpression itself to be responsible for
emitting X/E around non-primary expressions, which removes the
special-case, and corrects both these problems.

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

3 years agoItanium Mangling: Mangle `__alignof__` differently than `alignof`.
James Y Knight [Mon, 7 Dec 2020 15:26:49 +0000 (10:26 -0500)]
Itanium Mangling: Mangle `__alignof__` differently than `alignof`.

The two operations have acted differently since Clang 8, but were
unfortunately mangled the same. The new mangling uses new "vendor
extended expression" syntax proposed in
https://github.com/itanium-cxx-abi/cxx-abi/issues/112

GCC had the same mangling problem, https://gcc.gnu.org/PR88115, and
will hopefully be switching to the same mangling as implemented here.

Additionally, fix the mangling of `__uuidof` to use the new extension
syntax, instead of its previous nonstandard special-case.

Adjusts the demangler accordingly.

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

3 years ago[RISCV] Move RISCVVPseudosTable from RISCVBaseInfo.h to RISCVInstrInfo.h. NFC
Craig Topper [Wed, 27 Jan 2021 21:14:43 +0000 (13:14 -0800)]
[RISCV] Move RISCVVPseudosTable from RISCVBaseInfo.h to RISCVInstrInfo.h. NFC

RISCVBaseInfo.h belongs to the MC layer, but the Pseudo instructions
are only used by the CodeGen layer. So it makes sense to keep this
table in the CodeGen layer.

3 years agoDon't allow __VA_OPT__ to be detected by #ifdef.
Richard Smith [Wed, 27 Jan 2021 21:14:02 +0000 (13:14 -0800)]
Don't allow __VA_OPT__ to be detected by #ifdef.

More study has discovered this to not actually be useful: because
current C++20 implementations reject `#ifdef __VA_OPT__`, this can't
really be used as a feature-test mechanism. And it's not too hard to
detect __VA_OPT__ without this, for example:

  #define THIRD_ARG(a, b, c, ...) c
  #define HAS_VA_OPT(...) THIRD_ARG(__VA_OPT__(,), 1, 0, )
  #if HAS_VA_OPT(?)

Partially reverts 0436ec2128c9775ba13b0308937238fc79673fdd.

3 years ago[Demangle] Support demangling Swift calling convention in MS demangler.
Varun Gandhi [Wed, 20 Jan 2021 16:24:28 +0000 (08:24 -0800)]
[Demangle] Support demangling Swift calling convention in MS demangler.

Previously, Clang was able to mangle the Swift calling
convention but 'MicrosoftDemangle.cpp' was not able to demangle it.

Reviewed By: compnerd, rnk

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

3 years ago[sanitizer] Fix crash on empty strings.
Vyacheslav Chigrin [Wed, 27 Jan 2021 21:07:37 +0000 (13:07 -0800)]
[sanitizer] Fix crash on empty strings.

Reviewed By: eugenis

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

3 years agoRevert "[sanitizer] Fix crash on empty strings."
Evgenii Stepanov [Wed, 27 Jan 2021 21:20:45 +0000 (13:20 -0800)]
Revert "[sanitizer] Fix crash on empty strings."

Wrong author name, will recommit shortly.

This reverts commit 262c50856a377371cbea673419143ae45c590b7e.

3 years ago[ARM] Add BE check variants for soft-fp test. NFC
David Green [Wed, 27 Jan 2021 21:19:46 +0000 (21:19 +0000)]
[ARM] Add BE check variants for soft-fp test. NFC

3 years agoFix runInTerminal failures on Windows
Walter Erquinigo [Wed, 27 Jan 2021 21:02:45 +0000 (13:02 -0800)]
Fix runInTerminal failures on Windows

stella.stemenova mentioned in https://reviews.llvm.org/D93951 failures on Windows for this test.

I'm fixing the macro definitions and disabling the tests for python
versions lower than 3.7. I'll figure out that actual issue with
python3.6 after the buildbots are fine again.

3 years ago[sanitizer] Fix crash on empty strings.
Evgenii Stepanov [Wed, 27 Jan 2021 21:07:37 +0000 (13:07 -0800)]
[sanitizer] Fix crash on empty strings.

Patch by Vyacheslav Chigrin.

Reviewed By: eugenis

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

3 years agoIgnore unknown attribute warnings in this test
Aaron Ballman [Wed, 27 Jan 2021 20:44:28 +0000 (15:44 -0500)]
Ignore unknown attribute warnings in this test

We're testing the parsing behavior, not the actual attributes used, and
the attribute name cannot be elided for __declspec attributes.

3 years ago[libc] Fix list of public headers usable on aarch64.
Siva Chandra [Wed, 27 Jan 2021 20:42:42 +0000 (12:42 -0800)]
[libc] Fix list of public headers usable on aarch64.

3 years agoSilence a -Wlogical-op-parentheses diagnostic; NFC
Aaron Ballman [Wed, 27 Jan 2021 20:37:11 +0000 (15:37 -0500)]
Silence a -Wlogical-op-parentheses diagnostic; NFC

3 years ago[scudo][standalone] Restore GWP-ASan flag parsing
Kostya Kortchinsky [Wed, 27 Jan 2021 17:54:50 +0000 (09:54 -0800)]
[scudo][standalone] Restore GWP-ASan flag parsing

With D92696, the Scudo Standalone GWP-ASan flag parsing was changed to
the new GWP-ASan optional one. We do not necessarily want this, as this
duplicates flag parsing code in Scudo Standalone when using the
GWP-ASan integration.

This CL reverts the changes within Scudo Standalone, and increases
`MaxFlags` to 20 as an addionnal option got us to the current max.

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

3 years agoPermit __VA_OPT__ in all language modes and allow it to be detected with #ifdef.
Richard Smith [Wed, 27 Jan 2021 20:24:30 +0000 (12:24 -0800)]
Permit __VA_OPT__ in all language modes and allow it to be detected with #ifdef.

These changes are intended to give code a path to move away from the GNU
,##__VA_ARGS__ extension, which is non-conforming in some situations and
which we'd like to disable in our conforming mode in those cases.

3 years agoParse different attribute syntaxes in arbitrary order
Aaron Ballman [Wed, 27 Jan 2021 20:27:53 +0000 (15:27 -0500)]
Parse different attribute syntaxes in arbitrary order

In Clang today, we parse the different attribute syntaxes
(__attribute__, __declspec, and [[]]) in a fairly rigid order. This
leads to confusion for users when they guess the order incorrectly,
and leads to bug reports like PR24559 or necessitates changes like
D94788.

This patch adds a helper function to allow us to more easily parse
attributes in arbitrary order, and then updates all of the places
where we would parse two or more different syntaxes in a rigid order to
use the helper method. The patch does not attempt to handle Microsoft
attributes ([]) because those are ambiguous with other code constructs
and we don't have any attributes that use the syntax.

3 years ago[OpenMP] Fix misleading warning for OMP_PLACES
Peyton, Jonathan L [Thu, 21 Jan 2021 19:38:35 +0000 (13:38 -0600)]
[OpenMP] Fix misleading warning for OMP_PLACES

When OMP_PLACES contains an invalid value, the warning informs the user
that the fallback is OMP_PLACES=threads, but the actual internal setting
is OMP_PLACES=cores and is detected as such with KMP_SETTINGS=1.
This patch informs the user that OMP_PLACES=cores is being used instead
of OMP_PLACES=threads.

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

3 years ago[OpenMP] Add cpuid leaf 1f topology discovery
Peyton, Jonathan L [Fri, 15 Jan 2021 19:38:50 +0000 (13:38 -0600)]
[OpenMP] Add cpuid leaf 1f topology discovery

This patch adds the new algorithm for topology discovery using cpuid
leaf 1f.  Only the new die level is detected and integrated into the
current affinity mechanisms including KMP_AFFINITY (granularity level
and compact/scatter algorithm), OMP_PLACES=dies, and KMP_HW_SUBSET.

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

3 years ago[OpenMP] Fix HWLOC topology detection for 2.0.x
Peyton, Jonathan L [Mon, 11 Jan 2021 21:17:02 +0000 (15:17 -0600)]
[OpenMP] Fix HWLOC topology detection for 2.0.x

HWLOC 2.0 has numa nodes as separate children and are not in the main
parent/child topology tree anymore.  This change takes this into
account.  The main topology detection loop in the create_hwloc_map()
routine starts at a hardware thread within the initial affinity mask and
goes up the topology tree setting the socket/core/thread labels
correctly.

This change also introduces some of the more generic changes that the
future kmp_topology_t structure will take advantage of including a
generic ratio & count array (finding all ratios of topology layers like
threads/core cores/socket and finding all counts of each topology
layer), generic radix1 reduction step, generic uniformity check, and
generic printing of topology (en_US.txt)

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

3 years ago[RISCV] Reduce field sizes in searchable tables to reduce binary size.
Craig Topper [Wed, 27 Jan 2021 20:22:36 +0000 (12:22 -0800)]
[RISCV] Reduce field sizes in searchable tables to reduce binary size.

3 years ago[libc] Fix the CMake var name of the list of public headers.
Siva Chandra [Wed, 27 Jan 2021 19:52:26 +0000 (11:52 -0800)]
[libc] Fix the CMake var name of the list of public headers.

3 years ago[RISCV] Rework fault first only load isel.
Craig Topper [Wed, 27 Jan 2021 19:01:07 +0000 (11:01 -0800)]
[RISCV] Rework fault first only load isel.

-Remove the ISD opcode for READ_VL. Just emit the MachineSDNode directly.
-Move segmented fault first only load intrinsic handling completely to
 RISCVISelDAGToDAG.cpp and emit the ReadVL MachineSDNode there
 instead of lowering to ISD opcodes first.

3 years ago[builtins] Fix build after D95537 due to missing size_t
Jessica Clarke [Wed, 27 Jan 2021 19:44:01 +0000 (19:44 +0000)]
[builtins] Fix build after D95537 due to missing size_t

Strangely int_lib.h only includes stdint.h and not stddef.h, so we need
to include the latter to be able to use size_t here.

3 years ago[builtins] Fix integer/pointer confusion in gcc_personality_v0.c
Jessica Clarke [Wed, 27 Jan 2021 19:28:20 +0000 (19:28 +0000)]
[builtins] Fix integer/pointer confusion in gcc_personality_v0.c

This fixes the implementation for architectures like CHERI with strong
pointer provenance (pointers, and thus uintptr_t, are represented as
hardware capabilities). Specifically, adding two uintptr_t's together
(as is done for `start + length` and `funcStart + landingPad`) has
ambiguous provenance, whereas using a plain integer (such as size_t) for
the offset operand does not. Also, readULEB128 is creating a plain
integer, not a pointer.

On all currently-supported architectures this should be an NFC, as
size_t and uintptr_t end up being the same underlying plain integer
type.

Reviewed By: MaskRay

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

3 years ago[LoopVectorize] use IR fast-math-flags exclusively (not FP function attributes)
Sanjay Patel [Wed, 27 Jan 2021 19:11:22 +0000 (14:11 -0500)]
[LoopVectorize] use IR fast-math-flags exclusively (not FP function attributes)

I am trying to untangle the fast-math-flags propagation logic
in the vectorizers (see a6f022127 for SLP).

The loop vectorizer has a mix of checking FP function attributes,
IR-level FMF, and just wrong assumptions.

I am trying to avoid regressions while fixing this, and I think
the IR-level logic is good enough for that, but it's hard to say
for sure. This would be the 1st step in the clean-up.

The existing test that I changed to include 'fast' actually shows
a miscompile: the function only had the equivalent of nnan, but we
created new instructions that had fast (all FMF set). This is
similar to the example in https://llvm.org/PR35538

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

3 years ago[libc] Include only the relevant header files in the integration test.
Siva Chandra [Wed, 27 Jan 2021 19:08:31 +0000 (11:08 -0800)]
[libc] Include only the relevant header files in the integration test.

3 years ago[sanitizer][fuchsia] Implement ReleaseMemoryPagesToOS
Marco Vanotti [Mon, 25 Jan 2021 19:08:49 +0000 (11:08 -0800)]
[sanitizer][fuchsia] Implement ReleaseMemoryPagesToOS

The `zx_vmar_op_range` allows us to decommit memory pages without
needing a handle to the underlying vmo, as long as we have a handle to
a vmar that contains this mapping. This allows us to implement the
`ReleaseMemoryPagesToOS` function by decommitting the memory using a
handle to the root vmar.

Reviewed By: mcgrathr

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

3 years ago[lit][NFC] Use enum to represent test order
Julian Lettner [Wed, 27 Jan 2021 19:06:58 +0000 (11:06 -0800)]
[lit][NFC] Use enum to represent test order

Use an enum to more explicitly represent the test execution order.

3 years agoRevert "Suppress non-conforming GNU paste extension in all standard-conforming modes"
Reid Kleckner [Wed, 27 Jan 2021 18:59:28 +0000 (10:59 -0800)]
Revert "Suppress non-conforming GNU paste extension in all standard-conforming modes"

This reverts commit f4537935dcdbf390c863591cf556e76c3abab9c1.
This reverts commit b43c26d036dcbf7a6881f39e4434cf059364022a.

This GNU and MSVC extension turns out to be very popular. Most projects
are not using C++20, so cannot use the new __VA_OPT__ feature to be
standards conformant. The other workaround, using -std=gnu*, enables too
many language extensions and isn't viable.

Until there is a way for users to get the behavior provided by the
`, ## __VA_ARGS__` extension in the -std=c++17 and earlier language
modes, we need to revert this.

3 years ago[gn build] Port 0b50fa99452f
LLVM GN Syncbot [Wed, 27 Jan 2021 18:55:59 +0000 (18:55 +0000)]
[gn build] Port 0b50fa99452f

3 years ago[test] Fix clang/test/CodeGen tests
Fangrui Song [Wed, 27 Jan 2021 18:55:26 +0000 (10:55 -0800)]
[test] Fix clang/test/CodeGen tests

3 years ago[ThinLTO] Add Visibility bits to GlobalValueSummary::GVFlags
Fangrui Song [Wed, 27 Jan 2021 18:43:51 +0000 (10:43 -0800)]
[ThinLTO] Add Visibility bits to GlobalValueSummary::GVFlags

Imported functions and variable get the visibility from the module supplying the
definition.  However, non-imported definitions do not get the visibility from
(ELF) the most constraining visibility among all modules (Mach-O) the visibility
of the prevailing definition.

This patch

* adds visibility bits to GlobalValueSummary::GVFlags
* computes the result visibility and propagates it to all definitions

Protected/hidden can imply dso_local which can enable some optimizations (this
is stronger than GVFlags::DSOLocal because the implied dso_local can be
leveraged for ELF -shared while default visibility dso_local has to be cleared
for ELF -shared).

Note: we don't have summaries for declarations, so for ELF if a declaration has
the most constraining visibility, the result visibility may not be that one.

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

3 years ago[FaultsMaps][llvm-objdump] Move FaultMapParser to Object/. Remove CodeGen dependency...
Craig Topper [Wed, 27 Jan 2021 18:21:47 +0000 (10:21 -0800)]
[FaultsMaps][llvm-objdump] Move FaultMapParser to Object/. Remove CodeGen dependency from llvm-objdump

FaultsMapParser lived in CodeGen and was forcing llvm-objdump to
link CodeGen and everything CodeGen depends on.

This was previously attempted in r240364 to fix a link failure.
The CodeGen dependency was independently added to fix the same
link failure, and that ended up being kept.

Removing the dependency seems like the correct layering for
llvm-objdump.

Reviewed By: MaskRay, jhenderson

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

3 years ago[libc] Disable sqrtl_test on non-x86 platforms.
Siva Chandra [Wed, 27 Jan 2021 18:29:30 +0000 (10:29 -0800)]
[libc] Disable sqrtl_test on non-x86 platforms.

The added comment explains why it has been disabled for now. We will
enable back when we fix the problem.

3 years ago[RISCV] Group the legal vector types into lists we can iterator over in the RISCVISel...
Craig Topper [Wed, 27 Jan 2021 17:48:27 +0000 (09:48 -0800)]
[RISCV] Group the legal vector types into lists we can iterator over in the RISCVISelLowering constructor

Remove the RISCVVMVTs namespace because I don't think it provides
a lot of value. If we change the mappings we'd likely have to add
or remove things from the list anyway.

Add a wrapper around addRegisterClass that can determine the
register class from the fixed size of the type.

Reviewed By: frasercrmck, rogfer01

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

3 years ago[flang][openacc] Allow multiple wait clauses
Valentin Clement [Wed, 27 Jan 2021 18:18:27 +0000 (13:18 -0500)]
[flang][openacc] Allow multiple wait clauses

kernels loop and enter data had a too restrictive constraint for the wait clause.
The wait clause is allowed multiple times and not only once. This patch fix this problem.

Reviewed By: SouraVX

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

3 years ago[libc++] Fix extern template test failing on Windows
Louis Dionne [Wed, 27 Jan 2021 18:08:24 +0000 (13:08 -0500)]
[libc++] Fix extern template test failing on Windows

See https://reviews.llvm.org/D94718#2521489 for details.

3 years ago[LoopUtils] Pass SCEVExpander instead SE to addRuntimeChecks.
Florian Hahn [Wed, 27 Jan 2021 17:13:38 +0000 (17:13 +0000)]
[LoopUtils] Pass SCEVExpander instead SE to addRuntimeChecks.

This gives the user control over which expander to use, which in turn
allows the user to decide what to do with the expanded instructions.

Used in D75980.

Reviewed By: lebedev.ri

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

3 years ago[TableGen] [DetailedRecords] Print record name that is null string as ""
Paul C. Anagnostopoulos [Sun, 24 Jan 2021 18:30:31 +0000 (13:30 -0500)]
[TableGen] [DetailedRecords] Print record name that is null string as ""

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

Add a test for the backend.

3 years agoExecutionDomainFix.cpp - use const refs in for-range loops. NFCI.
Simon Pilgrim [Wed, 27 Jan 2021 15:21:26 +0000 (15:21 +0000)]
ExecutionDomainFix.cpp - use const refs in for-range loops. NFCI.

Avoid unnecessary copies. Reported by clang-tidy.

3 years ago[Support] CommandLine.cpp - Fix clang-tidy namespace comment warnings. NFCI.
Simon Pilgrim [Wed, 27 Jan 2021 13:57:43 +0000 (13:57 +0000)]
[Support] CommandLine.cpp - Fix clang-tidy namespace comment warnings. NFCI.

Ensure namespace braces have the correct comment with them

3 years ago[Support] Fix clang-tidy auto warnings. NFCI.
Simon Pilgrim [Wed, 27 Jan 2021 12:02:49 +0000 (12:02 +0000)]
[Support] Fix clang-tidy auto warnings. NFCI.

Use auto pointer/reference to fix llvm-qualified-auto remarks.

3 years ago[CodeGen] SafeStack: preserve DominatorTree if it is avaliable
Roman Lebedev [Wed, 27 Jan 2021 14:13:10 +0000 (17:13 +0300)]
[CodeGen] SafeStack: preserve DominatorTree if it is avaliable

While this is mostly NFC right now, because only ARM happens
to run this pass with DomTree available before it,
and required after it, more backends will be affected once
the SimplifyCFG's switch for domtree preservation is flipped,
and DwarfEHPrepare also preserves the domtree.

3 years ago[NFC] StackProtector: be consistent and to initialize DominatorTreeWrapperPass
Roman Lebedev [Wed, 27 Jan 2021 14:07:43 +0000 (17:07 +0300)]
[NFC] StackProtector: be consistent and to initialize DominatorTreeWrapperPass

We already ask for it, so it might be good to ensure that it is
actually initialized before us. Doesn't seem to matter in practice though.

3 years ago[compiler-rt] Support FreeBSD standalone (boot) environment
Jessica Clarke [Wed, 27 Jan 2021 15:28:59 +0000 (15:28 +0000)]
[compiler-rt] Support FreeBSD standalone (boot) environment

FreeBSD uses -Ddouble=jagged-little-pill -Dfloat=floaty-mcfloatface to
poison uses of floating point in its standalone environment. It also
deprecates machine/limits.h in favour of sys/limits.h and does not even
provide the former on newer architectures.

This is a cleaner reimplementation of equivalent patches in FreeBSD's
vendored copy of compiler-rt.

Reviewed By: dim

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

3 years ago[libc++] [P0879] constexpr heap and partial_sort algorithms
Arthur O'Dwyer [Thu, 17 Dec 2020 05:26:18 +0000 (00:26 -0500)]
[libc++] [P0879] constexpr heap and partial_sort algorithms

Now the only ones we're still missing from P0879
are `sort` and `nth_element`.

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