]> granicus.if.org Git - llvm/log
llvm
5 years ago[DAGCombiner] If a TokenFactor would be merged into its user, consider the user later.
Nirav Dave [Wed, 13 Mar 2019 17:07:09 +0000 (17:07 +0000)]
[DAGCombiner] If a TokenFactor would be merged into its user, consider the user later.

Summary:
A number of optimizations are inhibited by single-use TokenFactors not
being merged into the TokenFactor using it. This makes we consider if
we can do the merge immediately.

Most tests changes here are due to the change in visitation causing
minor reorderings and associated reassociation of paired memory
operations.

CodeGen tests with non-reordering changes:

  X86/aligned-variadic.ll -- memory-based add folded into stored leaq
  value.

  X86/constant-combiners.ll -- Optimizes out overlap between stores.

  X86/pr40631_deadstore_elision -- folds constant byte store into
  preceding quad word constant store.

Reviewers: RKSimon, craig.topper, spatel, efriedma, courbet

Reviewed By: courbet

Subscribers: dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, eraman, hiraditya, kbarton, jrtc27, atanasyan, jsji, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356068 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][AVX] Add X86ISD::VTRUNC handling to SimplifyDemandedVectorEltsForTargetNode
Simon Pilgrim [Wed, 13 Mar 2019 17:00:18 +0000 (17:00 +0000)]
[X86][AVX] Add X86ISD::VTRUNC handling to SimplifyDemandedVectorEltsForTargetNode

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356067 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][AVX] Add combineConcatVectors support to improve subvector handling
Simon Pilgrim [Wed, 13 Mar 2019 16:37:30 +0000 (16:37 +0000)]
[X86][AVX] Add combineConcatVectors support to improve subvector handling

Attempt to combine CONCAT_VECTORS nodes, which we only really have pre-legalization.

This encourages a lot of X86ISD::SUBV_BROADCAST generation, so I've added SimplifyDemandedVectorEltsForTargetNode handling for this at the same time.

The X86ISD::VTRUNC regression in shuffle-vs-trunc-256-widen.ll will be handled in a future commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356064 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Only mark fp as reserved if the function has a dedicated frame pointer
Alex Bradbury [Wed, 13 Mar 2019 16:33:45 +0000 (16:33 +0000)]
[RISCV] Only mark fp as reserved if the function has a dedicated frame pointer

This follows similar logic in the ARM and Mips backends, and allows the free
use of s0 in functions without a dedicated frame pointer. The changes in
callee-saved-gprs.ll most clearly show the effect of this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356063 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Add tests for callee-saved GPRs, FPR32s, and FPR64s
Alex Bradbury [Wed, 13 Mar 2019 16:14:16 +0000 (16:14 +0000)]
[RISCV] Add tests for callee-saved GPRs, FPR32s, and FPR64s

Note that s0 need not be marked reserved if the frame pointer isn't used. For
the ILP32 and LP64 soft float ABIS that are currently support, all FPRs are
always considered temporaries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356061 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[mips] Join some adjacent `let DecoderNamespace` blocks. NFC
Simon Atanasyan [Wed, 13 Mar 2019 16:00:42 +0000 (16:00 +0000)]
[mips] Join some adjacent `let DecoderNamespace` blocks. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356059 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][CMake] Improve Status message in the iOS toolchain file
Louis Dionne [Wed, 13 Mar 2019 15:35:21 +0000 (15:35 +0000)]
[NFC][CMake] Improve Status message in the iOS toolchain file

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356056 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64] Add test/CodeGen/AArch64/vecreduce-fadd.ll
Sander de Smalen [Wed, 13 Mar 2019 15:18:27 +0000 (15:18 +0000)]
[AArch64] Add test/CodeGen/AArch64/vecreduce-fadd.ll

This test is added to see difference created by:

  https://reviews.llvm.org/D59259

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356054 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[x86] limit extractelement of setcc to pre-legalization
Sanjay Patel [Wed, 13 Mar 2019 14:49:52 +0000 (14:49 +0000)]
[x86] limit extractelement of setcc to pre-legalization

A fuzzer found the crasher:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13700

The bug was introduced recently here:
rL355741

This is the quick fix. If we need to do this transform
later, then we'd have to extend/truncate the vector setcc
element type to the scalar setcc type (i8).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356053 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[mips] Fix encoding of the `mov.d` command for microMIPS R6
Simon Atanasyan [Wed, 13 Mar 2019 14:23:12 +0000 (14:23 +0000)]
[mips] Fix encoding of the `mov.d` command for microMIPS R6

Before this change LLVM emits non-microMIPS variant of the `mov.d`
command for microMIPS code.

Differential Revision: http://reviews.llvm.org/D59045

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356052 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[mips] Define `mov.d` instructions using `ABSS_M` multiclass. NFC
Simon Atanasyan [Wed, 13 Mar 2019 14:22:58 +0000 (14:22 +0000)]
[mips] Define `mov.d` instructions using `ABSS_M` multiclass. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356051 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRe-land r354244 "[DAGCombiner] Eliminate dead stores to stack."
Clement Courbet [Wed, 13 Mar 2019 13:56:23 +0000 (13:56 +0000)]
Re-land r354244 "[DAGCombiner] Eliminate dead stores to stack."

Always check candidates for hasOtherUses(), not only stores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356050 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix signed/unsigned mismatch warning. NFCI.
Simon Pilgrim [Wed, 13 Mar 2019 13:14:14 +0000 (13:14 +0000)]
Fix signed/unsigned mismatch warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356046 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[mips] Map SW instruction to its microMIPS R6 variant
Simon Atanasyan [Wed, 13 Mar 2019 13:09:30 +0000 (13:09 +0000)]
[mips] Map SW instruction to its microMIPS R6 variant

To provide mapping between standard and microMIPS R6 variants of the
`sw` command we have to rename SWSP_xxx commands from "sw" to "swsp".
Otherwise `tablegen` starts to show the error `Multiple matches found
for `SW'`. After that to restore printing SWSP command as `sw`, I add
an appropriate `MipsInstAlias` instance.

We also need to implement "size reduction" for microMIPS R6. But this
task is for separate patch. After that the `micromips-lwsp-swsp.ll` test
case will be extended.

Differential Revision: http://reviews.llvm.org/D59046

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356045 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Regenerate umulo-128-legalisation-lowering.ll
Alex Bradbury [Wed, 13 Mar 2019 12:33:44 +0000 (12:33 +0000)]
[RISCV] Regenerate umulo-128-legalisation-lowering.ll

