OSDN Git Service

android-x86/external-llvm.git
7 years ago[ARM] GlobalISel: Simplify inst selector code. NFC
Diana Picus [Wed, 12 Jul 2017 10:31:16 +0000 (10:31 +0000)]
[ARM] GlobalISel: Simplify inst selector code. NFC

Refactor CmpHelper into something simpler. It was overkill to use
templates for this - instead, use a simple CmpConstants structure to
hold the opcodes and other constants that are different when selecting
int / float / double comparisons. Also, extract some of the helpers that
were in CmpHelper into ARMInstructionSelector and make use of some of
them when selecting other things than just compares.

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

7 years ago[PM] Fix a silly bug in my recent update to the CG update logic.
Chandler Carruth [Wed, 12 Jul 2017 09:08:11 +0000 (09:08 +0000)]
[PM] Fix a silly bug in my recent update to the CG update logic.

I used the wrong variable to update. This was even covered by a unittest
I wrote, and the comments for the unittest were correct (if confusing)
but the test itself just matched the buggy behavior. =[

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

7 years ago[ARM] GlobalISel: Select s64 G_FCMP
Diana Picus [Wed, 12 Jul 2017 09:01:54 +0000 (09:01 +0000)]
[ARM] GlobalISel: Select s64 G_FCMP

Very similar to how we select s32 G_FCMP, the only thing that is
different is the exact opcodes that we use.

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

7 years agoHave Module::createRNG return a unique_ptr
Serge Guelton [Wed, 12 Jul 2017 08:03:44 +0000 (08:03 +0000)]
Have Module::createRNG return a unique_ptr

Instead of a raw pointer, this makes memory management safer.

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

7 years ago[X86][LLVM]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess.
Michael Zuckerman [Wed, 12 Jul 2017 08:01:44 +0000 (08:01 +0000)]
[X86][LLVM]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess.
Adding base test for AVX512

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

7 years ago[X86] Synchronize the ProcessorFeatures enum used by getHostCPUName with the enum...
Craig Topper [Wed, 12 Jul 2017 06:49:58 +0000 (06:49 +0000)]
[X86] Synchronize the ProcessorFeatures enum used by getHostCPUName with the enum in libgcc and soon compiler-rt.

This adds all the feature bits libgcc has. They will soon be added to compiler-rt as well. This adds a second 32 bit feature variable to hold the bits that are needed by getHostCPUName that are not in libgcc. libgcc had already used 31 of the 32 bits in the existing variable and we needed 3 bits so at minimum 2 bits would spill over. I chose to move all 3.

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

7 years ago[X86] Sync ProcessorTypes and ProcessorSubtypes enums used by getHostCPUName with...
Craig Topper [Wed, 12 Jul 2017 06:49:57 +0000 (06:49 +0000)]
[X86] Sync ProcessorTypes and ProcessorSubtypes enums used by getHostCPUName with the version proposed to for compiler-rt's cpu_model.c

This keeps the starting entries in the enums in sync with what's in gcc and in review D35214 for compiler-rt.

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

7 years ago[X86] Cleanup the switches in getHostCPUName to remove impossible combinations.
Craig Topper [Wed, 12 Jul 2017 06:49:56 +0000 (06:49 +0000)]
[X86] Cleanup the switches in getHostCPUName to remove impossible combinations.

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

7 years ago[X86] Remove 'barcelona' string from getHostCPUName. Use 'amdfam10' instead. The...
Craig Topper [Wed, 12 Jul 2017 06:49:55 +0000 (06:49 +0000)]
[X86] Remove 'barcelona' string from getHostCPUName. Use 'amdfam10' instead. The x86 backend doesn't distinguish.

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

7 years ago[MemoryBuiltins] Allow truncation in visitAllocaInst()
Mikael Holmen [Wed, 12 Jul 2017 06:19:10 +0000 (06:19 +0000)]
[MemoryBuiltins] Allow truncation in visitAllocaInst()

Summary:
Solves PR33689.

If the pointer size is less than the size of the type used for the array
size in an alloca (the <ty> type below) then we could trigger the assert in
the PR. In that example we have pointer size i16 and <ty> is i32.

<result> = alloca [inalloca] <type> [, <ty> <NumElements>] [, align <alignment>]

Handle the situation by allowing truncation as well as zero extension in
ObjectSizeOffsetVisitor::visitAllocaInst().

Also, we now detect overflow in visitAllocaInst(), similar to how it was
already done in visitCallSite().

Reviewers: craig.topper, rnk, george.burgess.iv

Reviewed By: george.burgess.iv

Subscribers: davide, llvm-commits

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

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

7 years agoSpecify complete target triple in test
Matthias Braun [Wed, 12 Jul 2017 01:16:50 +0000 (01:16 +0000)]
Specify complete target triple in test

This should fix the problems on the greendragon build.

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

7 years agoFix minor typo introduced in r276404
Don Hinton [Wed, 12 Jul 2017 01:15:46 +0000 (01:15 +0000)]
Fix minor typo introduced in r276404

Summary:
A space was added between '-' and 'help' when emitting help output.

See https://reviews.llvm.org/D22621 for details.

Reviewers: MaggieYi, vsk

Reviewed By: vsk

Subscribers: llvm-commits

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

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

7 years agoLowerTypeTests: When importing functions skip definitions where the summary contains...
Peter Collingbourne [Wed, 12 Jul 2017 00:39:12 +0000 (00:39 +0000)]
LowerTypeTests: When importing functions skip definitions where the summary contains a decl.

This normally indicates mixed CFI + non-CFI compilation, and will
result in us treating the function in the same way as a function
defined outside of the LTO unit.

Part of PR33752.

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

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

7 years ago[Dominators][NFC] Remove extra semicolon...
Jakub Kuderski [Wed, 12 Jul 2017 00:29:16 +0000 (00:29 +0000)]
[Dominators][NFC] Remove extra semicolon...

to silence a gcc warning.

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

7 years ago[WebAssembly] Expose the offset of each data segment
Sam Clegg [Wed, 12 Jul 2017 00:24:54 +0000 (00:24 +0000)]
[WebAssembly] Expose the offset of each data segment

Summary:
This allows tools like lld that process relocations
to apply data relocation correctly. This information
is required because relocation are stored as section
offset.

Subscribers: jfb, dschuff, jgravelle-google, aheejin

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

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

7 years agoFix unused variable warnings
Konstantin Zhuravlyov [Wed, 12 Jul 2017 00:15:53 +0000 (00:15 +0000)]
Fix unused variable warnings

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

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

7 years agoSimplify interface now that we don't need to pass IsPCRel. NFC.
Rafael Espindola [Tue, 11 Jul 2017 23:56:10 +0000 (23:56 +0000)]
Simplify interface now that we don't need to pass IsPCRel. NFC.

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

7 years ago[codeview] Change readobj symbol dumping format
Reid Kleckner [Tue, 11 Jul 2017 23:41:41 +0000 (23:41 +0000)]
[codeview] Change readobj symbol dumping format

Avoid duplicating DictScope with hand-written names everywhere.  Print
the S_-prefixed symbol kind for every record. This should make it easier
to search for certain kinds of records when debugging PDB linking.

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

7 years ago[CMake] Support multi-target runtimes build
Petr Hosek [Tue, 11 Jul 2017 23:41:15 +0000 (23:41 +0000)]
[CMake] Support multi-target runtimes build

This changes adds support for building runtimes for multiple
different targets using LLVM runtimes directory.

The implementation follow the model used already by the builtins
build which already supports this option. To specify the runtimes
targets to be built, use the LLVM_RUNTIME_TARGETS variable, where
the valuae is the list of targets to build runtimes for. To pass
a per target variable to the runtimes build, you can set
RUNTIMES_<target>_<variable> where <variable> will be passed to the
runtimes build for <target>.

Each runtime target (except for the default one) will be installed
into lib/<target> subdirectory. Build targets will be suffixed with
the target name.

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

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

7 years agoFully fix the movw/movt addend.
Rafael Espindola [Tue, 11 Jul 2017 23:18:25 +0000 (23:18 +0000)]
Fully fix the movw/movt addend.

The issue is not if the value is pcrel. It is whether we have a
relocation or not.

If we have a relocation, the static linker will select the upper
bits. If we don't have a relocation, we have to do it.

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

7 years ago[IPO] Temporarily rollback r307215.
Davide Italiano [Tue, 11 Jul 2017 23:10:17 +0000 (23:10 +0000)]
[IPO] Temporarily rollback r307215.

[GlobalOpt] Remove unreachable blocks before optimizing a function.
While the change is presumably correct, it exposes a latent bug
in DI which breaks on of the CFI checks. I'll analyze it further
and try to understand what's going on.

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

7 years ago[Dominators] Use a custom DFS implementation
Jakub Kuderski [Tue, 11 Jul 2017 22:55:04 +0000 (22:55 +0000)]
[Dominators] Use a custom DFS implementation

Summary:
Custom DFS implementation allows us to skip over certain nodes without adding them to the visited map, which is not easily doable with llvm's dfs iterators. What's more, caching predecessors becomes easy.

This patch implements a single DFS function (template) for both forward and reverse DFS, which should be easier to maintain then separate two ones.

Skipping over nodes based on a predicate will be necessary later to implement incremental updates.

There also seems to be a very slight performance improved when bootstrapping clang with this patch on my machine (3:28s -> 3:26s) .

Reviewers: dberlin, sanjoy, davide, grosser

Reviewed By: dberlin

Subscribers: llvm-commits

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

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

7 years ago[codeview] Fix type index discovery for four symbol records
Reid Kleckner [Tue, 11 Jul 2017 22:37:25 +0000 (22:37 +0000)]
[codeview] Fix type index discovery for four symbol records

I encountered these when linking LLD, which uses atls.lib. Those objects
appear to use these uncommon symbol records:

  0x115E S_HEAPALLOCSITE
  0x113D S_ENVBLOCK
  0x1113 S_GTHREAD32
  0x1153 S_FILESTATIC

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

7 years agoEnhance synchscope representation
Konstantin Zhuravlyov [Tue, 11 Jul 2017 22:23:00 +0000 (22:23 +0000)]
Enhance synchscope representation

  OpenCL 2.0 introduces the notion of memory scopes in atomic operations to
  global and local memory. These scopes restrict how synchronization is
  achieved, which can result in improved performance.

  This change extends existing notion of synchronization scopes in LLVM to
  support arbitrary scopes expressed as target-specific strings, in addition to
  the already defined scopes (single thread, system).

  The LLVM IR and MIR syntax for expressing synchronization scopes has changed
  to use *syncscope("<scope>")*, where <scope> can be "singlethread" (this
  replaces *singlethread* keyword), or a target-specific name. As before, if
  the scope is not specified, it defaults to CrossThread/System scope.

  Implementation details:
    - Mapping from synchronization scope name/string to synchronization scope id
      is stored in LLVM context;
    - CrossThread/System and SingleThread scopes are pre-defined to efficiently
      check for known scopes without comparing strings;
    - Synchronization scope names are stored in SYNC_SCOPE_NAMES_BLOCK in
      the bitcode.

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

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

7 years ago[CodeGen] Rename DEBUG_TYPE to match passnames
Evandro Menezes [Tue, 11 Jul 2017 22:08:28 +0000 (22:08 +0000)]
[CodeGen] Rename DEBUG_TYPE to match passnames

Rename missing DEBUG_TYPE "machine-scheduler" from backend files, which were
absent from https://reviews.llvm.org/rL303921.

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

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

7 years ago[x86] auto-generate full checks; NFC
Sanjay Patel [Tue, 11 Jul 2017 22:04:36 +0000 (22:04 +0000)]
[x86] auto-generate full checks; NFC

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

7 years ago[mips][mt] Correct spelling error in comment. NFCI.
Simon Dardis [Tue, 11 Jul 2017 21:36:58 +0000 (21:36 +0000)]
[mips][mt] Correct spelling error in comment. NFCI.

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

7 years ago[mips][mt][2/7] Implement .module and .set directives for the MT ASE.
Simon Dardis [Tue, 11 Jul 2017 21:28:36 +0000 (21:28 +0000)]
[mips][mt][2/7] Implement .module and .set directives for the MT ASE.

This patch implements the .module and .set directives for the MT ASE,
notably that .module sets the relevant flags in .MIPS.abiflags and .set
doesn't.

Reviewers: slthakur, atanasyan

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

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

7 years ago[ARM, ELF] Don't shift movt relocation offsets
Martin Storsjo [Tue, 11 Jul 2017 21:07:10 +0000 (21:07 +0000)]
[ARM, ELF] Don't shift movt relocation offsets

For ELF, a movw+movt pair is handled as two separate relocations.
If an offset should be applied to the symbol address, this offset is
stored as an immediate in the instruction (as opposed to stored as an
offset in the relocation itself).

Even though the actual value stored in the movt immediate after linking
is the top half of the value, we need to store the unshifted offset
prior to linking. When the relocation is made during linking, the offset
gets added to the target symbol value, and the upper half of the value
is stored in the instruction.

This makes sure that movw+movt with offset symbols get properly
handled, in case the offset addition in the lower half should be
carried over to the upper half.

This makes the output from the additions to the test case match
the output from GNU binutils.

For COFF and MachO, the movw/movt relocations are handled as a pair,
and the overflow from the lower half gets carried over to the movt,
so they should keep the shifted offset just as before.

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

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

7 years ago [AArch64] Remove unused IsDarwin & IsNotDarwin predicates (NFCI).
Florian Hahn [Tue, 11 Jul 2017 20:56:24 +0000 (20:56 +0000)]
 [AArch64] Remove unused IsDarwin & IsNotDarwin predicates (NFCI).

Reviewers: t.p.northover, rengolin

Reviewed By: t.p.northover

Subscribers: aemerson, javed.absar, llvm-commits, kristof.beyls

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

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

7 years ago[LoopUnrollRuntime] NFC: Add some debugging trace messages for why loop wasn't unrolled.
Anna Thomas [Tue, 11 Jul 2017 20:44:37 +0000 (20:44 +0000)]
[LoopUnrollRuntime] NFC: Add some debugging trace messages for why loop wasn't unrolled.

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

7 years ago[ProfileData] Add new option to dump topn hottest functions
Xinliang David Li [Tue, 11 Jul 2017 20:30:43 +0000 (20:30 +0000)]
[ProfileData] Add new option to dump topn hottest functions

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

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

7 years ago[NewGVN] Check for congruency of memory accesses.
Davide Italiano [Tue, 11 Jul 2017 19:49:12 +0000 (19:49 +0000)]
[NewGVN] Check for congruency of memory accesses.

This is fine as nothing in the code relies on leader and memory
leader being the same for a given congruency class. Ack'ed by
Dan.

Fixes PR33720.

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

7 years agoreverting 307677.
Michael Zuckerman [Tue, 11 Jul 2017 19:46:11 +0000 (19:46 +0000)]
reverting 307677.

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

7 years ago[NewGVN] Fix an innocent typo I found while debugging PR33720.
Davide Italiano [Tue, 11 Jul 2017 19:19:45 +0000 (19:19 +0000)]
[NewGVN] Fix an innocent typo I found while debugging PR33720.

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

7 years ago[NewGVN] Clarify the function invariants formatting them properly.
Davide Italiano [Tue, 11 Jul 2017 19:15:36 +0000 (19:15 +0000)]
[NewGVN] Clarify the function invariants formatting them properly.

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

7 years ago[PPC] Fix one test case regression for patch https://reviews.llvm.org/D34337.
Tony Jiang [Tue, 11 Jul 2017 19:07:10 +0000 (19:07 +0000)]
[PPC] Fix one test case regression for patch https://reviews.llvm.org/D34337.

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

7 years ago[LibFuzzer] Fix `-Wcomment` warning emitted by GCC.
Dan Liew [Tue, 11 Jul 2017 18:27:52 +0000 (18:27 +0000)]
[LibFuzzer] Fix `-Wcomment` warning emitted by GCC.

```
./FuzzerIOWindows.cpp:185:1: warning: multi-line comment [-Wcomment]
 // Parse a directory ending in separator, like: SomeDir\
 ^
./FuzzerIOWindows.cpp:200:1: warning: multi-line comment [-Wcomment]
 // Parse a servername and share, like: SomeServer\SomeShare\
 ^
```

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

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

7 years ago[LibFuzzer] Fix `-Wpedantic` warning reported by Eric Christopher.
Dan Liew [Tue, 11 Jul 2017 18:27:48 +0000 (18:27 +0000)]
[LibFuzzer] Fix `-Wpedantic` warning reported by Eric Christopher.

The warning is reproducible with GCC 4.8. Thanks to David Blaikie for
the suggested fix.

The reported warning was

```
/usr/local/google/home/echristo/sources/llvm/lib/Fuzzer/FuzzerExtFunctions.def:29:10: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
 EXT_FUNC(__lsan_enable, void, (), false);
          ^
/usr/local/google/home/echristo/sources/llvm/lib/Fuzzer/FuzzerExtFunctionsWeak.cpp:44:24: note: in definition of macro ‘EXT_FUNC’
   CheckFnPtr((void *)::NAME, #NAME, WARN);
                        ^
```

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

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

7 years ago[msan] Only check shadow memory for operands that are sized.
Evgeniy Stepanov [Tue, 11 Jul 2017 18:13:52 +0000 (18:13 +0000)]
[msan] Only check shadow memory for operands that are sized.

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

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

Patch by Matt Morehouse.

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

7 years ago[mips][mt][1/7] Add the MT ASE as a subtarget feature.
Simon Dardis [Tue, 11 Jul 2017 18:03:20 +0000 (18:03 +0000)]
[mips][mt][1/7] Add the MT ASE as a subtarget feature.

Preparatory work for adding the MIPS MT (multi-threading) ASE instructions.

Reviewers: slthakur, atanasyan

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

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

7 years agoRevert "AMDGPU: Do not test for SI in getIsaVersion"
Konstantin Zhuravlyov [Tue, 11 Jul 2017 17:57:41 +0000 (17:57 +0000)]
Revert "AMDGPU: Do not test for SI in getIsaVersion"

This reverts commit r307573.

This breaks downstream test.

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

7 years ago[X86][LLVM]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess.
Michael Zuckerman [Tue, 11 Jul 2017 17:17:49 +0000 (17:17 +0000)]
[X86][LLVM]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess.
Base test for avx512
adding new base test to trunk befor commit change on the test

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

7 years ago[LoopUnrollRuntime] Avoid multi-exit nested loop with epilog generation
Anna Thomas [Tue, 11 Jul 2017 17:16:33 +0000 (17:16 +0000)]
[LoopUnrollRuntime] Avoid multi-exit nested loop with epilog generation

The loop structure for the outer loop does not contain the epilog
preheader when we try to unroll inner loop with multiple exits and
epilog code is generated. For now, we just bail out in such cases.
Added a test case that shows the problem. Without this bailout, we would
trip on assert saying LCSSA form is incorrect for outer loop.

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

7 years ago[Hexagon] Do not rely on callee-saved info in hasFP
Krzysztof Parzyszek [Tue, 11 Jul 2017 17:11:54 +0000 (17:11 +0000)]
[Hexagon] Do not rely on callee-saved info in hasFP

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

7 years ago[Support] - Add bad alloc error handler for handling allocation malfunctions
Reid Kleckner [Tue, 11 Jul 2017 16:45:30 +0000 (16:45 +0000)]
[Support] - Add bad alloc error handler for handling allocation malfunctions

Summary:
Patch by Klaus Kretzschmar

We would like to introduce a new type of llvm error handler for handling
bad alloc fault situations.  LLVM already provides a fatal error handler
for serious non-recoverable error situations which by default writes
some error information to stderr and calls exit(1) at the end (functions
are marked as 'noreturn').

For long running processes (e.g. a server application), exiting the
process is not an acceptable option, especially not when the system is
in a temporary resource bottleneck with a good chance to recover from
this fault situation. In such a situation you would rather throw an
exception to stop the current compilation and try to overcome the
resource bottleneck. The user should be aware of the problem of throwing
an exception in bad alloc situations, e.g. you must not do any
allocations in the unwind chain. This is especially true when adding
exceptions in existing unfamiliar code (as already stated in the comment
of the current fatal error handler)

So the new handler can also be used to distinguish from general fatal
error situations where recovering is no option.  It should be used in
cases where a clean unwind after the allocation is guaranteed.

This patch contains:
- A report_bad_alloc function which calls a user defined bad alloc
  error handler. If no user handler is registered the
  report_fatal_error function is called. This function is not marked as
  'noreturn'.
- A install/restore_bad_alloc_error_handler to install/restore the bad
  alloc handler.
- An example (in Mutex.cpp) where the report_bad_alloc function is
  called in case of a malloc returns a nullptr.

If this patch gets accepted we would create similar patches to fix
corresponding malloc/calloc usages in the llvm code.

Reviewers: chandlerc, greened, baldrick, rnk

Reviewed By: rnk

Subscribers: llvm-commits, MatzeB

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

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

7 years ago[PPC] Fix two bugs in frame lowering.
Tony Jiang [Tue, 11 Jul 2017 16:42:20 +0000 (16:42 +0000)]
[PPC] Fix two bugs in frame lowering.

1. The available program storage region of the red zone to compilers is 288
 bytes rather than 244 bytes.
2. The formula for negative number alignment calculation should be
y = x & ~(n-1) rather than y = (x + (n-1)) & ~(n-1).

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

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

7 years ago[Hexagon] Add support for nontemporal loads and stores on HVX
Krzysztof Parzyszek [Tue, 11 Jul 2017 16:39:33 +0000 (16:39 +0000)]
[Hexagon] Add support for nontemporal loads and stores on HVX

Patch by Michael Wu.

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

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

7 years ago[lit] Fix import StringIO errors in Python 3
Reid Kleckner [Tue, 11 Jul 2017 16:12:53 +0000 (16:12 +0000)]
[lit] Fix import StringIO errors in Python 3

Remove the cStringIO micro-optimization, as it isn't portable to Python
3.

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

7 years ago[lit] Implement non-pipelined echo commands internally
Reid Kleckner [Tue, 11 Jul 2017 16:05:50 +0000 (16:05 +0000)]
[lit] Implement non-pipelined echo commands internally

Summary:
This speeds up the LLD test suite on Windows by 3x. Most of the time is
spent on lld/test/ELF/linkerscript/diagnostics.s, which repeatedly
constructs linker scripts with appending echo commands.

Reviewers: dlj, zturner, modocache

Subscribers: llvm-commits

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

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

7 years ago[SLPVectorizer] Revert change in cancelScheduling with referencing to FirstInBundle...
Dinar Temirbulatov [Tue, 11 Jul 2017 15:54:50 +0000 (15:54 +0000)]
[SLPVectorizer] Revert change in cancelScheduling with referencing to FirstInBundle, NFCI.

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

7 years ago[IR] Remove unnecessary const_casts from ConstantDataSequential and it's subclasses.
Craig Topper [Tue, 11 Jul 2017 15:52:21 +0000 (15:52 +0000)]
[IR] Remove unnecessary const_casts from ConstantDataSequential and it's subclasses.

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

7 years agofix formatting; NFC
Hiroshi Inoue [Tue, 11 Jul 2017 15:41:31 +0000 (15:41 +0000)]
fix formatting; NFC

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

7 years ago[globalisel][tablegen] Change method of squashing unused variable warnings following...
Daniel Sanders [Tue, 11 Jul 2017 14:23:14 +0000 (14:23 +0000)]
[globalisel][tablegen] Change method of squashing unused variable warnings following post-commit comments.

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

7 years ago[SystemZ] Minor fixing in SystemZScheduleZ13.td
Jonas Paulsson [Tue, 11 Jul 2017 14:07:55 +0000 (14:07 +0000)]
[SystemZ]  Minor fixing in SystemZScheduleZ13.td

Some minor corrections for the recently added instructions.

Review: Ulrich Weigand

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

7 years ago[ARM] GlobalISel: Tighten G_FCMP selection test. NFC
Diana Picus [Tue, 11 Jul 2017 12:34:33 +0000 (12:34 +0000)]
[ARM] GlobalISel: Tighten G_FCMP selection test. NFC

Use CHECK-NEXT for the comparison sequence, to make sure we don't get
any unexpected instructions in the middle of our flag manipulation
efforts.

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

7 years ago[DWARF] - Add testcase for checking message about broken relocations.
George Rimar [Tue, 11 Jul 2017 12:29:07 +0000 (12:29 +0000)]
[DWARF] - Add testcase for checking message about broken relocations.

Addresses comments for r306677, which fixed error message itself.

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

7 years ago[X86][AVX512] regenerate avx512-insert-extract.ll
Guy Blank [Tue, 11 Jul 2017 11:51:49 +0000 (11:51 +0000)]
[X86][AVX512] regenerate avx512-insert-extract.ll

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

7 years ago[ARM] GlobalISel: Add reg mapping for s64 G_FCMP
Diana Picus [Tue, 11 Jul 2017 11:47:45 +0000 (11:47 +0000)]
[ARM] GlobalISel: Add reg mapping for s64 G_FCMP

Map the result into GPR and the operands into FPR.

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

7 years ago[PM] Another post-commit fix in NewPMDriver
Philip Pfaffe [Tue, 11 Jul 2017 11:17:44 +0000 (11:17 +0000)]
[PM] Another post-commit fix in NewPMDriver

There were two errors in the parsing of opt's command line options for
extension point pipelines. The EP callbacks are not supposed to return a
value. To check the pipeline text for correctness, I now try to parse it
into a temporary PM object, and print a message on failure. This solves
the compile time error for the lambda return type, as well as correctly
handles unparsable pipelines now.

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

7 years ago[ARM] GlobalISel: Tighten legalizer tests. NFC
Diana Picus [Tue, 11 Jul 2017 10:52:08 +0000 (10:52 +0000)]
[ARM] GlobalISel: Tighten legalizer tests. NFC

Make sure that all the legalizer tests where the original instruction
needs to be removed check for the removal. We do this by adding
CHECK-NOT lines before and after the replacement sequence. This won't
catch pathological cases where the instruction remains somewhere in the
middle of the instruction sequence that's supposed to replace it, but
hopefully that won't occur in practice (since ideally we'd be setting
the insert point for the new instruction sequence either before or after
the original instruction and not fiddle with it while building the
sequence).

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

