platform/upstream/llvm.git
4 years agoFix PS4 build of compiler-rt runtime.
Douglas Yung [Thu, 14 May 2020 02:11:16 +0000 (02:11 +0000)]
Fix PS4 build of compiler-rt runtime.

In a previous change I added a shim for fork(), but when compiled from InstrProfiling.c, the
required header file was not included, so pid_t was undefined. This change adds that include.

4 years agoPropagate MIFlags in table gen
Michael Berg [Thu, 14 May 2020 01:19:38 +0000 (18:19 -0700)]
Propagate MIFlags in table gen

Summary: Add flag propagation to tablegen via OutMIs from originating MI in InstructionSelector::executeMatchTable.

Reviewers: dsanders, volkan

Reviewed By: dsanders

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[CodeGen][NFC] Fix test/CodeGen/pr45476.cpp to specify target triple.
Huihui Zhang [Thu, 14 May 2020 00:55:08 +0000 (17:55 -0700)]
[CodeGen][NFC] Fix test/CodeGen/pr45476.cpp to specify target triple.

Summary:
Use explicit target triple to match more accurately the output for libcall
or native atomic.

Similar to D74847, without explicit target triple, this test will fail for ARM.

This patch update test pr45476.cpp to check for both native atomic and libcall.

Reviewers: efriedma, ekatz, rjmccall, rsmith, luismarques

Reviewed By: efriedma

Subscribers: kristof.beyls, jfb, cfe-commits, llvm-commits

Tags: #llvm, #clang

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

4 years ago[X86] Return true from trySADReplacement in the partial reduction pass when a change...
Craig Topper [Thu, 14 May 2020 00:51:45 +0000 (17:51 -0700)]
[X86] Return true from trySADReplacement in the partial reduction pass when a change is made.

Otherwise we don't signal to the pass manager that we changed IR.

4 years ago[cmake] fix typo.
Stephen Neuendorffer [Thu, 14 May 2020 00:42:46 +0000 (17:42 -0700)]
[cmake] fix typo.

4 years ago[cmake] Need PUBLIC dependencies for object targets even if LLVM_PTHREAD_LIB is unset
Stephen Neuendorffer [Thu, 14 May 2020 00:17:54 +0000 (17:17 -0700)]
[cmake] Need PUBLIC dependencies for object targets even if LLVM_PTHREAD_LIB is unset

Fix logic in previous patch.

4 years ago[SVE] Remove usages of VectorType::getNumElements() from Hexagon
Christopher Tetreault [Wed, 13 May 2020 23:00:20 +0000 (16:00 -0700)]
[SVE] Remove usages of VectorType::getNumElements() from Hexagon

Reviewers: efriedma, kmclaughlin, sdesmalen, kparzysz

Reviewed By: kparzysz

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[AARch64] Add Marvell ThunderX3T110 support
Wei Zhao [Wed, 13 May 2020 23:38:42 +0000 (16:38 -0700)]
[AARch64] Add Marvell ThunderX3T110 support

This is the first checkin to support Marvell ThunderX3T110.

Initial definition of the micro-ops of the instructions in ThunderX3T110
is included.

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

4 years ago[cmake] Check for empty LLVM_PTHREAD_LIB
Stephen Neuendorffer [Wed, 13 May 2020 23:40:51 +0000 (16:40 -0700)]
[cmake] Check for empty LLVM_PTHREAD_LIB

Windows builds broke because LLVM_THREAD_LIB is not set.

4 years ago[Attributor] Improve the alignment of the loads
Omar Ahmed [Wed, 13 May 2020 21:48:49 +0000 (16:48 -0500)]
[Attributor] Improve the alignment of the loads

This patch introduces an improvement in the Alignment of the loads
generated in createReplacementValues() by querying AAAlign attribute for
the best Alignment for the base.

Reviewed By: jdoerfert

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

4 years ago[Attributor] Check lines accidentally not committed with D76208
Johannes Doerfert [Wed, 13 May 2020 22:43:01 +0000 (17:43 -0500)]
[Attributor] Check lines accidentally not committed with D76208

4 years agoAdd .debug_ranges support to the DWARF YAML.
Greg Clayton [Fri, 24 Apr 2020 02:25:12 +0000 (19:25 -0700)]
Add .debug_ranges support to the DWARF YAML.

Summary: This allows DIEs with DW_AT_ranges to be encoded and decoded _and_ actually have their address ranges be included instead of having DW_AT_ranges with a section offset value for a section that doesn't exist.

Reviewers: labath, aprantl, JDevlieghere, dblaikie, probinson

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[SVE] Remove usages of VectorType::getNumElements() from AMDGPU
Christopher Tetreault [Wed, 13 May 2020 22:19:07 +0000 (15:19 -0700)]
[SVE] Remove usages of VectorType::getNumElements() from AMDGPU

Reviewers: efriedma, arsenm, david-arm, fpetrogalli

Reviewed By: efriedma

Subscribers: dmgreen, arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, tschuett, hiraditya, rkruppe, psnobl, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[AArch64] Don't promote constants with float ConstantExpr.
Florian Hahn [Wed, 13 May 2020 22:31:47 +0000 (23:31 +0100)]
[AArch64] Don't promote constants with float ConstantExpr.

Currently the AsmPrinter cannot emit some floating point constant
expressions in global initializers. Avoid generating them.

Reviewers: dmgreen, t.p.northover, arsenm, efriedma, Gerolf

Reviewed By: efriedma

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

4 years agoRemove an unused variable.
Eric Christopher [Wed, 13 May 2020 22:12:34 +0000 (15:12 -0700)]
Remove an unused variable.

4 years ago[AArch64][SVE] Add patterns for VSELECT of immediate merged with a variable.
Eli Friedman [Tue, 12 May 2020 20:08:28 +0000 (13:08 -0700)]
[AArch64][SVE] Add patterns for VSELECT of immediate merged with a variable.

This covers forms involving "CPY (immediate, merging)".

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

4 years ago[HIP] Do not emit debug info for stub function
Yaxun (Sam) Liu [Wed, 13 May 2020 13:02:30 +0000 (09:02 -0400)]
[HIP] Do not emit debug info for stub function

The stub function is generated by compiler and its instructions have nothing
to do with the kernel source code.