Upstream changes have improved codegen, reducing stack usage. Regenerate the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356044 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][AVX] lowerShuffleAsBroadcast - improve load folding by avoiding bitcasts
Simon Pilgrim [Wed, 13 Mar 2019 12:20:39 +0000 (12:20 +0000)]
[X86][AVX] lowerShuffleAsBroadcast - improve load folding by avoiding bitcasts

AVX1 broadcasts were failing as we were adding bitcasts that caused MayFoldLoad's hasOneUse to return false.

This patch stops introducing bitcasts so early and also replaces the broadcast index scaling through bitcasts (which can't succeed in some cases) to instead just keep track of the bitoffset which can be converted back to the broadcast index later on.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356043 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAppease MSVC builds by #ifdef wrapping runAndGetCommandOutput tests. NFCI.
Simon Pilgrim [Wed, 13 Mar 2019 11:51:13 +0000 (11:51 +0000)]
Appease MSVC builds by #ifdef wrapping runAndGetCommandOutput tests. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356042 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo][Docs] Document how dbg.value intrinsics are interpreted in optimized...
Jeremy Morse [Wed, 13 Mar 2019 11:43:13 +0000 (11:43 +0000)]
[DebugInfo][Docs] Document how dbg.value intrinsics are interpreted in optimized code

This patch adds a section, ``Object lifetime in optimized code'', that
documents how such intrinsics are supposed to be handled. It sets out some of
the principles of how they specify variable locations, and how long those
locations are valid for.

This patch also documents one of the objectives behind the variable-location
design, that we should never allow the debugger to observe a state of the
program that would not have appeared without optimization.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356041 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAG] Move integer setcc %x, %x folding into FoldSetCC
Simon Pilgrim [Wed, 13 Mar 2019 11:08:57 +0000 (11:08 +0000)]
[DAG] Move integer setcc %x, %x folding into FoldSetCC

First step towards PR40800 - I intend to move the float case in a separate future patch.

I had to tweak the (overly reduced) thumb2 test and the x86 widening test change is annoying (no longer rematerializable) but we should address this separately.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356040 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MIPS][microMIPS] Fix PseudoMTLOHI_MM matching and expansion
Simon Atanasyan [Wed, 13 Mar 2019 11:04:38 +0000 (11:04 +0000)]
[MIPS][microMIPS] Fix PseudoMTLOHI_MM matching and expansion

On micromips MipsMTLOHI is always matched to PseudoMTLOHI_DSP regardless
of +dsp argument. This patch checks is HasDSP predicate is present for
PseudoMTLOHI_DSP so PseudoMTLOHI_MM can be matched when appropriate.

Add expansion of PseudoMTLOHI_MM instruction into a mtlo/mthi pair.

Patch by Mirko Brkusanin.

Differential Revision: http://reviews.llvm.org/D59203

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356039 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[mips] Fix CPU used in the test case to suppress warning. NFC
Simon Atanasyan [Wed, 13 Mar 2019 11:04:28 +0000 (11:04 +0000)]
[mips] Fix CPU used in the test case to suppress warning. NFC

The MSA ASE used in in the test case requires MIPS32 revision 5 or
greater while the test uses MIPS32 revision 1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356038 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ELF] Fix GCC8 warnings about "fall through", NFCI
Jonas Hahnfeld [Wed, 13 Mar 2019 10:38:17 +0000 (10:38 +0000)]
[ELF] Fix GCC8 warnings about "fall through", NFCI

Add break statements in Object/ELF.cpp since the code should consider the
generic tags for Hexagon, MIPS, and PPC. Add a test (copied from llvm-readobj)
to show that this works correctly (earlier versions of this patch would have
asserted).

The warnings in X86ELFObjectWriter.cpp are actually false-positives since
the nested switch() handles all possible values and returns in all cases.
Make this explicit by adding llvm_unreachable's.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356037 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Support] Treat truncation of fullpath as error
Jonas Hahnfeld [Wed, 13 Mar 2019 10:37:56 +0000 (10:37 +0000)]
[Support] Treat truncation of fullpath as error

If the concatenation of arguments dir and bin has at least PATH_MAX
characters the call to snprintf will truncate. The result will usually
not exist, but if it does it's actually incorrect to return that the
path exists.
(Motivated by GCC compiler warning about format truncation.)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356036 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Replace incorrect use of sizeof with array_lengthof
Alex Bradbury [Wed, 13 Mar 2019 09:22:57 +0000 (09:22 +0000)]
[RISCV] Replace incorrect use of sizeof with array_lengthof

RISCVDisassembler was incorrectly using sizeof(Arr) when it should have used
sizeof(Arr)/sizeof(Arr[0]). Update to use array_lengthof instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356035 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[clang-format] [PR25010] AllowShortIfStatementsOnASingleLine not working...
Paul Hoad [Wed, 13 Mar 2019 08:15:03 +0000 (08:15 +0000)]
Revert "[clang-format] [PR25010] AllowShortIfStatementsOnASingleLine not working if an "else" statement is present"

This reverts commit b358cbb9b78389e20f7be36e1a98e26515c3ecce.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356030 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang-format] [PR25010] AllowShortIfStatementsOnASingleLine not working if an "else...
Paul Hoad [Wed, 13 Mar 2019 08:07:46 +0000 (08:07 +0000)]
[clang-format] [PR25010] AllowShortIfStatementsOnASingleLine not working if an "else" statement is present

Summary:
Addressing: PR25010 - https://bugs.llvm.org/show_bug.cgi?id=25010

Code like:

```
    if(true) var++;
    else  {
        var--;
    }
```

is reformatted to be

```
  if (true)
    var++;
  else {
    var--;
  }
```

Even when `AllowShortIfStatementsOnASingleLine` is true

The following revision comes from a +1'd suggestion in the PR to support AllowShortIfElseStatementsOnASingleLine

This suppresses the clause prevents the merging of the if when there is a compound else

Reviewers: klimek, djasper, JonasToth, alexfh, krasimir, reuk
Reviewed By: reuk
Subscribers: reuk, Higuoxing, jdoerfert, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D59087

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356029 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ImplicitNullChecks] Support unordered atomic accesses
Philip Reames [Wed, 13 Mar 2019 03:25:20 +0000 (03:25 +0000)]
[ImplicitNullChecks] Support unordered atomic accesses

