platform/upstream/llvm.git
3 years agoFrontend: Respect -fno-temp-file when creating a PCH
Zachary Henkel [Fri, 18 Jun 2021 01:02:36 +0000 (18:02 -0700)]
Frontend: Respect -fno-temp-file when creating a PCH

When creating a PCH file the use of a temp file will be dictated by the
presence or absence of the -fno-temp-file flag. Creating a module file
will always use a temp file via the new ForceUseTemporary flag.

This fixes bug 50033.

3 years ago[FIX][Attributor] Fix broken build due to missing virtual deconstructors.
Kuter Dinel [Fri, 18 Jun 2021 04:30:31 +0000 (07:30 +0300)]
[FIX][Attributor] Fix broken build due to missing virtual deconstructors.

The lack some virtual deconstructors where causing some builds bots to fail.
This patch fixes that.

Problematic commit:
https://reviews.llvm.org/rGeaf1b6810ce0f40008b2b1d902750eafa3e198d3

Build bot:
https://lab.llvm.org/buildbot/#/builders/18/builds/1741

3 years ago[clang][AST] Make `getLocalOrImportedSubmoduleID` work with const `Module*`. NFC.
Volodymyr Sapsai [Wed, 16 Jun 2021 01:36:46 +0000 (18:36 -0700)]
[clang][AST] Make `getLocalOrImportedSubmoduleID` work with const `Module*`. NFC.

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

3 years ago[lld][WebAssembly] Fix crash calling weakly undefined function in PIC code
Sam Clegg [Thu, 17 Jun 2021 23:41:01 +0000 (16:41 -0700)]
[lld][WebAssembly] Fix crash calling weakly undefined function in PIC code

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

3 years ago[trace][intel-pt] Create basic SB API
Walter Erquinigo [Tue, 1 Jun 2021 22:34:06 +0000 (15:34 -0700)]
[trace][intel-pt] Create basic SB API

This adds a basic SB API for creating and stopping traces.
Note: This doesn't add any APIs for inspecting individual instructions. That'd be a more complicated change and it might be better to enhande the dump functionality to output the data in binary format. I'll leave that for a later diff.

This also enhances the existing tests so that they test the same flow using both the command interface and the SB API.

I also did some cleanup of legacy code.

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

3 years ago[lldb-vscode] remove failed test
Walter Erquinigo [Thu, 17 Jun 2021 22:07:36 +0000 (15:07 -0700)]
[lldb-vscode] remove failed test

Found in http://green.lab.llvm.org/green/job/lldb-cmake/32891/testReport/lldb-api/tools_lldb-vscode_launch/TestVSCode_launch_py/

the lldb-vscode changed and that test makes no sense anymore

3 years ago[NFC][SimpleLoopUnswitch] unswitchTrivialBranch(): add debug output explaining unswit...
Roman Lebedev [Thu, 17 Jun 2021 20:28:03 +0000 (23:28 +0300)]
[NFC][SimpleLoopUnswitch] unswitchTrivialBranch(): add debug output explaining unswitching failure

It's not prohibitively verbose, and allows easier understanding
why certain unswitching ultimately wasn't performed.

3 years ago[Attributor] Derive AACallEdges attribute
Kuter Dinel [Thu, 10 Jun 2021 20:24:13 +0000 (23:24 +0300)]
[Attributor] Derive AACallEdges attribute

This attribute computes the optimistic live call edges using the attributor
liveness information. This attribute will be used for deriving a
inter-procedural function reachability attribute.

Reviewed By: jdoerfert

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

3 years agoRevert "[DFSan] Cleanup code for platforms other than Linux x86_64."
Andrew Browne [Thu, 17 Jun 2021 21:18:45 +0000 (14:18 -0700)]
Revert "[DFSan] Cleanup code for platforms other than Linux x86_64."

This reverts commit 8441b993bdba29437b296bad6a37464669eef35e.

Buildbot failures.

3 years ago[InstrProfiling] Make __profd_ unconditionally private for ELF
Fangrui Song [Thu, 17 Jun 2021 21:16:54 +0000 (14:16 -0700)]
[InstrProfiling] Make __profd_ unconditionally private for ELF

For ELF, since all counters/data are in a section group (either `comdat any` or
`comdat noduplicates`), and the signature for `comdat any` is `__profc_`, the
D1003372 optimization prerequisite (linker GC cannot discard data variables
while the text section is retained) is always satisified, we can make __profd_
unconditionally private.

Reviewed By: davidxl, rnk

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

3 years ago[PartiallyInlineLibCalls] Disable sqrt expansion for strictfp.
Craig Topper [Thu, 17 Jun 2021 18:31:56 +0000 (11:31 -0700)]
[PartiallyInlineLibCalls] Disable sqrt expansion for strictfp.

This pass emits a floating point compare and a conditional branch,
but if strictfp is enabled we don't emit a constrained compare
intrinsic.

The backend also won't expand the readonly sqrt call this pass inserts
to a sqrt instruction under strictfp. So we end up with 2 libcalls as
seen here. https://godbolt.org/z/oax5zMEWd

Fix these things by disabling the pass.

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

3 years ago[DFSan] Cleanup code for platforms other than Linux x86_64.
Andrew Browne [Thu, 17 Jun 2021 19:12:27 +0000 (12:12 -0700)]
[DFSan] Cleanup code for platforms other than Linux x86_64.

These other platforms are unsupported and untested.
They could be re-added later based on MSan code.

Reviewed By: gbalats, stephan.yichao.zhao

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

3 years ago[ScalarEvolution] Fix pointer/int type handling converting select/phi to min/max.
Eli Friedman [Wed, 16 Jun 2021 07:00:13 +0000 (00:00 -0700)]
[ScalarEvolution] Fix pointer/int type handling converting select/phi to min/max.

The old version of this code would blindly perform arithmetic without
paying attention to whether the types involved were pointers or
integers.  This could lead to weird expressions like negating a pointer.

Explicitly handle simple cases involving pointers, like "x < y ? x : y".
In all other cases, coerce the operands of the comparison to integer
types.  This avoids the weird cases, while handling most of the
interesting cases.

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

3 years agoRISCV: clean up target expression handling
Saleem Abdulrasool [Thu, 17 Jun 2021 17:09:22 +0000 (17:09 +0000)]
RISCV: clean up target expression handling

