OSDN Git Service

android-x86/external-llvm.git
7 years ago[ARM] Fix typo in test added in r307889
Florian Hahn [Thu, 13 Jul 2017 08:53:43 +0000 (08:53 +0000)]
[ARM] Fix typo in test added in r307889

This fixes the following test failure:
    LLVM :: Transforms/Inline/ARM/inline-target-attr.ll

Sorry for any inconenience.

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

7 years ago[AVR] Fix broken indentation
Dylan McKay [Thu, 13 Jul 2017 08:40:59 +0000 (08:40 +0000)]
[AVR] Fix broken indentation

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

7 years ago[AVR] Add a 'LLVM_FALLTHROUGH' statement to the AsmParser
Dylan McKay [Thu, 13 Jul 2017 08:39:46 +0000 (08:39 +0000)]
[AVR] Add a 'LLVM_FALLTHROUGH' statement to the AsmParser

Should fix warnings in the build.

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

7 years ago[ARM] Inline callee if its target-features are a subset of the caller
Florian Hahn [Thu, 13 Jul 2017 08:26:17 +0000 (08:26 +0000)]
[ARM] Inline callee if its target-features are a subset of the caller

Summary:
Similar to X86, it should be safe to inline callees if their
target-features are a subset of the caller. As some subtarget features
provide different instructions depending on whether they are set or
unset (e.g. ThumbMode and ModeSoftFloat), we use a whitelist of
target-features describing hardware capabilities only.

Reviewers: kristof.beyls, rengolin, t.p.northover, SjoerdMeijer, peter.smith, silviu.baranga, efriedma

Reviewed By: SjoerdMeijer, efriedma

Subscribers: dschuff, efriedma, aemerson, sdardis, javed.absar, arichardson, eraman, llvm-commits

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

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

7 years ago[AVR] Fix indirect calls to function pointers
Dylan McKay [Thu, 13 Jul 2017 08:09:36 +0000 (08:09 +0000)]
[AVR] Fix indirect calls to function pointers

Patch by Carl Peto.

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

7 years agoAdd original reproducer for r307754 / PR33689
Mikael Holmen [Thu, 13 Jul 2017 07:38:53 +0000 (07:38 +0000)]
Add original reproducer for r307754 / PR33689

Apparently I managed to drop the test case between two revisions in
Phabricator: https://reviews.llvm.org/D35003

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

7 years agofix typos in comments and error messges; NFC
Hiroshi Inoue [Thu, 13 Jul 2017 06:48:39 +0000 (06:48 +0000)]
fix typos in comments and error messges; NFC

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

7 years ago[X86] Simplify the getHostCPUName for AMD family 6 and 15.
Craig Topper [Thu, 13 Jul 2017 06:34:10 +0000 (06:34 +0000)]
[X86] Simplify the getHostCPUName for AMD family 6 and 15.

As far as I can tell we can simply distinguish based on features rather than model number. Many of the strings we were previously using are treated the same by the backend.

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

7 years ago[llvm-objdump] Correctly distinguish between the MachO upper/lower16 relocations
Martin Storsjo [Thu, 13 Jul 2017 05:54:08 +0000 (05:54 +0000)]
[llvm-objdump] Correctly distinguish between the MachO upper/lower16 relocations

All other code in MachODump.cpp uses the same comparison,
((r_length & 0x1) == 1), for distinguishing between the two,
while the code in llvm-objdump.cpp seemed to be incorrect.

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

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

7 years ago[opt-viewer] Don't except when debug info is not available.
Davide Italiano [Thu, 13 Jul 2017 04:19:13 +0000 (04:19 +0000)]
[opt-viewer] Don't except when debug info is not available.

For records without DebugLoc we simply skip the caller location in
map_remarks.

Fixes PR33764.

Patch by Simon Whittaker!

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

7 years ago[TargetLowering] Add hook for adding target MMO flags when doing ISel.
Geoff Berry [Thu, 13 Jul 2017 03:49:42 +0000 (03:49 +0000)]
[TargetLowering] Add hook for adding target MMO flags when doing ISel.

Summary: Add TargetLowering hook getMMOFlags() to add target specific
MMO flags to load/store instructions created by ISel.

Reviewers: bogner, hfinkel, qcolombet, MatzeB

Subscribers: mcrosier, javed.absar, llvm-commits

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

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