Update the INC pass to allow folding unordered atomics.  This is the first optimization unblocked by the changes landed from D57601.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356006 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tests] Expand implicit null check coverage
Philip Reames [Wed, 13 Mar 2019 03:17:58 +0000 (03:17 +0000)]
[Tests] Expand implicit null check coverage

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356004 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[llvm] Skip over empty line table entries."
Evgeniy Stepanov [Wed, 13 Mar 2019 01:37:58 +0000 (01:37 +0000)]
Revert "[llvm] Skip over empty line table entries."

This reverts commit r355972.
See the discussion at https://reviews.llvm.org/D58952.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356001 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Enable printAliasInstr for the Intel assembly printer so that AAM and AAD will...
Craig Topper [Wed, 13 Mar 2019 00:43:03 +0000 (00:43 +0000)]
[X86] Enable printAliasInstr for the Intel assembly printer so that AAM and AAD will print without an immediate when the immediate is 10.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355997 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Place 'try' and 'catch' correctly wrt EH_LABELs
Heejin Ahn [Wed, 13 Mar 2019 00:37:31 +0000 (00:37 +0000)]
[WebAssembly] Place 'try' and 'catch' correctly wrt EH_LABELs

Summary:
After instruction selection phase, possibly-throwing calls, which were
previously invoke, are wrapped in `EH_LABEL` instructions. For example:
```
  EH_LABEL <mcsymbol .Ltmp0>
  CALL_VOID @foo ...
  EH_LABEL <mcsymbol .Ltmp1>
```

`EH_LABEL` is placed also in the beginning of EH pads:
```
bb.1 (landing-pad):
  EH_LABEL <mcsymbol .Ltmp2>
  ...
```

And we'd like to maintian this relationship, so when we place a `try`,
```
  TRY ...
  EH_LABEL <mcsymbol .Ltmp0>
  CALL_VOID @foo ...
  EH_LABEL <mcsymbol .Ltmp1>
```

When we place a `catch`,
```
bb.1 (landing-pad):
  EH_LABEL <mcsymbol .Ltmp2>
  %0:except_ref = CATCH ...
  ...
```

Previously we didn't treat EH_LABELs specially, so `try` was placed
right before a call, and `catch` was placed in the beginning of an EH
pad.

Reviewers: dschuff

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355996 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUse AIX version detection at LLVM run-time
Hubert Tong [Wed, 13 Mar 2019 00:12:43 +0000 (00:12 +0000)]
Use AIX version detection at LLVM run-time

Summary:
AIX compilers define macros based on the version of the operating
system.

This patch implements updating of versionless AIX triples to include the
host AIX version. Also, the host triple detection in the build system is
adjusted to strip the AIX version information so that the run-time
detection is preferred.

Reviewers: xingxue, stefanp, nemanjai, jasonliu

Reviewed By: xingxue

Subscribers: mgorny, kristina, jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355995 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add ImmArg markings to intrinsics.
Craig Topper [Tue, 12 Mar 2019 23:48:07 +0000 (23:48 +0000)]
[X86] Add ImmArg markings to intrinsics.

Remove test cases that checked for not crashing when immediate operands were passed not an immediate. These are now considered ill-formed in IR.

This was done by manually scanning the intrinsic file for llvm_i32_ty and llvm_i8_ty which are the predominant types we use for immediates. Most of them are on vector intrinsics. I might have missed some other intrinsics.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355993 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd XCOFF triple object format type for AIX
Jason Liu [Tue, 12 Mar 2019 22:01:10 +0000 (22:01 +0000)]
Add XCOFF triple object format type for AIX

This patch adds an XCOFF triple object format type into LLVM.
This XCOFF triple object file type will be used later by object file and assembly generation for the AIX platform.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355989 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReland "[Remarks] Add -foptimization-record-passes to filter remark emission"
Francis Visoiu Mistrih [Tue, 12 Mar 2019 21:22:27 +0000 (21:22 +0000)]
Reland "[Remarks] Add -foptimization-record-passes to filter remark emission"

Currently we have -Rpass for filtering the remarks that are displayed as
diagnostics, but when using -fsave-optimization-record, there is no way
to filter the remarks while generating them.

This adds support for filtering remarks by passes using a regex.
Ex: `clang -fsave-optimization-record -foptimization-record-passes=inline`

will only emit the remarks coming from the pass `inline`.

This adds:

* `-fsave-optimization-record` to the driver
* `-opt-record-passes` to cc1
* `-lto-pass-remarks-filter` to the LTOCodeGenerator
* `--opt-remarks-passes` to lld
* `-pass-remarks-filter` to llc, opt, llvm-lto, llvm-lto2
* `-opt-remarks-passes` to gold-plugin

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

Original llvm-svn: 355964

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355984 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Test] Add tests for implicit null checks on atomic/volatile instructions
Philip Reames [Tue, 12 Mar 2019 21:09:58 +0000 (21:09 +0000)]
[Test] Add tests for implicit null checks on atomic/volatile instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355983 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFor faulting ops, include a comment w/the fault destination
Philip Reames [Tue, 12 Mar 2019 21:05:31 +0000 (21:05 +0000)]
For faulting ops, include a comment w/the fault destination

A faulting_op is one that has specified behavior when a fault occurs, generally redirecting control flow to another location.  This change just adds a comment to the assembly output which makes it both human readable, and machine checkable w/o having to parse the FaultMap section.  This is used to split a test file into two parts, so that I can (in a near future commit) easily extend the test file to demonstrate another case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355982 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoIR: Add immarg attribute
Matt Arsenault [Tue, 12 Mar 2019 21:02:54 +0000 (21:02 +0000)]
IR: Add immarg attribute

This indicates an intrinsic parameter is required to be a constant,
and should not be replaced with a non-constant value.

Add the attribute to all AMDGPU and generic intrinsics that comments
indicate it should apply to. I scanned other target intrinsics, but I
don't see any obvious comments indicating which arguments are intended
to be only immediates.

This breaks one questionable testcase for the autoupgrade. I'm unclear
on whether the autoupgrade is supposed to really handle declarations
which were never valid. The verifier fails because the attributes now
refer to a parameter past the end of the argument list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355981 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[Remarks] Add -foptimization-record-passes to filter remark emission"
Francis Visoiu Mistrih [Tue, 12 Mar 2019 20:54:18 +0000 (20:54 +0000)]
Revert "[Remarks] Add -foptimization-record-passes to filter remark emission"