The target specific expression handling was slightly regressed by
bbea64250f65480d787e1c5ff45c4de3ec2dcda8.  This restores the proper
sub-expression evaluation to allow for constant folding within the
expression.  We explicitly discard the layout and assembler when
evaluating the expression to avoid any symbolic computation and instead
using the `evaluateAsRelocatable` to canonicalise and constant fold
only.

We can also simplify the expression handling - none of the target
variants support symbolic difference.  This simplifies the logic for
that and adds additional tests to ensure that we do not accidentally
regress here in the future.

Reviewed By: maskray

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

3 years ago[libc++] Make sure std::allocator<void> is always trivial
Louis Dionne [Wed, 16 Jun 2021 16:35:00 +0000 (12:35 -0400)]
[libc++] Make sure std::allocator<void> is always trivial

When we removed the allocator<void> specialization, the triviality of
std::allocator<void> changed because the primary template had a
non-trivial default constructor and the specialization didn't
(so std::allocator<void> went from trivial to non-trivial).

This commit fixes that oversight by giving a trivial constructor to
the primary template when instantiated on cv-void.

This was reported in https://llvm.org/PR50299.

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

3 years ago[GISel] Eliminate redundant bitmasking
Jon Roelofs [Fri, 28 May 2021 18:41:20 +0000 (11:41 -0700)]
[GISel] Eliminate redundant bitmasking

This was a GISel vs SDAG regression that showed up at -Os on arm64 in:
SingleSource/Benchmarks/Adobe-C++/simple_types_constant_folding.test

https://llvm.godbolt.org/z/aecjodsjG

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

3 years ago[AArch64][GISel] and+or+shl => bfi
Jon Roelofs [Thu, 27 May 2021 22:11:55 +0000 (15:11 -0700)]
[AArch64][GISel] and+or+shl => bfi

This fixes a GISEL vs SDAG regression that showed up at -Os in 256.bzip2

In `_getAndMoveToFrontDecode`:

gisel:
```
and w9, w0, #0xff
orr w9, w9, w8, lsl #8
```

sdag:
```
bfi w0, w8, #8, #24
```

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

3 years agoRevert "[NFC] Remove checking pointee type for byval/preallocated type"
Jorge Gorbe Moya [Thu, 17 Jun 2021 19:17:07 +0000 (12:17 -0700)]
Revert "[NFC] Remove checking pointee type for byval/preallocated type"

This reverts commit 738abfdbea21acd2597d83ad3390daf5696b6d07.

3 years ago[lldb-vscode] only report long running progress events
Walter Erquinigo [Fri, 30 Apr 2021 04:27:12 +0000 (21:27 -0700)]
[lldb-vscode] only report long running progress events

When the number of shared libs is massive, there could be hundreds of
thousands of short lived progress events sent to the IDE, which makes it
irresponsive while it's processing all this data. As these small jobs
take less than a second to process, the user doesn't even see them,
because the IDE only display the progress of long operations. So it's
better not to send these events.

I'm fixing that by sending only the events that are taking longer than 5
seconds to process.
In a specific run, I got the number of events from ~500k to 100, because
there was only 1 big lib to parse.

I've tried this on several small and massive targets, and it seems to
work fine.

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

3 years ago[LoopUnroll] Fold all exits based on known trip count/multiple
Nikita Popov [Sun, 13 Jun 2021 14:55:17 +0000 (16:55 +0200)]
[LoopUnroll] Fold all exits based on known trip count/multiple

Fold all exits based on known trip count/multiple information from
SCEV. Previously only the latch exit or the single exit were folded.

This doesn't yet eliminate ULO.TripCount and ULO.TripMultiple
entirely: They're still used to a) decide whether runtime unrolling
should be performed and b) for ORE remarks. However, the core
unrolling logic is independent of them now.

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

3 years ago[MCA] [RegisterFile] Allow for skipping Defs with RegID of 0 (rather than assert...
Patrick Holland [Wed, 16 Jun 2021 22:53:00 +0000 (15:53 -0700)]
[MCA] [RegisterFile] Allow for skipping Defs with RegID of 0 (rather than assert(RegID) like we do before this patch).

This patch will allow developers to remove unwanted instruction Defs (most likely from within a target specific InstrPostProcess) by setting that Def's RegisterID to 0.
Differential Revision: https://reviews.llvm.org/D104433

3 years ago[lld][WebAssembly] Add new `--import-undefined` option
Sam Clegg [Thu, 27 May 2021 21:27:10 +0000 (14:27 -0700)]
[lld][WebAssembly] Add new `--import-undefined` option

This change revisits https://reviews.llvm.org/D79248 which originally
added support for the --unresolved-symbols flag.

At the time I thought it would make sense to add a third option to this
flag called `import-functions` but it turns out (as was suspects by on
the reviewers IIRC) that this option can be authoganal.

Instead I've added a new option called `--import-undefined` that only
operates on symbols that can be imported (for example, function symbols
can always be imported as opposed to data symbols we can only be
imported when compiling with PIC).

This option gives us the full expresivitiy that emscripten needs to be
able allow reporting of undefined data symbols as well as the option to
disable that.

This change does remove the `--unresolved-symbols=import-functions`
option, which is been in the codebase now for about a year but I would
be extremely surprised if anyone was using it.

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

3 years ago[lld-macho] Rework mergeFlag to behave closer to what ld64 does.
Vy Nguyen [Wed, 9 Jun 2021 16:12:10 +0000 (12:12 -0400)]
[lld-macho] Rework mergeFlag to behave closer to what ld64 does.

Details:
I've been getting a few weird errors similar to the following from our internal tests:

```
ld64.lld.darwinnew: error: Cannot merge section __eh_frame (type=0x0) into __eh_frame (type=0xB): inconsistent types
ld64.lld.darwinnew: error: Cannot merge section __eh_frame (flags=0x0) into __eh_frame (flags=0x6800000B): strict flags differ
ld64.lld.darwinnew: error: Cannot merge section __eh_frame (type=0x0) into __eh_frame (type=0xB): inconsistent types
ld64.lld.darwinnew: error: Cannot merge section __eh_frame (flags=0x0) into __eh_frame (flags=0x6800000B): strict flags differ
```

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

3 years ago[llvm-symbolizer][docs] Update example for --verbose in the guide
Andrew Ng [Fri, 11 Jun 2021 15:58:00 +0000 (16:58 +0100)]
[llvm-symbolizer][docs] Update example for --verbose in the guide

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

3 years ago[X86] AMD Zen 3: don't confuse shift and shuffle, NFC
Roman Lebedev [Thu, 17 Jun 2021 18:04:52 +0000 (21:04 +0300)]
[X86] AMD Zen 3: don't confuse shift and shuffle, NFC

These proc res groups occupy the exact same pipes,
so this doesn't affect the modelling,
but it's confusing nontheless.

3 years ago[NFC] LoopVectorizationCostModel::getMaximizedVFForTarget(): clarify debug msg
Roman Lebedev [Thu, 17 Jun 2021 17:53:48 +0000 (20:53 +0300)]
[NFC] LoopVectorizationCostModel::getMaximizedVFForTarget(): clarify debug msg

This really isn't talking about vectors in general,
but only about either fixed or scalable vectors,
and it's pretty confusing to see it state
that there aren't any vectors :)

3 years ago[AIX] Remove --as-needed passing into aix linker
jasonliu [Thu, 17 Jun 2021 17:14:49 +0000 (17:14 +0000)]
[AIX] Remove --as-needed passing into aix linker

Summary:
AIX does not support --as-needed linker options. Remove that option from
aix linker when -lunwind is needed.
For unwinder library, nothing special is needed because by default aix
linker has the as-needed effect for library that's an archive (which is
the case for libunwind on AIX).

