platform/upstream/llvm.git
4 years ago[lldb][NFC] Take a llvm::Triple in ClangASTContext constructor
Raphael Isemann [Tue, 7 Jan 2020 09:37:57 +0000 (10:37 +0100)]
[lldb][NFC] Take a llvm::Triple in ClangASTContext constructor

This constructor is supposed to take a string representing an llvm::Triple.
We might as well take a llvm::Triple here which saves us all the string
conversions in the call sites and we make this more type safe.

4 years ago[NFC] Use isX86() instead of getArch()
Jim Lin [Tue, 7 Jan 2020 09:32:39 +0000 (17:32 +0800)]
[NFC] Use isX86() instead of getArch()

Summary: This is a clean up for https://reviews.llvm.org/D72247.

Reviewers: MaskRay, craig.topper, jhenderson

Reviewed By: MaskRay

Subscribers: hiraditya, rupprecht, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[SystemZ] Fix python failure in test case
Ulrich Weigand [Tue, 7 Jan 2020 09:24:26 +0000 (10:24 +0100)]
[SystemZ] Fix python failure in test case

With recent Python the Large/spill-02.py test failed with an error:
TypeError: can't multiply sequence by non-int of type 'float'

4 years ago[APFloat] Fix out of scope usage of a pointer to local variable
Ehud Katz [Tue, 7 Jan 2020 09:24:11 +0000 (11:24 +0200)]
[APFloat] Fix out of scope usage of a pointer to local variable

4 years agoFix compiler extension example cmake integration
serge-sans-paille [Tue, 7 Jan 2020 08:27:08 +0000 (09:27 +0100)]
Fix compiler extension example cmake integration

- Do not add it to the Export file
- Update install target

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

4 years ago[lldb] Fix LLDB build after API change to printInst (D72172)
Raphael Isemann [Tue, 7 Jan 2020 07:30:45 +0000 (08:30 +0100)]
[lldb] Fix LLDB build after API change to printInst (D72172)

It seems in D72172 we always pass a 0 as the new default argument so let's
do the same in LLDB to get the build bot running.

4 years ago[APFloat] Fix fusedMultiplyAdd when `this` equals to `Addend`
Ehud Katz [Tue, 7 Jan 2020 06:45:18 +0000 (08:45 +0200)]
[APFloat] Fix fusedMultiplyAdd when `this` equals to `Addend`

Up until now, the arguments to `fusedMultiplyAdd` are passed by
reference. We must save the `Addend` value on the beginning of the
function, before we modify `this`, as they may be the same reference.

To fix this, we now pass the `addend` parameter of `multiplySignificand`
by value (instead of by-ref), and have a default value of zero.

Fix PR44051.

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

4 years ago[libc] Move implementations of strcat and strcpy to the string directory.
Siva Chandra Reddy [Mon, 6 Jan 2020 18:38:45 +0000 (10:38 -0800)]
[libc] Move implementations of strcat and strcpy to the string directory.

Summary:
Now that tests live in separate top-level directory, keeping the
implementations of individual functions in a directory of their own is
not meaningful. Hence, this change moves them into the higher level
string directory.

NFC intended.

Reviewers: MaskRay

Subscribers: mgorny, tschuett, libc-commits

Tags: #libc-project

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

4 years ago[OpenMP] NFC: Fix trivial typos in comments
Kazuaki Ishizaki [Tue, 7 Jan 2020 06:03:31 +0000 (14:03 +0800)]
[OpenMP] NFC: Fix trivial typos in comments

Reviewers: jdoerfert, Jim

Reviewed By: Jim

Subscribers: Jim, mgorny, guansong, jfb, openmp-commits

Tags: #openmp

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

4 years ago[libc] Add __attribute__((always_inline)) to x86_64 syscall functions.
Siva Chandra Reddy [Thu, 2 Jan 2020 19:09:18 +0000 (11:09 -0800)]
[libc] Add __attribute__((always_inline)) to x86_64 syscall functions.

Summary:
Some syscalls like SYS_clone do not tolerate a return instruction after
the syscall instruction. Marking the syscall functions with the
`always_inline` attribute accommodates such syscalls as inlining
eliminates the return instruction.

Reviewers: abrachet, phosek

Subscribers: MaskRay, tschuett, libc-commits

Tags: #libc-project

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

4 years agoLet PassBuilder Expose PassInstrumentationCallbacks
Juneyoung Lee [Tue, 7 Jan 2020 05:04:32 +0000 (14:04 +0900)]
Let PassBuilder Expose PassInstrumentationCallbacks

Summary:
This is an effort to allowing external libraries register their own pass instrumentation during their llvmGetPassPluginInfo() calls.

By exposing this through the added getPIC(), now a pass writer can do something like this:

```
extern "C" ::llvm::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK
llvmGetPassPluginInfo() {
  return {
    ..,
    [](llvm::PassBuilder &PB) {
      PB.getPIC()->registerAfterPassCallback(move(f));
    }
  };
}
```

Reviewers: chandlerc, philip.pfaffe, fedor.sergeev

Reviewed By: fedor.sergeev

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[MC] Add parameter `Address` to MCInstrPrinter::printInstruction
Fangrui Song [Fri, 3 Jan 2020 20:02:46 +0000 (12:02 -0800)]
[MC] Add parameter `Address` to MCInstrPrinter::printInstruction

Follow-up of D72172.

Reviewed By: jhenderson, rnk

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

4 years ago[MC] Add parameter `Address` to MCInstPrinter::printInst
Fangrui Song [Fri, 3 Jan 2020 18:55:30 +0000 (10:55 -0800)]
[MC] Add parameter `Address` to MCInstPrinter::printInst

printInst prints a branch/call instruction as `b offset` (there are many
variants on various targets) instead of `b address`.

It is a convention to use address instead of offset in most external
symbolizers/disassemblers. This difference makes `llvm-objdump -d`
output unsatisfactory.

Add `uint64_t Address` to printInst(), so that it can pass the argument to
printInstruction(). `raw_ostream &OS` is moved to the last to be
consistent with other print* methods.

The next step is to pass `Address` to printInstruction() (generated by
tablegen from the instruction set description). We can gradually migrate
targets to print addresses instead of offsets.

In any case, downstream projects which don't know `Address` can pass 0 as
the argument.

Reviewed By: jhenderson

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