This reverts commit 20fff32b7d1f1a1bd417b22aa9f26ededd97a3e5.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355976 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm] Skip over empty line table entries.
Mircea Trofin [Tue, 12 Mar 2019 20:48:45 +0000 (20:48 +0000)]
[llvm] Skip over empty line table entries.

Summary:
This is similar to how addr2line handles consecutive entries with the
same address - pick the last one.

Reviewers: dblaikie, friss, JDevlieghere

Reviewed By: dblaikie

Subscribers: ormris, echristo, JDevlieghere, probinson, aprantl, hiraditya, rupprecht, jdoerfert, llvm-commits

Tags: #llvm, #debug-info

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355972 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix missing C++ mode comments
Matt Arsenault [Tue, 12 Mar 2019 20:42:14 +0000 (20:42 +0000)]
Fix missing C++ mode comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355971 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMIR: Stop reinitializing target information for every use
Matt Arsenault [Tue, 12 Mar 2019 20:42:12 +0000 (20:42 +0000)]
MIR: Stop reinitializing target information for every use

Every time a physical register reference was parsed, this would
initialize a string map for every register in in target, and discard
it for the next. The same applies for the other fields initialized
from target information.

Follow along with how the function state is tracked, and add a new
tracking class for target information.

The string->register class/register bank for some reason were kept
separately, so track them in the same place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355970 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Remarks] Add -foptimization-record-passes to filter remark emission
Francis Visoiu Mistrih [Tue, 12 Mar 2019 20:28:50 +0000 (20:28 +0000)]
[Remarks] Add -foptimization-record-passes to filter remark emission

Currently we have -Rpass for filtering the remarks that are displayed as
diagnostics, but when using -fsave-optimization-record, there is no way
to filter the remarks while generating them.

This adds support for filtering remarks by passes using a regex.
Ex: `clang -fsave-optimization-record -foptimization-record-passes=inline`

will only emit the remarks coming from the pass `inline`.

This adds:

* `-fsave-optimization-record` to the driver
* `-opt-record-passes` to cc1
* `-lto-pass-remarks-filter` to the LTOCodeGenerator
* `--opt-remarks-passes` to lld
* `-pass-remarks-filter` to llc, opt, llvm-lto, llvm-lto2
* `-opt-remarks-passes` to gold-plugin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355964 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SROA] Fix a crash when trying to convert a memset to an non-integral pointer type
Philip Reames [Tue, 12 Mar 2019 20:15:05 +0000 (20:15 +0000)]
[SROA] Fix a crash when trying to convert a memset to an non-integral pointer type

The included test case currently crashes on tip of tree. Rather than adding a bailout, I chose to restructure the code so that the existing helper function could be used. Given that, the majority of the diff is NFC-ish, but the key difference is that canConvertValue returns false when only one side is a non-integral pointer.

Thanks to Cherry Zhang for the test case.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355962 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[x86] scalarize extractelement 0 of FP vselect
Sanjay Patel [Tue, 12 Mar 2019 19:20:45 +0000 (19:20 +0000)]
[x86] scalarize extractelement 0 of FP vselect

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355955 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeGen] Add MMOs to statepoint nodes during SelectionDAG
Philip Reames [Tue, 12 Mar 2019 19:12:33 +0000 (19:12 +0000)]
[CodeGen] Add MMOs to statepoint nodes during SelectionDAG

The existing statepoint lowering code does something odd; it adds machine memory operands post instruction selection. This was copied from the stackmap/patchpoint implementation, but appears to be non-idiomatic.

This change is largely NFC. It moves the MMO creation logic into SelectionDAG building. It ends up not quite being NFC because the size of the stack slot is reflected in the MMO. The old code blindly used pointer size for the MMO size, which appears to have always been incorrect for larger values. It just happened nothing actually relied on the MMOs, so it worked out okay.

For context, I'm planning on removing the MOVolatile flag from these in a future commit, and then removing the MOStore flag from deopt spill slots in a separate one. Doing so is motivated by a small test case where we should be able to better schedule spill slots, but don't do so due to a memory use/def implied by the statepoint.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355953 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SCEV] Use depth limit for trunc analysis
Teresa Johnson [Tue, 12 Mar 2019 18:28:05 +0000 (18:28 +0000)]
[SCEV] Use depth limit for trunc analysis

Summary:
This fixes an extremely long compile time caused by recursive analysis
of truncs, which were not previously subject to any depth limits unlike
some of the other ops. I decided to use the same control used for
sext/zext, since the routines analyzing these are sometimes mutually
recursive with the trunc analysis.

Reviewers: mkazantsev, sanjoy

Subscribers: sanjoy, jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355949 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSet useful flags for vector imm setting instructions
Jinsong Ji [Tue, 12 Mar 2019 18:27:09 +0000 (18:27 +0000)]
Set useful flags for vector imm setting instructions

Vector imm setting instructions like XXLXORz/XXLXORspz/XXLXORdpz
Should behave like LI8.

We should set corresponding flags to allow rematerialization and other
opts in LICM, RA, Scheduling etc.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355948 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SanitizerCoverage] Avoid splitting critical edges when destination is a basic block...
Craig Topper [Tue, 12 Mar 2019 18:20:25 +0000 (18:20 +0000)]
[SanitizerCoverage] Avoid splitting critical edges when destination is a basic block containing unreachable

This patch adds a new option to SplitAllCriticalEdges and uses it to avoid splitting critical edges when the destination basic block ends with unreachable. Otherwise if we split the critical edge, sanitizer coverage will instrument the new block that gets inserted for the split. But since this block itself shouldn't be reachable this is pointless. These basic blocks will stick around and generate assembly, but they don't end in sane control flow and might get placed at the end of the function. This makes it look like one function has code that flows into the next function.

This showed up while compiling the linux kernel with clang. The kernel has a tool called objtool that detected the code that appeared to flow from one function to the next. https://github.com/ClangBuiltLinux/linux/issues/351#issuecomment-461698884

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355947 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV][MC] Find matching pcrel_hi fixup in more cases.
Eli Friedman [Tue, 12 Mar 2019 18:14:16 +0000 (18:14 +0000)]
[RISCV][MC] Find matching pcrel_hi fixup in more cases.

If a symbol points to the end of a fragment, instead of searching for
fixups in that fragment, search in the next fragment.

Fixes spurious assembler error with subtarget change next to "la"
pseudo-instruction, or expanded equivalent.