Reviewed By: daltenty

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

3 years ago[gn build] Port f27e4548fc42
LLVM GN Syncbot [Thu, 17 Jun 2021 17:09:43 +0000 (17:09 +0000)]
[gn build] Port f27e4548fc42

3 years ago[lld-macho] Implement ICF
Greg McGary [Wed, 19 May 2021 16:58:17 +0000 (09:58 -0700)]
[lld-macho] Implement ICF

ICF = Identical C(ode|OMDAT) Folding

This is the LLD ELF/COFF algorithm, adapted for MachO. So far, only `-icf all` is supported. In order to support `-icf safe`, we will need to port address-significance tables (`.addrsig` directives) to MachO, which will come in later diffs.

`check-{llvm,clang,lld}` have 0 regressions for `lld -icf all` vs. baseline ld64.

We only run ICF on `__TEXT,__text` for reasons explained in the block comment in `ConcatOutputSection.cpp`.

Here is the perf impact for linking `chromium_framekwork` on a Mac Pro (16-core Xeon W) for the non-ICF case vs. pre-ICF:
```
    N           Min           Max        Median           Avg        Stddev
x  20          4.27          4.44          4.34         4.349   0.043029977
+  20          4.37          4.46         4.405        4.4115   0.025188761
Difference at 95.0% confidence
        0.0625 +/- 0.0225658
        1.43711% +/- 0.518873%
        (Student's t, pooled s = 0.0352566)
```

Reviewed By: #lld-macho, int3

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

3 years ago[clang] Fix a race condition in the build of clangInterpreter
Stella Stamenova [Thu, 17 Jun 2021 17:03:33 +0000 (10:03 -0700)]
[clang] Fix a race condition in the build of clangInterpreter

The library depends on Attributes.inc, so it has to depend on the intrinsics_gen target

Reviewed By: v.g.vassilev

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

3 years ago[mlir][sparse] Add Matricized Tensor Times Khatri-Rao Product (MTTKRP) integration...
Gus Smith [Wed, 16 Jun 2021 21:07:15 +0000 (21:07 +0000)]
[mlir][sparse] Add Matricized Tensor Times Khatri-Rao Product (MTTKRP) integration test

See this documentation from taco:
http://tensor-compiler.org/docs/data_analytics/index.html

Reviewed By: aartbik

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

3 years ago[libcxx][module-map] 🎨 updates module map to account for ranges headers
Christopher Di Bella [Wed, 16 Jun 2021 19:12:51 +0000 (19:12 +0000)]
[libcxx][module-map] 🎨 updates module map to account for ranges headers

Corresponding module map update for D104414, split out for rollback
reasons.

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

3 years ago[libcxx][iwyu] 🎨 adds more headers to IWYU
Christopher Di Bella [Wed, 16 Jun 2021 19:02:23 +0000 (19:02 +0000)]
[libcxx][iwyu] 🎨 adds more headers to IWYU

A few slipped through the cracks because D104175 and D104170 didn't
concern themselves with newer commits.

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

3 years agotest: clean up some of the RISCV tests (NFC)
Saleem Abdulrasool [Thu, 17 Jun 2021 16:48:51 +0000 (16:48 +0000)]
test: clean up some of the RISCV tests (NFC)

This addresses some post-commit comments from jrtc27 to make the tests
easier to process.

3 years agofix an -Wunused-variable warning in release built, NFC
Haojian Wu [Thu, 17 Jun 2021 16:48:12 +0000 (18:48 +0200)]
fix an -Wunused-variable warning in release built, NFC

3 years ago[InstSimplify] add tests for computeKnownBits of shift-with-bitcast op; NFC
Sanjay Patel [Thu, 17 Jun 2021 15:57:44 +0000 (11:57 -0400)]
[InstSimplify] add tests for computeKnownBits of shift-with-bitcast op; NFC

3 years ago[InstCombine][x86] add tests for complex vector shift value tracking; NFC
Sanjay Patel [Wed, 16 Jun 2021 19:30:55 +0000 (15:30 -0400)]
[InstCombine][x86] add tests for complex vector shift value tracking; NFC

https://llvm.org/PR50123

3 years ago[compiler-rt][hwasan]: undefine new/delete operators with alignment on Android.
Yabin Cui [Thu, 17 Jun 2021 16:25:58 +0000 (09:25 -0700)]
[compiler-rt][hwasan]: undefine new/delete operators with alignment on Android.

This is to fix build on Android. And we don't want to intercept more new/delete operators on Android.

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

3 years agoRevert "Remove obsolete call to AsyncSignalSafeLazyInitiFakeStack."
Kevin Athey [Thu, 17 Jun 2021 16:26:13 +0000 (09:26 -0700)]
Revert "Remove obsolete call to AsyncSignalSafeLazyInitiFakeStack."

This reverts commit 07481b37961f5b9a670c924367d2ead2e3c32b86.

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

3 years agoRISCV: adjust handling of relocation emission for RISCV
Saleem Abdulrasool [Wed, 26 May 2021 15:41:11 +0000 (15:41 +0000)]
RISCV: adjust handling of relocation emission for RISCV