4 years agoAMDGPU/GlobalISel: Fix unused variable warning in release
Matt Arsenault [Tue, 7 Jan 2020 03:31:33 +0000 (22:31 -0500)]
AMDGPU/GlobalISel: Fix unused variable warning in release

4 years ago[mlir][Linalg] Add a linalg.reshape op
Nicolas Vasilache [Tue, 7 Jan 2020 03:14:14 +0000 (22:14 -0500)]
[mlir][Linalg] Add a linalg.reshape op

Summary:
This diff adds a new operation to linalg to allow reshaping of an
existing view into a new view in the same buffer at the same offset.

More specifically:
The `linalg.reshape` op produces a new view whose sizes are a reassociation
of the original `view`. Depending on whether or not the reassociated
MemRefType is contiguous, the resulting memref may require explicit alloc
and copies.

A reassociation is defined as a continous grouping of dimensions and is
represented with a affine map array attribute. In the future, non-continous
groupings may be allowed (i.e. permutations, reindexings etc).

For now, it is assumed that either:
  1. a reassociation produces and consumes contiguous MemRefType or,
  2. the reshape op will be folded into its consumers (by changing the shape
     of the computations).
All other cases are undefined behavior and a reshape op may not lower to
LLVM if it cannot be proven statically that it does not require alloc+copy.

A reshape may either collapse or expand dimensions, depending on the
relationship between source and target memref ranks. The verification rule
is that the reassociation maps are applied to the memref with the larger
rank to obtain the memref with the smaller rank. In the case of a dimension
expansion, the reassociation maps can be interpreted as inverse maps.

Examples:

```mlir
   // Dimension collapse (i, j) -> i' and k -> k'
   %1 = linalg.reshape %0 [(i, j, k) -> (i, j),
                           (i, j, k) -> (k)] :
     memref<?x?x?xf32, stride_spec> into memref<?x?xf32, stride_spec_2>
```

```mlir
   // Dimension expansion i -> (i', j') and (k) -> (k')
   %1 = linalg.reshape %0 [(i, j, k) -> (i, j),
                           (i, j, k) -> (k)] :
     memref<?x?xf32, stride_spec> into memref<?x?x?xf32, stride_spec_2>
```

The relevant invalid and roundtripping tests are added.

Reviewers: AlexEichenberger, ftynse, rriddle, asaadaldien, yangjunpro

Subscribers: kiszk, merge_guards_bot, mehdi_amini, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, llvm-commits

Tags: #llvm

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

4 years ago[NFC][Test] Add a test to verify the DAGCombine of fma
QingShan Zhang [Tue, 7 Jan 2020 03:13:39 +0000 (03:13 +0000)]
[NFC][Test] Add a test to verify the DAGCombine of fma

4 years agoAMDGPU: Add run line to int_to_fp tests
Matt Arsenault [Tue, 7 Jan 2020 02:01:16 +0000 (21:01 -0500)]
AMDGPU: Add run line to int_to_fp tests

This wasn't catching a regression on targets with legal i16 triggered
in a future commit.

4 years agoAMDGPU: Select llvm.amdgcn.interp.p2.f16 directly
Matt Arsenault [Mon, 21 Oct 2019 20:39:17 +0000 (13:39 -0700)]
AMDGPU: Select llvm.amdgcn.interp.p2.f16 directly

This will enable automatic GlobalISel support in a future commit.

4 years agoAlways deduce the lengths of contained parameter packs when deducing a
Richard Smith [Tue, 7 Jan 2020 01:16:29 +0000 (17:16 -0800)]
Always deduce the lengths of contained parameter packs when deducing a
pack expansion.

Previously, if all parameter / argument pairs for a pack expansion
deduction were non-deduced contexts, we would not deduce the arity of
the pack, and could end up deducing a different arity (leading to
failures during substitution) or defaulting to an arity of 0 (leading to
bad diagnostics about passing the wrong number of arguments to a
variadic function). Instead, we now always deduce the arity for all
involved packs any time we deduce a pack expansion.

This will result in less substitution happening in some cases, which
could avoid non-SFINAEable errors, and should generally improve the
quality of diagnostics when passing initializer lists to variadic
functions.

4 years agoAMDGPU: Use default operands for clamp/omod
Matt Arsenault [Sat, 7 Sep 2019 22:42:27 +0000 (18:42 -0400)]
AMDGPU: Use default operands for clamp/omod

We have a lot of complex pattern variants that just set the source
modifiers that are really handled, and then set the output modifiers
to 0. We're unlikely to ever match output modifiers from the use
instruction side, and we already match clamp/omod in a separate pass.

4 years ago[WebAssembly] Fix landingpad-only case in Emscripten EH
Heejin Ahn [Tue, 7 Jan 2020 00:15:53 +0000 (16:15 -0800)]
[WebAssembly] Fix landingpad-only case in Emscripten EH

Summary:
Previously we didn't set `Changed` to true when there are only landing
pads but not invokes. This fixes it and we set `Changed` to true
whenever we have landing pads. (There can't be invokes without landing
pads, so that case is covered too)

The test case for this has to be a separate file because this pass is a
`ModulePass` and `Changed` is computed based on the whole module.

Reviewers: tlively

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

4 years agoAMDGPU/GlobalISel: Legalize G_READCYCLECOUNTER
Matt Arsenault [Sat, 4 Jan 2020 17:50:18 +0000 (12:50 -0500)]
AMDGPU/GlobalISel: Legalize G_READCYCLECOUNTER

4 years ago[CodeGen][ObjC] Push the properties of a protocol before pushing the
Akira Hatanaka [Sat, 4 Jan 2020 16:32:49 +0000 (08:32 -0800)]
[CodeGen][ObjC] Push the properties of a protocol before pushing the
properties of the protocol it inherits

This fixes a bug where the type string for a @dynamic property of an
@implementation didn't have 'D' in it when the protocol it conforms to
redeclares the property declared in the base protocol.

rdar://problem/45503561

4 years ago[msan] Fix underflow in qsort interceptor.
Evgenii Stepanov [Tue, 7 Jan 2020 00:12:52 +0000 (16:12 -0800)]
[msan] Fix underflow in qsort interceptor.

4 years ago[NFC] Fixes -Wrange-loop-analysis warnings
Mark de Wever [Mon, 6 Jan 2020 23:49:41 +0000 (00:49 +0100)]
[NFC] Fixes -Wrange-loop-analysis warnings

This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