7 years ago[globalisel][tablegen] Fix an multi-insn match bug where ComplexPattern is used on...
Daniel Sanders [Tue, 11 Jul 2017 10:40:18 +0000 (10:40 +0000)]
[globalisel][tablegen] Fix an multi-insn match bug where ComplexPattern is used on multiple insns.

In each rule, each use of ComplexPattern is assigned an element in the Renderers
array. The matcher then collects renderer functions in this array and they are
used to render instructions. This works well for a single instruction but a
bug in the allocation mechanism causes the elements to be assigned on a
per-instruction basis rather than a per-rule basis.

So in the case of:
  (set GPR32:$dst, (Op complex:$src1, complex:$src2))
tablegen currently assigns elements 0 and 1 to $src1 and $src2 respectively,
but for:
  (set GPR32:$dst, (Op complex:$src1, (Op complex:$src2)))
it currently assigned both $src1 and $src2 the same element (0). This results in
one complex operand being rendered twice and the other being forgotten.
This patch corrects the allocation such that $src1 and $src2 are still allocated
different elements in this case.

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

7 years ago[ARM] ldr pc,=expression should be allowed in Thumb2
Peter Smith [Tue, 11 Jul 2017 09:47:12 +0000 (09:47 +0000)]
[ARM] ldr pc,=expression should be allowed in Thumb2