Alternate proposal to fix the problem discussed in
https://reviews.llvm.org/D58759.

Testcase by Ana Pazos.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355946 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][PowerPC] Update testcases using utils/update_llc_test_checks.py
Jinsong Ji [Tue, 12 Mar 2019 17:55:32 +0000 (17:55 +0000)]
[NFC][PowerPC] Update testcases using utils/update_llc_test_checks.py

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355945 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTest commit: add a blank line in test case ppc64-dq-expr.s
Jason Liu [Tue, 12 Mar 2019 17:33:07 +0000 (17:33 +0000)]
Test commit: add a blank line in test case ppc64-dq-expr.s

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355942 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[yaml2obj]Allow explicit symbol indexes in relocations and emit error for bad names
James Henderson [Tue, 12 Mar 2019 17:00:25 +0000 (17:00 +0000)]
[yaml2obj]Allow explicit symbol indexes in relocations and emit error for bad names

Prior to this change, the "Symbol" field of a relocation would always be
assumed to be a symbol name, and if no such symbol existed, the
relocation would reference index 0. This confused me when I tried to use
a literal symbol index in the field: since "0x1" was not a known symbol
name, the symbol index was set as 0. This change falls back to treating
unknown symbol names as integers, and emits an error if the name is not
found and the string is not an integer.

Note that the Symbol field is optional, so if a relocation doesn't
reference a symbol, it shouldn't be specified. The new error required a
number of test updates.

Reviewed by: grimar, ruiu
Differential Revision: https://reviews.llvm.org/D58510

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355938 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SDAG] Expand pow2 mulo using shifts
Nikita Popov [Tue, 12 Mar 2019 16:57:25 +0000 (16:57 +0000)]
[SDAG] Expand pow2 mulo using shifts

Expand MULO with constant power of two operand into a shift. The
overflow is checked with (x << shift) >> shift == x, where the right
shift will be logical for umulo and arithmetic for smulo (with
exception for multiplications by signed_min).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355937 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Arrange more CPU features to inherit from earlier CPUs. NFCI
Craig Topper [Tue, 12 Mar 2019 16:35:30 +0000 (16:35 +0000)]
[X86] Arrange more CPU features to inherit from earlier CPUs. NFCI

This makes SandyBridge inherit back to Westmere/Nehalem.

Make bdver1-4 inherit from each other and btver2 inherit from btver1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355935 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRegenerate sign_extend.ll test.
Simon Pilgrim [Tue, 12 Mar 2019 16:00:59 +0000 (16:00 +0000)]
Regenerate sign_extend.ll test.

This will change as part of the fix for the regressions in D58017.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355933 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAGCombine] Pull out repeated demanded bitmask generation. NFCI.
Simon Pilgrim [Tue, 12 Mar 2019 15:58:28 +0000 (15:58 +0000)]
[DAGCombine] Pull out repeated demanded bitmask generation. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355932 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Docs] Add note about legacy PM to Ch4 of tutorial
Kristina Brooks [Tue, 12 Mar 2019 15:44:18 +0000 (15:44 +0000)]
[Docs] Add note about legacy PM to Ch4 of tutorial

Add a note about legacy FunctionPassManager to the LLVM tutorial.

It seems to confuse some people, worth adding a warning to the tutorial
to elaborate and suggest using `llvm::legacy::FunctionPassManager` for
now. Not a perfect solution but hopefully will avoid confusion
in the meantime.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355930 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-cxxfilt]Add test to show that empty lines can be handled
James Henderson [Tue, 12 Mar 2019 15:42:38 +0000 (15:42 +0000)]
[llvm-cxxfilt]Add test to show that empty lines can be handled

I recently discovered a bug in llvm-cxxfilt introduced in r353743 but
was fixed later incidentally due to r355031. Specifically, llvm-cxxfilt
was attempting to call .back() on an empty string any time there was a
new line in the input. This was causing a crash in my debug builds only.
This patch simply adds a test that explicitly tests that llvm-cxxfilt
handles empty lines correctly. It may pass under release builds under
the broken behaviour, but it fails at least in debug builds.

Reviewed by: mattd

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355929 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[FileCheck]Remove assertions that prevent matching an empty string at file start...
James Henderson [Tue, 12 Mar 2019 15:37:34 +0000 (15:37 +0000)]
[FileCheck]Remove assertions that prevent matching an empty string at file start before CHECK-NEXT/SAME

This patch removes two assertions that were preventing writing of a test
that checked an empty line followed by some text. For example:

CHECK: {{^$}}
CHECK-NEXT: foo()

The assertion was because the current location the CHECK-NEXT was
scanning from was the start of the buffer. A similar issue occurred with
CHECK-SAME. These assertions don't protect against anything, as there is
already an error check that checks that CHECK-NEXT/EMPTY/SAME don't
appear first in the checks, and the following code works fine if the
pointer is at the start of the input.

Reviewed by: probinson, thopre, jdenny
Differential Revision: https://reviews.llvm.org/D58784

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355928 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoCodeGenPrep: preserve inbounds attribute when sinking GEPs.
Tim Northover [Tue, 12 Mar 2019 15:22:23 +0000 (15:22 +0000)]
CodeGenPrep: preserve inbounds attribute when sinking GEPs.

Targets can potentially emit more efficient code if they know address
computations never overflow. For example ILP32 code on AArch64 (which only has
64-bit address computation) can ignore the possibility of overflow with this
extra information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355926 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[format] \t => ' '
Liang Zou [Tue, 12 Mar 2019 14:48:32 +0000 (14:48 +0000)]
[format] \t => '  '

Summary:
1. \t => '  '
2. test commit access

Reviewers: Higuoxing, liangdzou

Reviewed By: Higuoxing, liangdzou

Subscribers: kristina, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355924 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-readobj] Print symbol version when dumping relocations (PR31564)
Xing GUO [Tue, 12 Mar 2019 14:30:13 +0000 (14:30 +0000)]
[llvm-readobj] Print symbol version when dumping relocations (PR31564)

Summary: This helps resolve https://bugs.llvm.org/show_bug.cgi?id=31564

Reviewers: jhenderson, grimar

Reviewed By: jhenderson

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355922 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SimplifyLibCalls] Simplify optimizePuts
Fangrui Song [Tue, 12 Mar 2019 14:20:22 +0000 (14:20 +0000)]
[SimplifyLibCalls] Simplify optimizePuts