This re-architects the RISCV relocation handling to bring the
implementation closer in line with the implementation in binutils.  We
would previously aggressively resolve the relocation.  With this
restructuring, we always will emit a paired relocation for any symbolic
difference of the type of S±T[±C] where S and T are labels and C is a
constant.

GAS has a special target hook controlled by `RELOC_EXPANSION_POSSIBLE`
which indicates that a fixup may be expanded into multiple relocations.
This is used by the RISCV backend to always emit a paired relocation -
either ADD[WIDTH] + SUB[WIDTH] for text relocations or SET[WIDTH] +
SUB[WIDTH] for a debug info relocation.  Irrespective of whether linker
relaxation support is enabled, symbolic difference is always emitted as
a paired relocation.

This change also sinks the target specific behaviour down into the
target specific area rather than exposing it to the shared relocation
handling.  In the process, we also sink the "special" handling for debug
information down into the RISCV target.  Although this improves the path
for the other targets, this is not necessarily entirely ideal either.
The changes in the debug info emission could be done through another
type of hook as this functionality would be required by any other target
which wishes to do linker relaxation.  However, as there are no other
targets in LLVM which currently do this, this is a reasonable thing to
do until such time as the code needs to be shared.

Improve the handling of the relocation (and add a reduced test case from
the Linux kernel) to ensure that we handle complex expressions for
symbolic difference.  This ensures that we correct relocate symbols with
the adddends normalized and associated with the addition portion of the
paired relocation.

This change also addresses some review comments from Alex Bradbury about
the relocations meant for use in the DWARF CFA being named incorrectly
(using ADD6 instead of SET6) in the original change which introduced the
relocation type.

This resolves the issues with the symbolic difference emission
sufficiently to enable building the Linux kernel with clang+IAS+lld
(without linker relaxation).

Resolves PR50153, PR50156!
Fixes: ClangBuiltLinux/linux#1023, ClangBuiltLinux/linux#1143

Reviewed By: nickdesaulniers, maskray

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

3 years agoReapply "[DebugInfo] Prevent non-determinism when updating DIArgList users of a value"
Stephen Tozer [Thu, 17 Jun 2021 14:21:10 +0000 (15:21 +0100)]
Reapply "[DebugInfo] Prevent non-determinism when updating DIArgList users of a value"

Reapply the commit which previously caused build failures due to the
mismatched template arguments between the return type and the returned
SmallVector.

This reverts commit e8991caea8690ec2d17b0b7e1c29bf0da6609076.

3 years ago[lld-macho] Avoid force-loading the same archive twice
Jez Ng [Thu, 17 Jun 2021 15:12:52 +0000 (11:12 -0400)]
[lld-macho] Avoid force-loading the same archive twice

We need to dedup archive loads (similar to what we do for dylib
loads).

I noticed this issue after building some Swift stuff that used
`-force_load_swift_libs`, as it caused some Swift archives to be loaded
many times.

Reviewed By: #lld-macho, thakis, MaskRay

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

3 years ago[clangd] Explicitly fail if the file passed to --check is not valid.
Haojian Wu [Thu, 17 Jun 2021 12:33:24 +0000 (14:33 +0200)]
[clangd] Explicitly fail if the file passed to --check is not valid.

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

3 years ago[FPEnv][InstSimplify] Precommit tests for D103169.
Kevin P. Neal [Thu, 17 Jun 2021 14:30:21 +0000 (10:30 -0400)]
[FPEnv][InstSimplify] Precommit tests for D103169.

In D103169 I'm adding to InstSimplify support for NaN to constrained
intrinsics that have a regular FP IR instruction counterpart. Precommit
the tests for clarity when that ticket lands.

3 years ago[llvm] fix typo in comment
Guillaume Chatelet [Thu, 17 Jun 2021 14:30:52 +0000 (14:30 +0000)]
[llvm] fix typo in comment

3 years agoRevert "[DebugInfo] Prevent non-determinism when updating DIArgList users of a value"
Stephen Tozer [Thu, 17 Jun 2021 14:20:06 +0000 (15:20 +0100)]
Revert "[DebugInfo] Prevent non-determinism when updating DIArgList users of a value"

Commit caused build errors on buildbots with [-Werror,-Wreturn-std-move]
enabled.

This reverts commit fa1de88f81e9c6db5255ca7c4d0fd25606c5a054.

3 years ago[Sema] Fix for PR50741
eahcmrh [Wed, 16 Jun 2021 21:35:19 +0000 (23:35 +0200)]
[Sema] Fix for PR50741

Fixed crash when doing pointer math on a void pointer.

Also, reworked test to use -verify rather than FileCheck.

Reviewed By: erichkeane

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

3 years ago[DebugInfo] Prevent non-determinism when updating DIArgList users of a value
Stephen Tozer [Thu, 17 Jun 2021 12:58:34 +0000 (13:58 +0100)]
[DebugInfo] Prevent non-determinism when updating DIArgList users of a value

This patch fixes an issue where builds of programs with multiple dbg.values
with DIArgList locations could have non-deterministic output. This issue
was caused by ReplaceableMetadataImpl::getAllArgListUsers, which
returned DIArgList pointers in a random order; the output of this
function would later be used to insert dbg.values, causing the order of
insertion to be non-deterministic. This patch changes getAllArgListUsers
to return pointers in a fixed order.

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

3 years ago[mlir] Remove linalg.indexed_generic forward decl.
Alexander Belyaev [Thu, 17 Jun 2021 14:04:06 +0000 (16:04 +0200)]
[mlir] Remove linalg.indexed_generic forward decl.

3 years ago[lldb] Remove redundant calls to set eReturnStatusFailed
David Spickett [Thu, 17 Jun 2021 11:32:23 +0000 (12:32 +0100)]
[lldb] Remove redundant calls to set eReturnStatusFailed

This is part 2, covering the commands source.

Some uses remain where it's tricky to see what the
logic is or they are not used with AppendError.

Reviewed By: teemperor

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

3 years ago[FuncSpec] Precommit test: don't specialise funcs with NoDuplicate instrs. NFC.
Sjoerd Meijer [Thu, 17 Jun 2021 12:50:15 +0000 (13:50 +0100)]
[FuncSpec] Precommit test: don't specialise funcs with NoDuplicate instrs. NFC.