This change allows the pc to be used as a destination register for the
pseudo instruction LDR pc,=expression . The pseudo instruction must not be
transformed into a MOV, but it can use the Thumb2 LDR (literal) instruction
to a constant pool entry. See (A7.7.43 from ARMv7M ARM ARM).

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

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

7 years ago[ARM] GlobalISel: Fix oversight in G_FCMP legalization
Diana Picus [Tue, 11 Jul 2017 09:43:51 +0000 (09:43 +0000)]
[ARM] GlobalISel: Fix oversight in G_FCMP legalization

We used to forget to erase the original instruction when replacing a
G_FCMP true/false. Fix this bug and make sure the tests check for it.

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

7 years ago[globalisel][tablegen] Correct matching of intrinsic ID's.
Daniel Sanders [Tue, 11 Jul 2017 08:57:29 +0000 (08:57 +0000)]
[globalisel][tablegen] Correct matching of intrinsic ID's.

TreePatternNode considers them to be plain integers but MachineInstr considers
them to be a distinct kind of operand.

The tweak to AArch64InstrInfo.td to produce a simple test case is a NFC for
everything except GlobalISelEmitter (confirmed by diffing the tablegenerated
files). GlobalISelEmitter is currently unable to infer the type of operands in
the Dst pattern from the operands in the Src pattern.

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