The code might intend to replace puts("") with putchar('\n') even if the
return value is used. It failed because use_empty() was used to guard
the whole block. While returning '\n' (putchar('\n')) is technically
correct (puts is only required to return a nonnegative number on
success), doing this looks weird and there is really little benefit to
optimize puts whose return value is used. So don't do that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355921 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][PowerPC]Assert when trying to generate directmove below P8.
Jinsong Ji [Tue, 12 Mar 2019 14:01:29 +0000 (14:01 +0000)]
[NFC][PowerPC]Assert when trying to generate directmove below P8.

This was found when we generated COPY from G8RC to F8RC in
EmitInstrWithCustomInserter without checking proper architecture,
we silently generated mtvsrd, which require P8 and up.

This is a NFC patch to add assert when we call copyPhysReg, in case
someone accidentally generate COPY between G8RC to F8RC for P7 and
below.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355920 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[XRay][docs] Fix option name
Fangrui Song [Tue, 12 Mar 2019 13:44:42 +0000 (13:44 +0000)]
[XRay][docs] Fix option name

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355917 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objcopy] Remove unneeded checks. NFC
Eugene Leviant [Tue, 12 Mar 2019 12:41:06 +0000 (12:41 +0000)]
[llvm-objcopy] Remove unneeded checks. NFC

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355914 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert rL355906: [SLP] Remove redundancy of performing operand reordering twice:...
Simon Pilgrim [Tue, 12 Mar 2019 11:51:59 +0000 (11:51 +0000)]
Revert rL355906: [SLP] Remove redundancy of performing operand reordering twice: once in buildTree() and later in vectorizeTree().

This is a refactoring patch that removes the redundancy of performing operand reordering twice, once in buildTree() and later in vectorizeTree().
To achieve this we need to keep track of the operands within the TreeEntry struct while building the tree, and later in vectorizeTree() we are just accessing them from the TreeEntry in the right order.

This patch is the first in a series of patches that will allow for better operand reordering across chains of instructions (e.g., a chain of ADDs), as presented here: https://www.youtube.com/watch?v=gIEn34LvyNo

Patch by: @vporpo (Vasileios Porpodas)

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

Reverted due to buildbot failures that I don't have time to track down.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355913 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTry to fix SLPVectorizer BoUpSLP::BoEdgeInfo::dump visibility on non-debug builds
Simon Pilgrim [Tue, 12 Mar 2019 11:31:06 +0000 (11:31 +0000)]
Try to fix SLPVectorizer BoUpSLP::BoEdgeInfo::dump visibility on non-debug builds

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355912 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM][NFC] Delete original smlad tests
Sam Parker [Tue, 12 Mar 2019 11:06:15 +0000 (11:06 +0000)]
[ARM][NFC] Delete original smlad tests

Because I don't understand svn.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355908 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM][NFC] Move smlad tests
Sam Parker [Tue, 12 Mar 2019 11:01:11 +0000 (11:01 +0000)]
[ARM][NFC] Move smlad tests

Created a test/CodeGen/ARM/ParallelDSP folder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355907 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SLP] Remove redundancy of performing operand reordering twice: once in buildTree...
Simon Pilgrim [Tue, 12 Mar 2019 10:51:51 +0000 (10:51 +0000)]
[SLP] Remove redundancy of performing operand reordering twice: once in buildTree() and later in vectorizeTree().

This is a refactoring patch that removes the redundancy of performing operand reordering twice, once in buildTree() and later in vectorizeTree().
To achieve this we need to keep track of the operands within the TreeEntry struct while building the tree, and later in vectorizeTree() we are just accessing them from the TreeEntry in the right order.

This patch is the first in a series of patches that will allow for better operand reordering across chains of instructions (e.g., a chain of ADDs), as presented here: https://www.youtube.com/watch?v=gIEn34LvyNo

Patch by: @vporpo (Vasileios Porpodas)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355906 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SimplifyLibCalls] Fix comments about fputs, memchr, and s[n]printf. NFC
Fangrui Song [Tue, 12 Mar 2019 10:31:52 +0000 (10:31 +0000)]
[SimplifyLibCalls] Fix comments about fputs, memchr, and s[n]printf. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355905 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CGP] Fix UB when GEP is bound to trivial PHINode
Eugene Leviant [Tue, 12 Mar 2019 10:10:29 +0000 (10:10 +0000)]
[CGP] Fix UB when GEP is bound to trivial PHINode

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355904 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Add support for immediate operand for S_ENDPGM
David Stuttard [Tue, 12 Mar 2019 09:52:58 +0000 (09:52 +0000)]
[AMDGPU] Add support for immediate operand for S_ENDPGM

Summary:
Add support for immediate operand in S_ENDPGM

Change-Id: I0c56a076a10980f719fb2a8f16407e9c301013f6

Reviewers: alexshap

Subscribers: qcolombet, arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, tpr, t-tye, eraman, arphaman, Petar.Avramovic, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355902 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TTI] Enable analysis of clib functions in getIntrinsicCosts. NFCI.
Sjoerd Meijer [Tue, 12 Mar 2019 09:48:02 +0000 (09:48 +0000)]
[TTI] Enable analysis of clib functions in getIntrinsicCosts. NFCI.

This is addressing the issue that we're not modeling the cost of clib functions
in TTI::getIntrinsicCosts and thus we're basically addressing this fixme:

// FIXME: This is wrong for libc intrinsics.

To enable analysis of clib functions, we not only need an intrinsic ID and
formal arguments, but also the actual user of that function so that we can e.g.
look at alignment and values of arguments. So, this is the initial plumbing to
pass the user of an intrinsinsic on to getCallCosts, which queries
getIntrinsicCosts.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355901 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TableGen] Allow 2^63-1 and 2^63-2 as int literals.
Simon Tatham [Tue, 12 Mar 2019 09:28:19 +0000 (09:28 +0000)]
[TableGen] Allow 2^63-1 and 2^63-2 as int literals.

These two values correspond to the 'Empty' and 'Tombstone' special
keys defined by DenseMapInfo<int64_t>, which means that neither one
can be used as a key in DenseMap<int64_t, anything>. Hence, if you try
to use either of those values as an int literal, IntInit::get() fails
an assertion when it tries to insert them into its static cache of
int-literal objects.

Fixed by replacing the DenseMap with a std::map, which doesn't intrude
on the space of legal values of the key type.

Reviewers: nhaehnle, hfinkel, javedabsar, efriedma

Reviewed By: efriedma