3 years ago[mlir] Split things dependent on LLVM_DEBUG into a .cpp file
Benjamin Kramer [Thu, 17 Jun 2021 13:02:00 +0000 (15:02 +0200)]
[mlir] Split things dependent on LLVM_DEBUG into a .cpp file

LLVM_DEBUG in headers is awkward, better avoid it. DEBUG_TYPE in a
header results in a lot of macro redefinition warnings.

3 years ago[X86] combineSelect - refactor MIN/MAX detection code to make it easier to add additi...
Simon Pilgrim [Thu, 17 Jun 2021 12:17:51 +0000 (13:17 +0100)]
[X86] combineSelect - refactor MIN/MAX detection code to make it easier to add additional select(setcc,x,y) folds. NFCI.

I need to add some additional handling to address some of the regressions from D101074

3 years ago[mlir][linalg] Purge linalg.indexed_generic.
Alexander Belyaev [Thu, 17 Jun 2021 12:35:26 +0000 (14:35 +0200)]
[mlir][linalg] Purge linalg.indexed_generic.

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

3 years ago[X86] Check using default in test added in 0bd5bbb31e0345ae.
Florian Hahn [Thu, 17 Jun 2021 12:08:53 +0000 (13:08 +0100)]
[X86] Check using default in test added in 0bd5bbb31e0345ae.

Make sure llvm-mc is invariant with respect to debug locations in the
test (checks update to use the -x86-pad-for-align default value)

3 years ago[libc] Generate one benchmark per implementation
Guillaume Chatelet [Thu, 10 Jun 2021 13:04:56 +0000 (13:04 +0000)]
[libc] Generate one benchmark per implementation

We now generate as many benchmarks as there are implementations.

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

3 years ago[X86] Add test showing binary differences with -x86-pad-for-align.
Florian Hahn [Thu, 17 Jun 2021 11:13:55 +0000 (12:13 +0100)]
[X86] Add test showing binary differences with -x86-pad-for-align.

This patch adds a test case showing how a single extra .loc can cause
binary differences when using -x86-pad-for-align=true.

The issue has been discussed in D94542, PR42138, PR48742.

3 years ago[mlir] define a customized DEBUG_TYPE in InterfaceSupport.h
Alex Zinenko [Thu, 17 Jun 2021 11:24:32 +0000 (13:24 +0200)]
[mlir] define a customized DEBUG_TYPE in InterfaceSupport.h

3 years ago[lldb] Remove redundant calls to set eReturnStatusFailed
David Spickett [Wed, 16 Jun 2021 12:56:51 +0000 (13:56 +0100)]
[lldb] Remove redundant calls to set eReturnStatusFailed

Since https://reviews.llvm.org/D103701 AppendError<...>
sets this for you.

This change includes all of the non-command uses.

Some uses remain where it's either tricky to reason about
the logic, or they aren't paired with AppendError calls.

Reviewed By: teemperor

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

3 years ago[lldb] Set return object failed status even if error string is empty
David Spickett [Wed, 16 Jun 2021 13:39:50 +0000 (14:39 +0100)]
[lldb] Set return object failed status even if error string is empty

The idea is now that AppendError<...> will set eReturnStatusFailed
for you so you don't have to call SetStatus again.

Previously if the error message was empty, the status wouldn't
be set.

I don't think there are any sitautions where the message is in
fact empty but it potentially could be depending on where
we get the string from.

So let's set the status up front then return early if the message is empty.

Reviewed By: teemperor

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

3 years ago[mlir] Enable delayed registration of attribute/operation/type interfaces
Alex Zinenko [Wed, 16 Jun 2021 16:53:21 +0000 (18:53 +0200)]
[mlir] Enable delayed registration of attribute/operation/type interfaces

This functionality is similar to delayed registration of dialect interfaces. It
allows external interface models to be registered before the dialect containing
the attribute/operation/type interface is loaded, or even before the context is
created.

Reviewed By: rriddle

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

3 years ago[hwasan] Improve report for addresses within regions.
Florian Mayer [Wed, 16 Jun 2021 18:38:37 +0000 (19:38 +0100)]
[hwasan] Improve report for addresses within regions.

Before: ADDR is located -320 bytes to the right of 1072-byte region
After: ADDR is located 752 bytes inside 1072-byte region

Reviewed By: eugenis, walli99

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

3 years ago[hwasan] Do not use short granule tags as poison tags.
Florian Mayer [Tue, 15 Jun 2021 12:12:02 +0000 (13:12 +0100)]
[hwasan] Do not use short granule tags as poison tags.

Short granule tags as poison cause a UaF to read the referenced
memory to retrieve the tag, and means we do not detect the UaF
if the last granule's tag is still around.

This only increases the change of not catching a UaF from
0.39 % (1 / 256) to 0.42 % (1 / (256 - 17)).

Reviewed By: eugenis

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

3 years ago[InstCombine] Fix miscompile on GEP+load to icmp fold (PR45210)
hyeongyukim [Thu, 17 Jun 2021 10:28:24 +0000 (19:28 +0900)]
[InstCombine] Fix miscompile on GEP+load to icmp fold (PR45210)

As noted in PR45210: https://bugs.llvm.org/show_bug.cgi?id=45210
...the bug is triggered as Eli say when sext(idx) * ElementSize overflows.

```
   // assume that GV is an array of 4-byte elements
   GEP = gep GV, 0, Idx // this is accessing Idx * 4
   L = load GEP
   ICI = icmp eq L, value
 =>
   ICI = icmp eq Idx, NewIdx
```

The foldCmpLoadFromIndexedGlobal function simplifies GEP+load operation to icmp.
And there is a problem because Idx * ElementSize can overflow.

Let's assume that the wanted value is at offset 0.
Then, there are actually four possible values for Idx to match offset 0: 0x00..00, 0x40..00, 0x80..00, 0xC0..00.
We should return true for all these values, but currently, the new icmp only returns true for 0x00..00.

This problem can be solved by masking off (trailing zeros of ElementSize) bits from Idx.

```
   ...
 =>
   Idx' = and Idx, 0x3F..FF
   ICI = icmp eq Idx', NewIdx
```

Reviewed By: efriedma

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

3 years ago[flang] preserve symbol in DescriptorInquiry
Jean Perier [Thu, 17 Jun 2021 10:40:19 +0000 (12:40 +0200)]
[flang] preserve symbol in DescriptorInquiry

Do not use ultimate symbols in DescriptorInquiry. Using the ultimate
symbol may lead to issues later for at least two reasons:

- The original symbols may have volatile/asynchronous attributes that
  the ultimate may not have. Later phases working on the DescriptorInquiry
  would then not apply potential care required by these attributes.
- HostAssociatedDetails symbols are used by OpenMP for symbols with
  special OpenMP attributes inside OpenMP region (e.g variables with
  private attribute), so it is very important to preserve this
  aspect in the DescriptorInquiry, that would otherwise apply on the
  symbol outside of the region.

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

3 years ago[NFC] test commit, fix namespace ending comment.
Florian Mayer [Thu, 17 Jun 2021 10:17:11 +0000 (11:17 +0100)]
[NFC] test commit, fix namespace ending comment.

3 years ago[ELF] Restore arm-branch.s test
Igor Kudrin [Thu, 17 Jun 2021 10:08:13 +0000 (17:08 +0700)]
[ELF] Restore arm-branch.s test

After D77330, the comments are inconsistent with the disassembled code.
As the value of `far` has been changed, a thunk to reach it is now
generated, and target addresses of branch instructions are different
from what was initially expected.

The patch fixes that and makes the test closer to what it was originally.

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

3 years ago[LLD] [COFF] Remove a stray duplicate comment. NFC.
Martin Storsjö [Wed, 16 Jun 2021 13:56:33 +0000 (16:56 +0300)]
[LLD] [COFF] Remove a stray duplicate comment. NFC.

The following class isn't part of the export table; there's a
second correctly placed comment about the things that actually
belong to the export table.

3 years ago[llvm-dlltool] Imply the target arch from a tool triple prefix
Martin Storsjö [Mon, 14 Jun 2021 10:21:54 +0000 (13:21 +0300)]
[llvm-dlltool] Imply the target arch from a tool triple prefix

Also use the default LLVM target as default for dlltool. This
matches how GNU dlltool behaves; it is compiled with one default
target, which is used if no option is provided.

Extend the anonymous namespace in the implementation file instead
of using static functions.

Based on a patch by Mateusz Mikuła.

The effect of the default LLVM target, if neither the -m option
nor a tool triple prefix is provided, isn't tested, as we can't
make assumptions about what it is set to.

(We could make the default be forced to one of the four supported
architectures if the default triple is another arch, and then just
test that llvm-dlltool without an -m option is able to produce an
import library, without checking the actual architecture though.)

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

3 years ago[llvm-dlltool] [test] Add a testcase for all machine option types. NFC.
Martin Storsjö [Mon, 14 Jun 2021 10:28:33 +0000 (13:28 +0300)]
[llvm-dlltool] [test] Add a testcase for all machine option types. NFC.

The existing tests only test that some options (but not e.g. arm)
are accepted, but it doesn't test their functional effect of
affecting the generated object files.

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

3 years ago[llvm-dlltool] [test] Remove superfluous --coff-exports option to llvm-readobj. NFC.
Martin Storsjö [Mon, 14 Jun 2021 10:25:28 +0000 (13:25 +0300)]
[llvm-dlltool] [test] Remove superfluous --coff-exports option to llvm-readobj. NFC.

The --coff-exports option to llvm-readobj prints the exported symbols
from a DLL/EXE, it doesn't do anything with regards to an import
library.

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

3 years ago[llvm-dlltool] [test] Test both short and long forms of options. NFC.
Martin Storsjö [Mon, 14 Jun 2021 10:23:01 +0000 (13:23 +0300)]
[llvm-dlltool] [test] Test both short and long forms of options. NFC.

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

3 years ago[libcxx] Fix a case of -Wundef warnings regarding _POSIX_TIMERS
Martin Storsjö [Wed, 16 Jun 2021 12:22:28 +0000 (15:22 +0300)]
[libcxx] Fix a case of -Wundef warnings regarding _POSIX_TIMERS

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

3 years ago[mlir] separable registration of operation interfaces
Alex Zinenko [Tue, 15 Jun 2021 13:27:01 +0000 (15:27 +0200)]
[mlir] separable registration of operation interfaces

This is similar to attribute and type interfaces and mostly the same mechanism
(FallbackModel / ExternalModel, ODS generation). There are minor differences in
how the concept-based polymorphism is implemented for operations that are
accounted for by ODS backends, and this essentially adds a test and exposes the
API.

Reviewed By: rriddle

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

3 years ago[FuncSpec] Don't specialise functions with attribute NoDuplicate.
Sjoerd Meijer [Wed, 16 Jun 2021 13:26:57 +0000 (14:26 +0100)]
[FuncSpec] Don't specialise functions with attribute NoDuplicate.

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

3 years ago[RISCV][VP] Lower FP VP ISD nodes to RVV instructions
Fraser Cormack [Mon, 14 Jun 2021 10:00:25 +0000 (11:00 +0100)]
[RISCV][VP] Lower FP VP ISD nodes to RVV instructions

With the exception of `frem`, this patch supports the current set of VP
floating-point binary intrinsics by lowering them to to RVV instructions. It
does so by using the existing `RISCVISD *_VL` custom nodes as an intermediate
layer. Both scalable and fixed-length vectors are supported by using this
method.

The `frem` node is unsupported due to a lack of available instructions. For
fixed-length vectors we could scalarize but that option is not (currently)
available for scalable-vector types. The support is intentionally left out so
it equivalent for both vector types.

The matching of vector/scalar forms is currently lacking, as scalable vector
types do not lower to the custom `VFMV_V_F_VL` node. We could either make
floating-point scalable vector splats lower to this node, or support the
matching of multiple kinds of splat via a `ComplexPattern`, much like we do for
integer types.

Reviewed By: rogfer01

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

3 years ago[clang][AST] Set correct DeclContext in ASTImporter lookup table for template params.
Balázs Kéri [Thu, 17 Jun 2021 07:12:36 +0000 (09:12 +0200)]
[clang][AST] Set correct DeclContext in ASTImporter lookup table for template params.

Template parameters are created in ASTImporter with the translation unit as DeclContext.
The DeclContext is later updated (by the create function of template classes).
ASTImporterLookupTable was not updated after these changes of the DC. The patch
adds update of the DeclContext in ASTImporterLookupTable.

Reviewed By: martong

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

3 years ago[InterleaveAccess] Copy fast math flags when adjusting binary operators in interleave...
David Green [Thu, 17 Jun 2021 08:53:33 +0000 (09:53 +0100)]
[InterleaveAccess] Copy fast math flags when adjusting binary operators in interleave access pass

