platform/upstream/llvm.git
5 years ago[X86] Use ISD::INTRINSIC_VOID in getTgtMemIntrinsic for truncating stores and scatter...
Craig Topper [Mon, 1 Apr 2019 05:26:12 +0000 (05:26 +0000)]
[X86] Use ISD::INTRINSIC_VOID in getTgtMemIntrinsic for truncating stores and scatter intrinsics.

This is the appropriate opcode for only having a chain output. Though I'm not
sure it matters much.

llvm-svn: 357375

5 years ago[RISCV] Don't evaluatePCRelLo if a relocation will be forced (e.g. due to linker...
Alex Bradbury [Mon, 1 Apr 2019 02:38:27 +0000 (02:38 +0000)]
[RISCV] Don't evaluatePCRelLo if a relocation will be forced (e.g. due to linker relaxation)

A pcrel_lo will point to the associated pcrel_hi fixup which in turn points to
the real target. RISCVMCExpr::evaluatePCRelLo will work around this
indirection in order to allow the fixup to be evaluate properly. However, if
relocations are forced (e.g. due to linker relaxation is enabled) then its
evaluation is undesired and will result in a relocation with the wrong target.

This patch modifies evaluatePCRelLo so it will not try to evaluate if the
fixup will be forced as a relocation. A new helper method is added to
RISCVAsmBackend to query this.

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

llvm-svn: 357374

5 years agoSimplify. NFC.
Rui Ueyama [Mon, 1 Apr 2019 00:25:17 +0000 (00:25 +0000)]
Simplify. NFC.

llvm-svn: 357373

5 years agoReplace `typedef A B` with `using B = A`. NFC.
Rui Ueyama [Mon, 1 Apr 2019 00:11:24 +0000 (00:11 +0000)]
Replace `typedef A B` with `using B = A`. NFC.

I did this using Perl.

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

llvm-svn: 357372

5 years agoSpelling correction for docs for cppcoreguidelines-owning-memory
Sylvestre Ledru [Sun, 31 Mar 2019 21:53:00 +0000 (21:53 +0000)]
Spelling correction for docs for cppcoreguidelines-owning-memory

Summary: There's a typo in the docs, as mentioned in the title. Please see the diff.

Reviewers: JonasToth

Subscribers: sylvestre.ledru, nemanjai, kbarton, cfe-commits

Tags: #clang-tools-extra, #clang

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

llvm-svn: 357371

5 years agoMake common_type's implementation common
Eric Fiselier [Sun, 31 Mar 2019 20:49:06 +0000 (20:49 +0000)]
Make common_type's implementation common

Summary:
Currently the C++03 implementation of common_type has much different behavior than the C++11 one. This causes bugs, including inside `<chrono>`.

This patch unifies the two implementations as best it can. The more code they share, the less their behavior can diverge.

Reviewers: mclow.lists, ldionne, sbenza

Reviewed By: mclow.lists, ldionne

Subscribers: libcxx-commits

Tags: #libc

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

llvm-svn: 357370

5 years agogn build: Add build files for most clang-tools-extra unit tests
Nico Weber [Sun, 31 Mar 2019 16:49:54 +0000 (16:49 +0000)]
gn build: Add build files for most clang-tools-extra unit tests

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

llvm-svn: 357369

5 years ago[InstCombine] add tests for inverted select-shuffles + binop (PR41304); NFC
Sanjay Patel [Sun, 31 Mar 2019 15:45:47 +0000 (15:45 +0000)]
[InstCombine] add tests for inverted select-shuffles + binop (PR41304); NFC

llvm-svn: 357368

5 years ago[x86] allow movmsk with 2-element reductions
Sanjay Patel [Sun, 31 Mar 2019 15:11:34 +0000 (15:11 +0000)]
[x86] allow movmsk with 2-element reductions

One motivation for making this change is that the lack of using movmsk is likely
a main source of perf difference between clang and gcc on the C-Ray benchmark as
shown here:
https://www.phoronix.com/scan.php?page=article&item=gcc-clang-2019&num=5
...but this change alone isn't enough to solve that problem.

The 'all-of' examples show what is likely the worst case trade-off: we end up with
an extra instruction (or 2 if we count the 'xor' register clearing). The 'any-of'
examples look clearly better using movmsk because we've traded 2 vector instructions
for 2 scalar instructions, and movmsk may have better timing than the generic 'movq'.

If we examine the llvm-mca output for these cases, it appears that even though the
'all-of' movmsk variant looks worse on paper, it would perform better on both
Haswell and Jaguar.

  $ llvm-mca -mcpu=haswell no_movmsk.s -timeline
  Iterations:        100
  Instructions:      400
  Total Cycles:      504
  Total uOps:        400

  Dispatch Width:    4
  uOps Per Cycle:    0.79
  IPC:               0.79
  Block RThroughput: 1.0

  $ llvm-mca -mcpu=haswell movmsk.s -timeline
  Iterations:        100
  Instructions:      600
  Total Cycles:      358
  Total uOps:        600

  Dispatch Width:    4
  uOps Per Cycle:    1.68
  IPC:               1.68
  Block RThroughput: 1.5

  $ llvm-mca -mcpu=btver2 no_movmsk.s -timeline
  Iterations:        100
  Instructions:      400
  Total Cycles:      407
  Total uOps:        400

  Dispatch Width:    2
  uOps Per Cycle:    0.98
  IPC:               0.98
  Block RThroughput: 2.0

  $ llvm-mca -mcpu=btver2 movmsk.s -timeline
  Iterations:        100
  Instructions:      600
  Total Cycles:      311
  Total uOps:        600

  Dispatch Width:    2
  uOps Per Cycle:    1.93
  IPC:               1.93
  Block RThroughput: 3.0

Finally, there may be CPUs where movmsk is horribly slow (old AMD small cores?), but if
that's true, then we're also almost certainly making the wrong transform already for
reductions with >2 elements, so that should be fixed independently.

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

llvm-svn: 357367

5 years ago[InstCombine] canonicalize select shuffles by commuting
Sanjay Patel [Sun, 31 Mar 2019 15:01:30 +0000 (15:01 +0000)]
[InstCombine] canonicalize select shuffles by commuting

In PR41304:
https://bugs.llvm.org/show_bug.cgi?id=41304
...we have a case where we want to fold a binop of select-shuffle (blended) values.