Subscribers: fhahn, efriedma, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355900 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Add test cases for the lp64 ABI
Alex Bradbury [Tue, 12 Mar 2019 09:26:53 +0000 (09:26 +0000)]
[RISCV] Add test cases for the lp64 ABI

These are closely modeled on similar tests for the ilp32 ABI. Like those
tests, we group together tests that should be common cross lp64, lp64+lp64f,
and lp64+lp64f+lp64d ABIs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355899 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix git-llvm crashing when trying to remove directory while cleaning
Raphael Isemann [Tue, 12 Mar 2019 07:40:54 +0000 (07:40 +0000)]
Fix git-llvm crashing when trying to remove directory while cleaning

Summary:
I'm trying to push D59198 but it seems that `git-llvm push` can't handle the fact
that I add a new directory in the patch:

```
> git llvm push -n
Pushing 1 commit:
  e7c0a9bd136 Correctly look up declarations in inline namespaces
Traceback (most recent call last):
  File "llvm/utils/git-svn//git-llvm", line 431, in <module>
    args.func(args)
  File "llvm/utils/git-svn//git-llvm", line 385, in cmd_push
    clean_svn(svn_root)
  File "llvm/utils/git-svn//git-llvm", line 201, in clean_svn
    os.remove(os.path.join(svn_repo, filename))
IsADirectoryError: [Errno 21] Is a directory: '.git/llvm-upstream-svn/lldb/trunk/packages/Python/lldbsuite/test/expression_command/inline-namespace'
```

This patch just uses shutil to delete the directory instead of trying to use `os.remove`
which only works for files.

Reviewers: mehdi_amini, jlebar

Reviewed By: jlebar

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355896 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoVery minor typo. NFC
Kristina Brooks [Tue, 12 Mar 2019 07:08:19 +0000 (07:08 +0000)]
Very minor typo. NFC

Typo `we we're` => `we were` in the pass EarlyCSE

Patch by liangdzou (Liang ZOU)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355895 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agollvm-objcopy: Remove unused field. NFCI.
Peter Collingbourne [Tue, 12 Mar 2019 02:17:01 +0000 (02:17 +0000)]
llvm-objcopy: Remove unused field. NFCI.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355892 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReland "Relax constraints for reduction vectorization"
Sanjoy Das [Tue, 12 Mar 2019 01:31:44 +0000 (01:31 +0000)]
Reland "Relax constraints for reduction vectorization"

Change from original commit: move test (that uses an X86 triple) into the X86
subdirectory.

Original description:
Gating vectorizing reductions on *all* fastmath flags seems unnecessary;
`reassoc` should be sufficient.

Reviewers: tvvikram, mkuper, kristof.beyls, sdesmalen, Ayal

Reviewed By: sdesmalen

Subscribers: dcaballe, huntergr, jmolloy, mcrosier, jlebar, bixia, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355889 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd Swift enumerator value for CodeView::SourceLanguage
Nathan Lanza [Mon, 11 Mar 2019 23:27:59 +0000 (23:27 +0000)]
Add Swift enumerator value for CodeView::SourceLanguage

Summary:
Swift now generates PDBs for debugging on Windows. llvm and lldb
need a language enumerator value too properly handle the output
emitted by swiftc.

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355882 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoHexagon RDF: Replace function template (plus explicit specializations) with non-templ...
David Blaikie [Mon, 11 Mar 2019 23:10:33 +0000 (23:10 +0000)]
Hexagon RDF: Replace function template (plus explicit specializations) with non-template overloads

For the design in question, overloads seem to be a much simpler and less subtle solution.

This removes ODR issues, and errors of the kind where code that uses the
specialization in question will accidentally and erroneously specialize
the primary template. This only "works" by accident; the program is
ill-formed NDR.

(Found with -Wundefined-func-template.)

Patch by Thomas Köppe!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355880 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "Relax constraints for reduction vectorization"
Sanjoy Das [Mon, 11 Mar 2019 22:37:31 +0000 (22:37 +0000)]
Revert "Relax constraints for reduction vectorization"

This reverts commit r355868.  Breaks hexagon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355873 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Remove ProcModel and ProcFeatures tablegen classes. Move all feature lists...
Craig Topper [Mon, 11 Mar 2019 22:29:00 +0000 (22:29 +0000)]
[X86] Remove ProcModel and ProcFeatures tablegen classes. Move all feature lists into a ProcessorFeatures class.

ProcFeatures was a class that just concatenated two feature lists together and gave it a name. We used it to inherit features between CPUs.

ProcModel took a two CPU feature lists and concatenated them before deferring to ProcessorModel. This was to allow inherited features and specific features to be passed to each CPU.

Both of these allowed for only very rigid CPU inheritance rules.

With this patch we now store all of the lists we were using for inheritance in one object and do any list oncatenation we want there. Then we just pass whatever list we want from this class into the ProcessorModel class for each CPU.

Hopefully this gives us more flexibility to build up feature lists in whatever ways we think make sense. Perhaps untangling ISA flags and tuning flags.

I've only touched the CPUs that were directly affected by the removal of the ProcModel and ProcFeatures classes. We should move more of the feature lists into ProcessorFeatures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355872 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRecommit "[GlobalISel][AArch64] Add selection support for G_EXTRACT_VECTOR_ELT"
Jessica Paquette [Mon, 11 Mar 2019 22:18:01 +0000 (22:18 +0000)]
Recommit "[GlobalISel][AArch64] Add selection support for G_EXTRACT_VECTOR_ELT"

After r355865, we should be able to safely select G_EXTRACT_VECTOR_ELT without
running into any problematic intrinsics.

Also add a fix for lane copies, which don't support index 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355871 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove ASan asm instrumentation.
Evgeniy Stepanov [Mon, 11 Mar 2019 21:50:10 +0000 (21:50 +0000)]
Remove ASan asm instrumentation.

Summary: It is incomplete and has no users AFAIK.

Reviewers: pcc, vitalybuka

Subscribers: srhines, kubamracek, mgorny, krytarowski, eraman, hiraditya, jdoerfert, #sanitizers, llvm-commits, thakis

Tags: #sanitizers, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355870 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Do a sign-extension in a compare-and-swap of 32 bit in RV64A
Alex Bradbury [Mon, 11 Mar 2019 21:41:22 +0000 (21:41 +0000)]
[RISCV] Do a sign-extension in a compare-and-swap of 32 bit in RV64A