4 years agoAdd Triple::isX86()
Fangrui Song [Mon, 6 Jan 2020 18:16:28 +0000 (10:16 -0800)]
Add Triple::isX86()

Reviewed By: craig.topper, skan

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

4 years agoUse FileCheck instead of grep
Akira Hatanaka [Mon, 6 Jan 2020 23:45:27 +0000 (15:45 -0800)]
Use FileCheck instead of grep

4 years agoAMDGPU/GlobalISel: Select G_UADDE/G_USUBE
Matt Arsenault [Wed, 25 Dec 2019 14:06:05 +0000 (09:06 -0500)]
AMDGPU/GlobalISel: Select G_UADDE/G_USUBE

4 years agoAMDGPU/GlobalISel: Replace handling of boolean values
Matt Arsenault [Sat, 2 Nov 2019 16:30:59 +0000 (09:30 -0700)]
AMDGPU/GlobalISel: Replace handling of boolean values

This solves selection failures with generated selection patterns,
which would fail due to inferring the SGPR reg bank for virtual
registers with a set register class instead of VCC bank. Use
instruction selection would constrain the virtual register to a
specific class, so when the def was selected later the bank no longer
was set to VCC.

Remove the SCC reg bank. SCC isn't directly addressable, so it
requires copying from SCC to an allocatable 32-bit register during
selection, so these might as well be treated as 32-bit SGPR values.

Now any scalar boolean value that will produce an outupt in SCC should
be widened during RegBankSelect to s32. Any s1 value should be a
vector boolean during selection. This makes the vcc register bank
unambiguous with a normal SGPR during selection.

Summary of how this should now work:

- G_TRUNC is always a no-op, and never should use a vcc bank result.

- SALU boolean operations should be promoted to s32 in RegBankSelect
  apply mapping

- An s1 value means vcc bank at selection. The exception is for
  legalization artifacts that use s1, which are never VCC. All other
  contexts should infer the VCC register classes for s1 typed
  registers. The LLT for the register is now needed to infer the
  correct register class. Extensions with vcc sources should be
  legalized to a select of constants during RegBankSelect.

- Copy from non-vcc to vcc ensures high bits of the input value are
  cleared during selection.

- SALU boolean inputs should ensure the inputs are 0/1. This includes
  select, conditional branches, and carry-ins.

There are a few somewhat dirty details. One is that G_TRUNC/G_*EXT
selection ignores the usual register-bank from register class
functions, and can't handle truncates with VCC result banks. I think
this is OK, since the artifacts are specially treated anyway. This
does require some care to avoid producing cases with vcc. There will
also be no 100% reliable way to verify this rule is followed in
selection in case of register classes, and violations manifests
themselves as invalid copy instructions much later.

Standard phi handling also only considers the bank of the result
register, and doesn't insert copies to make the source banks
match. This doesn't work for vcc, so we have to manually correct phi
inputs in this case. We should add a verifier check to make sure there
are no phis with mixed vcc and non-vcc register bank inputs.

There's also some duplication with the LegalizerHelper, and some code
which should live in the helper. I don't see a good way to share
special knowledge about what types to use for intermediate operations
depending on the bank for example. Using the helper to replace
extensions with selects also seems somewhat awkward to me.

Another issue is there are some contexts calling
getRegBankFromRegClass that apparently don't have the LLT type for the
register, but I haven't yet run into a real issue from this.

This also introduces new unnecessary instructions in most cases, since
we don't yet try to optimize out the zext when the source is known to
come from a compare.

4 years agoTableGen/GlobalISel: Handle default operands that are used
Matt Arsenault [Tue, 22 Oct 2019 04:39:42 +0000 (21:39 -0700)]
TableGen/GlobalISel: Handle default operands that are used

Copy the logic from the existing handling in the DAG matcher emittter.

This will enable some AMDGPU pattern cleanups without breaking
GlobalISel tests, and eventually handle importing more patterns.

The test is a bit annoying since the sections seem to randomly sort
themselves if anything else is added in the future.

4 years agoGlobalISel: Implement lower for G_INTRINSIC_ROUND
Matt Arsenault [Tue, 24 Dec 2019 19:49:31 +0000 (14:49 -0500)]
GlobalISel: Implement lower for G_INTRINSIC_ROUND

Mostly copied from AMDGPU lowering implementation, except used
G_SITOFP instead of directly creating a select on -1.0, 0.0.

4 years agoChange the patterns to include the prefix '= ' so we don't pass errantly.
Jason Molenda [Mon, 6 Jan 2020 23:18:22 +0000 (15:18 -0800)]
Change the patterns to include the prefix '= ' so we don't pass errantly.
Looking at a sometimes-passing test case on a platform
where random values were being returned - sometimes
the expected digit ('1' or '2') would be included in the
random returned value.  Add a prefix to reduce the likelihood of
this a bit.

4 years ago[X86] Move an enum definition into a header to simplify future patches [NFC]
Philip Reames [Mon, 6 Jan 2020 23:13:45 +0000 (15:13 -0800)]
[X86] Move an enum definition into a header to simplify future patches [NFC]

4 years ago[msan] Check qsort input.
Evgenii Stepanov [Fri, 20 Dec 2019 20:07:04 +0000 (12:07 -0800)]
[msan] Check qsort input.

Summary:
Qsort interceptor suppresses all checks by unpoisoning the data in the
wrapper of a comparator function, and then unpoisoning the output array
as well.

This change adds an explicit run of the comparator on all elements of
the input array to catch any sanitizer bugs.

Reviewers: vitalybuka

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years ago[NSArray] Remove a very old and deprecated formatter.
Davide Italiano [Mon, 6 Jan 2020 22:58:01 +0000 (14:58 -0800)]
[NSArray] Remove a very old and deprecated formatter.

Checked with the Foundation folks.

4 years ago[CMake] Pass symlink dependency to add_llvm_install_targets explicitly
Petr Hosek [Sat, 28 Dec 2019 00:25:43 +0000 (16:25 -0800)]
[CMake] Pass symlink dependency to add_llvm_install_targets explicitly