Currently clang generates debug info for the stub function, which causes
confusion for the HIP debugger. For example, when users set break point
on a line of a kernel, the debugger should break on that line when the kernel is
executed and reaches that line, but instead the debugger breaks in the stub function.

This patch disables debug info for stub function for HIP.

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

4 years ago[AMDGPU] Optimized indirect multi-VGPR addressing
Stanislav Mekhanoshin [Wed, 13 May 2020 18:46:28 +0000 (11:46 -0700)]
[AMDGPU] Optimized indirect multi-VGPR addressing

SelectMOVRELOffset prevents peeling of a constant from an index
if final base could be negative. isBaseWithConstantOffset() succeeds
if a value is an "add" or "or" operator. In case of "or" it shall
be an add-like "or" which never changes a sign of the sum given a
non-negative offset. I.e. we can safely allow peeling if operator is
an "or".

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

4 years ago[mlir] Change generate-test-checks.py to `%[[V:.*]]` style
Sean Silva [Wed, 13 May 2020 03:15:09 +0000 (20:15 -0700)]
[mlir] Change generate-test-checks.py to `%[[V:.*]]` style

Summary:
This style seems to be the preferred style lately as it plays better
with op syntaxes that include `[` and `]`.

Input:
```
module {
  func @f(%arg0 : i32) -> i32 {
    %0 = addi %arg0, %arg0 : i32
    %1 = muli %arg0, %0 : i32
    return %1 : i32
  }
}
```

New output:

```
// NOTE: Assertions have been autogenerated by utils/generate-test-checks.py
// CHECK:       module {

// CHECK-LABEL:   func @f(
// CHECK-SAME:            %[[VAL_0:.*]] : i32) -> i32 {
// CHECK:           %[[VAL_1:.*]] = addi %[[VAL_0]], %[[VAL_0]] : i32
// CHECK:           %[[VAL_2:.*]] = muli %[[VAL_0]], %[[VAL_1]] : i32
// CHECK:           return %[[VAL_2]] : i32
// CHECK:         }
// CHECK:       }
```

Old output:
```
// NOTE: Assertions have been autogenerated by utils/generate-test-checks.py
// CHECK:       module {

// CHECK-LABEL:   func @f(
// CHECK-SAME:            [[VAL_0:%.*]] : i32) -> i32 {
// CHECK:           [[VAL_1:%.*]] = addi [[VAL_0]], [[VAL_0]] : i32
// CHECK:           [[VAL_2:%.*]] = muli [[VAL_0]], [[VAL_1]] : i32
// CHECK:           return [[VAL_2]] : i32
// CHECK:         }
// CHECK:       }
```

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

4 years ago[Attributor] Use AAValueConstantRange to infer dereferencability.
Kuter Dinel [Wed, 13 May 2020 17:49:15 +0000 (12:49 -0500)]
[Attributor] Use AAValueConstantRange to infer dereferencability.

Reviewed By: jdoerfert

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

4 years agoRemove unused Debugging variable.
Eric Christopher [Wed, 13 May 2020 21:36:53 +0000 (14:36 -0700)]
Remove unused Debugging variable.

4 years ago[PDB] Switch from LLVM_PACKED to LLVM_PACKED_START/END
Reid Kleckner [Wed, 13 May 2020 21:24:11 +0000 (14:24 -0700)]
[PDB] Switch from LLVM_PACKED to LLVM_PACKED_START/END

Reportedly using the pragma instead of the __attribute__ silences
warnings with some GCC versions.

4 years agoFix template class debug info for Visual Studio visualizers
Adrian McCarthy [Fri, 1 May 2020 22:51:02 +0000 (15:51 -0700)]
Fix template class debug info for Visual Studio visualizers

An earlier change eliminated spaces between the close brackets of nested
template lists.  Unfortunately that prevents the Windows debuggers from
matching some types to their corresponding visualizers (e.g., std::map).

This selects the SeparateTemplateClosers flag when generating CodeView.
Note that we were already making formatting adjustments under similar
circumstances for similar reasons.

This wasn't caught by existing tests because they were using only
-std=c++98.

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

4 years ago[X86] Add test case for a regression from D76649. NFC
Craig Topper [Wed, 13 May 2020 21:13:25 +0000 (14:13 -0700)]
[X86] Add test case for a regression from D76649. NFC

When combineLoopMAdd was moved to IR we got stricter about
ensuring the truncate was free. This prevents us from matching
this sum of squares of byte differences pattern show here.

We used to get this case when it was in SelectionDAG.

4 years ago[cmake] Update creation of object library dependencies for LINK_LIBS PUBLIC (v2)
Stephen Neuendorffer [Wed, 13 May 2020 21:06:55 +0000 (14:06 -0700)]
[cmake] Update creation of object library dependencies for LINK_LIBS PUBLIC (v2)

REGEX matching doesn't work here because the problematic library can
sometimes be "-lpthread" and sometimes "pthread".  Let's do the
simplest thing possible and just string compare.

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

4 years ago[llvm][NFC] Remove unused fields in InlineAdvisor
Mircea Trofin [Wed, 13 May 2020 21:08:55 +0000 (14:08 -0700)]
[llvm][NFC] Remove unused fields in InlineAdvisor

4 years ago[X86] Fix one of the PMADDWD tests to not have dead code.
Craig Topper [Wed, 13 May 2020 20:30:34 +0000 (13:30 -0700)]
[X86] Fix one of the PMADDWD tests to not have dead code.

There are two reductions in this test. It looks like I intended
to combine them by packing one of them into the upper 32 bits of
the result. But the OR instruction was missing.

4 years agoEnsure that CMake tries to find Python3 before processing
Christopher Tetreault [Wed, 13 May 2020 20:31:43 +0000 (13:31 -0700)]
Ensure that CMake tries to find Python3 before processing

Summary:
It is possible that CMake tries to process debuginfo-tests before any
attempt to find Python3. Ensure that CMake attempts to find it before
complaining that it doesn't exist.

Reviewers: zturner, rnk, jmorse, chandlerc

Reviewed By: rnk

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

4 years ago[docs] Add link to zorg github project
Mircea Trofin [Wed, 13 May 2020 17:41:00 +0000 (10:41 -0700)]
[docs] Add link to zorg github project

Reviewers: gkistanova

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[llvm] Add interface to drive inlining decision using ML model
Mircea Trofin [Tue, 28 Apr 2020 20:25:15 +0000 (13:25 -0700)]
[llvm] Add interface to drive inlining decision using ML model