The Interleave Access pass will convert shuffle(binop(load, load)) to
binop(shuffle(load), shuffle(load)), in order to create more
interleaving load patterns (VLD2/3/4) that might have been messed up by
instcombine. As shown in D104247 we were missing copying IR flags to the
new instruction though, which should just be kept the same as the
original instruction.

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

3 years ago[Demangle] Support Rust v0 mangling scheme in llvm::demangle
Tomasz Miąsko [Thu, 17 Jun 2021 08:30:04 +0000 (10:30 +0200)]
[Demangle] Support Rust v0 mangling scheme in llvm::demangle

The llvm::demangle is currently used by llvm-objdump and llvm-readobj,
so this effectively adds support for Rust v0 mangling to those
applications.

Reviewed By: dblaikie

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

3 years ago[VPlan] Support PHIs as LastInst when inserting scalars in ::get().
Florian Hahn [Thu, 17 Jun 2021 07:53:36 +0000 (08:53 +0100)]
[VPlan] Support PHIs as LastInst when inserting scalars in ::get().

At the moment, we create insertelement instructions directly after
LastInst when inserting scalar values in a vector in
VPTransformState::get.

This results in invalid IR when LastInst is a phi, followed by another
phi. In that case, the new instructions should be inserted just after
the last PHI node in the block.

At the moment, I don't think the problematic case can be triggered, but
it can happen once predicate regions are merged and multiple
VPredInstPHI recipes are in the same block (D100260).

Reviewed By: Ayal

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

3 years ago[Format] Fix incorrect pointer/reference detection
Yilong Guo [Thu, 17 Jun 2021 08:33:00 +0000 (09:33 +0100)]
[Format] Fix incorrect pointer/reference detection

https://llvm.org/PR50568

When an overloaded operator is called, its argument must be an
expression.

Before:
    void f() { a.operator()(a *a); }

After:
    void f() { a.operator()(a * a); }

Reviewed By: HazardyKnusperkeks, curdeius, MyDeveloperDay

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

3 years ago[analyzer] Make checker silencing work for non-pathsensitive bug reports
Kirstóf Umann [Fri, 21 May 2021 12:02:03 +0000 (14:02 +0200)]
[analyzer] Make checker silencing work for non-pathsensitive bug reports

D66572 separated BugReport and BugReporter into basic and path sensitive
versions. As a result, checker silencing, which worked deep in the path
sensitive report generation facilities became specific to it. DeadStoresChecker,
for instance, despite being in the static analyzer, emits non-pathsensitive
reports, and was impossible to silence.

This patch moves the corresponding code before the call to the virtual function
generateDiagnosticForConsumerMap (which is overriden by the specific kinds of
bug reporters). Although we see bug reporting as relatively lightweight compared
to the analysis, this will get rid of several steps we used to throw away.

Quoting from D65379:

At a very high level, this consists of 3 steps:

For all BugReports in the same BugReportEquivClass, collect all their error
nodes in a set. With that set, create a new, trimmed ExplodedGraph whose leafs
are all error nodes.
Until a valid report is found, construct a bug path, which is yet another
ExplodedGraph, that is linear from a given error node to the root of the graph.
Run all visitors on the constructed bug path. If in this process the report got
invalidated, start over from step 2.
Checker silencing used to kick in after all of these. Now it does before any of
them :^)

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

Change-Id: Ice42939304516f2bebd05a1ea19878b89c96a25d

3 years ago[mlir] ODS: emit interface traits outside of the interface class
Alex Zinenko [Wed, 16 Jun 2021 14:31:17 +0000 (16:31 +0200)]
[mlir] ODS: emit interface traits outside of the interface class

ODS currently emits the interface trait class as a nested class inside the
interface class. As an unintended consequence, the default implementations of
interface methods have implicit access to static fields of the interface class,
e.g. those declared in `extraClassDeclaration`, including private methods (!),
or in the parent class. This may break the use of default implementations for
external models, which are not defined in the interface class, and generally
complexifies the abstraction.

Emit intraface traits outside of the interface class itself to avoid accidental
implicit visibility. Public static fields can still be accessed via explicit
qualification with a class name, e.g., `MyOpInterface::staticMethod()` instead
of `staticMethod`.

Update the documentation to clarify the role of `extraClassDeclaration` in
interfaces.

Reviewed By: rriddle

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

3 years ago[lldb] Skip variant/optional libc++ tests for Clang 5/6
Raphael Isemann [Thu, 17 Jun 2021 07:52:08 +0000 (09:52 +0200)]
[lldb] Skip variant/optional libc++ tests for Clang 5/6

Clang 5 and Clang 6 can no longer parse newer versions of libc++. As we can't
specify the specific libc++ version in the decorator, let's only allow Clang
versions that can parse all currently available libc++ versions.

3 years agoUpdate @llvm.powi to handle different int sizes for the exponent
Bjorn Pettersson [Fri, 26 Mar 2021 20:02:26 +0000 (21:02 +0100)]
Update @llvm.powi to handle different int sizes for the exponent

This can be seen as a follow up to commit 0ee439b705e82a4fe20e2,
that changed the second argument of __powidf2, __powisf2 and
__powitf2 in compiler-rt from si_int to int. That was to align with
how those runtimes are defined in libgcc.
One thing that seem to have been missing in that patch was to make
sure that the rest of LLVM also handle that the argument now depends
on the size of int (not using the si_int machine mode for 32-bit).
When using __builtin_powi for a target with 16-bit int clang crashed.
And when emitting libcalls to those rtlib functions, typically when
lowering @llvm.powi), the backend would always prepare the exponent
argument as an i32 which caused miscompiles when the rtlib was
compiled with 16-bit int.

The solution used here is to use an overloaded type for the second
argument in @llvm.powi. This way clang can use the "correct" type
when lowering __builtin_powi, and then later when emitting the libcall
it is assumed that the type used in @llvm.powi matches the rtlib
function.

One thing that needed some extra attention was that when vectorizing
calls several passes did not support that several arguments could
be overloaded in the intrinsics. This patch allows overload of a
scalar operand by adding hasVectorInstrinsicOverloadedScalarOpd, with
an entry for powi.

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

3 years ago[clangd] Fix feature modules to drop diagnostics
Kadir Cetinkaya [Mon, 31 May 2021 06:24:06 +0000 (08:24 +0200)]
[clangd] Fix feature modules to drop diagnostics