The install-${name}-stripped targets don't strip when ${name} is being
symlinked, e.g. llvm-ar or llvm-objcopy. The problem is that
llvm_install_symlink passes install-${dest} as a dependency of
install-${name}, e.g. install-llvm-ar becomes a dependency of both
install-llvm-ranlib and install-llvm-ranlib-stripped. What this means is
that when installing a distribution that contains both llvm-ar and
llvm-ranlib is that first the stripped version of llvm-ar is installed
(by the install-llvm-ar-stripped target) and then it's overwritten by an
unstripped version of llvm-ar bnecause install-llvm-ranlib-stripped has
install-llvm-ranlib as a dependency as mentioned earlier. To avoid this
issue, rather than passing the install-${dest} as dependency, we
introduce a new argument to add_llvm_install_targets for symlink target
which expands it into an appropriate dependency, i.e. install-${dest}
for install-${name} target and install-${dest}-stripped for
install-${name}-stripped.

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

4 years agoDon't rely on 'l'(ell) modifiers to indicate a label reference
Bill Wendling [Tue, 24 Dec 2019 00:57:41 +0000 (16:57 -0800)]
Don't rely on 'l'(ell) modifiers to indicate a label reference

Summary:
It's not necessary to use an 'l'(ell) modifier when referencing a label.
Treat block addresses and MBB references as if the modifier is used
anyway. This prevents us from generating references to ficticious
labels.

Reviewers: jyknight, nickdesaulniers, hfinkel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[FileCheck] Remove FileCheck prefix in API
Thomas Preud'homme [Wed, 11 Dec 2019 23:48:01 +0000 (23:48 +0000)]
[FileCheck] Remove FileCheck prefix in API

Summary:
When FileCheck was made a library, types in the public API were renamed
to add a FileCheck prefix, such as Pattern to FileCheckPattern. Many
types were moved into a private interface and thus don't need this
prefix anymore. This commit removes those unneeded prefixes.

Reviewers: jhenderson, jdenny, probinson, grimar, arichardson, rnk

Reviewed By: jhenderson

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[PowerPC][NFC] Rename record instructions to use _rec suffix instead of o
Jinsong Ji [Mon, 6 Jan 2020 19:05:12 +0000 (19:05 +0000)]
[PowerPC][NFC] Rename record instructions to use _rec suffix instead of o

We use o suffix to indicate record form instuctions,
(as it is similar to dot '.' in mne?)

This was fine before, as we did not support XO-form.
However, with https://reviews.llvm.org/D66902,
we now have XO-form support.

It becomes confusing now to still use 'o' for record form,
and it is weird to have something like 'Oo' .

This patch rename all 'o' instructions to use '_rec' instead.
Also rename `isDot` to `isRecordForm`.

Reviewed By: #powerpc, hfinkel, nemanjai, steven.zhang, lkail

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

4 years ago[Diagnostic] make Wmisleading-indendation not warn about labels
Tyker [Mon, 6 Jan 2020 21:04:55 +0000 (22:04 +0100)]
[Diagnostic] make Wmisleading-indendation not warn about labels

Reviewers: aaron.ballman, xbolva00

Reviewed By: aaron.ballman

Subscribers: nickdesaulniers, nathanchance

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

4 years agoGlobalISel: Fix unsupported legalize action
Matt Arsenault [Mon, 9 Sep 2019 20:55:49 +0000 (16:55 -0400)]
GlobalISel: Fix unsupported legalize action

This would complain about invalid legalizer rules otherwise.

Mark some operations as unsupported for AMDGPU. This currently seems
to produce the same legalize error as when no rules are defined, but
eventually this should produce a proper user facing error.

4 years agoGlobalISel: Correct result type for G_FCMP in lowerFPTOUI
Matt Arsenault [Sat, 4 Jan 2020 22:06:47 +0000 (17:06 -0500)]
GlobalISel: Correct result type for G_FCMP in lowerFPTOUI

Using the final result type doesn't make any sense. Use the natural
default boolean type for the select condition.

4 years agoGlobalISel: Start adding computeNumSignBits to GISelKnownBits
Matt Arsenault [Sat, 4 Jan 2020 19:13:06 +0000 (14:13 -0500)]
GlobalISel: Start adding computeNumSignBits to GISelKnownBits

4 years agoAMDGPU: Fix legalizing f16 fpow
Matt Arsenault [Sat, 4 Jan 2020 20:48:46 +0000 (15:48 -0500)]
AMDGPU: Fix legalizing f16 fpow

The existing test only covered one case for r600. The use of
mul_legacy also looks suspicious to me, but leave it for now. The
patterns are also not making use of source modifiers.

4 years agoAMDGPU: Use ImmLeaf
Matt Arsenault [Mon, 6 Jan 2020 20:39:05 +0000 (15:39 -0500)]
AMDGPU: Use ImmLeaf

This solves one GlobalISel importer error, but the pattern still fails
for another reason.

4 years agoAMDGPU: Use ImmLeaf for inline immediate predicates
Matt Arsenault [Mon, 6 Jan 2020 19:39:13 +0000 (14:39 -0500)]
AMDGPU: Use ImmLeaf for inline immediate predicates

4 years agollc/MIR: Fix setFunctionAttributes for MIR functions
Matt Arsenault [Fri, 6 Dec 2019 18:36:34 +0000 (00:06 +0530)]
llc/MIR: Fix setFunctionAttributes for MIR functions

A random set of attributes are implemented by llc/opt forcing the
string attributes on the IR functions before processing anything. This
would not happen for MIR functions, which have not yet been created at
this point.

Use a callback in the MIR parser, purely to avoid dealing with the
ugliness that the command line flags are in a .inc file, and would
require allowing access to these flags from multiple places (either
from the MIR parser directly, or a new utility pass to implement these
flags). It would probably be better to cleanup the flag handling into
a separate library.

This is in preparation for treating more command line flags with a
corresponding function attribute in a more uniform way. The fast math
flags in particular have a messy system where the command line flag
sets the behavior from a function attribute if present, and otherwise
the command line flag. This means if any other pass tries to inspect
the function attributes directly, it will be inconsistent with the
intended behavior. This is also inconsistent with the current behavior
of -mcpu and -mattr, which overwrites any pre-existing function
attributes. I would like to move this to consistenly have the command
line flags not overwrite any pre-existing attributes, and to always
ensure the command line flags are consistent with the function
attributes.

4 years ago[X86] Improve v4i32->v4f64 uint_to_fp for AVX1/AVX2 targets.
Craig Topper [Mon, 6 Jan 2020 22:06:20 +0000 (14:06 -0800)]
[X86] Improve v4i32->v4f64 uint_to_fp for AVX1/AVX2 targets.