Summary:

This change introduces InliningAdvisor (and related APIs), the interface
that abstracts decision making away from the inlining pass. We will use
this interface to delegate decision making to a trained ML model,
subsequently (see referenced RFC).

RFC: http://lists.llvm.org/pipermail/llvm-dev/2020-April/140763.html

Reviewers: davidxl, eraman, dblaikie

Subscribers: mgorny, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[X86] Only allow f32, f64, or f80 to be used with 'f' inline assembly constraint.
Craig Topper [Wed, 13 May 2020 19:51:18 +0000 (12:51 -0700)]
[X86] Only allow f32, f64, or f80 to be used with 'f' inline assembly constraint.

Avoids crash when using i128. Gives better error than
'scalar-to-vector conversion failed' for other types.

4 years ago[libc++] Explicitly list Lit features from the config_site header
Louis Dionne [Wed, 13 May 2020 20:15:34 +0000 (16:15 -0400)]
[libc++] Explicitly list Lit features from the config_site header

When grepping for unused features in the test suite, we will now find
those features and where they are defined, as opposed to thinking they
are dead features.

4 years ago[SelectionDAG] Require constant index for INSERT/EXTRACT_SUBVECTOR.
Eli Friedman [Tue, 12 May 2020 22:09:10 +0000 (15:09 -0700)]
[SelectionDAG] Require constant index for INSERT/EXTRACT_SUBVECTOR.

It sounds like an interesting idea in theory, but nothing is actually
taking advantage of it, and specifying/implementing the edge cases is
painful. So just forbid it.

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

4 years ago[NewPassManager] Add assertions when getting statefull cached analysis.
Alina Sbirlea [Tue, 14 Jan 2020 18:27:20 +0000 (10:27 -0800)]
[NewPassManager] Add assertions when getting statefull cached analysis.

Summary:
Analyses that are statefull should not be retrieved through a proxy from
an outer IR unit, as these analyses are only invalidated at the end of
the inner IR unit manager.
This patch disallows getting the outer manager and provides an API to
get a cached analysis through the proxy. If the analysis is not
stateless, the call to getCachedResult will assert.

Reviewers: chandlerc

Subscribers: mehdi_amini, eraman, hiraditya, zzheng, llvm-commits

Tags: #llvm

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

4 years ago[SimpleLoopUnswitch] Add non-empty unreachable block check to exit cases removed.
Alina Sbirlea [Thu, 16 Apr 2020 07:08:53 +0000 (00:08 -0700)]
[SimpleLoopUnswitch] Add non-empty unreachable block check to exit cases removed.

Summary:
Update check to include the check for unreachable.