7 years ago[MIR] Add support for printing and parsing target MMO flags
Geoff Berry [Thu, 13 Jul 2017 02:28:54 +0000 (02:28 +0000)]
[MIR] Add support for printing and parsing target MMO flags

Summary: Add target hooks for printing and parsing target MMO flags.
Targets may override getSerializableMachineMemOperandTargetFlags() to
return a mapping from string to flag value for target MMO values that
should be serialized/parsed in MIR output.

Add implementation of this hook for AArch64 SuppressPair MMO flag.

Reviewers: bogner, hfinkel, qcolombet, MatzeB

Subscribers: mcrosier, javed.absar, llvm-commits

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

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

7 years ago[libFuzzer] make sure that -reduce_inputs=1 deletes redundant files in the corpus
Kostya Serebryany [Thu, 13 Jul 2017 01:56:37 +0000 (01:56 +0000)]
[libFuzzer] make sure that -reduce_inputs=1 deletes redundant files in the corpus

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

7 years ago[sanstats] Remove a flaky test.
Davide Italiano [Thu, 13 Jul 2017 01:36:12 +0000 (01:36 +0000)]
[sanstats] Remove a flaky test.

I don't know a reliable way of crafting a test for this case,
but I'll try a little harder. In the meanwhile, let's get the
bots green again. Please note this will be tested by `check-cfi`
once r307215 relands.

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

7 years ago[libFuzzer] experimental feature -reduce_inputs (off by default) that tries to replac...
Kostya Serebryany [Thu, 13 Jul 2017 01:08:53 +0000 (01:08 +0000)]
[libFuzzer] experimental feature -reduce_inputs (off by default) that tries to replace elements in the corpus with smaller ones that have the same feature set. Still needs tuning

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

7 years ago[DWARF] Fixing a bug with processing of DWARF v5 indexed strings in Mach-O objects.
Wolfgang Pieb [Thu, 13 Jul 2017 01:03:28 +0000 (01:03 +0000)]
[DWARF] Fixing a bug with processing of DWARF v5 indexed strings in Mach-O objects.
Code to convert MachO - specific section debug section names to standard DWARF v5
section names was in the wrong place.

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

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

7 years ago[sanstats] Print the correct line information.
Davide Italiano [Thu, 13 Jul 2017 00:49:03 +0000 (00:49 +0000)]
[sanstats] Print the correct line information.

The instrumentation tracks the return address and not that of the
call so we remove one to compensate. Thanks for Peter Collingbourne
for confirming the analysis of the problem.

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

7 years ago[CodeGenPrepare] Don't create dead instructions in addrmode sinking
Eli Friedman [Wed, 12 Jul 2017 23:30:02 +0000 (23:30 +0000)]
[CodeGenPrepare] Don't create dead instructions in addrmode sinking

When we fail to sink an instruction, we must make sure not to modify
the function; otherwise, we end up in an infinite loop because
CodeGenPrepare iterates until it doesn't make any changes.

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

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

7 years ago[PGO] Enhance pgo counter promotion
Xinliang David Li [Wed, 12 Jul 2017 23:27:44 +0000 (23:27 +0000)]
[PGO] Enhance pgo counter promotion

This is an incremental change to the promotion feature.

There are two problems with the current behavior:
1) loops with multiple exiting blocks are totally disabled
2) a counter update can only be promoted one level up in
  the loop nest -- which does help much for short trip
  count inner loops inside a high trip-count outer loops.

Due to this limitation, we still saw very large profile
count fluctuations from run to run for the affected loops
which are usually very hot.

This patch adds the support for promotion counters iteratively
across the loop nest. It also turns on the promotion for
loops with multiple exiting blocks (with a limit).

For single-threaded applications, the performance impact is flat
on average. For instance, dealII improves, but povray regresses.

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

7 years ago[libFuzzer] relax test/shrink.test a bit (got broken on windows)
Kostya Serebryany [Wed, 12 Jul 2017 23:22:32 +0000 (23:22 +0000)]
[libFuzzer] relax test/shrink.test a bit (got broken on windows)

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

7 years agoAMDGPU: Fix converting unanalyzable global loads to SMRD
Matt Arsenault [Wed, 12 Jul 2017 23:06:18 +0000 (23:06 +0000)]
AMDGPU: Fix converting unanalyzable global loads to SMRD