Use zext+or+fsub to do the conversion. Similar to D71971.

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

4 years ago[lldb/Docs] Describe optional dependencies on build page.
Jonas Devlieghere [Mon, 6 Jan 2020 21:57:55 +0000 (13:57 -0800)]
[lldb/Docs] Describe optional dependencies on build page.

List the different CMake flags controlling the optional dependencies as
per the discussion on the mailing list:

http://lists.llvm.org/pipermail/lldb-dev/2020-January/015867.html

4 years ago[LegalizeTypes] Add widening support for STRICT_FSETCC/FSETCCS
Craig Topper [Mon, 6 Jan 2020 21:37:47 +0000 (13:37 -0800)]
[LegalizeTypes] Add widening support for STRICT_FSETCC/FSETCCS

This patch adds widening which really just scalarizes because we don't have a strategy for the extra elements we would need to pad with.

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

4 years ago[X86] Rename vec-strict-*-cmp.ll to vec-strict-cmp-*.ll to match other strict files...
Craig Topper [Mon, 6 Jan 2020 21:34:45 +0000 (13:34 -0800)]
[X86] Rename vec-strict-*-cmp.ll to vec-strict-cmp-*.ll to match other strict files wich have the size at the end. NFC

4 years ago[OPENMP50]Support lastprivate conditional updates in inc/dec unary ops.
Alexey Bataev [Mon, 6 Jan 2020 21:14:34 +0000 (16:14 -0500)]
[OPENMP50]Support lastprivate conditional updates in inc/dec unary ops.

Added support for checking of updates of variables used in unary
pre(pos) inc/dec expressions.

4 years ago [NFC] Test commit, revert whitespace change
stevewan [Mon, 6 Jan 2020 21:28:13 +0000 (16:28 -0500)]
 [NFC] Test commit, revert whitespace change

As per the Developer Policy, upon obtaining commit access.

4 years ago[NFC] Test commit, whitespace change
stevewan [Mon, 6 Jan 2020 21:24:27 +0000 (16:24 -0500)]
[NFC] Test commit, whitespace change

As per the Developer Policy, upon obtaining commit access.

4 years ago[x86] add tests for concat self + shuffle; NFC
Sanjay Patel [Mon, 6 Jan 2020 20:24:30 +0000 (15:24 -0500)]
[x86] add tests for concat self + shuffle; NFC

4 years ago[OpenMP] Fix incorrect property of __has_attribute() macro
Kelvin Li [Mon, 6 Jan 2020 20:00:10 +0000 (15:00 -0500)]
[OpenMP] Fix incorrect property of __has_attribute() macro

__has_attribute(fallthough) -> __has_attribute(fallthrough)

Submitted by: kiszk (Kazuaki Ishizaki <ishizaki@jp.ibm.com>)

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

4 years agoLower TAGPstack with negative offset to SUBG.
Evgenii Stepanov [Tue, 10 Dec 2019 00:52:31 +0000 (16:52 -0800)]
Lower TAGPstack with negative offset to SUBG.

Summary:
This never really occurs in the current codegen, so only a MIR test is
possible.

Reviewers: ostannard, pcc

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[X86] Fix an 8 bit testb being selected when folding a volatile i32 load pattern.
Amara Emerson [Wed, 11 Dec 2019 22:42:16 +0000 (14:42 -0800)]
[X86] Fix an 8 bit testb being selected when folding a volatile i32 load pattern.

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

4 years ago[PowerPC][LoopVectorize] Extend getRegisterClassForType to consider double and other...
Jinsong Ji [Fri, 3 Jan 2020 20:25:19 +0000 (20:25 +0000)]
[PowerPC][LoopVectorize] Extend getRegisterClassForType to consider double and other floating point type

In https://reviews.llvm.org/D67148, we use isFloatTy to test floating
point type, otherwise we return GPRRC.
So 'double' will be classified as GPRRC, which is not accurate.

This patch covers other floating point types.

Reviewed By: #powerpc, nemanjai

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

4 years ago[lld] Fix trivial typos in comments
Kazuaki Ishizaki [Mon, 6 Jan 2020 18:21:05 +0000 (10:21 -0800)]
[lld] Fix trivial typos in comments

Reviewed By: ruiu, MaskRay

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

4 years ago[libc] Move all tests to a top level `test` directory.
Siva Chandra Reddy [Fri, 3 Jan 2020 20:00:45 +0000 (12:00 -0800)]
[libc] Move all tests to a top level `test` directory.

A toplevel target, `check-libc` has also been added.

Reviewers: abrachet, phosek

Tags: #libc-project

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

4 years ago[lldb/Docs] Fix capitalization typo.
Jonas Devlieghere [Mon, 6 Jan 2020 18:08:05 +0000 (10:08 -0800)]
[lldb/Docs] Fix capitalization typo.

This has been bothering me for way too long.

4 years ago[lldb/CMake] Only set PYTHON_HOME on Windows
Jonas Devlieghere [Mon, 6 Jan 2020 17:56:46 +0000 (09:56 -0800)]
[lldb/CMake] Only set PYTHON_HOME on Windows

My earlier change for Python auto-detection caused PYTHON_HOME to be set
unconditionally, while before the change this only happened for Windows.
This caused the PythonDataObjectsTest to fail with an import error.

4 years ago[CMake] Add $ORIGIN/../../../../lib to rpath if BUILD_SHARED_LIBS or LLVM_LINK_LLVM_D...
Fangrui Song [Sat, 21 Dec 2019 22:59:16 +0000 (14:59 -0800)]
[CMake] Add $ORIGIN/../../../../lib to rpath if BUILD_SHARED_LIBS or LLVM_LINK_LLVM_DYLIB on *nix

Summary:
lib/python2.7/dist-packages/lldb/_lldb.so is a symlink to lib/liblldb.so,
which depends on lib/libLLVM*.so (-DBUILD_SHARED_LIBS=ON) or lib/libLLVM-10git.so
(-DLLVM_LINK_LLVM_DYLIB=ON). Add an additional rpath `$ORIGIN/../../../../lib` so
that _lldb.so can be loaded from Python.

This fixes an import error from lib/python2.7/dist-packages/lldb/__init__.py

  from . import _lldb
  ImportError: libLLVMAArch64CodeGen.so.10git: cannot open shared object file: No such file or directory

 The following configurations will work:

* -DBUILD_SHARED_LIBS=ON
* -DBUILD_SHARED_LIBS=OFF -DLLVM_LINK_LLVM_DYLIB=ON
* -DBUILD_SHARED_LIBS=OFF -DLLVM_LINK_LLVM_DYLIB=ON -DCLANG_LINK_CLANG_DYLIB=ON
  (-DCLANG_LINK_CLANG_DYLIB=ON depends on -DLLVM_LINK_LLVM_DYLIB=ON)

Reviewed By: labath

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

4 years agoMake check-llvm run 50% faster on macOS, 18% faster on Windows.
Nico Weber [Mon, 6 Jan 2020 15:54:13 +0000 (10:54 -0500)]
Make check-llvm run 50% faster on macOS, 18% faster on Windows.

While looking at cycle time graphs of some of my bots, I noticed
that 327894859cc made check-llvm noticeably slower on macOS and
Windows.

As it turns out, the 5 substitutions added in that change were
enough to cause lit to thrash the build-in cache in re.compile()
(re.sub() is implemented as re.compile().sub()), and apparently
applySubstitutions() is on the cricital path and slow when all
regexes need to compile all the time.

(See `_MAXCACHE = 512` in cpython/Lib/re.py)

Supporting full regexes for lit substitutions seems a bit like
overkill, but for now add a simple unbounded cache to recover
the lost performance.

No intended behavior change.

4 years ago[lldb/Test] Move @skipIfAsan from test class to test methods.
Jonas Devlieghere [Mon, 6 Jan 2020 17:52:09 +0000 (09:52 -0800)]
[lldb/Test] Move @skipIfAsan from test class to test methods.

skipTestIfFn can only be used to decorate a test method.

4 years ago[llvm-readelf] Print EI_ABIVERSION as decimal instead of hexadecimal
Fangrui Song [Sun, 5 Jan 2020 22:56:27 +0000 (14:56 -0800)]
[llvm-readelf] Print EI_ABIVERSION as decimal instead of hexadecimal

This matches GNU readelf and llvm-readobj.

Reviewed By: jhenderson

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

4 years ago[gn build] Port 350da402ef6
LLVM GN Syncbot [Mon, 6 Jan 2020 17:22:13 +0000 (17:22 +0000)]
[gn build] Port 350da402ef6

4 years ago[clang-tidy] new check: bugprone-signed-char-misuse
Tamás Zolnai [Sat, 4 Jan 2020 13:05:09 +0000 (14:05 +0100)]
[clang-tidy] new check: bugprone-signed-char-misuse

Summary:
This check searches for signed char -> integer conversions which might
indicate programming error, because of the misinterpretation of char
values. A signed char might store the non-ASCII characters as negative
values. The human programmer probably expects that after an integer
conversion the converted value matches with the character code
(a value from [0..255]), however, the actual value is in
[-128..127] interval.

See also:
STR34-C. Cast characters to unsigned char before converting to larger integer sizes
<https://wiki.sei.cmu.edu/confluence/display/c/STR34-C.+Cast+characters+to+unsigned+char+before+converting+to+larger+integer+sizes>

By now this check is limited to assignment / variable declarations.
If we would catch all signed char -> integer conversion, then it would
produce a lot of findings and also false positives. So I added only
this use case now, but this check can be extended with additional
use cases later.
The CERT documentation mentions another use case when the char is
used for array subscript. Next to that a third use case can be
the signed char - unsigned char comparison, which also a use case
where things happen unexpectedly because of conversion to integer.

Reviewers: alexfh, hokein, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: sylvestre.ledru, whisperity, Eugene.Zelenko, mgorny, xazax.hun, cfe-commits

Tags: #clang, #clang-tools-extra

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

4 years ago[lldb/Test] Temporarily skip TestFoundationDisassembly on the ASan bot.
Jonas Devlieghere [Mon, 6 Jan 2020 17:06:09 +0000 (09:06 -0800)]
[lldb/Test] Temporarily skip TestFoundationDisassembly on the ASan bot.

This test is timing out on the sanitized bot on GreenDragon. Temporarily
disable it to increase the signal-to-noise ration.

4 years ago[lldb/CMake] Autodetect Python dependency
Jonas Devlieghere [Mon, 6 Jan 2020 16:49:36 +0000 (08:49 -0800)]
[lldb/CMake] Autodetect Python dependency

Python was the last remaining "optional" dependency for LLDB. This moves
the code to find Python into FindPythonInterpAndLibs using the same
principles as FindCursesAndPanel.

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

4 years ago[AIX] Use csect reference for function address constants
diggerlin [Mon, 6 Jan 2020 16:45:00 +0000 (11:45 -0500)]
[AIX] Use csect reference for function address constants

SUMMARY:
We currently emit a reference for function address constants as labels;
for example:

foo_ptr:
.long foo
however, there may be no such label in the case where the function is
undefined. Although the label exists when the function is defined, we
will (to be consistent) also use a csect reference in that case.

Address one comment
https://reviews.llvm.org/D71144#inline-653255

Reviewers: daltenty,hubert.reinterpretcast,jasonliu,Xiangling_L
Subscribers: cebowleratibm, wuzish, nemanjai

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

4 years ago[llvm-libc] Fix missing virtual destructor
Guillaume Chatelet [Mon, 6 Jan 2020 12:31:45 +0000 (13:31 +0100)]
[llvm-libc] Fix missing virtual destructor

Summary: This patch adds a virtual destructor to the Command class.

Reviewers: sivachandra

Subscribers: mgorny, MaskRay, libc-commits

Tags: #libc-project

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

4 years ago[ARM] Use the correct opcodes for Thumb2 segmented stack frame lowering
David Green [Mon, 6 Jan 2020 15:54:36 +0000 (15:54 +0000)]
[ARM] Use the correct opcodes for Thumb2 segmented stack frame lowering

The segmented stack lowering code appears to be using ARM opcodes under
Thumb2. The MRC opcode will be the same for Thumb and ARM, but t2LDR
seems wrong. Either way, using the correct thumb vs arm opcodes is more
correct.

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

4 years ago[ARM] Use correct TRAP opcode for thumb in FastISel
David Green [Mon, 6 Jan 2020 10:58:14 +0000 (10:58 +0000)]
[ARM] Use correct TRAP opcode for thumb in FastISel