7 years ago[ARM] GlobalISel: Legalize s64 G_FCMP
Diana Picus [Tue, 11 Jul 2017 08:50:01 +0000 (08:50 +0000)]
[ARM] GlobalISel: Legalize s64 G_FCMP

Same as the s32 version, for both hard and soft float.

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

7 years agoRevert Revert [MBP] do not rotate loop if it creates extra branch
Serguei Katkov [Tue, 11 Jul 2017 08:34:58 +0000 (08:34 +0000)]
Revert Revert [MBP] do not rotate loop if it creates extra branch

This is a second attempt to land this patch.

The first one resulted in a crash of clang sanitizer buildbot.
The fix is here and regression test is added.

This is a last fix for the corner case of PR32214. Actually this is not really corner case in general.

We should not do a loop rotation if we create an additional branch due to it.
Consider the case where we have a loop chain H, M, B, C , where
H is header with viable fallthrough from pre-header and exit from the loop
M - some middle block
B - backedge to Header but with exit from the loop also.
C - some cold block of the loop.

Let's H is determined as a best exit. If we do a loop rotation M, B, C, H we can introduce the extra branch.
Let's compute the change in number of branches:
+1 branch from pre-header to header
-1 branch from header to exit
+1 branch from header to middle block if there is such
-1 branch from cold bock to header if there is one