Not all memory dependence queries succeed, so this needs to
be conservative if it fails.

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

7 years ago[SjLj] Replace recursive block marking algorithm with iterative algorithm
Gerolf Hoflehner [Wed, 12 Jul 2017 23:05:15 +0000 (23:05 +0000)]
[SjLj] Replace recursive block marking algorithm with iterative algorithm

Summary:
Some programs run into a stack overflow issue. This change avoids this
problem by replacing the recursive algorithm with the iterative version.

Reviewers: MatzeB, t.p.northover, dblaikie

Reviewed By: MatzeB

Subscribers: llvm-commits

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

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

7 years ago[x86] add select-of-constant tests; NFC
Sanjay Patel [Wed, 12 Jul 2017 22:42:39 +0000 (22:42 +0000)]
[x86] add select-of-constant tests; NFC

We're using cmov in these cases, but we could reduce to simpler ops.

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

7 years ago[libFuzzer] remove include <sanitizer/coverage_interface.h>, not needed any more
Kostya Serebryany [Wed, 12 Jul 2017 22:22:36 +0000 (22:22 +0000)]
[libFuzzer] remove  include <sanitizer/coverage_interface.h>, not needed any more

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

7 years ago[libFuzzer] refactoring in preparation for -reduce_inputs; NFC intended
Kostya Serebryany [Wed, 12 Jul 2017 22:20:04 +0000 (22:20 +0000)]
[libFuzzer] refactoring in preparation for -reduce_inputs; NFC intended

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

7 years agoAdd element atomic memset intrinsic
Daniel Neilson [Wed, 12 Jul 2017 21:57:23 +0000 (21:57 +0000)]
Add element atomic memset intrinsic

Summary: Continuing the work from https://reviews.llvm.org/D33240, this change introduces an element unordered-atomic memset intrinsic. This intrinsic is essentially memset with the implementation requirement that all stores used for the assignment are done with unordered-atomic stores of a given element size.

Reviewers: eli.friedman, reames, mkazantsev, skatkov

Reviewed By: reames

Subscribers: jfb, dschuff, sbc100, jgravelle-google, aheejin, efriedma, llvm-commits

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

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

7 years ago[Solaris] Detect Solaris LD, use detection results to pass Solaris-ld options
Rui Ueyama [Wed, 12 Jul 2017 21:43:14 +0000 (21:43 +0000)]
[Solaris] Detect Solaris LD, use detection results to pass Solaris-ld options

Solaris ld is not the only linker available on Solaris.
Introducing linker detection and using LLVM_LINKER_IS_SOLARISLD to
select Solaris-ld specific handling.

Patch by: Fedor Sergeev

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

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

7 years ago[AArch64] Only run macro fusion for CPUs with any fusion support.
Florian Hahn [Wed, 12 Jul 2017 21:41:28 +0000 (21:41 +0000)]
[AArch64] Only run macro fusion for CPUs with any fusion support.

Reviewers: evandro, t.p.northover, javed.absar

Reviewed By: evandro

Subscribers: aemerson, rengolin, kristof.beyls, llvm-commits

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

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

7 years agoUse --color-diagnostics instead of -color-diagnostics.
Rui Ueyama [Wed, 12 Jul 2017 21:37:02 +0000 (21:37 +0000)]
Use --color-diagnostics instead of -color-diagnostics.

Solaris ld interprets -color-diagnostics as a -c option, so it is
better to use --color-diagnostics instead. lld accepts both.

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

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

7 years agoAllow clients to specify search order of DynamicLibraries.
Frederich Munch [Wed, 12 Jul 2017 21:22:45 +0000 (21:22 +0000)]
Allow clients to specify search order of DynamicLibraries.

Summary: Different JITs and other clients of LLVM may have different needs in how symbol resolution should occur.

Reviewers: v.g.vassilev, lhames, karies

Reviewed By: v.g.vassilev

Subscribers: pcanal, llvm-commits

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

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

7 years ago[AMDGPU] fcanonicalize elimination optimization
Stanislav Mekhanoshin [Wed, 12 Jul 2017 21:20:28 +0000 (21:20 +0000)]
[AMDGPU] fcanonicalize elimination optimization