We were previously unconditionally using the ARM::TRAP opcode, even
under Thumb. My understanding is that these are essentially the same
thing (they both result in a trap under Thumb), but the ARM::TRAP opcode
is marked as requiring IsARM, so it is more correct to use ARM::tTRAP.

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

4 years ago[AIX] Use csect reference for function address constants
diggerlin [Mon, 6 Jan 2020 16:38:22 +0000 (11:38 -0500)]
[AIX] Use csect reference for function address constants

SUMMARY:
We currently emit a reference for function address constants as labels;
for example:

foo_ptr:
.long foo
however, there may be no such label in the case where the function is
undefined. Although the label exists when the function is defined, we
will (to be consistent) also use a csect reference in that case.

Reviewers: daltenty,hubert.reinterpretcast,jasonliu,Xiangling_L
Subscribers: cebowleratibm, wuzish, nemanjai

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

4 years agoAdds -Wrange-loop-analysis to -Wall
Mark de Wever [Wed, 1 Jan 2020 16:23:18 +0000 (17:23 +0100)]
Adds -Wrange-loop-analysis to -Wall

This makes the range loop warnings part of -Wall.

Fixes PR32823: Warn about accidental coping of data in range based for

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

Recomitted after fixing the warnings it created.

4 years ago[NFC] Fixes -Wrange-loop-analysis warnings
Mark de Wever [Sun, 5 Jan 2020 13:26:39 +0000 (14:26 +0100)]
[NFC] Fixes -Wrange-loop-analysis warnings

This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

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

4 years ago[AMDGPU] Fix "use of uninitialized variable" static analyzer warning. NFCI.
Simon Pilgrim [Mon, 6 Jan 2020 16:36:33 +0000 (16:36 +0000)]
[AMDGPU] Fix "use of uninitialized variable" static analyzer warning. NFCI.

Add "unreachable" default case to AMDGPUTargetStreamer::getArchNameFromElfMach

4 years agoFix "use of uninitialized variable" static analyzer warnings. NFCI.
Simon Pilgrim [Mon, 6 Jan 2020 16:17:05 +0000 (16:17 +0000)]
Fix "use of uninitialized variable" static analyzer warnings. NFCI.

Add "unreachable" default cases like we do for the other switch()s in X86MCInstLower::Lower

4 years agoFix "use of uninitialized variable" static analyzer warning. NFCI.
Simon Pilgrim [Mon, 6 Jan 2020 16:15:17 +0000 (16:15 +0000)]
Fix "use of uninitialized variable" static analyzer warning. NFCI.

4 years ago[ARM,MVE] Fix many signedness errors in MVE intrinsics.
Simon Tatham [Mon, 6 Jan 2020 16:33:14 +0000 (16:33 +0000)]
[ARM,MVE] Fix many signedness errors in MVE intrinsics.

Summary:
Running an end-to-end test last week I noticed that a lot of the ACLE
intrinsics that operate differently on vectors of signed and unsigned
integers were ending up generating the signed version of the
instruction unconditionally. This is because the IR intrinsics had no
way to distinguish signed from unsigned: the LLVM type system just
calls them both `v8i16` (or whatever), so you need either separate
intrinsics for signed and unsigned, or a flag parameter that tells
ISel which one to choose.

This patch fixes all the problems of that kind that I've noticed, by
adding an i32 flag parameter to many of the IR intrinsics which is set
to 1 for unsigned (matching the existing practice in cases where we
got it right), and conditioning all the isel patterns on that flag. So
the fundamental change is in `IntrinsicsARM.td`, changing the
low-level IR intrinsics API; there are knock-on changes in
`arm_mve.td` (adjusting code gen for the ACLE intrinsics to use the
modified API) and in `ARMInstrMVE.td` (adjusting isel to expect the
new unsigned flags). The rest of this patch is boringly updating tests.

Reviewers: dmgreen, miyuki, MarkMurrayARM

Reviewed By: dmgreen

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

Tags: #clang, #llvm

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

4 years ago[ARM,MVE] Support -ve offsets in gather-load intrinsics.
Simon Tatham [Mon, 6 Jan 2020 16:33:05 +0000 (16:33 +0000)]
[ARM,MVE] Support -ve offsets in gather-load intrinsics.

Summary:
The ACLE intrinsics with `gather_base` or `scatter_base` in the name
are wrappers on the MVE load/store instructions that take a vector of
base addresses and an immediate offset. The immediate offset can be up
to 127 times the alignment unit, and it can be positive or negative.

At the MC layer, we got that right. But in the Sema error checking for
the wrapping intrinsics, the offset was erroneously constrained to be
positive.

To fix this I've adjusted the `imm_mem7bit` class in the Tablegen that
defines the intrinsics. But that causes integer literals like
`0xfffffffffffffe04` to appear in the autogenerated calls to
`SemaBuiltinConstantArgRange`, which provokes a compiler warning
because that's out of the non-overflowing range of an `int64_t`. So
I've also tweaked `MveEmitter` to emit that as `-0x1fc` instead.

Updated the tests of the Sema checks themselves, and also adjusted a
random sample of the CodeGen tests to actually use negative offsets
and prove they get all the way through code generation without causing
a crash.

Reviewers: dmgreen, miyuki, MarkMurrayARM

Reviewed By: dmgreen

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

Tags: #clang, #llvm

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

4 years ago[ARM,MVE] Generate the right instruction for vmaxnmq_m_f16.
Simon Tatham [Mon, 6 Jan 2020 16:28:18 +0000 (16:28 +0000)]
[ARM,MVE] Generate the right instruction for vmaxnmq_m_f16.

Summary:
Due to a copy-paste error in the isel patterns, the predicated version
of this intrinsic was expanding to the `VMAXNMT.F32` instruction
instead of `VMAXNMT.F16`. Similarly for vminnm.

Reviewers: dmgreen, miyuki, MarkMurrayARM

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years agoAMDGPU/GlobalISel: Select scalar v2s16 G_BUILD_VECTOR
Matt Arsenault [Mon, 2 Sep 2019 07:27:20 +0000 (03:27 -0400)]
AMDGPU/GlobalISel: Select scalar v2s16 G_BUILD_VECTOR

4 years ago[lldb] [Process/NetBSD] Remove unused orig_*ax use
Michał Górny [Sat, 4 Jan 2020 04:34:41 +0000 (05:34 +0100)]
[lldb] [Process/NetBSD] Remove unused orig_*ax use