So if C is not a predecessor of H then we introduce extra branch.

This change actually prohibits rotation of the loop if both true
  Best Exit has next element in chain as successor.
  Last element in chain is not a predecessor of first element of chain.

Reviewers: iteratee, xur, sammccall, chandlerc
Reviewed By: iteratee
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34745

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

7 years ago[GlobalISel][X86] Use correct AND instructions.
Igor Breger [Tue, 11 Jul 2017 08:04:51 +0000 (08:04 +0000)]
[GlobalISel][X86] Use correct AND instructions.

AND8ri8 not supported in 64bit.

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

7 years ago[CGP] Relax a bit restriction for optimizeMemoryInst to extend scope
Serguei Katkov [Tue, 11 Jul 2017 06:24:44 +0000 (06:24 +0000)]
[CGP] Relax a bit restriction for optimizeMemoryInst to extend scope

CodeGenPrepare::optimizeMemoryInst contains a check that we do nothing
if all instructions combining the address for memory instruction is in the same
block as memory instruction itself.

However if any of these instruction are placed after memory instruction then
address calculation will not be folded to memory instruction.

The added test case shows an example.

Reviewers: loladiro, spatel, efriedma
Reviewed By: efriedma
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34862

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

7 years agofix typos in comments; NFC
Hiroshi Inoue [Tue, 11 Jul 2017 06:04:59 +0000 (06:04 +0000)]
fix typos in comments; NFC

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