Rather than try to match commuted variants of the pattern, we can canonicalize the
shuffles and check for mask equality with commuted operands.

We don't produce arbitrary shuffle masks in instcombine, but select-shuffles are a
special case that the backend is required to handle because we already canonicalize
vector select to this shuffle form.

So there should be no codegen difference from this change. It's possible that this
improves CSE in IR though.

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

llvm-svn: 357366

5 years agofix typo: "\t" => " "
Liang Zou [Sun, 31 Mar 2019 14:49:00 +0000 (14:49 +0000)]
fix typo: "\t" => "  "

Reviewers: llvm.org, Jim

Reviewed By: Jim

Subscribers: arsenm, jvesely, nhaehnle, rupprecht, llvm-commits

Tags: #llvm

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

llvm-svn: 357365

5 years ago[gnustep-objc] Make the GNUstep v2 ABI work for Windows DLLs.
David Chisnall [Sun, 31 Mar 2019 11:22:33 +0000 (11:22 +0000)]
[gnustep-objc] Make the GNUstep v2 ABI work for Windows DLLs.

Summary:
Based on a patch by Dustin Howett, modified to not change the ABI for
ELF platforms.

Use more Windows-like section names.

This also makes things more readable by PE/COFF debug tools that assume
sections fit in the first header.

With these changes in, it is now possible to build a working WinObjC
with clang and the WinObjC version of GNUstep libobjc (upstream GNUstep
libobjc + a work around for incremental linking, which can be removed
once LINK.EXE gains a feature to opt sections out of receiving extra
padding during an incremental link).

Patch by Dustin Howett!

Reviewers: DHowett-MSFT

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 357364

5 years agoCOMDAT-fold block descriptors.
David Chisnall [Sun, 31 Mar 2019 11:22:26 +0000 (11:22 +0000)]
COMDAT-fold block descriptors.

Without this change, linking multiple objects containing block
descriptors together on Windows will generate duplicate symbol errors.

Patch by Dustin Howett!

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

llvm-svn: 357363

5 years ago[objc-gnustep] Use .init_array not .ctors when requested.
David Chisnall [Sun, 31 Mar 2019 11:22:19 +0000 (11:22 +0000)]
[objc-gnustep] Use .init_array not .ctors when requested.

This doesn't make a difference most of the time but FreeBSD/ARM doesn't
run anything in the .ctors array.

llvm-svn: 357362

5 years agoSafepointIRVerifier port to new Pass Manager
Fedor Sergeev [Sun, 31 Mar 2019 10:15:39 +0000 (10:15 +0000)]
SafepointIRVerifier port to new Pass Manager

Straightforward port of StatepointIRVerifier pass to new Pass Manager framework.

Fix By: skatkov
Reviewed By: fedor.sergeev
Differential Revision: https://reviews.llvm.org/D59825

This is a re-land of r357147/r357148 with LLVM_ENABLE_MODULES build fixed.
Adding IR/SafepointIRVerifier.h into its own module.

llvm-svn: 357361

5 years ago[NFC][InstCombine] Add tests for combining icmp of no-wrap sub w/ constant.
Luqman Aden [Sun, 31 Mar 2019 08:58:50 +0000 (08:58 +0000)]
[NFC][InstCombine] Add tests for combining icmp of no-wrap sub w/ constant.

llvm-svn: 357360

5 years agoRange-style std::find{,_if} -> llvm::find{,_if}. NFC
Fangrui Song [Sun, 31 Mar 2019 08:48:19 +0000 (08:48 +0000)]
Range-style std::find{,_if} -> llvm::find{,_if}. NFC

llvm-svn: 357359

5 years agogn build: Merge r357340
Nico Weber [Sun, 31 Mar 2019 00:03:37 +0000 (00:03 +0000)]
gn build: Merge r357340

llvm-svn: 357358

5 years agogn build: Merge r357326
Nico Weber [Sun, 31 Mar 2019 00:01:24 +0000 (00:01 +0000)]
gn build: Merge r357326

llvm-svn: 357357

5 years agoRename IncludeFixerTests to ClangIncludeFixerTests and ChangeNamespaceTests to ClangC...
Nico Weber [Sat, 30 Mar 2019 23:09:10 +0000 (23:09 +0000)]
Rename IncludeFixerTests to ClangIncludeFixerTests and ChangeNamespaceTests to ClangChangeNamespaceTests

Follow-up to r356897 and r356254.

llvm-svn: 357356

5 years ago[SystemZ] Remove fcmp undef from reduced test
Simon Pilgrim [Sat, 30 Mar 2019 20:24:26 +0000 (20:24 +0000)]
[SystemZ] Remove fcmp undef from reduced test

Pre-commit for D60006 (Add fcmp UNDEF handling to SelectionDAG::FoldSetCC)

Approved by @uweigand (Ulrich Weigand)

llvm-svn: 357355

5 years ago[MIPS] Remove fcmp undef from reduced test
Simon Pilgrim [Sat, 30 Mar 2019 20:16:16 +0000 (20:16 +0000)]
[MIPS] Remove fcmp undef from reduced test

Pre-commit for D60006 (Add fcmp UNDEF handling to SelectionDAG::FoldSetCC)

Approved by @atanasyan (Simon Atanasyan)

llvm-svn: 357354

5 years ago[X86] Teach isel for RMW binops to handle negate
Craig Topper [Sat, 30 Mar 2019 18:59:17 +0000 (18:59 +0000)]
[X86] Teach isel for RMW binops to handle negate

Negate updates flags like a subtract. We should be able to use the flags from the RMW form of negate when we have (store (X86ISD::SUB 0, load A), A)

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

llvm-svn: 357353

5 years ago[RISCV] Add codegen support for ilp32f, ilp32d, lp64f, and lp64d ("hard float") ABIs
Alex Bradbury [Sat, 30 Mar 2019 17:59:30 +0000 (17:59 +0000)]
[RISCV] Add codegen support for ilp32f, ilp32d, lp64f, and lp64d ("hard float") ABIs

This patch adds support for the RISC-V hard float ABIs, building on top of
rL355771, which added basic target-abi parsing and MC layer support. It also
builds on some re-organisations and expansion of the upstream ABI and calling
convention tests which were recently committed directly upstream.