We are using multiplication by 1.0 to flush denormals and quiet sNaNs.
That is possible to omit this multiplication if source of the
fcanonicalize instruction is known to be flushed/quieted, i.e.
if it comes from another instruction known to do the normalization
and we are using IEEE mode to quiet sNaNs.

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

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

7 years agoDon't expose a map in the DWARFContext interface.
Rafael Espindola [Wed, 12 Jul 2017 21:08:24 +0000 (21:08 +0000)]
Don't expose a map in the DWARFContext interface.

Doing so is leaking an implementation detail.

I have an implementation that uses the lld infrastructure and doesn't
use a map or object::SectionRef.

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

7 years ago[LoopUnrollRuntime] NFC: Refactored safety checks of unrolling multi-exit loop
Anna Thomas [Wed, 12 Jul 2017 20:55:43 +0000 (20:55 +0000)]
[LoopUnrollRuntime] NFC: Refactored safety checks of unrolling multi-exit loop

Refactored the code and separated out a function
`canSafelyUnrollMultiExitLoop` to reduce redundant checks and make it
easier to add profitability heuristics later.
Added tests to runtime unrolling to make sure that unrolling for
multi-exit loops is not done unless the option
-unroll-runtime-multi-exit is true.

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

7 years ago[AArch64] Add AArch64Subtarget::isFusion function.
Florian Hahn [Wed, 12 Jul 2017 20:53:22 +0000 (20:53 +0000)]
[AArch64] Add AArch64Subtarget::isFusion function.

Summary:
isFusion returns true if the subtarget supports any kind of instruction
fusion, similar to ARMSubtarget::isFusion. This was suggested in D34142.

This changes the current behavior slightly, because the macro fusion mutation
is now added to the PostRA MachineScheduler in case the subtarget supports
any kind of fusion. I think that makes sense because if the PostRA
MachineScheduler is run, there is potential that instructions scheduled back to
back are re-scheduled.

Reviewers: evandro, t.p.northover, joelkevinjones, joel_k_jones, steleman

Reviewed By: joelkevinjones

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

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

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

7 years ago[WebAssembly] Mark element atomic memcpy/memmove intrinsics as unsupported
Heejin Ahn [Wed, 12 Jul 2017 20:50:04 +0000 (20:50 +0000)]
[WebAssembly] Mark element atomic memcpy/memmove intrinsics as unsupported

Summary:
Element atomic intrinsicAtomic instructions are not yet supported in WebAssembly, so we mark them as
unsupported for the moment.

Reviewers: sunfish, dschuff, sbc100

Reviewed By: dschuff, sbc100

Subscribers: jfb, sbc100, jgravelle-google

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

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

7 years agoRemove unneeded use of #undef DEBUG_TYPE. NFC
Sam Clegg [Wed, 12 Jul 2017 20:49:21 +0000 (20:49 +0000)]
Remove unneeded use of #undef DEBUG_TYPE. NFC

Where is is needed (at the end of headers that define it), be
consistent about its use.

Also fix a few header guards that I found in the process.

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

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

7 years ago[LV] Don't allow outside uses of IVs if the SCEV is predicated on loop conditions.
Michael Kuperstein [Wed, 12 Jul 2017 19:53:55 +0000 (19:53 +0000)]
[LV] Don't allow outside uses of IVs if the SCEV is predicated on loop conditions.

This fixes PR33706.
Differential Revision: https://reviews.llvm.org/D35227

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

7 years ago[mips][mt][6/7] Add support for mftr, mttr instructions.
Simon Dardis [Wed, 12 Jul 2017 19:47:45 +0000 (19:47 +0000)]
[mips][mt][6/7] Add support for mftr, mttr instructions.

Unlike many other instructions, these instructions have aliases which
take coprocessor registers, gpr register, accumulator (and dsp accumulator)
registers, floating point registers, floating point control registers and
coprocessor 2 data and control operands.

For the moment, these aliases are treated as pseudo instructions which are
expanded into the underlying instruction. As a result, disassembling these
instructions shows the underlying instruction and not the alias.

Reviewers: slthakur, atanasyan

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

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

7 years agoFix non-Windows build after PDB native builtin type change
Reid Kleckner [Wed, 12 Jul 2017 19:46:35 +0000 (19:46 +0000)]
Fix non-Windows build after PDB native builtin type change

Some C++14 features slipped in along with an extra member qualification.

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