7 years ago[PM/ThinLTO] Fix PR33536, a bug where the ThinLTO bitcode writer was
Chandler Carruth [Tue, 11 Jul 2017 05:39:20 +0000 (05:39 +0000)]
[PM/ThinLTO] Fix PR33536, a bug where the ThinLTO bitcode writer was
querying for analysis results on a function declaration rather than
a definition.

The only reason this worked previously is by chance -- because the way
we got alias analysis results with the legacy PM, we happened to not
compute a dominator tree and so we happened to not hit an assert even
though it didn't make any real sense. Now we bail out before trying to
compute alias analysis so that we don't hit these asserts.

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

7 years ago[PowerPC] fix latency for simple integer instructions in POWER9 scheduler
Hiroshi Inoue [Tue, 11 Jul 2017 05:37:16 +0000 (05:37 +0000)]
[PowerPC] fix latency for simple integer instructions in POWER9 scheduler

In the POWER9 instruction scheduler, SchedWriteRes for the simple integer instructions are misconfigured to use that of (costly) DFU instructions.
This results in surprisingly long instruction latency estimation and causes misbehavior in some optimizers such as if-conversion.

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

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

7 years ago[PowerPC] avoid redundant analysis while lowering an immediate; NFC
Hiroshi Inoue [Tue, 11 Jul 2017 05:28:26 +0000 (05:28 +0000)]
[PowerPC] avoid redundant analysis while lowering an immediate; NFC