A number of aspects of the RISC-V float hard float ABIs require frontend
support (e.g. flattening of structs and passing int+fp for fp+fp structs in a
pair of registers), and will be addressed in a Clang patch.

As can be seen from the tests, it would be worthwhile extending
RISCVMergeBaseOffsets to handle constant pool as well as global accesses.

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

llvm-svn: 357352

5 years ago[X86][SSE] detectAVGPattern - Match zext(or(x,y)) 'add like' patterns (PR41316)
Simon Pilgrim [Sat, 30 Mar 2019 17:12:29 +0000 (17:12 +0000)]
[X86][SSE] detectAVGPattern - Match zext(or(x,y)) 'add like' patterns (PR41316)

Fixes PR41316 where the expanded PAVG intrinsic had had one of its ADDs turned into an OR due to its operands having no conflicting bits.

llvm-svn: 357351

5 years ago[RISCV] Add RV64 CHECK lines to test/CodeGen/RISCV/vararg.ll and prepare for hard...
Alex Bradbury [Sat, 30 Mar 2019 15:53:38 +0000 (15:53 +0000)]
[RISCV] Add RV64 CHECK lines to test/CodeGen/RISCV/vararg.ll and prepare for hard float tests

vararg.ll previously missed RV64 tests. This patch also prepares for using
vararg.ll to test handling of varargs for the ilp32f/ilp32d/lp64f/lp64d hard
float ABIs. In these ABIs, varargs are passed as in either the ilp32 or lp64
ABI. Due to some slight codegen differences, different check lines are needed
for when RV32D is enabled.

llvm-svn: 357350

5 years ago[X86][SSE] detectAVGPattern - begin generalizing ADD matches
Simon Pilgrim [Sat, 30 Mar 2019 15:31:53 +0000 (15:31 +0000)]
[X86][SSE] detectAVGPattern - begin generalizing ADD matches

Move the ADD matching into a helper - first NFC stage towards supporting 'ADD like' cases such as in PR41316

llvm-svn: 357349

5 years ago[cmake] Change deprecated $<CONFIG> to $<CONFIGURATION>. NFC
Fangrui Song [Sat, 30 Mar 2019 14:38:51 +0000 (14:38 +0000)]
[cmake] Change deprecated $<CONFIG> to $<CONFIGURATION>. NFC

See rL357338 for a similar change. The informational expression
$<CONFIGURATION> has been deprecated since CMake 3.0

llvm-svn: 357348

5 years ago[llvm-objcopy] Replace the size() helper with SectionTableRef::size
Fangrui Song [Sat, 30 Mar 2019 14:08:59 +0000 (14:08 +0000)]
[llvm-objcopy] Replace the size() helper with SectionTableRef::size

Summary:
BTW, STLExtras.h provides llvm::size() which is similar to std::size()
for random access iterators. However, if we prefer qualified
llvm::size(), the member function .size() will be more convenient.

Reviewers: jhenderson, jakehehrlich, rupprecht, grimar, alexshap, espindola

Reviewed By: grimar

Subscribers: emaste, arichardson, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 357347

5 years ago[X86][SSE] Add PAVG test case from PR41316
Simon Pilgrim [Sat, 30 Mar 2019 13:53:11 +0000 (13:53 +0000)]
[X86][SSE] Add PAVG test case from PR41316

llvm-svn: 357346

5 years ago[clang-format] [PR41187] moves Java import statements to the wrong location if code...
Paul Hoad [Sat, 30 Mar 2019 13:05:40 +0000 (13:05 +0000)]
[clang-format] [PR41187] moves Java import statements to the wrong location if code contains statements that start with the word import

Summary:
Import sorting of java file, incorrectly move import statement to after a function beginning with the word import.

Make 1 character change to regular expression to ensure there is always at least one space/tab after the word import

Previously clang-format --style="LLVM" would format

```
import X;

class C {
  void m() {
    importFile();
  }
}
```
as

```
class C {
  void m() {
    importFile();
import X;
  }
}
```

Reviewers: djasper, klimek, reuk, JonasToth

Reviewed By: klimek

Subscribers: cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 357345

5 years ago[clang-format]: Add NonEmptyParentheses spacing option
Reuben Thomas [Sat, 30 Mar 2019 12:32:35 +0000 (12:32 +0000)]
[clang-format]: Add NonEmptyParentheses spacing option

This patch aims to add support for the following rules from the JUCE coding standards:

- Always put a space before an open parenthesis that contains text - e.g. foo (123);
- Never put a space before an empty pair of open/close parenthesis - e.g. foo();

Patch by Reuben Thomas

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

llvm-svn: 357344

5 years ago[WebAssembly] Fix unwind destination mismatches in CFG stackify
Heejin Ahn [Sat, 30 Mar 2019 11:04:48 +0000 (11:04 +0000)]
[WebAssembly] Fix unwind destination mismatches in CFG stackify

Summary:
Linearing the control flow by placing `try`/`end_try` markers can create
mismatches in unwind destinations. This patch resolves these mismatches
by wrapping those instructions with an incorrect unwind destination with
a nested `try`/`catch`/`end_try` and branching to the right destination
within the new catch block.

Reviewers: dschuff

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

Tags: #llvm

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

llvm-svn: 357343

5 years ago[WebAssembly] Run ExplicitLocals pass after CFGStackify
Heejin Ahn [Sat, 30 Mar 2019 09:29:57 +0000 (09:29 +0000)]
[WebAssembly] Run ExplicitLocals pass after CFGStackify

Summary:
While this does not change any final output, this will greatly simplify
ixing unwind destination mismatches in CFGStackify (D48345), because we
have to create some new registers there.

Reviewers: dschuff

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

Tags: #llvm

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

llvm-svn: 357342

5 years ago[RISCV] Add DAGCombine for (SplitF64 (ConstantFP x))
Alex Bradbury [Sat, 30 Mar 2019 09:15:47 +0000 (09:15 +0000)]
[RISCV] Add DAGCombine for (SplitF64 (ConstantFP x))