7 years ago[PDB] Enable NativeSession to create symbols for built-in types on demand
Adrian McCarthy [Wed, 12 Jul 2017 19:38:11 +0000 (19:38 +0000)]
[PDB] Enable NativeSession to create symbols for built-in types on demand

Summary:
There is a reserved range of type indexes for built-in types (like integers).
This will create a symbol for a built-in type if the caller askes for one by
type index.  This is also plumbing for being able to recall symbols by type
index in general, but user-defined types will come in subsequent patches.

Reviewers: rnk, zturner

Subscribers: mgorny, hiraditya, llvm-commits

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

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

7 years agoFix to web assembly lib call list
Daniel Neilson [Wed, 12 Jul 2017 19:24:07 +0000 (19:24 +0000)]
Fix to web assembly lib call list

Summary:
 Revision 307796 caused an internal build break in WebAssembly bots in the form of a
crash.  ex:
Here's the crash dump from one of the failing tests:

/usr/local/google/home/blaikie/dev/llvm/build/default/./bin/llc < /usr/local/google/home/blaikie/dev/llvm/src/test/CodeGen/WebAssembly/global.ll -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/FileCheck /usr/local/google/home/blaikie/dev/llvm/src/test/CodeGen/WebAssembly/global.ll
--
Exit Code: 2

Command Output (stderr):
--
Stack dump:
0.      Program arguments: build/default/./bin/llc -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals
1.      Running pass 'Function Pass Manager' on module '<stdin>'.
2.      Running pass 'WebAssembly Assembly Printer' on function '@call_memcpy'
FileCheck error: '-' is empty.
FileCheck command line:  build/default/./bin/FileCheck src/test/CodeGen/WebAssembly/global.ll

The problem is in lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp. There’s an array declared:
545 static const char *
Fix to web assembly lib call list

Summary:
 Revision 307796 caused an internal build break in WebAssembly bots in the form of a
crash.  ex:
Here's the crash dump from one of the failing tests:

/usr/local/google/home/blaikie/dev/llvm/build/default/./bin/llc < /usr/local/google/home/blaikie/dev/llvm/src/test/CodeGen/WebAssembly/global.ll -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/FileCheck /usr/local/google/home/blaikie/dev/llvm/src/test/CodeGen/WebAssembly/global.ll
--
Exit Code: 2

Command Output (stderr):
--
Stack dump:
0.      Program arguments: build/default/./bin/llc -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals
1.      Running pass 'Function Pass Manager' on module '<stdin>'.
2.      Running pass 'WebAssembly Assembly Printer' on function '@call_memcpy'
FileCheck error: '-' is empty.
FileCheck command line:  build/default/./bin/FileCheck src/test/CodeGen/WebAssembly/global.ll