Basic blocks ending in unreachable are special cased, as these blocks may be already unswitched. Before this patch this check is only done for the default destination.
The condition for the exit cases and the default case must be the same, because we should never leave edges from the switch instruction to a basic block that we are unswitching. In PR45355 we still have a remaining edge (that we're attempting to remove from the DT) because its the default edge to an unreachable-terminated block where we unswitch a case edge to that block.

Resolves PR45355.

Reviewers: chandlerc

Subscribers: hiraditya, uabelho, llvm-commits

Tags: #llvm

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

4 years agoAMDGPU: Use Register
Matt Arsenault [Wed, 13 May 2020 17:00:58 +0000 (13:00 -0400)]
AMDGPU: Use Register

4 years ago[X86] Don't allow f80 to be used with the 'q', 'r', 'l', 'Q' or 'q' inline assembly...
Craig Topper [Wed, 13 May 2020 03:59:43 +0000 (20:59 -0700)]
[X86] Don't allow f80 to be used with the 'q', 'r', 'l', 'Q' or 'q' inline assembly constraints.

It was previously trying to use the 64-bit class, but 80 isn't
evenly divisible by 64 so it will trigger a crash.

4 years ago[X86] Make the if statement structure for inline assembly constraints 'l', 'r', ...
Craig Topper [Wed, 13 May 2020 03:54:13 +0000 (20:54 -0700)]
[X86] Make the if statement structure for inline assembly constraints 'l', 'r', 'q', 'Q', and 'R' the same.

These did similar things but had slight differences. For example
'Q' didn't allow f64, but the others did.

4 years agoAdd shim for fork() on PS4 as it is not supported there.
Douglas Yung [Wed, 13 May 2020 18:47:01 +0000 (18:47 +0000)]
Add shim for fork() on PS4 as it is not supported there.

Reviewers: probinson

Subscribers: #sanitizers llvm-commits

Tags: #sanitizers

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

4 years agoFixed a problem removing temp files
Pete Steinfeld [Tue, 12 May 2020 20:10:32 +0000 (13:10 -0700)]
Fixed a problem removing temp files

Summary:
Before making this change, whenever I ran "check-flang", I'd get an
error message like:

llvm-lit: /mnt/c/GitHub/f18/c751/flang/build/bin/../../../llvm/utils/lit/lit/main.py:252: warning: Failed to delete temp directory '/tmp/lit_tmp_gOKUIh'

With this change, there's no such message in the output, and the temp
directory is successfully removed.

Note that my working environment is on Windows 10 running Windows
Subsystem for Linux using the Ubuntu app.  I'm running Python version
2.7.1.

Earlier versions of Python do not contain `shutil`.  It may be that this
module was available on Windows systems later than other platforms.
Upgrading my version of Python made the problem go away

I don't believe that timing was a problem since inserting a long delay
didn't fix things.

So I added some text to the error message recommending that the user
upgrade their version of Python if they run into this problem.

Reviewers: yln, DavidTruby

Subscribers: delcypher, llvm-commits

Tags: #llvm

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

4 years ago[demangler] Fix demangling of enumerators with negative values
Erik Pilkington [Wed, 13 May 2020 18:13:37 +0000 (14:13 -0400)]
[demangler] Fix demangling of enumerators with negative values

rdar://27527445

4 years ago[SROA] Clean up some uses of MaybeAlign in SROA.
Eli Friedman [Thu, 30 Apr 2020 20:43:58 +0000 (13:43 -0700)]
[SROA] Clean up some uses of MaybeAlign in SROA.

Use Align instead of using MaybeAlign; all the operations in question
have known alignment.

For getSliceAlign() in particular, in the cases where we used to return
None, it would be converted back to an Align by IRBuilder, so there's no
functional change there.

Split off from D77454.

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

4 years ago[analyzer][StreamChecker] Don't make StreamTestChecker depend on StreamChecker for...
Kirstóf Umann [Tue, 14 Apr 2020 14:53:09 +0000 (16:53 +0200)]
[analyzer][StreamChecker] Don't make StreamTestChecker depend on StreamChecker for the time being

The comment in Checkers.td explains whats going on. As StreamChecker grows,
expect a need to have smaller checkers out of it, but let that be a worry for
later.

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

4 years ago[Statepoint] Mark FixupStatepointCallerSaved as preserving the CFG
Craig Topper [Wed, 13 May 2020 17:29:04 +0000 (10:29 -0700)]
[Statepoint] Mark FixupStatepointCallerSaved as preserving the CFG

I'm hoping this will restore some compile time lost by D75936 and D75937.

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

4 years ago[Clang] Restore replace_path_prefix instead of startswith
Sylvain Audi [Wed, 29 Apr 2020 16:50:37 +0000 (12:50 -0400)]
[Clang] Restore replace_path_prefix instead of startswith

In D49466, sys::path::replace_path_prefix was used instead startswith for -f[macro/debug/file]-prefix-map options.
However those were reverted later (commit rG3bb24bf25767ef5bbcef958b484e7a06d8689204) due to broken Windows tests.

This patch restores those replace_path_prefix calls.
It also modifies the prefix matching to be case-insensitive under Windows.

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

4 years ago[InstCombine] Add vector tests for the or(shl(zext(x),32)|zext(y)) concat combines
Simon Pilgrim [Wed, 13 May 2020 13:31:18 +0000 (14:31 +0100)]
[InstCombine] Add vector tests for the or(shl(zext(x),32)|zext(y)) concat combines

4 years ago[mlir][vulkan-runner] Avoid dependency on LLVM libraries
Lei Zhang [Fri, 8 May 2020 21:06:03 +0000 (17:06 -0400)]
[mlir][vulkan-runner] Avoid dependency on LLVM libraries

The Vulkan runtime wrapper will be compiled to a shared library
that are loaded by the JIT runner. Depending on LLVM libraries
means that LLVM symbols will be compiled into the shared library.
That can cause problems if we are using it with other shared
libraries depending on LLVM, notably Mesa, the open-source graphics
driver framework. The Vulkan API wrappers invoked by the JIT runner
links to the system libvulkan.so. If it's Mesa providing the
implementation, Mesa will normally try to load the system libLLVM.so
for its shader compilation. That causes issues because the JIT runner
already loaded the Vulkan runtime wrapper which has LLVM sybmols
compiled in. So system linker will instruct Mesa to use those symbols
instead.

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

4 years ago[MLIR] Discourage people from copying the toy examples
Stephen Neuendorffer [Wed, 13 May 2020 15:57:25 +0000 (08:57 -0700)]
[MLIR] Discourage people from copying the toy examples

The CMake structure of the toy example is non-standard.  encourage people to
copy the standalone example instead.

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

4 years ago[MLIR] refactor cmake specification of tablegen'd interfaces.
Stephen Neuendorffer [Wed, 13 May 2020 06:37:23 +0000 (23:37 -0700)]
[MLIR] refactor cmake specification of tablegen'd interfaces.

Introduce add_mlir_interface to avoid lots of boilerplate

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

4 years ago[clang-format] : Fix additional pointer alignment for overloaded operators
mydeveloperday [Wed, 13 May 2020 17:33:57 +0000 (18:33 +0100)]
[clang-format] : Fix additional pointer alignment for overloaded operators

Summary:
Follow on from {D78879} to handle the more obscure to prevent spaces between operators

```
operator void *&();
operator void *&&();
operator void &*();
operator void &&*();
```

Reviewers: sylvestre.ledru, sammccall, krasimir, Abpostelnicu

Reviewed By: sammccall, Abpostelnicu

Subscribers: cfe-commits

Tags: #clang, #clang-format

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

4 years ago[clang-format] Fix AlignConsecutive on PP blocks
mydeveloperday [Wed, 13 May 2020 17:27:16 +0000 (18:27 +0100)]
[clang-format] Fix AlignConsecutive on PP blocks

Summary:
Currently the 'AlignConsecutive*' options incorrectly align across
elif and else statements, even if they are very far away and across
unrelated preprocessor macros.

This failed since on preprocessor run 2+, there is not enough context
about the #ifdefs to actually differentiate one block from another,
causing them to align across different blocks or even large sections of
the file.

Eg, with AlignConsecutiveAssignments:

```
\#if FOO      // Run 1
\#else        // Run 1
int a   = 1;  // Run 2, wrong
\#endif       // Run 1

\#if FOO      // Run 1
\#else        // Run 1
int bar = 1;  // Run 2
\#endif       // Run 1
```

is read as

```
int a   = 1;  // Run 2, wrong
int bar = 1;  // Run 2
```

The approach taken to fix this was to add a new flag to Token that
forces breaking alignment across groups of lines (MustBreakAlignBefore)
in a similar manner to the existing flag that forces a line break
(MustBreakBefore). This flag is set for the first Token after a
preprocessor statement or diff conflict marker.

Fixes #25167,#31281

Patch By: JakeMerdichAMD

Reviewed By: MyDeveloperDay

Tags: #clang, #clang-format

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

4 years agoNFC: Avoid redundant checks for vector-function-abi-variant attribute
Anna Thomas [Wed, 13 May 2020 15:45:39 +0000 (11:45 -0400)]
NFC: Avoid redundant checks for vector-function-abi-variant attribute

Updated the comments on the code as well to reflect what the
preconditions on VFABI::getVectorVariantNames are.

4 years ago[lld][WebAssembly] Fix for --relocatable and signature mismatches
Sam Clegg [Tue, 12 May 2020 00:39:04 +0000 (17:39 -0700)]
[lld][WebAssembly] Fix for --relocatable and signature mismatches

This is a followup to https://reviews.llvm.org/D78779.

When signatures mismatch we create set of variant symbols.  Some of
the fields in these symbols were not be initialized correct.
Specifically we were seeing isUsedInRegularObj not being set correctly,
leading to the symbol not getting included in the symbol table
and a crash writing relections in --reloctable mode.

There is larger refactor due here, but this is a minimal change the
fixes the bug at hand.

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

4 years agoOpenMPOpt Remarks Support
Huber, Joseph [Wed, 13 May 2020 17:19:02 +0000 (12:19 -0500)]
OpenMPOpt Remarks Support

Reviewed By: jdoerfert

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

4 years ago[mlir] Change dialect namespace loop->scf
Alex Zinenko [Wed, 13 May 2020 10:12:30 +0000 (12:12 +0200)]
[mlir] Change dialect namespace loop->scf

All ops of the SCF dialect now use the `scf.` prefix instead of `loop.`. This
is a part of dialect renaming.

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

4 years ago[mlir][Linalg] Fix missing template keyword.
MaheshRavishankar [Wed, 13 May 2020 16:53:28 +0000 (09:53 -0700)]
[mlir][Linalg] Fix missing template keyword.

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

4 years ago[libc] Call mtx_init in mtx_test.
Siva Chandra Reddy [Tue, 12 May 2020 23:31:17 +0000 (16:31 -0700)]
[libc] Call mtx_init in mtx_test.

A typo which was caught has also been fixed.

Reviewers: abrachet

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

4 years ago[NativeSession] Implement NativeSession::findSymbolByAddress.
Amy Huang [Mon, 16 Mar 2020 16:53:49 +0000 (09:53 -0700)]
[NativeSession] Implement NativeSession::findSymbolByAddress.

Summary: This implements searching for function symbols and public symbols by address.

More specifically,
-Implements NativeSession::findSymbolByAddress for function symbols and
public symbols. I think data symbols are also searched for, but isn't
implemented in this patch.
-Adds classes for NativeFunctionSymbol and NativePublicSymbol
-Adds a '-use-native-pdb-reader' option to llvm-symbolizer, for testing
purposes.

Reviewers: rnk, amccarth, labath

Subscribers: mgorny, hiraditya, MaskRay, rupprecht, llvm-commits

Tags: #llvm

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

4 years ago[CodeGenPrepare] Remove a superflouos variable. NFC.
Benjamin Kramer [Wed, 13 May 2020 16:25:20 +0000 (18:25 +0200)]
[CodeGenPrepare] Remove a superflouos variable. NFC.

Fixes a -Wunused-variable warning in Release builds.

4 years ago[lldb/Reproducers] Add test-specific API to set the test CWD
Jonas Devlieghere [Wed, 13 May 2020 15:54:57 +0000 (08:54 -0700)]
[lldb/Reproducers] Add test-specific API to set the test CWD

The reproducers' working directory is set to the current working
directory when they are initialized. While this is not optimal, as the
cwd can change during a debug session, it has been sufficient so far.

The current approach doesn't work for the API test suite however because
dotest temporarily changes the directory to where the test's Python file
lives.

This patch adds an API to tell the reproducers what to set the CWD to.
This is a NO-OP in every mode but capture.

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

4 years agoAdd -print-targets to print the registered targets
Yaxun (Sam) Liu [Thu, 30 Apr 2020 21:41:54 +0000 (17:41 -0400)]
Add -print-targets to print the registered targets

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

4 years ago[FileCheck] Support comment directives
Joel E. Denny [Mon, 4 May 2020 22:05:55 +0000 (18:05 -0400)]
[FileCheck] Support comment directives

Sometimes you want to disable a FileCheck directive without removing
it entirely, or you want to write comments that mention a directive by
name.  The `COM:` directive makes it easy to do this.  For example,
you might have:

```
; X32: pinsrd_1:
; X32:    pinsrd $1, 4(%esp), %xmm0

; COM: FIXME: X64 isn't working correctly yet for this part of codegen, but
; COM: X64 will have something similar to X32:
; COM:
; COM:   X64: pinsrd_1:
; COM:   X64:    pinsrd $1, %edi, %xmm0
```

Without this patch, you need to use some combination of rewording and
directive syntax mangling to prevent FileCheck from recognizing the
commented occurrences of `X32:` and `X64:` above as directives.
Moreover, FileCheck diagnostics have been proposed that might complain
about the occurrences of `X64` that don't have the trailing `:`
because they look like directive typos:

  <http://lists.llvm.org/pipermail/llvm-dev/2020-April/140610.html>

I think dodging all these problems can prove tedious for test authors,
and directive syntax mangling already makes the purpose of existing
test code unclear.  `COM:` can avoid all these problems.

This patch also updates the small set of existing tests that define
`COM` as a check prefix:

- clang/test/CodeGen/default-address-space.c
- clang/test/CodeGenOpenCL/addr-space-struct-arg.cl
- clang/test/Driver/hip-device-libs.hip
- llvm/test/Assembler/drop-debug-info-nonzero-alloca.ll

I think lit should support `COM:` as well.  Perhaps `clang -verify`
should too.

Reviewed By: jhenderson, thopre

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

4 years agoRevert "[BrachProbablityInfo] Set edge probabilities at once. NFC."
Reid Kleckner [Wed, 13 May 2020 15:23:09 +0000 (08:23 -0700)]
Revert "[BrachProbablityInfo] Set edge probabilities at once. NFC."

This reverts commit eef95f2746c3347b8dad19091ffb82a88d73acd3.

The new assertion about branch propability sums does not hold.

4 years ago[lldb][NFC] Early-exit in SetupDeclVendor
Raphael Isemann [Wed, 13 May 2020 13:56:51 +0000 (15:56 +0200)]
[lldb][NFC] Early-exit in SetupDeclVendor

Also removed the unnecessary element-by-element copy of the std::vector
hand_imported_modules to modules_for_macros.

4 years agoMake FormatToken::Type private.
Manuel Klimek [Tue, 27 Aug 2019 14:11:25 +0000 (16:11 +0200)]
Make FormatToken::Type private.

This enables us to intercept changes to the token type via setType(), which
is a precondition for being able to use multi-pass formatting for macro
arguments.

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

4 years agoPerform ActOnConversionDeclarator after looking for any virtual functions it overrides
Ronald Wampler [Sun, 19 Apr 2020 02:23:21 +0000 (22:23 -0400)]
Perform ActOnConversionDeclarator after looking for any virtual functions it overrides

Summary: This allows for suppressing warnings about the conversion function never being called if it overrides a virtual function in a base class.

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

4 years ago[DebugInfo] Fix test Fortran-DIModule.ll after 678bd84c4
Russell Gallop [Wed, 13 May 2020 14:23:37 +0000 (15:23 +0100)]
[DebugInfo] Fix test Fortran-DIModule.ll after 678bd84c4

Was failing here:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/32320

4 years ago[ARM] Convert floating point splats to integer
David Green [Wed, 13 May 2020 13:35:32 +0000 (14:35 +0100)]
[ARM] Convert floating point splats to integer

Under MVE a vdup will always take a gpr register, not a floating point
value. During DAG combine we convert the types to a bitcast to an
integer in an attempt to fold the bitcast into other instructions. This
is OK, but only works inside the same basic block. To do the same trick
across a basic block boundary we need to convert the type in
codegenprepare, before the splat is sunk into the loop.

This adds a convertSplatType function to codegenprepare to do that,
putting bitcasts around the splat to force the type to an integer. There
is then some adjustment to the code in shouldSinkOperands to handle the
extra bitcasts.

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

4 years ago[mlir] [VectorOps] Add missing EDSC intrinsics.
Pierre Oechsel [Wed, 13 May 2020 14:09:39 +0000 (10:09 -0400)]
[mlir] [VectorOps] Add missing EDSC intrinsics.

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

4 years ago[mlir] Add SubViewOp::getOrCreateRanges and fix folding pattern
Nicolas Vasilache [Wed, 13 May 2020 02:21:36 +0000 (22:21 -0400)]
[mlir] Add SubViewOp::getOrCreateRanges and fix folding pattern

The existing implementation of SubViewOp::getRanges relies on all
offsets/sizes/strides to be dynamic values and does not work in
combination with canonicalization. This revision adds a
SubViewOp::getOrCreateRanges to create the missing constants in the
canonicalized case.

This allows reactivating the fused pass with staged pattern
applications.

However another issue surfaces that the SubViewOp verifier is now too
strict to allow folding. The existing folding pattern is turned into a
canonicalization pattern which rewrites memref_cast + subview into
subview + memref_cast.

The transform-patterns-matmul-to-vector can then be reactivated.

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

4 years ago[AMDGPU] Strengthen export cluster ordering
Carl Ritson [Wed, 13 May 2020 14:06:57 +0000 (23:06 +0900)]
[AMDGPU] Strengthen export cluster ordering

Summary:
When removing barrier edges on exports then dependencies need to
be propagated.

Reviewers: foad

Reviewed By: foad

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[ARM] Sink splats to fma intrinsics
David Green [Wed, 13 May 2020 09:08:16 +0000 (10:08 +0100)]
[ARM] Sink splats to fma intrinsics

Similar to fmul/fadd, we can sink a splat into a loop containing a fma
in order to use more register instruction variants. For that there are
also adjustments to the sinking code to handle more than 2 arguments.

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

4 years ago[lldb][NFC] Don't specify a default argument when creating a TextDiagnosticPrinter
Raphael Isemann [Wed, 13 May 2020 12:55:46 +0000 (14:55 +0200)]
[lldb][NFC] Don't specify a default argument when creating a TextDiagnosticPrinter

4 years ago[libcxx][span] Implement P1976R2
Michael Schellenberger Costa [Wed, 13 May 2020 13:50:06 +0000 (09:50 -0400)]
[libcxx][span] Implement P1976R2

This resolves the NB comment about the construction of a fixed-size span
from a dynamic range.

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

4 years ago[LSR][ARM] Add new TTI hook to mark some LSR chains as profitable
Pierre-vh [Tue, 5 May 2020 13:25:23 +0000 (14:25 +0100)]
[LSR][ARM] Add new TTI hook to mark some LSR chains as profitable

This patch adds a new TTI hook to allow targets to tell LSR that
a chain including some instruction is already profitable and
should not be optimized. This patch also adds an implementation
of this TTI hook for ARM so LSR doesn't optimize chains that include
the VCTP intrinsic.

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

4 years ago[MLIR] Nested regions test for Buffer Assginment
Ehsan Toosi [Mon, 4 May 2020 15:05:51 +0000 (17:05 +0200)]
[MLIR] Nested regions test for Buffer Assginment

Due to the extension of Liveness, Buffer Assignment can now work on nested regions. This PR provides a test case to show that existing functionally of BA works properly.

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

4 years agoClang crash targeting ARM or Thumb when assembling a prel31 relocation variant
Simon Wallis [Wed, 13 May 2020 09:40:14 +0000 (10:40 +0100)]
Clang crash targeting ARM or Thumb when assembling a prel31 relocation variant

Summary:
In the assembler or inline assembler,
attempting to use an invalid fixup type
gives a crash with a segmentation fault.

__attribute__((naked))
void foo(void) {
 __asm__("mov r9, :lower16:bar(prel31)");
}

This should give a proper error message when building for ARM or Thumb.
This brings it in line with AARCH64.

This fixes all 8 instances of llvm_unreachable("Unsupported Modifier");
in ARM/MCTargetDesc/ARMELFObjectWriter.cpp.
A test is provided for each instance.

Reviewers: llvm-commits, MarkMurrayARM

Reviewed By: MarkMurrayARM

Subscribers: kristof.beyls, hiraditya, danielkiss

Tags: #llvm

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

Change-Id: I6971ba37f129cc453568fe71514ccb2ac9d16831

4 years agoRecommit #2: "[LV] Induction Variable does not remain scalar under tail-folding."
Sjoerd Meijer [Tue, 12 May 2020 19:23:09 +0000 (20:23 +0100)]
Recommit #2: "[LV] Induction Variable does not remain scalar under tail-folding."

This was reverted because of a miscompilation. At closer inspection, the
problem was actually visible in a changed llvm regression test too. This
one-line follow up fix/recommit will splat the IV, which is what we are trying
to avoid if unnecessary in general, if tail-folding is requested even if all
users are scalar instructions after vectorisation. Because with tail-folding,
the splat IV will be used by the predicate of the masked loads/stores
instructions. The previous version omitted this, which caused the
miscompilation. The original commit message was:

If tail-folding of the scalar remainder loop is applied, the primary induction
variable is splat to a vector and used by the masked load/store vector
instructions, thus the IV does not remain scalar. Because we now mark
that the IV does not remain scalar for these cases, we don't emit the vector IV
if it is not used. Thus, the vectoriser produces less dead code.

Thanks to Ayal Zaks for the direction how to fix this.

4 years ago[StructurizeCFG] Fix region nodes ordering
Ehud Katz [Wed, 13 May 2020 12:33:36 +0000 (15:33 +0300)]
[StructurizeCFG] Fix region nodes ordering

This is a reimplementation of the `orderNodes` function, as the old
implementation didn't take into account all cases.

Fix PR41509

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

4 years ago[compiler-rt] [builtin] Switch the return type of __atomic_compare_exchange_##n to...
Kamil Rytarowski [Wed, 13 May 2020 12:08:39 +0000 (14:08 +0200)]
[compiler-rt] [builtin] Switch the return type of __atomic_compare_exchange_##n to bool

Summary:
Synchronize the function definition with the LLVM documentation.

https://llvm.org/docs/Atomics.html#libcalls-atomic

GCC also returns bool for the same atomic builtin.

Reviewers: theraven

Reviewed By: theraven

Subscribers: theraven, dberris, jfb, #sanitizers

Tags: #sanitizers

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

4 years ago[mlir] Adapted standard Alloc and Alloca ops to use new side-effect resources.
Marcel Koester [Fri, 8 May 2020 08:11:25 +0000 (10:11 +0200)]
[mlir] Adapted standard Alloc and Alloca ops to use new side-effect resources.

The current standard Alloca node is not annotated with the
MemEffect<Alloc> trait. This CL updates the Alloc and Alloca
memory-effect annotations using the latest Resource objects. Alloca
nodes will use a newly defined AutomaticAllocationScopeResource to
distinguish between Alloc and Alloca memory effects.

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

4 years ago[lldb] Merge PlatformXXX::ResolveExecutable
Pavel Labath [Wed, 13 May 2020 11:21:59 +0000 (13:21 +0200)]
[lldb] Merge PlatformXXX::ResolveExecutable

The near-identical implementations of this function for posix-y
platforms were merged in r293910. PlatformWindows was left out of this
merge because at the time we did not have a suitable base class to sink
the code into. That is no longer true, so this commit finishes the job
by moving the code into RemoteAwarePlatform::ResolveExecutable.

4 years ago[AMDGPU][MC][GFX9+] Enabled clamp for v_add_i32 and v_sub_i32
Dmitry Preobrazhensky [Wed, 13 May 2020 11:15:46 +0000 (14:15 +0300)]
[AMDGPU][MC][GFX9+] Enabled clamp for v_add_i32 and v_sub_i32

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

Reviewers: arsenm, rampitec

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

4 years agoRevert "[libc++] [LWG3321] Mark "year_month_day_last::day() specification does not...
Marek Kurdej [Wed, 13 May 2020 11:15:40 +0000 (13:15 +0200)]
Revert "[libc++] [LWG3321] Mark "year_month_day_last::day() specification does not cover !ok() values" issue as "Nothing to do", but add assertion."

This reverts commit e25a2601aaa95c861af3228982ecbb2b1c19d27a.
It was failing due to _LIBCPP_ASSERT throwing in a method marked noexcept.

4 years ago[analyzer] SATestBuild.py: Be defensive against corrupt plist files.
Artem Dergachev [Wed, 13 May 2020 11:06:44 +0000 (14:06 +0300)]
[analyzer] SATestBuild.py: Be defensive against corrupt plist files.

4 years ago[lldb] Also recognize DWARF UTF base types using their size
Mathias LANG [Wed, 13 May 2020 10:48:19 +0000 (12:48 +0200)]
[lldb] Also recognize DWARF UTF base types using their size

Summary:
The D programming language has 'char', 'wchar', and 'dchar' as base types,
which are defined as UTF-8, UTF-16, and UTF-32, respectively.

It also has type constructors (e.g. 'const' and 'immutable'),
that leads to D compilers emitting DW_TAG_base_type with DW_ATE_UTF
and name 'char', 'immutable(wchar)', 'const(char)', etc...

Before this patch, DW_ATE_UTF would only recognize types that
followed the C/C++ naming, and emit an error message for the rest, e.g.:
```
error: need to add support for DW_TAG_base_type 'immutable(char)'
encoded with DW_ATE = 0x10, bit_size = 8
```

The code was changed to check the byte size first,
then fall back to the old name-based check.

Reviewers: clayborg, labath

Reviewed By: labath

Subscribers: labath, lldb-commits

Tags: #lldb

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

4 years ago[libcxx testing] Remove ALLOW_RETRIES from wait_for futures test
David Zarzycki [Wed, 13 May 2020 10:43:16 +0000 (06:43 -0400)]
[libcxx testing] Remove ALLOW_RETRIES from wait_for futures test

This test tried to verify that "wait()" returned quickly but "quick" is
impossible to define given a busy and/or slow system.

Instead, I've refactored the test to verify that `wait()` actually
waits which the old test did not verify.

4 years ago[examples] Skip building the Bye pass plugin on windows
Martin Storsjö [Tue, 12 May 2020 08:54:51 +0000 (11:54 +0300)]
[examples] Skip building the Bye pass plugin on windows

Windows doesn't properly support pass plugins (as a shared library
can't have undefined references, which pass plugins assume, being
loaded into a host process that contains provides them), thus
disable building it and the corresponding test.