AtomicCmpSwapWithSuccess is legalised into an AtomicCmpSwap plus a comparison.
This requires an extension of the value which, by default, is a
zero-extension. When we later lower AtomicCmpSwap into a PseudoCmpXchg32 and then expanded in
RISCVExpandPseudoInsts.cpp, the lr.w instruction does a sign-extension.

This mismatch of extensions causes the comparison to fail when the compared
value is negative. This change overrides TargetLowering::getExtendForAtomicOps
for RISC-V so it does a sign-extension instead.

Differential Revision: https://reviews.llvm.org/D58829
Patch by Ferran Pallarès Roca.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355869 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRelax constraints for reduction vectorization
Sanjoy Das [Mon, 11 Mar 2019 21:36:41 +0000 (21:36 +0000)]
Relax constraints for reduction vectorization

Summary:
Gating vectorizing reductions on *all* fastmath flags seems unnecessary;
`reassoc` should be sufficient.

Reviewers: tvvikram, mkuper, kristof.beyls, sdesmalen, Ayal

Reviewed By: sdesmalen

Subscribers: dcaballe, huntergr, jmolloy, mcrosier, jlebar, bixia, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355868 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Allow fp as an alias of s0
Alex Bradbury [Mon, 11 Mar 2019 21:35:26 +0000 (21:35 +0000)]
[RISCV] Allow fp as an alias of s0

The RISC-V Assembly Programmer's Manual defines fp as another alias of x8.
However, our tablegen rules only recognise s0. This patch adds fp as another
alias of x8. GCC also accepts fp.

Differential Revision: https://reviews.llvm.org/D59209
Patch by Ferran Pallarès Roca.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355867 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GlobalISel][AArch64] Always fall back on aarch64.neon.addp.*
Jessica Paquette [Mon, 11 Mar 2019 20:51:17 +0000 (20:51 +0000)]
[GlobalISel][AArch64] Always fall back on aarch64.neon.addp.*

Overloaded intrinsics aren't necessarily safe for instruction selection. One
such intrinsic is aarch64.neon.addp.*.

This is a temporary workaround to ensure that we always fall back on that
intrinsic. Eventually this will be replaced with a proper solution.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355865 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV][NFC] Convert some MachineBaiscBlock::iterator(MI) to MI.getIterator()
Alex Bradbury [Mon, 11 Mar 2019 20:43:29 +0000 (20:43 +0000)]
[RISCV][NFC] Convert some MachineBaiscBlock::iterator(MI) to MI.getIterator()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355864 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove esan.
Nico Weber [Mon, 11 Mar 2019 20:23:40 +0000 (20:23 +0000)]
Remove esan.

It hasn't seen active development in years, and it hasn't reached a
state where it was useful.

Remove the code until someone is interested in working on it again.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355862 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SDAG][AArch64] Legalize VECREDUCE
Nikita Popov [Mon, 11 Mar 2019 20:22:13 +0000 (20:22 +0000)]
[SDAG][AArch64] Legalize VECREDUCE

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

Implement basic legalizations (PromoteIntRes, PromoteIntOp,
ExpandIntRes, ScalarizeVecOp, WidenVecOp) for VECREDUCE opcodes.
There are more legalizations missing (esp float legalizations),
but there's no way to test them right now, so I'm not adding them.

This also includes a few more changes to make this work somewhat
reasonably:

 * Add support for expanding VECREDUCE in SDAG. Usually
   experimental.vector.reduce is expanded prior to codegen, but if the
   target does have native vector reduce, it may of course still be
   necessary to expand due to legalization issues. This uses a shuffle
   reduction if possible, followed by a naive scalar reduction.
 * Allow the result type of integer VECREDUCE to be larger than the
   vector element type. For example we need to be able to reduce a v8i8
   into an (nominally) i32 result type on AArch64.
 * Use the vector operand type rather than the scalar result type to
   determine the action, so we can control exactly which vector types are
   supported. Also change the legalize vector op code to handle
   operations that only have vector operands, but no vector results, as
   is the case for VECREDUCE.
 * Default VECREDUCE to Expand. On AArch64 (only target using VECREDUCE),
   explicitly specify for which vector types the reductions are supported.

This does not handle anything related to VECREDUCE_STRICT_*.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355860 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r355777
Nico Weber [Mon, 11 Mar 2019 19:30:13 +0000 (19:30 +0000)]
gn build: Merge r355777

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355857 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r355835
Nico Weber [Mon, 11 Mar 2019 19:14:22 +0000 (19:14 +0000)]
gn build: Merge r355835

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355856 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r355834
Nico Weber [Mon, 11 Mar 2019 19:11:15 +0000 (19:11 +0000)]
gn build: Merge r355834

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355855 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RegAlloc] Avoid compile time regression with multiple copy hints.
Jonas Paulsson [Mon, 11 Mar 2019 19:00:37 +0000 (19:00 +0000)]
[RegAlloc]  Avoid compile time regression with multiple copy hints.

As a fix for https://bugs.llvm.org/show_bug.cgi?id=40986 ("excessive compile
time building opencollada"), this patch makes sure that no phys reg is hinted
more than once from getRegAllocationHints().

This handles the case were many virtual registers are assigned to the same
physreg. The previous compile time fix (r343686) in weightCalcHelper() only
made sure that physical/virtual registers are passed no more than once to
addRegAllocationHint().

Review: Dimitry Andric, Quentin Colombet
https://reviews.llvm.org/D59201

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355854 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[coroutines][PR40979] Ignore unreachable uses across suspend points
Brian Gesiak [Mon, 11 Mar 2019 18:31:28 +0000 (18:31 +0000)]
[coroutines][PR40979] Ignore unreachable uses across suspend points

Summary:
Depends on https://reviews.llvm.org/D59069.

https://bugs.llvm.org/show_bug.cgi?id=40979 describes a bug in which the
-coro-split pass would assert that a use was across a suspend point from
a definition. Normally this would mean that a value would "spill" across
a suspend point and thus need to be stored in the coroutine frame. However,
in this case the use was unreachable, and so it would not be necessary
to store the definition on the frame.

To prevent the assert, simply remove unreachable basic blocks from a
coroutine function before computing spills. This avoids the assert
reported in PR40979.

Reviewers: GorNishanov, tks2103

Reviewed By: GorNishanov

Subscribers: EricWF, jdoerfert, llvm-commits, lewissbaker

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355852 91177308-0d34-0410-b5e6-96231b3b80d8