The SplitF64 node is used on RV32D to convert an f64 directly to a pair of i32
(necessary as bitcasting to i64 isn't legal). When performed on a ConstantFP,
this will result in a FP load from the constant pool followed by a store to
the stack and two integer loads from the stack (necessary as there is no way
to directly move between f64 FPRs and i32 GPRs on RV32D). It's always cheaper
to just materialise integers for the lo and hi parts of the FP constant, so do
that instead.

llvm-svn: 357341

5 years agoAdds `-ftime-trace` option to clang that produces Chrome `chrome://tracing` compatibl...
Anton Afanasyev [Sat, 30 Mar 2019 08:42:48 +0000 (08:42 +0000)]
Adds `-ftime-trace` option to clang that produces Chrome `chrome://tracing` compatible JSON profiling output dumps.

This change adds hierarchical "time trace" profiling blocks that can be visualized in Chrome, in a "flame chart" style. Each profiling block can have a "detail" string that for example indicates the file being processed, template name being instantiated, function being optimized etc.

This is taken from GitHub PR: https://github.com/aras-p/llvm-project-20170507/pull/2

Patch by Aras Pranckevičius.

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

llvm-svn: 357340

5 years ago[RISCV][NFC] Remove floating point operations from test/CodeGen/RISCV/vararg.ll
Alex Bradbury [Sat, 30 Mar 2019 05:24:42 +0000 (05:24 +0000)]
[RISCV][NFC] Remove floating point operations from test/CodeGen/RISCV/vararg.ll

This minimises differences in output when compiling with hardware floating
point support, which will be done in a future patch (to demonstrate the same
vararg calling convention is used).

llvm-svn: 357339

5 years ago[cmake] Remove use of deprecated generator expression. NFC
Shoaib Meenai [Sat, 30 Mar 2019 01:35:01 +0000 (01:35 +0000)]
[cmake] Remove use of deprecated generator expression. NFC

Use $<CONFIG> instead of $<CONFIGURATION>, since the latter has been
deprecated since CMake 3.0, and the former is entirely equivalent.

llvm-svn: 357338

5 years ago[WebAssembly] Optimize the number of routing blocks in FixIrreducibleCFG
Heejin Ahn [Sat, 30 Mar 2019 01:31:11 +0000 (01:31 +0000)]
[WebAssembly] Optimize the number of routing blocks in FixIrreducibleCFG

Summary:
Currently we create a routing block to the dispatch block for every
predecessor of every entry. So the total number of routing blocks
created will be (# of preds) * (# of entries). But we don't need to do
this: we need at most 2 routing blocks per loop entry, one for when the
predecessor is inside the loop and one for it is outside the loop. (We
can't merge these into one because this will creates another loop cycle
between blocks inside and blocks outside) This patch fixes this and
creates at most 2 routing blocks per entry.

This also renames variable `Split` to `Routing`, which I think is a bit
clearer.

Reviewers: kripken

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

Tags: #llvm

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

llvm-svn: 357337

5 years ago[CMake] Add missing test dep
David Zarzycki [Sat, 30 Mar 2019 00:00:19 +0000 (00:00 +0000)]
[CMake] Add missing test dep

lit/SymbolFile/NativePDB/globals-bss.cpp needs llvm-readobj

llvm-svn: 357336

5 years ago[analyzer] MIGChecker: Add support for more deallocator APIs.
Artem Dergachev [Fri, 29 Mar 2019 23:56:53 +0000 (23:56 +0000)]
[analyzer] MIGChecker: Add support for more deallocator APIs.

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

llvm-svn: 357335

5 years ago[lit] Set shlibpath_var on AIX
Hubert Tong [Fri, 29 Mar 2019 23:33:04 +0000 (23:33 +0000)]
[lit] Set shlibpath_var on AIX

Summary:
When building the `check-all` target on AIX, lit produces
```
warning: unable to inject shared library path on 'AIX'
```

This patch addresses this. `LIBPATH` is the environment variable of
interest on AIX. Newer versions of AIX may consider `LD_LIBRARY_PATH`,
but only when `LIBPATH` is unset.

Reviewers: xingxue, jasonliu, sfertile, serge-sans-paille

Reviewed By: xingxue

Subscribers: jsji, cfe-commits, llvm-commits

Tags: #clang

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

llvm-svn: 357334

5 years ago[Support] Implement is_local_impl with AIX mntctl
Hubert Tong [Fri, 29 Mar 2019 23:32:47 +0000 (23:32 +0000)]
[Support] Implement is_local_impl with AIX mntctl

Summary:
On AIX, we can determine whether a filesystem is remote using `mntctl`.

If the information is not found, then claim that the file is remote
(since that is the more restrictive case). Testing for the associated
interface is restored with a modified version of the unit test from
rL295768.

Reviewers: jasonliu, xingxue

Reviewed By: xingxue

Subscribers: jsji, apaprocki, Hahnfeld, zturner, krytarowski, kristina, llvm-commits

Tags: #llvm

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

llvm-svn: 357333

5 years agoRevert "[analyzer] Introduce a simplified API for adding custom path notes."
Artem Dergachev [Fri, 29 Mar 2019 23:11:10 +0000 (23:11 +0000)]
Revert "[analyzer] Introduce a simplified API for adding custom path notes."

This reverts commit r357323.

ASan leaks found by a buildbot :)

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

llvm-svn: 357332

5 years ago[LoopPredication] Remove stale TODO
Philip Reames [Fri, 29 Mar 2019 23:10:01 +0000 (23:10 +0000)]
[LoopPredication] Remove stale TODO

llvm-svn: 357331

5 years ago[LoopPredication] Use the builder's insertion point everywhere [NFC]
Philip Reames [Fri, 29 Mar 2019 23:06:57 +0000 (23:06 +0000)]
[LoopPredication] Use the builder's insertion point everywhere [NFC]

llvm-svn: 357330

5 years ago[analyzer] PR41239: Fix a crash on invalid source location in NoStoreFuncVisitor.
Artem Dergachev [Fri, 29 Mar 2019 22:57:49 +0000 (22:57 +0000)]
[analyzer] PR41239: Fix a crash on invalid source location in NoStoreFuncVisitor.

It turns out that SourceManager::isInSystemHeader() crashes when an invalid
source location is passed into it. Invalid source locations are relatively
common: not only they come from body farms, but also, say, any function in C
that didn't come with a forward declaration would have an implicit
forward declaration with invalid source locations.

There's a more comfy API for us to use in the Static Analyzer:
CallEvent::isInSystemHeader(), so just use that.

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

llvm-svn: 357329

5 years agoRe-land "[WebAssembly] Improve invalid relocation error message""
Sam Clegg [Fri, 29 Mar 2019 22:56:39 +0000 (22:56 +0000)]
Re-land "[WebAssembly] Improve invalid relocation error message""

See https://reviews.llvm.org/D59860

The initial version of this change effected more than just the
error message.  This version is scoped down to only effect the error
itself.

llvm-svn: 357328

5 years ago[MemorySSA] Temporary fix assert when reaching 0 limit.
Alina Sbirlea [Fri, 29 Mar 2019 22:55:59 +0000 (22:55 +0000)]
[MemorySSA] Temporary fix assert when reaching 0 limit.

llvm-svn: 357327

5 years ago[analyzer] Move taint API from ProgramState to a separate header. NFC.
Artem Dergachev [Fri, 29 Mar 2019 22:49:30 +0000 (22:49 +0000)]
[analyzer] Move taint API from ProgramState to a separate header. NFC.

It is now an inter-checker communication API, similar to the one that
connects MallocChecker/CStringChecker/InnerPointerChecker: simply a set of
setters and getters for a state trait.

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

llvm-svn: 357326

5 years ago[analyzer] PR37501: Disable assertion for logical op short circuit evaluation.
Artem Dergachev [Fri, 29 Mar 2019 22:43:34 +0000 (22:43 +0000)]
[analyzer] PR37501: Disable assertion for logical op short circuit evaluation.

The transfer function for the CFG element that represents a logical operation
computes the value of the operation and does nothing else. The element
appears after all the short circuit decisions were made, so they don't need
to be made again at this point.

Because our expression evaluation is imprecise, it is often hard to
discriminate between:

  (1) we don't know the value of the RHS because we failed to evaluate it

and

  (2) we don't know the value of the RHS because it didn't need to be evaluated.

This is hard because it depends on our knowledge about the value of the LHS
(eg., if LHS is true, then RHS in (LHS || RHS) doesn't need to be computed)
but LHS itself may have been evaluated imprecisely and we don't know whether
it is true or not. Additionally, the Analyzer wouldn't necessarily even remember
what the value of the LHS was because theoretically it's not really necessary
to know it for any future evaluations.

In order to work around these issues, the transfer function for logical
operations consists in looking at the ExplodedGraph we've constructed so far
in order to figure out from which CFG direction did we arrive here.
Such post-factum backtracking that doesn't involve looking up LHS and RHS values
is usually possible. However sometimes it fails because when we deduplicate
exploded nodes with the same program point and the same program state we may end
up in a situation when we reached the same program point from two or more
different directions.

By removing the assertion, we admit that the procedure indeed sometimes fails to
work. When it fails, we also admit that we don't know the value of the logical
operator.

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

llvm-svn: 357325

5 years agoTry to fix buildbot error
Sanjoy Das [Fri, 29 Mar 2019 22:27:10 +0000 (22:27 +0000)]
Try to fix buildbot error

Error is:

llvm/lib/Analysis/ScalarEvolution.cpp:3534:10: error: chosen constructor is explicit in copy-initialization
  return {UniqueSCEVs.FindNodeOrInsertPos(ID, IP), std::move(ID), IP};
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/aarch64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here
        constexpr tuple(_UElements&&... __elements)
                  ^
1 error generated.

llvm-svn: 357324

5 years ago[analyzer] Introduce a simplified API for adding custom path notes.
Artem Dergachev [Fri, 29 Mar 2019 22:21:00 +0000 (22:21 +0000)]
[analyzer] Introduce a simplified API for adding custom path notes.

Almost all path-sensitive checkers need to tell the user when something specific
to that checker happens along the execution path but does not constitute a bug
on its own. For instance, a call to operator delete in C++ has consequences
that are specific to a use-after-free bug. Deleting an object is not a bug
on its own, but when the Analyzer finds an execution path on which a deleted
object is used, it'll have to explain to the user when exactly during that path
did the deallocation take place.

Historically such custom notes were added by implementing "bug report visitors".
These visitors were post-processing bug reports by visiting every ExplodedNode
along the path and emitting path notes whenever they noticed that a change that
is relevant to a bug report occurs within the program state. For example,
it emits a "memory is deallocated" note when it notices that a pointer changes
its state from "allocated" to "deleted".

The "visitor" approach is powerful and efficient but hard to use because
such preprocessing implies that the developer first models the effects
of the event (say, changes the pointer's state from "allocated" to "deleted"
as part of operator delete()'s transfer function) and then forgets what happened
and later tries to reverse-engineer itself and figure out what did it do
by looking at the report.

The proposed approach tries to avoid discarding the information that was
available when the transfer function was evaluated. Instead, it allows the
developer to capture all the necessary information into a closure that
will be automatically invoked later in order to produce the actual note.

This should reduce boilerplate and avoid very painful logic duplication.

On the technical side, the closure is a lambda that's put into a special kind of
a program point tag, and a special bug report visitor visits all nodes in the
report and invokes all note-producing closures it finds along the path.

For now it is up to the lambda to make sure that the note is actually relevant
to the report. For instance, a memory deallocation note would be irrelevant when
we're reporting a division by zero bug or if we're reporting a use-after-free
of a different, unrelated chunk of memory. The lambda can figure these thing out
by looking at the bug report object that's passed into it.

A single checker is refactored to make use of the new functionality: MIGChecker.
Its program state is trivial, making it an easy testing ground for the first
version of the API.

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

llvm-svn: 357323

5 years ago[libc++abi] Don't set POSITION_INDEPENDENT_CODE when building static library
Sam Clegg [Fri, 29 Mar 2019 22:08:56 +0000 (22:08 +0000)]
[libc++abi] Don't set POSITION_INDEPENDENT_CODE when building static library

With the current WebAssembly backend, objects built with -fPIC are not
compatible with static linking.  libc++abi was (mistakenly?) adding
-fPIC to the objects it was including in a static library.

IIUC this change should also mean the static build can be more efficient
on all platforms.

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

llvm-svn: 357322

5 years ago[WebAssembly] Add mutable globals feature
Thomas Lively [Fri, 29 Mar 2019 22:00:18 +0000 (22:00 +0000)]
[WebAssembly] Add mutable globals feature

Summary:
This feature is not actually used for anything in the WebAssembly
backend, but adding it allows users to get it into the target features
sections of their objects, which makes these objects
future-compatible.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, jdoerfert, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 357321

5 years ago[SCEV] Check the cache in get{S|U}MaxExpr before doing any work
Sanjoy Das [Fri, 29 Mar 2019 22:00:12 +0000 (22:00 +0000)]
[SCEV] Check the cache in get{S|U}MaxExpr before doing any work

Summary:
This lets us avoid e.g. checking if A >=s B in getSMaxExpr(A, B) if we've
already established that (A smax B) is the best we can do.

Fixes PR41225.

Reviewers: asbirlea

Subscribers: mcrosier, jlebar, bixia, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 357320

5 years ago[MemorySSA] Limit clobber walks.
Alina Sbirlea [Fri, 29 Mar 2019 21:56:09 +0000 (21:56 +0000)]
[MemorySSA] Limit clobber walks.

Summary: This patch limits all getClobberingMemoryAccess() walks to MaxCheckLimit.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, llvm-commits

Tags: #llvm

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

llvm-svn: 357319

5 years ago[GlobalISel][AArch64] Add isel support for G_INSERT_VECTOR_ELT on v2s32s
Jessica Paquette [Fri, 29 Mar 2019 21:39:36 +0000 (21:39 +0000)]
[GlobalISel][AArch64] Add isel support for G_INSERT_VECTOR_ELT on v2s32s

This adds support for v2s32 vector inserts, and updates the selection +
regbankselect tests for G_INSERT_VECTOR_ELT.

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

llvm-svn: 357318

5 years ago[X86] When using Win64 ABI, exit with error if SSE is disabled for varargs
Amara Emerson [Fri, 29 Mar 2019 21:30:51 +0000 (21:30 +0000)]
[X86] When using Win64 ABI, exit with error if SSE is disabled for varargs

We need XMM registers to handle varargs with the Win64 ABI. Before we would
silently generate bad code resulting in an assertion failure elsewhere in the
backend.

llvm-svn: 357317

5 years agoFix build following r357308 : Ensure only live thunks are considered when creating...
Alexandre Ganea [Fri, 29 Mar 2019 21:24:19 +0000 (21:24 +0000)]
Fix build following r357308 : Ensure only live thunks are considered when creating import modules

llvm-svn: 357316

5 years ago[MemorySSA] Don't optimize incomplete phis.
Alina Sbirlea [Fri, 29 Mar 2019 21:16:31 +0000 (21:16 +0000)]
[MemorySSA] Don't optimize incomplete phis.

Summary:
MemoryPhis cannot be optimized out until they are complete.
Resolves PR41254.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 357315

5 years agoDon't copy the .drective section with std::string
Reid Kleckner [Fri, 29 Mar 2019 21:00:22 +0000 (21:00 +0000)]
Don't copy the .drective section with std::string

Both COFF and bitcode input files expose these as stable strings.

llvm-svn: 357314

5 years ago[ScriptInterpreterPython] Fix the unit test after refactor
Jonas Devlieghere [Fri, 29 Mar 2019 20:56:52 +0000 (20:56 +0000)]
[ScriptInterpreterPython] Fix the unit test after refactor

llvm-svn: 357313

5 years ago[clang-tidy] Fix PR28406
Alexander Kornienko [Fri, 29 Mar 2019 20:55:29 +0000 (20:55 +0000)]
[clang-tidy] Fix PR28406

Fix the crash resulting from a careless use of getLocWithOffset. At the
beginning of a macro expansion it produces an invalid SourceLocation that causes
an assertion failure later on.

llvm-svn: 357312

5 years ago[WebAssembly] "atomics" feature requires shared memory
Thomas Lively [Fri, 29 Mar 2019 20:43:49 +0000 (20:43 +0000)]
[WebAssembly] "atomics" feature requires shared memory

Summary:
Makes it a linker error if the "atomics" feature is used but the user
does not opt in to shared memory or if "atomics" is disallowed but the
user does opt in to shared memory. Also check that an appropriate max
memory size is supplied if shared memory is used.

Reviewers: sbc100, aheejin

Subscribers: dschuff, jgravelle-google, sunfish, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 357310

5 years ago[DAGCombiner] Rewrite ImproveLifetimeNodeChain to avoid DAG loop.
Nirav Dave [Fri, 29 Mar 2019 20:26:23 +0000 (20:26 +0000)]
[DAGCombiner] Rewrite ImproveLifetimeNodeChain to avoid DAG loop.

Avoid EXPENSIVE_CHECK failure. NFCI.

llvm-svn: 357309

5 years ago[LLD][COFF] Generate import modules & COFF groups in PDB
Alexandre Ganea [Fri, 29 Mar 2019 20:25:34 +0000 (20:25 +0000)]
[LLD][COFF] Generate import modules & COFF groups in PDB

Generate import modules for each imported DLL, along with its symbol stream.
Also create COFF groups in the * Linker * module, one for each PartialSection (input, unmerged sections)
Currently COFF groups are disabled for MINGW because it significantly increases PDB sizes. We could enable that later with an option.

The overall objective for this change is to support code hot patching tools. Such tools need to know the import libraries used, from the PDB alone.

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

llvm-svn: 357308

5 years ago[Python] Remove Python include from ScriptInterpreterPython.h
Jonas Devlieghere [Fri, 29 Mar 2019 20:17:20 +0000 (20:17 +0000)]
[Python] Remove Python include from ScriptInterpreterPython.h

This patch limits the scope of the python header to the implementation
of the python script interpreter plugin. ScriptInterpreterPython is now
an abstract interface that doesn't expose any Python specific types, and
is implemented by the ScriptInterpreterPythonImpl.

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

llvm-svn: 357307

5 years ago[pstl] Qualify calls to internal functions
Louis Dionne [Fri, 29 Mar 2019 20:11:24 +0000 (20:11 +0000)]
[pstl] Qualify calls to internal functions

This guards against unintended ADL issues.
Thanks to Thomas Rogers for the patch.

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

llvm-svn: 357306

5 years ago[LLD][COFF] Improve checkFailIfMismatch()
Alexandre Ganea [Fri, 29 Mar 2019 19:58:58 +0000 (19:58 +0000)]
[LLD][COFF] Improve checkFailIfMismatch()

As suggested by ruiu here (https://reviews.llvm.org/D58910#1425484), defer a call to toString(File) until it's really needed (if there's an error)

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

llvm-svn: 357305

5 years ago[Sema] Avoid sending a dependent expression to the constant evaluator.
Erik Pilkington [Fri, 29 Mar 2019 19:53:41 +0000 (19:53 +0000)]
[Sema] Avoid sending a dependent expression to the constant evaluator.

Fixes llvm.org/PR41286

llvm-svn: 357304

5 years ago[WebAssembly] Handle END_LOOP in unreachable BB in CFGStackify
Heejin Ahn [Fri, 29 Mar 2019 19:36:51 +0000 (19:36 +0000)]
[WebAssembly] Handle END_LOOP in unreachable BB in CFGStackify

Summary:
This fixes crashes when a BB in which an END_LOOP is to be placed is
unreachable and does not have any predecessors. Fixes PR41307.

Reviewers: dschuff

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

Tags: #llvm

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

llvm-svn: 357303

5 years agoAMDGPU: Remove dx10-clamp from subtarget features
Matt Arsenault [Fri, 29 Mar 2019 19:14:54 +0000 (19:14 +0000)]
AMDGPU: Remove dx10-clamp from subtarget features

Since this can be set with s_setreg*, it should not be a subtarget
property. Set a default based on the calling convention, and Introduce
a new amdgpu-dx10-clamp attribute to override this if desired.

Also introduce a new amdgpu-ieee attribute to match.

The values need to match to allow inlining. I think it is OK for the
caller's dx10-clamp attribute to override the callee, but there
doesn't appear to be the infrastructure to do this currently without
definining the attribute in the generic Attributes.td.

Eventually the calling convention lowering will need to insert a mode
switch somewhere for these.

llvm-svn: 357302

5 years ago[Hexagon] Remove fcmp undef from reduced tests
Simon Pilgrim [Fri, 29 Mar 2019 19:14:52 +0000 (19:14 +0000)]
[Hexagon] Remove fcmp undef from reduced tests

Pre-commit for D60006 (Add fcmp UNDEF handling to SelectionDAG::FoldSetCC)

Approved by @kparzysz (Krzysztof Parzyszek)

llvm-svn: 357301

5 years ago[X86] Add test cases showing failure to use RMW form of negate when only flags are...
Craig Topper [Fri, 29 Mar 2019 19:09:37 +0000 (19:09 +0000)]
[X86] Add test cases showing failure to use RMW form of negate when only flags are used. NFC

llvm-svn: 357300

5 years ago[DAG] Avoid redundancy in StoreMerge TokenFactor generation.
Nirav Dave [Fri, 29 Mar 2019 18:50:22 +0000 (18:50 +0000)]
[DAG] Avoid redundancy in StoreMerge TokenFactor generation.

Avoid generating redundant TokenFactor when all merged stores have
the same chain.

llvm-svn: 357299

5 years ago[Sema] Fix assertion when `auto` parameter in lambda has an attribute.
Volodymyr Sapsai [Fri, 29 Mar 2019 18:47:07 +0000 (18:47 +0000)]
[Sema] Fix assertion when `auto` parameter in lambda has an attribute.

Fixes the assertion
> no Attr* for AttributedType*
> UNREACHABLE executed at llvm-project/clang/lib/Sema/SemaType.cpp:298!

In `TypeProcessingState::getAttributedType` we put into `AttrsForTypes`
types with `auto` but later in
`TypeProcessingState::takeAttrForAttributedType` we use transformed
types and that's why cannot find `Attr` corresponding to
`AttributedType`.

Fix by keeping `AttrsForTypes` up to date after replacing `AutoType`.

rdar://problem/47689465

Reviewers: rsmith, arphaman, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: jkorous, dexonsmith, jdoerfert, cfe-commits

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

llvm-svn: 357298

5 years ago[X86] Use cached OptForSize in X86ISelDAGToDAG.cpp instead of pulling it from the...
Craig Topper [Fri, 29 Mar 2019 18:36:40 +0000 (18:36 +0000)]
[X86] Use cached OptForSize in X86ISelDAGToDAG.cpp instead of pulling it from the function attribute. NFCI

llvm-svn: 357297

5 years ago[Driver] Use --warn-shared-textrel for Android.
Dan Albert [Fri, 29 Mar 2019 18:34:25 +0000 (18:34 +0000)]
[Driver] Use --warn-shared-textrel for Android.

Android does not allow shared text relocations. Enable the linker
warning to detect them by default.

Reviewers: srhines, pirama

Reviewed By: srhines

Subscribers: cfe-commits

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

llvm-svn: 357296

5 years ago[SystemZ] Regenerate double constant comparison test
Simon Pilgrim [Fri, 29 Mar 2019 18:23:08 +0000 (18:23 +0000)]
[SystemZ] Regenerate double constant comparison test

Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)

llvm-svn: 357295

5 years ago[MIPS] Regenerate double constant comparison test
Simon Pilgrim [Fri, 29 Mar 2019 18:22:18 +0000 (18:22 +0000)]
[MIPS] Regenerate double constant comparison test

Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)

llvm-svn: 357294

5 years ago[ARM] Regenerate execute-only float comparison tests
Simon Pilgrim [Fri, 29 Mar 2019 18:21:19 +0000 (18:21 +0000)]
[ARM] Regenerate execute-only float comparison tests

Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)

llvm-svn: 357293

5 years ago[ScriptInterpreterPython] Remove unused field (NFC)
Jonas Devlieghere [Fri, 29 Mar 2019 17:58:07 +0000 (17:58 +0000)]
[ScriptInterpreterPython] Remove unused field (NFC)

The m_lldb_module was initialized but not used.

llvm-svn: 357292

5 years ago[InstCombine] autogenerate complete checks; NFC
Sanjay Patel [Fri, 29 Mar 2019 17:51:39 +0000 (17:51 +0000)]
[InstCombine] autogenerate complete checks; NFC

llvm-svn: 357291

5 years agoVarious fixes and additions to creduce-clang-crash.py
George Burgess IV [Fri, 29 Mar 2019 17:50:43 +0000 (17:50 +0000)]
Various fixes and additions to creduce-clang-crash.py

Some more additions to the script - mainly reducing the clang args after
the creduce run by removing them one by one and seeing if the crash
reproduces. Other things:

- remove the --crash flag when "fatal error" occurs
- fixed to read stack trace functions from the top
- run creduce on a copy of the original file

Patch by Amy Huang!

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

llvm-svn: 357290

5 years ago[AMDGPU] Add an additional Code Object V3 assembler example
Scott Linder [Fri, 29 Mar 2019 17:49:51 +0000 (17:49 +0000)]
[AMDGPU] Add an additional Code Object V3 assembler example

Document the intended use of the `.amdgcn.next_free_{s,v}gpr` in the
context of multiple kernels and functions.

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

llvm-svn: 357289

5 years ago[InstCombine] regenerate test checks; NFC
Sanjay Patel [Fri, 29 Mar 2019 17:47:51 +0000 (17:47 +0000)]
[InstCombine] regenerate test checks; NFC

llvm-svn: 357288

5 years ago[CMake] Move link dependencies where they are used.
Jonas Devlieghere [Fri, 29 Mar 2019 17:47:26 +0000 (17:47 +0000)]
[CMake] Move link dependencies where they are used.

The utility library shouldn't depend on curses, libedit or python. Move
curses to core, libedit to host and python to the python plugin.

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

llvm-svn: 357287

5 years ago[AArch64] Regenerate half precision tests
Simon Pilgrim [Fri, 29 Mar 2019 17:46:06 +0000 (17:46 +0000)]
[AArch64] Regenerate half precision tests

Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)