This matches what was done for the passes unit test in
bc8e44218810c0db6328b9809c959ceb7d43e3f5.

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

4 years ago[analyzer] Fix crash for non-pointers annotated as nonnull
Valeriy Savchenko [Wed, 13 May 2020 10:02:00 +0000 (13:02 +0300)]
[analyzer] Fix crash for non-pointers annotated as nonnull

Summary:
Nonnull attribute can be applied to non-pointers.  This caused assertion
failures in NonNullParamChecker when we tried to *assume* such parameters
to be non-zero.

rdar://problem/63150074

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

4 years ago[libc++] [LWG3321] Mark "year_month_day_last::day() specification does not cover...
Marek Kurdej [Wed, 13 May 2020 09:37:58 +0000 (11:37 +0200)]
[libc++] [LWG3321] Mark "year_month_day_last::day() specification does not cover !ok() values" issue as "Nothing to do", but add assertion.

Summary:
This LWG issue states that the result of `year_month_day_last::day()` is implementation defined if `ok()` is `false`.
However, from user perspective, calling `day()` in this situation will lead to a (possibly difficult to find) crash.
Hence, I have added an assertion to warn user at least when assertions are enabled.
I am however not aware of the libc++ stand on the desired behaviour.

Reviewers: ldionne, mclow.lists, EricWF, #libc