This patch reduces compilation time by avoiding redundant analysis while selecting instructions to create an immediate.
If the instruction count required to create the input number without rotate is 2, we do not need further analysis to find a shorter instruction sequence with rotate; rotate + load constant cannot be done by 1 instruction (i.e. getInt64CountDirectnever return 0).
This patch should not change functionality.

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

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

7 years ago[AVR] Remove a few very old TODOs that don't have enough context to understand
Dylan McKay [Tue, 11 Jul 2017 05:14:40 +0000 (05:14 +0000)]
[AVR] Remove a few very old TODOs that don't have enough context to understand

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

7 years ago[InstCombine] Add test case for PR33721.
Craig Topper [Tue, 11 Jul 2017 05:12:52 +0000 (05:12 +0000)]
[InstCombine] Add test case for PR33721.

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

7 years ago[AVR] Rename 'ZREGS' to 'ZREG'
Dylan McKay [Tue, 11 Jul 2017 04:53:43 +0000 (04:53 +0000)]
[AVR] Rename 'ZREGS' to 'ZREG'

It will only ever contain one register.

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

7 years ago[AVR] Rename 'AVRTiny' to 'Tiny'
Dylan McKay [Tue, 11 Jul 2017 04:45:15 +0000 (04:45 +0000)]
[AVR] Rename 'AVRTiny' to 'Tiny'

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

7 years ago[AVR] Use the generic branch relaxer
Dylan McKay [Tue, 11 Jul 2017 04:17:13 +0000 (04:17 +0000)]
[AVR] Use the generic branch relaxer

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

7 years agoWhitespace.
NAKAMURA Takumi [Tue, 11 Jul 2017 02:31:54 +0000 (02:31 +0000)]
Whitespace.

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

7 years agoRevert r307581, "Avoid doing conservative phi checks in aliasSameBasePointerGEPs...
NAKAMURA Takumi [Tue, 11 Jul 2017 02:31:51 +0000 (02:31 +0000)]
Revert r307581, "Avoid doing conservative phi checks in aliasSameBasePointerGEPs() if no phis have been visited yet."

It broke stage2 tests in selfhosting.

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

7 years ago[WebAssembly] Fix use of cast vs dyn_cast
Sam Clegg [Tue, 11 Jul 2017 02:21:57 +0000 (02:21 +0000)]
[WebAssembly] Fix use of cast vs dyn_cast

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

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

7 years ago[llvm-cov] Disable threading in a test. NFC.
Vedant Kumar [Tue, 11 Jul 2017 01:42:12 +0000 (01:42 +0000)]
[llvm-cov] Disable threading in a test. NFC.

PR30735 reports an issue where llvm-cov hangs with a worker thread
waiting on a condition, and the main thread waiting to join() the
workers. While this doesn't appear to be a bug in llvm-cov or the
ThreadPool implementation, it would be helpful to disable the use of
threading in the llvm-cov tests where no test coverage is added.

More context: https://bugs.llvm.org/show_bug.cgi?id=30735

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

7 years ago[llvm-cov] Add a cl::opt to control the number of threads
Vedant Kumar [Tue, 11 Jul 2017 01:23:29 +0000 (01:23 +0000)]
[llvm-cov] Add a cl::opt to control the number of threads

When an output directory is specified, llvm-cov spawns some threads to
speed up the process of writing out file reports. Add an option which
allows users to control how many threads llvm-cov uses.

A CommandGuide.rst update + test is included.

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

7 years agollvm-profdata: Improve memory usage by tuning SmallDenseMap size
David Blaikie [Tue, 11 Jul 2017 01:18:28 +0000 (01:18 +0000)]
llvm-profdata: Improve memory usage by tuning SmallDenseMap size

This takes memory usage from 5.1GB to 970MB - it could go further by
using a small size of 2 instead of the default of 4, but given the
rather high cost of going over this limit by much, I figured a little
slosh would be worth the ~130MB of memory usage.

& this'll might not be such a big deal if we use a custom slab allocator
for the DenseMaps here anyway

While the vast majority (99.9%) of records use only 1 entry, the tuning
parameter to SmallDenseMap is the the number of buckets, not the number
of entries - so a small size of 1 wasn't useful, even for 1 element, it
would tip over into allocating (much, 64 slots worth) more space - none
of them ended up small.

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

7 years ago[cmake] Check for Haiku when setting LIB_NAMES for GNU ld
Andrew Wilkins [Tue, 11 Jul 2017 01:17:44 +0000 (01:17 +0000)]
[cmake] Check for Haiku when setting LIB_NAMES for GNU ld