llvm-svn: 357286

5 years ago[AMDGPU] Switch default DWARF version to 5
Scott Linder [Fri, 29 Mar 2019 17:45:40 +0000 (17:45 +0000)]
[AMDGPU] Switch default DWARF version to 5

Effectively reverts r337612. The issues that cropped up with the last
attempt appear to have gone away.

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

llvm-svn: 357285

5 years ago[llvm][NFC] Factor out logic for getting incoming & back Loop edges
Mircea Trofin [Fri, 29 Mar 2019 17:39:17 +0000 (17:39 +0000)]
[llvm][NFC] Factor out logic for getting incoming & back Loop edges

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 357284

5 years ago[DAGCombine] Prune unnused nodes.
Nirav Dave [Fri, 29 Mar 2019 17:35:56 +0000 (17:35 +0000)]
[DAGCombine] Prune unnused nodes.

Summary:
Nodes that have no uses are eventually pruned when they are selected
from the worklist. Record nodes newly added to the worklist or DAG and
perform pruning after every combine attempt.

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

Reviewed By: jyknight

Subscribers: jdoerfert, jyknight, nemanjai, jvesely, nhaehnle, javed.absar, hiraditya, jsji, llvm-commits

Tags: #llvm

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

llvm-svn: 357283

5 years ago[Cmake] Unify python variables
Jonas Devlieghere [Fri, 29 Mar 2019 17:35:42 +0000 (17:35 +0000)]
[Cmake] Unify python variables