Reviewed By: ldionne, #libc

Subscribers: christof, dexonsmith, libcxx-commits

Tags: #libc

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

4 years ago[NFC] [PowerPC] Narrow fast-math flags in tests
Qiu Chaofan [Wed, 13 May 2020 09:21:31 +0000 (17:21 +0800)]
[NFC] [PowerPC] Narrow fast-math flags in tests

A lot of tests under PowerPC are using fast flag, while fast is just
alias of 7 fast-math flags. This change makes test points clearer.

mc-instrlat.ll and sms-iterator.ll keeps unchanged since they are not
testing fast-math behavior. (one for machine combiner crash, one for
machine pipeliner bug)

Reviewed By: steven.zhang, spatel

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

4 years ago[TableGen] Fix register class handling in TableGen's DAG ISel Matcher Generator
Victor Campos [Tue, 5 May 2020 14:42:23 +0000 (15:42 +0100)]
[TableGen] Fix register class handling in TableGen's DAG ISel Matcher Generator

Summary:
In TableGen's instruction selection table generator, references to
register classes were handled by generating a matcher table entry in the
form of "EmitStringInteger, MVT::i32, 'RegisterClassID'". This ID is in
fact the enum integer value corresponding to the register class.

However, both the table generator and the table consumer
(SelectionDAGISel) assume that this ID is less than or equal to 127,
i.e. at most 7 bits. Values greater than this threshold cause completely
wrong behaviours in the instruction selection process.