Haiku uses GNU ld for linking, but is not captured in the
conditional when setting LIB_NAMES. This causes a shared
library with no symbols on Haiku. This patch simply adds
a check for whether the CMake system name is Haiku in
addition to the existing checks.

Patch by Jérôme Duval.

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

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

7 years agoRemove circular dependency from runtimes/CMakeLists
George Karpenkov [Tue, 11 Jul 2017 00:48:00 +0000 (00:48 +0000)]
Remove circular dependency from runtimes/CMakeLists

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

7 years ago[lld/pdb] Create an empty public symbol record stream.
Zachary Turner [Mon, 10 Jul 2017 22:40:20 +0000 (22:40 +0000)]
[lld/pdb] Create an empty public symbol record stream.

This is part of the continuing effort to increase parity between
LLD and MSVC PDBs.  link still doesn't like our PDBs, so the most
obvious thing to check was whether adding an empty publics stream
would get it to do something else.  It still fails in the same way
but at least this removes one more variable from the equation.
The next logical step would be to try creating an empty globals
stream.

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

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

7 years agoDoxygen formatting. NFCI
Joel Jones [Mon, 10 Jul 2017 22:11:50 +0000 (22:11 +0000)]
Doxygen formatting. NFCI

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

7 years agoInstrProf: Fix unit test which accidentally used a duplicate name
Vedant Kumar [Mon, 10 Jul 2017 21:44:43 +0000 (21:44 +0000)]
InstrProf: Fix unit test which accidentally used a duplicate name

This unit test constructed some profile records incorrectly. One of the
records had a duplicate name: adding that record into the writer caused
an error unrelated to what needed to be tested.

Reported by David Blaikie!

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

7 years ago[lld/pdb] Add some basic linker module symbols.
Zachary Turner [Mon, 10 Jul 2017 21:01:37 +0000 (21:01 +0000)]
[lld/pdb] Add some basic linker module symbols.

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

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

7 years agoRevert "[DAG] Improve Aliasing of operations to static alloca"
Matthias Braun [Mon, 10 Jul 2017 20:51:30 +0000 (20:51 +0000)]
Revert "[DAG] Improve Aliasing of operations to static alloca"

Reverting as it breaks tramp3d-v4 in the llvm test-suite. I added some
comments to https://reviews.llvm.org/D33345 about it.

This reverts commit r307546.

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

7 years ago[WebAssembly] Add more details to llvm-readobj for wasm files
Sam Clegg [Mon, 10 Jul 2017 20:47:12 +0000 (20:47 +0000)]
[WebAssembly] Add more details to llvm-readobj for wasm files

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

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

7 years ago[ConstantHoisting] Remove dupliate logic in constant hoisting
Leo Li [Mon, 10 Jul 2017 20:45:34 +0000 (20:45 +0000)]
[ConstantHoisting] Remove dupliate logic in constant hoisting

Summary:
As metioned in https://reviews.llvm.org/D34576, checkings in
`collectConstantCandidates` can be replaced by using
`llvm::canReplaceOperandWithVariable`.

The only special case is that `collectConstantCandidates` return false for
all `IntrinsicInst` but it is safe for us to collect constant candidates from
`IntrinsicInst`.

Reviewers: pirama, efriedma, srhines

Reviewed By: efriedma

Subscribers: llvm-commits, javed.absar

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

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

7 years ago[NewGVN] Simplify a lambda a little bit. NFCI.
Davide Italiano [Mon, 10 Jul 2017 20:45:00 +0000 (20:45 +0000)]
[NewGVN] Simplify a lambda a little bit. NFCI.

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

7 years ago[WebAssembly] Be consistent in generating trivial test input files
Sam Clegg [Mon, 10 Jul 2017 20:43:26 +0000 (20:43 +0000)]
[WebAssembly] Be consistent in generating trivial test input files

For each checked-in wasm file, make sure the there is
corresponding .ll file that can be used to regenerate it
if needed.

Add test/Object/Inputs/trivial-object-test.wasm to match other
formats and add some new wasm tests in test/Object.

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

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

7 years agoAdd DAG argument to canMergeStoresTo NFC.
Nirav Dave [Mon, 10 Jul 2017 20:25:54 +0000 (20:25 +0000)]
Add DAG argument to canMergeStoresTo NFC.

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

7 years ago[Hexagon] Convert typed ISD opcodes to generic ones, NFC
Krzysztof Parzyszek [Mon, 10 Jul 2017 20:16:44 +0000 (20:16 +0000)]
[Hexagon] Convert typed ISD opcodes to generic ones, NFC

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

7 years agoAvoid doing conservative phi checks in aliasSameBasePointerGEPs() if no phis have...
Farhana Aleen [Mon, 10 Jul 2017 20:15:40 +0000 (20:15 +0000)]
Avoid doing conservative phi checks in aliasSameBasePointerGEPs() if no phis have been visited yet.

Reviewers: Daniel Berlin

Subscribers: llvm-commits

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

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

7 years ago[Hexagon] Remove unused ISD opcodes, NFC
Krzysztof Parzyszek [Mon, 10 Jul 2017 20:13:44 +0000 (20:13 +0000)]
[Hexagon] Remove unused ISD opcodes, NFC

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

7 years agoUse DenseMap instead std::map for GVSummaryMapTy.
Dehao Chen [Mon, 10 Jul 2017 20:12:54 +0000 (20:12 +0000)]
Use DenseMap instead std::map for GVSummaryMapTy.

Summary: This speeds-up thin-link by ~47% for large programs.

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: sanjoy, llvm-commits, mehdi_amini

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

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