Ignored diagnostics were only checked after level adjusters and assumed
it would stay the same for the rest. But it can also be modified by
FeatureModules.

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

3 years ago[clangd] Use command line adjusters for inserting compile flags
Kadir Cetinkaya [Fri, 19 Mar 2021 09:01:14 +0000 (10:01 +0100)]
[clangd] Use command line adjusters for inserting compile flags

This fixes issues with `--` in the compile flags.

Fixes https://github.com/clangd/clangd/issues/632.

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

3 years agoAvoid unnecessary AArch64 DSB in __clear_cache in some situations.
Kristof Beyls [Tue, 15 Jun 2021 12:37:08 +0000 (13:37 +0100)]
Avoid unnecessary AArch64 DSB in __clear_cache in some situations.

The dsb after instruction cache invalidation only needs to be executed
if any instruction cache invalidation did happen.
Without this change, if the CTR_EL0.DIC bit indicates that instruction
cache invalidation is not needed, __clear_cache would execute two dsb
instructions in a row; with the second one being unnecessary.

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

3 years ago[mlir] Move `memref.dim` canonicalization using `InferShapedTypeOpInterface` to a...
MaheshRavishankar [Thu, 17 Jun 2021 05:12:16 +0000 (22:12 -0700)]
[mlir] Move `memref.dim` canonicalization using `InferShapedTypeOpInterface` to a separate pass.

Based on dicussion in
[this](https://llvm.discourse.group/t/remove-canonicalizer-for-memref-dim-via-shapedtypeopinterface/3641)
thread the pattern to resolve the `memref.dim` of a value that is a
result of an operation that implements the
`InferShapedTypeOpInterface` is moved to a separate pass instead of
running it as a canonicalization pass. This allows shape resolution to
happen when explicitly required, instead of automatically through a
canonicalization.

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

3 years ago[ORC] Switch from uint8_t to char buffers for TargetProcessControl::runWrapper.
Lang Hames [Wed, 16 Jun 2021 11:58:26 +0000 (21:58 +1000)]
[ORC] Switch from uint8_t to char buffers for TargetProcessControl::runWrapper.

This matches WrapperFunctionResult's char buffer, cutting down on the number of
pointer casts needed.

3 years agoImprove error reporting on pass registration collision (NFC)
Mehdi Amini [Thu, 17 Jun 2021 01:28:17 +0000 (01:28 +0000)]
Improve error reporting on pass registration collision (NFC)

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

3 years ago[lld][MachO] Sort symbols in parallel in -map
Xuanda Yang [Thu, 17 Jun 2021 02:13:15 +0000 (10:13 +0800)]
[lld][MachO] Sort symbols in parallel in -map

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

When writing a map file, sort symbols in parallel using parallelSort.
Use address name to break ties if two symbols have the same address.

Reviewed By: thakis, int3

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

3 years ago[mlir] Fixed dynamic operand storage on big-endian machines.
Haruki Imai [Thu, 17 Jun 2021 01:37:32 +0000 (18:37 -0700)]
[mlir] Fixed dynamic operand storage on big-endian machines.

Many tests fails by D101969 (https://reviews.llvm.org/D101969)
on big-endian machines. This patch changes bit order of
TrailingOperandStorage in big-endian machines. This patch
works on System Z (Triple = "s390x-ibm-linux", CPU = "z14").

Signed-off-by: Haruki Imai <imaihal@jp.ibm.com>
Reviewed By: rriddle

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

3 years agoRemove obsolete call to AsyncSignalSafeLazyInitiFakeStack.
Kevin Athey [Wed, 16 Jun 2021 05:54:04 +0000 (22:54 -0700)]
Remove obsolete call to AsyncSignalSafeLazyInitiFakeStack.

Code was originally added for Myriad D46626 which was removed
with D104279.

related to: https://github.com/google/sanitizers/issues/1394

Reviewed By: vitalybuka, morehouse

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

3 years ago[mlir-vscode] Add a link to mlir.llvm.org at the top of the vscode extension doc
River Riddle [Thu, 17 Jun 2021 01:21:47 +0000 (18:21 -0700)]
[mlir-vscode] Add a link to mlir.llvm.org at the top of the vscode extension doc

3 years ago[mlir-lsp-server] Add an explicit blurb on where to send code contributions.
River Riddle [Thu, 17 Jun 2021 01:21:39 +0000 (18:21 -0700)]
[mlir-lsp-server] Add an explicit blurb on where to send code contributions.

When the vscode extension is published, it may be unclear how to contribute improvements to the extension. This revision makes it clear that contributions should follow the traditional LLVM guidelines.

3 years agoRelax language comparison when matching up C++ forward decls with definitions
Adrian Prantl [Thu, 17 Jun 2021 01:17:58 +0000 (18:17 -0700)]
Relax language comparison when matching up C++ forward decls with definitions

when dealing with -gmodules debug info.

This fixes the bot failures on Darwin.

A recent clang change (presumably https://reviews.llvm.org/D104291)
introduced a bug where .pcm files would identify themselves as
DW_LANG_C_plus_plus, but the .o that references them would identify as
DW_LANG_C_plus_plus_14. While that bug needs to be fixed, too, it
shows that the current strict comparison also isn't meaningful.

rdar://79423225

3 years ago[flang] Complain about more cases of calls to insufficiently defined procedures
peter klausler [Tue, 15 Jun 2021 22:17:16 +0000 (15:17 -0700)]
[flang] Complain about more cases of calls to insufficiently defined procedures

When a function is called in a specification expression, it must be
sufficiently defined, and cannot be a recursive call (10.1.11(5)).
The best fix for this is to change the contract for the procedure
characterization infrastructure to catch and report such errors,
and to guarantee that it does emit errors on failed characterizations.
Some call sites were adjusted to avoid cascades.

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

3 years ago[mlir-lsp-server][Docs] Tweak the documentation for the visual studio code extension
River Riddle [Thu, 17 Jun 2021 00:58:24 +0000 (17:58 -0700)]
[mlir-lsp-server][Docs] Tweak the documentation for the visual studio code extension

This revision updates the feature set, and cleans up the contributing section a little.

3 years agoImprove error message on pass registration failures to include the faulty pass name
Mehdi Amini [Thu, 17 Jun 2021 00:22:35 +0000 (00:22 +0000)]
Improve error message on pass registration failures to include the faulty pass name