This patch adds a check to determine if the enum integer value is
greater than the limit of 127. In finding so, the generator emits an
"EmitInteger" instead, which properly supports values with arbitrary
sizes.

Commit f8d044bbcfdc9e1ddc02247ffb86fe39e1f277f0 fixed the very same bug
for register subindices. The present patch now extends this cover to
register classes.

Reviewers: rampitec

Reviewed By: rampitec

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[mips] Fix typo in FileCheck directives - replace \0xa0 char by space. NFC
Simon Atanasyan [Wed, 13 May 2020 05:14:28 +0000 (08:14 +0300)]
[mips] Fix typo in FileCheck directives - replace \0xa0 char by space. NFC

The problem is found by the D79276 on the following builder:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/23489

4 years ago[DebugInfo] Fixes windows bot failure due to a test failure
Sourabh Singh Tomar [Wed, 13 May 2020 08:57:53 +0000 (14:27 +0530)]
[DebugInfo] Fixes windows bot failure due to a test failure

This fixes failures on windows bot specifically:

http://lab.llvm.org:8011/builders/lld-x86_64-win/builds/445
and http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/
builds/32314

* TEST 'LLVM :: DebugInfo/X86/Fortran-DIModule.ll' FAILED *
Script:
--
: 'RUN: at line 2';   c:\ps4-buildslave2\lld-x86_64-win\build\bin\llc.exe
-mtriple=x86_64-pc-windows-gnu
c:\ps4-buildslave2\lld-x86_64-win\llvm-project\llvm\test\DebugInfo\X86\Fortran-DIModule.ll
-filetype=obj -o - |    c:\ps4-buildslave2\lld-x86_64-win\build\bin\llvm-dwarfdump.exe - |
 c:\ps4-buildslave2\lld-x86_64-win\build\bin\filecheck.exe