FindPythonInterp and FindPythonLibs do two things, they set some
variables (PYTHON_LIBRARIES, PYTHON_INCLUDE_DIRS) and update the cached
variables (PYTHON_LIBRARY, PYTHON_INCLUDE_DIR) which are also used to
specify a custom python installation.

I believe the canonical way to do this is to use the PYTHON_LIBRARIES
and PYTHON_INCLUDE_DIRS variables instead of the cached ones. However,
since the cached variables are accessible from the cache and GUI, this
is a lot less confusing when you're trying to debug why a variable did
or didn't get the value you expected. Furthermore, as far as I can tell,
the implementation uses the cached variables to set their LIBRARIES/DIRS
counterparts. This is also the reason this works today even though we
mix-and-match.

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

llvm-svn: 357282

5 years ago[ARM] Regenerate vector comparison tests
Simon Pilgrim [Fri, 29 Mar 2019 17:35:11 +0000 (17:35 +0000)]
[ARM] Regenerate vector comparison tests

Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)

llvm-svn: 357281

5 years ago[CodeGen] Refactor the option for the maximum jump table size
Evandro Menezes [Fri, 29 Mar 2019 17:28:11 +0000 (17:28 +0000)]
[CodeGen] Refactor the option for the maximum jump table size

Refactor the option `max-jump-table-size` to default to the maximum
representable number.  Essentially, NFC.