The problem is in lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp. There’s an array declared:
static const char *
RuntimeLibcallNames[RTLIB::UNKNOWN_LIBCALL] = {

 That is defining a runtime lib call name for each entry in the enum RTLIB:Libcall from include/llvm/CodeGen/RuntimeLibcalls.h.

Revision 307796 added entries to the enum, but didn’t add entries to the RuntimeLibcallNames array, which caused a crash when attempting
to access past the end of the array.

This patch fixes the issue by adding the element atomic memmove to the WebAssembly arrays.

Reviewed by: reames

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

7 years ago[LoopRotate] Fix DomTree update logic for unreachable nodes. Fix PR33701.
Jakub Kuderski [Wed, 12 Jul 2017 18:42:16 +0000 (18:42 +0000)]
[LoopRotate] Fix DomTree update logic for unreachable nodes. Fix PR33701.

Summary:
LoopRotate manually updates the DoomTree by iterating over all predecessors of a basic block and computing the Nearest Common Dominator.

When a predecessor happens to be unreachable, `DT.findNearestCommonDominator` returns nullptr.

This patch teaches LoopRotate to handle this case and fixes [[ https://bugs.llvm.org/show_bug.cgi?id=33701 | PR33701 ]].

In the future, LoopRotate should be taught to use the new incremental API for updating the DomTree.

Reviewers: dberlin, davide, uabelho, grosser

Subscribers: efriedma, mzolotukhin

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

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

7 years agoUse std::mutex to avoid memory allocation after OOM
Reid Kleckner [Wed, 12 Jul 2017 18:23:06 +0000 (18:23 +0000)]
Use std::mutex to avoid memory allocation after OOM

ManagedStatic<sys::Mutex> would lazilly allocate a sys::Mutex to lock
when reporting an OOM, which is a bad idea.

The three STL implementations that I know of use pthread_mutex_lock and
EnterCriticalSection to implement std::mutex. I'm pretty sure that
neither of those allocate heap memory.

It seems that we unconditionally use std::mutex without testing
LLVM_ENABLE_THREADS elsewhere in the codebase, so this should be
portable.

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

7 years ago[libFuzzer] Add a dependency on symbolizer from libFuzzer tests
George Karpenkov [Wed, 12 Jul 2017 18:17:34 +0000 (18:17 +0000)]
[libFuzzer] Add a dependency on symbolizer from libFuzzer tests

Some libFuzzer tests on Linux would fail with bizarre error messages
unless llvm-symbolizer binary is present.

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

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

7 years ago[libFuzzer] NFC Declare LIBFUZZER_FLAGS_BASE outside of an if-block
George Karpenkov [Wed, 12 Jul 2017 18:16:09 +0000 (18:16 +0000)]
[libFuzzer] NFC Declare LIBFUZZER_FLAGS_BASE outside of an if-block

The current code relies on the assumption that tests are included only
if LLVM_USE_SANITIZE_COVERAGE is enabled.
This commit makes it easier to relax the assumption in the future, as
the variable LIBFUZZER_FLAGS_BASE is used further in libFuzzer tests.

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

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

7 years ago[libFuzzer] Do not use LLVM ostream in tests
George Karpenkov [Wed, 12 Jul 2017 18:14:19 +0000 (18:14 +0000)]
[libFuzzer] Do not use LLVM ostream in tests

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

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

7 years ago[x86] improve SBB optimizations for SETB/SETA with subtract
Sanjay Patel [Wed, 12 Jul 2017 17:56:46 +0000 (17:56 +0000)]
[x86] improve SBB optimizations for SETB/SETA with subtract

This is another step towards removing a combine that turns sext
into select of constants and preparing the backend for an IR
future where select is the canonical form.

Earlier commits in this area:
https://reviews.llvm.org/rL306040
https://reviews.llvm.org/rL306072
https://reviews.llvm.org/rL307404 (https://reviews.llvm.org/D34652)
https://reviews.llvm.org/rL307471

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

7 years ago[x86] add tests for improving sbb transforms; NFC
Sanjay Patel [Wed, 12 Jul 2017 17:44:50 +0000 (17:44 +0000)]
[x86] add tests for improving sbb transforms; NFC

We're subtracting X from X the hard way...

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

7 years agoGlobalISel: Handle selection of G_IMPLICIT_DEF in AArch64
Justin Bogner [Wed, 12 Jul 2017 17:32:32 +0000 (17:32 +0000)]
GlobalISel: Handle selection of G_IMPLICIT_DEF in AArch64

A generic variant of IMPLICIT_DEF was added in r306875, but this
survives to selection and hits a `Cannot Select`. Add handling that
converts the note to a regular IMPLICIT_DEF.

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

7 years agoAdd a test for r307754
George Burgess IV [Wed, 12 Jul 2017 16:30:37 +0000 (16:30 +0000)]
Add a test for r307754

As promised in D35003.

Uses -codegenprepare instead of -instcombine since we hit the same
buggy path anyway, and CGP lets us keep this test really simple
(instcombine likes turning the alloca T, N into alloca [N x T], which
hides the bug this is testing for).

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

7 years ago[mips][mt][5/7] Add support for fork and yield instructions.
Simon Dardis [Wed, 12 Jul 2017 16:23:57 +0000 (16:23 +0000)]
[mips][mt][5/7] Add support for fork and yield instructions.

Reviewers: slthakur, atanasyan

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

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

7 years agoAdd back a CHECK line.
Rafael Espindola [Wed, 12 Jul 2017 16:14:00 +0000 (16:14 +0000)]
Add back a CHECK line.

I accidentally removed it in r307730.

Thanks to Martin Storsjö for noticing!

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

7 years ago[CodeGen] Add dependency printer
Evandro Menezes [Wed, 12 Jul 2017 15:30:59 +0000 (15:30 +0000)]
[CodeGen] Add dependency printer

Add SDep printer to make debugging sessions more productive.

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

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

7 years ago[X86/FastIsel] Fall-back to SelectionDAG when lowering soft-floats.
Davide Italiano [Wed, 12 Jul 2017 15:26:06 +0000 (15:26 +0000)]
[X86/FastIsel] Fall-back to SelectionDAG when lowering soft-floats.

FastIsel can't handle them, so we would end up crashing during
register class selection.
Fixes PR26522.

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

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

7 years agoAdd element atomic memmove intrinsic
Daniel Neilson [Wed, 12 Jul 2017 15:25:26 +0000 (15:25 +0000)]
Add element atomic memmove intrinsic

Summary: Continuing the work from https://reviews.llvm.org/D33240, this change introduces an element unordered-atomic memmove intrinsic. This intrinsic is essentially memmove with the implementation requirement that all loads/stores used for the copy are done with unordered-atomic loads/stores of a given element size.

Reviewers: eli.friedman, reames, mkazantsev, skatkov

Reviewed By: reames

Subscribers: llvm-commits

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

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

7 years ago[mips][mt][4/7] Add IAS support for dvpe, evpe instructions.
Simon Dardis [Wed, 12 Jul 2017 14:48:27 +0000 (14:48 +0000)]
[mips][mt][4/7] Add IAS support for dvpe, evpe instructions.

Reviewers: slthakur, atanasyan

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

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

7 years ago[X86][SSE] Fix file check prefix warning breaking buildbots
Simon Pilgrim [Wed, 12 Jul 2017 13:41:13 +0000 (13:41 +0000)]
[X86][SSE] Fix file check prefix warning breaking buildbots

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

7 years agoMake shell redirection construct portable
Kamil Rytarowski [Wed, 12 Jul 2017 13:24:46 +0000 (13:24 +0000)]
Make shell redirection construct portable

Summary:
NetBSD shell sh(1) does not support ">& /dev/null" construct.
This is bashism. The portable and POSIX solution is to use:
"> /dev/null 2>&1".

This change fixes 22 Unexpected Failures on NetBSD/amd64
for the "check-llvm" target.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, dim, rnk

Reviewed By: joerg, rnk

Subscribers: rnk, davide, llvm-commits

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

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

7 years ago[ARM] Adjust ifcvt heuristic for the diamond ifcvt case
John Brawn [Wed, 12 Jul 2017 13:23:10 +0000 (13:23 +0000)]
[ARM] Adjust ifcvt heuristic for the diamond ifcvt case

When we have a diamond ifcvt the fallthough block will have a branch at the end
of it that disappears when predicated, so discount it from the predication cost.

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

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

7 years ago[X86][SSE] Add 512-bit (iX bitcast(vXi1)) test cases
Simon Pilgrim [Wed, 12 Jul 2017 12:44:10 +0000 (12:44 +0000)]
[X86][SSE] Add 512-bit (iX bitcast(vXi1)) test cases

Improves test coverage for pre-AVX512 targets as well

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

7 years ago[mips][mt] Add missing files from last commit
Simon Dardis [Wed, 12 Jul 2017 12:33:40 +0000 (12:33 +0000)]
[mips][mt] Add missing files from last commit

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

7 years agofix typo in document; NFC
Hiroshi Inoue [Wed, 12 Jul 2017 12:16:22 +0000 (12:16 +0000)]
fix typo in document; NFC

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

7 years ago[mips][mt][3/7] Add IAS support for emt, dmt instructions.
Simon Dardis [Wed, 12 Jul 2017 11:57:44 +0000 (11:57 +0000)]
[mips][mt][3/7] Add IAS support for emt, dmt instructions.

Reviewers: slthakur, atanasyan

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

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

7 years ago[Linker] Add directives to support mixing ARM/Thumb module-level inline asm.
Florian Hahn [Wed, 12 Jul 2017 11:52:28 +0000 (11:52 +0000)]
[Linker] Add directives to support mixing ARM/Thumb module-level inline asm.

Summary:
By prepending `.text .thumb .balign 2` to the module-level inline
assembly from a Thumb module, the assembler will generate the assembly
from that module as Thumb, even if the destination module uses an ARM
triple. Similar directives are used for module-level inline assembly in
ARM modules.

The alignment and instruction set are reset based on the target triple
before emitting the first function label.

Reviewers: olista01, tejohnson, echristo, t.p.northover, rafael

Reviewed By: echristo

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

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

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

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