c:\ps4-buildslave2\lld-x86_64-win\llvm-project\llvm\test\DebugInfo\X86\Fortran-DIModule.ll
--
Exit Code: 1
error: command failed with exit status: 1

4 years ago[DebugInfo] Fortran module DebugInfo support in LLVM
Sourabh Singh Tomar [Fri, 8 May 2020 06:01:41 +0000 (11:31 +0530)]
[DebugInfo] Fortran module DebugInfo support in LLVM

This patch extends DIModule Debug metadata in LLVM to support
Fortran modules. DIModule is extended to contain File and Line
fields, these fields will be used by Flang FE to create debug
information necessary for representing Fortran modules at IR level.

Furthermore DW_TAG_module is also extended to contain these fields.
If these fields are missing, debuggers like GDB won't be able to
show Fortran modules information correctly.

Reviewed By: aprantl

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

4 years ago[BrachProbablityInfo] Set edge probabilities at once. NFC.
Yevgeny Rouban [Wed, 13 May 2020 05:14:06 +0000 (12:14 +0700)]
[BrachProbablityInfo] Set edge probabilities at once. NFC.

Hide the method that allows setting probability for particular
edge and introduce a public method that sets probabilities for
all outgoing edges at once.
Setting individual edge probability is error prone. More over
it is difficult to check that the total probability is 1.0
because there is no easy way to know when the user finished
setting all the probabilities.

Reviewers: yamauchi, ebrevnov
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79396

4 years ago[NFC] Code cleanup in TargetInfo.cpp
Shengchen Kan [Wed, 13 May 2020 06:44:54 +0000 (14:44 +0800)]
[NFC] Code cleanup in TargetInfo.cpp

Fix the signed/unsigned mismatch issue

4 years ago[PowerPC] Exploit VSX neg, abs and nabs for f32
Qiu Chaofan [Tue, 12 May 2020 06:29:40 +0000 (14:29 +0800)]
[PowerPC] Exploit VSX neg, abs and nabs for f32

xsnegdp, xsabsdp and xsnabsdp can be used to operate on f32 operand.

This patch adds the missing patterns since we prefer VSX instructions
when available.

Reviewed By: steven.zhang

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

4 years ago[CostModel] Modify BasicTTI getCastInstrCost
Sam Parker [Wed, 13 May 2020 06:22:42 +0000 (07:22 +0100)]
[CostModel] Modify BasicTTI getCastInstrCost

Fix the assumption that all bitcasts of the same type sizes are free.
We now only assume that bitcasts between ints and ptrs of the same
size are free. This allows TTImpl to just call the concrete
implementation of getCastInstrCost.

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

4 years ago[mlir][StandardToLLVM] Add SinOp to LLVM dialect and lowering of std.sin to this op.
MaheshRavishankar [Wed, 13 May 2020 06:04:33 +0000 (23:04 -0700)]
[mlir][StandardToLLVM] Add SinOp to LLVM dialect and lowering of std.sin to this op.

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