llvm-svn: 357280

5 years ago[DAG] Set up infrastructure to avoid smart constructor-based dangling nodes
Nirav Dave [Fri, 29 Mar 2019 17:26:40 +0000 (17:26 +0000)]
[DAG] Set up infrastructure to avoid smart constructor-based dangling nodes

Summary:
Various SelectionDAG non-combine operations (e.g. the getNode smart
constructor and legalization) may leave dangling nodes by applying
optimizations without fully pruning unused result values. This results
in nodes that are never added to the worklist and therefore can not be
pruned.

Add a node inserter for the combiner to make sure such nodes have the
chance of being pruned. This allows a number of additional peephole
optimizations.

Reviewers: efriedma, RKSimon, craig.topper, jyknight

Reviewed By: jyknight

Subscribers: msearles, jyknight, sdardis, nemanjai, javed.absar, hiraditya, jrtc27, atanasyan, jsji, llvm-commits

Tags: #llvm

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

llvm-svn: 357279

5 years ago[X86] Fix some tests using fcmp with undef arguments
Simon Pilgrim [Fri, 29 Mar 2019 17:20:27 +0000 (17:20 +0000)]
[X86] Fix some tests using fcmp with undef arguments

Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)

llvm-svn: 357278

5 years ago[Python] Remove readline module
Jonas Devlieghere [Fri, 29 Mar 2019 17:12:08 +0000 (17:12 +0000)]
[Python] Remove readline module

Todd added this empty readline module to workaround an issue with an old
version of Python on Ubuntu in 2014 (18841). In the meantime, libedit
seems to have fixed the underlying issue, and indeed, I wasn't able to
reproduce this.

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

llvm-svn: 357277

5 years agoUse the multi-lockable form of std::lock for operator=
Jim Ingham [Fri, 29 Mar 2019 17:07:30 +0000 (17:07 +0000)]
Use the multi-lockable form of std::lock for operator=

For = operators for lists that have mutexes, we were either
just taking the locks sequentially or hand-rolling a trick
to try to avoid lock inversion.  Use the std::lock mechanism
for this instead.

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

llvm-svn: 357276

5 years ago[fuchsia] Add clang-doc to Fuchsia distribution
Julie Hockett [Fri, 29 Mar 2019 16:56:37 +0000 (16:56 +0000)]
[fuchsia] Add clang-doc to Fuchsia distribution

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

llvm-svn: 357275