orig_*ax logic is Linux-specific, and was never used on NetBSD.
In fact, its support seems to be a dead code entirely.

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

4 years agoAMDGPU/GlobalISel: Select more G_EXTRACTs correctly
Matt Arsenault [Wed, 1 Jan 2020 20:23:58 +0000 (15:23 -0500)]
AMDGPU/GlobalISel: Select more G_EXTRACTs correctly

This assumed a 32-bit extract size, which would produce invalid copies
with 64-bit extracts. Handle the easy case. Ideally we would have a
way to get the proper subreg index for any 32-bit offset, but there
should probably be a tablegenerated way of getting the subreg index
for any size and offset.

4 years ago[mlir][Linalg] Reimplement and extend getStridesAndOffset
Nicolas Vasilache [Thu, 2 Jan 2020 20:25:21 +0000 (15:25 -0500)]
[mlir][Linalg] Reimplement and extend getStridesAndOffset

Summary: This diff reimplements getStridesAndOffset in a significantly simpler way by operating on the AffineExpr and calling into simplifyAffineExpr instead of rolling its own saturating arithmetic.

As a consequence it becomes quite simple to extend the behavior of getStridesAndOffset to encompass more cases by manipulating the AffineExpr more directly.
The divisions are still filtered out and continue to yield fully dynamic strides.
Simplifying the divisions is left for a later time if compelling use cases arise.

Relevant tests are added.

Reviewers: ftynse

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, llvm-commits

Tags: #llvm

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

4 years ago[clang-format] fix conflict between FormatStyle::BWACS_MultiLine and BeforeCatch...
Mitchell Balan [Mon, 6 Jan 2020 14:21:41 +0000 (09:21 -0500)]
[clang-format] fix conflict between FormatStyle::BWACS_MultiLine and BeforeCatch/BeforeElse

Summary:
Found a bug introduced with BraceWrappingFlags AfterControlStatement MultiLine. This feature conflicts with the existing BeforeCatch and BeforeElse flags.

For example, our team uses BeforeElse.

if (foo ||
    bar) {
  doSomething();
}
else {
  doSomethingElse();
}

If we enable MultiLine (which we'd really love to do) we expect it to work like this:

if (foo ||
    bar)
{
  doSomething();
}
else {
  doSomethingElse();
}

What we actually get is:

if (foo ||
    bar)
{
  doSomething();
}
else
{
  doSomethingElse();
}

Reviewers: MyDeveloperDay, Bouska, mitchell-stellar

Patch by: pastey

Subscribers: Bouska, cfe-commits

Tags: clang

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

4 years ago[X86] Add extra PR43971 test case mentioned in D70267
Simon Pilgrim [Mon, 6 Jan 2020 13:44:55 +0000 (13:44 +0000)]
[X86] Add extra PR43971 test case mentioned in D70267

4 years ago[CostModel][X86] Add missing scalar i64->f32 uitofp costs
Simon Pilgrim [Mon, 6 Jan 2020 13:16:43 +0000 (13:16 +0000)]
[CostModel][X86] Add missing scalar i64->f32 uitofp costs

4 years ago[DAG] DAGCombiner::XformToShuffleWithZero - use APInt::extractBits helper. NFCI.
Simon Pilgrim [Mon, 6 Jan 2020 10:42:48 +0000 (10:42 +0000)]
[DAG] DAGCombiner::XformToShuffleWithZero - use APInt::extractBits helper. NFCI.

4 years ago[test][DebugInfo][NFC] Rename method for clarity
James Henderson [Fri, 3 Jan 2020 14:06:57 +0000 (14:06 +0000)]
[test][DebugInfo][NFC] Rename method for clarity

The checkGetOrParseLineTableEmitsError function could end up generating
both recoverable and unrecoverable errors, but it is only intended for
handling the latter.

Reviewed by: dblaikie

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

4 years ago[NFC] Fix trivial typos in comments
James Henderson [Mon, 6 Jan 2020 10:15:44 +0000 (10:15 +0000)]
[NFC] Fix trivial typos in comments

Reviewed By: jhenderson

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

Patch by Kazuaki Ishizaki.

4 years agoFix MSVC "not all control paths return a value" warning. NFCI.
Simon Pilgrim [Mon, 6 Jan 2020 10:20:20 +0000 (10:20 +0000)]
Fix MSVC "not all control paths return a value" warning. NFCI.

4 years ago[ARM][MVE] More MVETailPredication debug messages. NFC.
Sjoerd Meijer [Mon, 6 Jan 2020 09:56:02 +0000 (09:56 +0000)]
[ARM][MVE] More MVETailPredication debug messages. NFC.

I've added a few more debug messages to MVETailPredication because I wanted to
trace better which instructions are added/removed. And while I was at it, I
factored out one function which I thought was clearer, and have added some
comments to describe better the flow between MVETailPredication and
ARMLowOverheadLoops.

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

4 years agoAdd interface emitPrefix for MCCodeEmitter
Shengchen Kan [Tue, 31 Dec 2019 16:19:56 +0000 (00:19 +0800)]
Add interface emitPrefix for MCCodeEmitter

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

4 years ago[APFloat] Fix compilation warnings
Ehud Katz [Mon, 6 Jan 2020 08:51:55 +0000 (10:51 +0200)]
[APFloat] Fix compilation warnings

4 years ago[mlir] Update mlir/CMakeLists.txt to install *.def files
Kern Handa [Mon, 6 Jan 2020 09:01:59 +0000 (10:01 +0100)]
[mlir] Update mlir/CMakeLists.txt to install *.def files

This is needed to consume mlir after it has been installed of the source
tree. Without this, consuming mlir results a build error.

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

4 years agoAdd ExternalAAWrapperPass to createLegacyPMAAResults.
Neil Henning [Wed, 11 Dec 2019 13:20:42 +0000 (13:20 +0000)]
Add ExternalAAWrapperPass to createLegacyPMAAResults.

Our out-of-tree custom aliasing solution for the HPC# Burst compiler
here at Unity makes use of the `ExternalAAwrapperPass` infrastructure to
insert our custom aliasing resolution into the core of LLVM. This is
great for all cases except for function inlining, where because
`createLegacyPMAAResults` does not make use of `ExternalAAWrapperPass`,
when we have a definite no-alias result within a function it won't be
propagated to the calling function during inlining.

This commit just rectifies this oversight by adding the missing
dependency.

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