OSDN Git Service

android-x86/external-llvm.git
8 years agoTry to fix the MSVC build
Vedant Kumar [Sat, 25 Jun 2016 03:27:29 +0000 (03:27 +0000)]
Try to fix the MSVC build

There's some kind of issue with using "constexpr unsigned" in an
anonymous namespace.

http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/13395

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

8 years ago[AMDGPU] Emit debugger prologue and emit the rest of the debugger fields in the kerne...
Konstantin Zhuravlyov [Sat, 25 Jun 2016 03:11:28 +0000 (03:11 +0000)]
[AMDGPU] Emit debugger prologue and emit the rest of the debugger fields in the kernel code header

Debugger prologue is emitted if -mattr=+amdgpu-debugger-emit-prologue.

Debugger prologue writes work group IDs and work item IDs to scratch memory at fixed location in the following format:
  - offset 0: work group ID x
  - offset 4: work group ID y
  - offset 8: work group ID z
  - offset 16: work item ID x
  - offset 20: work item ID y
  - offset 24: work item ID z

Set
  - amd_kernel_code_t::debug_wavefront_private_segment_offset_sgpr to scratch wave offset reg
  - amd_kernel_code_t::debug_private_segment_buffer_sgpr to scratch rsrc reg
  - amd_kernel_code_t::is_debug_supported to true if all debugger features are enabled

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

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

8 years agollvm-ar: add some tests for llvm-ar default selection
Saleem Abdulrasool [Sat, 25 Jun 2016 03:05:56 +0000 (03:05 +0000)]
llvm-ar: add some tests for llvm-ar default selection

This adds some tests for the smarter llvm-ar selection mode as well as some
additional tests as per Rafael's post commit review comments.

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

8 years ago[llvm-cov] Separate presentation logic from formatting logic, NFC
Vedant Kumar [Sat, 25 Jun 2016 02:58:30 +0000 (02:58 +0000)]
[llvm-cov] Separate presentation logic from formatting logic, NFC

This makes it easier to add renderers for new kinds of output formats.

- Define and document a pure-virtual coverage rendering interface.
- Move the text-based rendering logic into its a new file.
- Re-work the API to better reflect the presentation/formatting split.

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

8 years agoMachineScheduler: Remember top/bottom choice in bidirectional scheduling
Matthias Braun [Sat, 25 Jun 2016 02:03:36 +0000 (02:03 +0000)]
MachineScheduler: Remember top/bottom choice in bidirectional scheduling

Remember the last choice for the top/bottom scheduling boundary in
bidirectional scheduling mode. The top choice should not change if we
schedule at the bottom and vice versa.

This allows us to improve compiletime: We only recalculate the best pick
for one border and re-use the cached top-pick from the other border.

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

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

8 years agoAMDGPU/SI: Make sure not to fold offsets into local address space globals
Tom Stellard [Sat, 25 Jun 2016 01:59:16 +0000 (01:59 +0000)]
AMDGPU/SI: Make sure not to fold offsets into local address space globals

Summary:
Offset folding only works if you are emitting relocations, and we don't
emit relocations for local address space globals.

Reviewers: arsenm, nhaustov

Subscribers: arsenm, llvm-commits, kzhuravl

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

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

8 years ago[PlaceSafepoints] Don't call undef in test case; NFC
Sanjoy Das [Sat, 25 Jun 2016 01:40:54 +0000 (01:40 +0000)]
[PlaceSafepoints] Don't call undef in test case; NFC

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

8 years ago[LoopUnswitch] Avoid exponential behavior
Sanjoy Das [Sat, 25 Jun 2016 01:14:19 +0000 (01:14 +0000)]
[LoopUnswitch] Avoid exponential behavior

Summary: (No semantic change intended).

Reviewers: majnemer, bogner, mzolotukhin

Subscribers: mcrosier, llvm-commits, mzolotukhin

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

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

8 years agoThe absence of noreturn doesn't ensure mayReturn
David Majnemer [Sat, 25 Jun 2016 00:55:12 +0000 (00:55 +0000)]
The absence of noreturn doesn't ensure mayReturn

There are two separate issues:
- LLVM doesn't consider infinite loops to be side effects: we happily
  hoist/sink above/below loops whose bounds are unknown.
- The absence of the noreturn attribute is insufficient for us to know
  if a function will definitely return.  Relying on noreturn in the
  middle-end for any property is an accident waiting to happen.

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

8 years agoIt isn't meaningful for a transform to preserve another transform. NFC.
Michael Kuperstein [Sat, 25 Jun 2016 00:47:21 +0000 (00:47 +0000)]
It isn't meaningful for a transform to preserve another transform. NFC.

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

8 years agoIR: Introduce llvm.type.checked.load intrinsic.
Peter Collingbourne [Sat, 25 Jun 2016 00:23:04 +0000 (00:23 +0000)]
IR: Introduce llvm.type.checked.load intrinsic.

This intrinsic safely loads a function pointer from a virtual table pointer
using type metadata. This intrinsic is used to implement control flow integrity
in conjunction with virtual call optimization. The virtual call optimization
pass will optimize away llvm.type.checked.load intrinsics associated with
devirtualized calls, thereby removing the type check in cases where it is
not needed to enforce the control flow integrity constraint.

This patch also introduces the capability to copy type metadata between
global variables, and teaches the virtual call optimization pass to do so.

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

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

8 years agoMachineScheduler: Fully compare top/bottom candidates
Matthias Braun [Sat, 25 Jun 2016 00:23:00 +0000 (00:23 +0000)]
MachineScheduler: Fully compare top/bottom candidates

In bidirectional scheduling this gives more stable results than just
comparing the "reason" fields of the top/bottom node because the reason
field may be higher depending on what other nodes are in the queue.

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

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

8 years agoReinstate r273711
David Majnemer [Sat, 25 Jun 2016 00:04:10 +0000 (00:04 +0000)]
Reinstate r273711

r273711 was reverted by r273743.  The inliner needs to know about any
call sites in the inlined function.  These were obscured if we replaced
a call to undef with an undef but kept the call around.

This fixes PR28298.

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

8 years agoSilence a -Wsign-compare warning
David Majnemer [Sat, 25 Jun 2016 00:04:06 +0000 (00:04 +0000)]
Silence a -Wsign-compare warning

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

8 years agoAMDGPU: Define a schedule class for COPY.
Matthias Braun [Fri, 24 Jun 2016 23:52:11 +0000 (23:52 +0000)]
AMDGPU: Define a schedule class for COPY.

COPY was lacking a scheduling class, define it to avoid regressions in
the upcoming change to the bidirectional MachineScheduler. Approved by
tstellar on IRC.

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

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

8 years ago[PM] Port float2int to the new pass manager
Michael Kuperstein [Fri, 24 Jun 2016 23:32:02 +0000 (23:32 +0000)]
[PM] Port float2int to the new pass manager

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

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

8 years agoHookup ProfileSummary with SampleProfilerLoader
Dehao Chen [Fri, 24 Jun 2016 22:57:06 +0000 (22:57 +0000)]
Hookup ProfileSummary with SampleProfilerLoader

Summary: Set ProfileSummary in SampleProfilerLoader.

Reviewers: davidxl, eraman

Subscribers: llvm-commits

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

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

8 years ago[MBP] show function name in debug dump
Xinliang David Li [Fri, 24 Jun 2016 22:54:21 +0000 (22:54 +0000)]
[MBP] show function name in debug dump

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

8 years agoRevert r273711, it caused PR28298.
Nico Weber [Fri, 24 Jun 2016 22:52:39 +0000 (22:52 +0000)]
Revert r273711, it caused PR28298.

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

8 years agoFix lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp for r273701
Kevin Enderby [Fri, 24 Jun 2016 22:38:30 +0000 (22:38 +0000)]
Fix lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp for r273701
and the change to libObject’s getSymbolAddress() to Expected<...> .

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

8 years agoSimplify. NFC.
Rafael Espindola [Fri, 24 Jun 2016 22:19:54 +0000 (22:19 +0000)]
Simplify. NFC.

Also delete out of date comment. This code was always returning .data
since r253436.

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

8 years agoFix unused variable warning in -asserts builds.
Peter Collingbourne [Fri, 24 Jun 2016 21:37:11 +0000 (21:37 +0000)]
Fix unused variable warning in -asserts builds.

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

8 years agoFix the type signature of DwarfExpression::Add.*Constant to support values >32 bits.
Adrian Prantl [Fri, 24 Jun 2016 21:35:09 +0000 (21:35 +0000)]
Fix the type signature of DwarfExpression::Add.*Constant to support values >32 bits.
This fixes an embarrassing bug when emitting .debug_loc entries for 64-bit+ constants,
which were previously silently truncated to 32 bits.

<rdar://problem/26843232>

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

8 years agoFix documentation for FindAvailableLoadedValue.
Eli Friedman [Fri, 24 Jun 2016 21:32:15 +0000 (21:32 +0000)]
Fix documentation for FindAvailableLoadedValue.

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

8 years ago[Hexagon] Simplify (+fix) instruction selection for indexed loads/stores
Krzysztof Parzyszek [Fri, 24 Jun 2016 21:27:17 +0000 (21:27 +0000)]
[Hexagon] Simplify (+fix) instruction selection for indexed loads/stores

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

8 years ago[IndVarSimplify] Run clang-format over some oddly formatted bits
Sanjoy Das [Fri, 24 Jun 2016 21:23:32 +0000 (21:23 +0000)]
[IndVarSimplify] Run clang-format over some oddly formatted bits

NFC (whitespace only change)

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

8 years agoIR: New representation for CFI and virtual call optimization pass metadata.
Peter Collingbourne [Fri, 24 Jun 2016 21:21:32 +0000 (21:21 +0000)]
IR: New representation for CFI and virtual call optimization pass metadata.

The bitset metadata currently used in LLVM has a few problems:

1. It has the wrong name. The name "bitset" refers to an implementation
   detail of one use of the metadata (i.e. its original use case, CFI).
   This makes it harder to understand, as the name makes no sense in the
   context of virtual call optimization.

2. It is represented using a global named metadata node, rather than
   being directly associated with a global. This makes it harder to
   manipulate the metadata when rebuilding global variables, summarise it
   as part of ThinLTO and drop unused metadata when associated globals are
   dropped. For this reason, CFI does not currently work correctly when
   both CFI and vcall opt are enabled, as vcall opt needs to rebuild vtable
   globals, and fails to associate metadata with the rebuilt globals. As I
   understand it, the same problem could also affect ASan, which rebuilds
   globals with a red zone.

This patch solves both of those problems in the following way:

1. Rename the metadata to "type metadata". This new name reflects how
   the metadata is currently being used (i.e. to represent type information
   for CFI and vtable opt). The new name is reflected in the name for the
   associated intrinsic (llvm.type.test) and pass (LowerTypeTests).

2. Attach metadata directly to the globals that it pertains to, rather
   than using the "llvm.bitsets" global metadata node as we are doing now.
   This is done using the newly introduced capability to attach
   metadata to global variables (r271348 and r271358).

See also: http://lists.llvm.org/pipermail/llvm-dev/2016-June/100462.html

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

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

8 years ago[APInt] Don't shift into the sign bit
David Majnemer [Fri, 24 Jun 2016 21:15:36 +0000 (21:15 +0000)]
[APInt] Don't shift into the sign bit

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

8 years agoAdd support for musl-libc on ARM Linux.
Rafael Espindola [Fri, 24 Jun 2016 21:14:33 +0000 (21:14 +0000)]
Add support for musl-libc on ARM Linux.

Patch by Lei Zhang!

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

8 years ago[MachO] Fixing copy-paste error from r273719
Chris Bieneman [Fri, 24 Jun 2016 21:06:52 +0000 (21:06 +0000)]
[MachO] Fixing copy-paste error from r273719

Thanks Kevin!

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

8 years agoAdd missing dependency to LLVMPasses
Michael Kuperstein [Fri, 24 Jun 2016 21:05:41 +0000 (21:05 +0000)]
Add missing dependency to LLVMPasses

Passes should depend on CodeGen, as that contains some IR-to-IR passes.

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

8 years ago[MemorySSA] Move code around a bit. NFC.
George Burgess IV [Fri, 24 Jun 2016 21:02:12 +0000 (21:02 +0000)]
[MemorySSA] Move code around a bit. NFC.

This patch moves MSSA's caching walker into MemorySSA, and moves the
actual definition of MSSA's caching walker out of MemorySSA.h. This is
done in preparation for the new walker, which should be out for review
soonish.

Also, this patch removes a field from UpwardsMemoryQuery and has a few
lines of diff from clang-format'ing MemorySSA.cpp.

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

8 years ago[APInt] Don't shift into the sign bit
David Majnemer [Fri, 24 Jun 2016 20:51:47 +0000 (20:51 +0000)]
[APInt] Don't shift into the sign bit

This fixes PR28294.

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

8 years ago[obj2yaml] [yaml2obj] Support for MachO Universal binaries
Chris Bieneman [Fri, 24 Jun 2016 20:42:28 +0000 (20:42 +0000)]
[obj2yaml] [yaml2obj] Support for MachO Universal binaries

This patch adds round-trip support for MachO Universal binaries to obj2yaml and yaml2obj. Universal binaries have a header and list of architecture structures, followed by a the individual object files at specified offsets.

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

8 years ago[ARM] Remove dead SDNodes. NFC.
Ahmed Bougacha [Fri, 24 Jun 2016 20:38:00 +0000 (20:38 +0000)]
[ARM] Remove dead SDNodes. NFC.

The opcodes are used, but only by DAG->DAG.

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

8 years ago[X86] Remove dead ISD opcodes. NFC.
Ahmed Bougacha [Fri, 24 Jun 2016 20:37:55 +0000 (20:37 +0000)]
[X86] Remove dead ISD opcodes. NFC.

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

8 years ago[InstCombine] use m_APInt; NFCI
Sanjay Patel [Fri, 24 Jun 2016 20:36:34 +0000 (20:36 +0000)]
[InstCombine] use m_APInt; NFCI

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

8 years ago[PM] Port PreISelIntrinsicLowering to the new PM
Michael Kuperstein [Fri, 24 Jun 2016 20:13:42 +0000 (20:13 +0000)]
[PM] Port PreISelIntrinsicLowering to the new PM

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

8 years agoSimplifyInstruction does not imply DCE
David Majnemer [Fri, 24 Jun 2016 19:34:46 +0000 (19:34 +0000)]
SimplifyInstruction does not imply DCE

We cannot remove an instruction with no uses just because
SimplifyInstruction succeeds.  It may have side effects.

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

8 years ago[CodeView] Healthy paranoia around strings
David Majnemer [Fri, 24 Jun 2016 19:34:41 +0000 (19:34 +0000)]
[CodeView] Healthy paranoia around strings

Make sure strings don't get too big for a record, truncate them if
need-be.

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

8 years ago[AArch64] Adjust the model for the vector by element FP multiplies on Exynos M1....
Evandro Menezes [Fri, 24 Jun 2016 18:58:54 +0000 (18:58 +0000)]
[AArch64] Adjust the model for the vector by element FP multiplies on Exynos M1. (NFC)

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

8 years agoRevert r273545, "[IfConversion] Bugfix: Don't use undef flag while adding use operands."
Peter Collingbourne [Fri, 24 Jun 2016 18:57:29 +0000 (18:57 +0000)]
Revert r273545, "[IfConversion] Bugfix: Don't use undef flag while adding use operands."
as it caused PR28295.

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

8 years ago[InstCombine] refactor optional bitcasting in matchSelectFromAndOr() into one code...
Sanjay Patel [Fri, 24 Jun 2016 18:55:27 +0000 (18:55 +0000)]
[InstCombine] refactor optional bitcasting in matchSelectFromAndOr() into one code path (NFCI)

Tests to verify that the commuted variants are all exercised were added with:
http://reviews.llvm.org/rL273702

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

8 years agoUse shouldAssumeDSOLocal in isOffsetFoldingLegal.
Rafael Espindola [Fri, 24 Jun 2016 18:48:36 +0000 (18:48 +0000)]
Use shouldAssumeDSOLocal in isOffsetFoldingLegal.

This makes it slightly more powerful for dynamic-no-pic.

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

8 years agoRevert "InstCombine rule to fold trunc when value available"
Reid Kleckner [Fri, 24 Jun 2016 18:42:58 +0000 (18:42 +0000)]
Revert "InstCombine rule to fold trunc when value available"

This reverts commit r273608.

Broke building code with sanitizers, where apparently these kinds of
loads, casts, and truncations are common:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/24502
http://crbug.com/623099

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

8 years ago[InstCombine] consolidate commutation variants of matchSelectFromAndOr() in one place...
Sanjay Patel [Fri, 24 Jun 2016 18:26:02 +0000 (18:26 +0000)]
[InstCombine] consolidate commutation variants of matchSelectFromAndOr() in one place; NFCI

By putting all the possible commutations together, we simplify the code.
Note that this is NFCI, but I'm adding tests that actually exercise each
commutation pattern because we don't have this anywhere else.

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

8 years agoThread Expected<...> up from libObject’s getSymbolAddress() for symbols to allow
Kevin Enderby [Fri, 24 Jun 2016 18:24:42 +0000 (18:24 +0000)]
Thread Expected<...> up from libObject’s getSymbolAddress() for symbols to allow
a good error message to be produced.

This is nearly the last libObject interface that used ErrorOr and the last one
that appears in llvm/include/llvm/Object/MachO.h .  For Mach-O objects this is
just a clean up because it’s version of getSymbolAddress() can’t return an
error.

I will leave it to the experts on COFF and ELF to actually add meaning full
error messages in their tests if they wish.  And also leave it to these experts
to change the last two ErrorOr interfaces in llvm/include/llvm/Object/ObjectFile.h
for createCOFFObjectFile() and createELFObjectFile() if they wish.

Since there are no test cases for COFF and ELF error cases with respect to
getSymbolAddress() in the test suite this is no functional change (NFC).

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

8 years agoCodegen: Fix broken assumption in Tail Merge.
Kyle Butt [Fri, 24 Jun 2016 18:16:36 +0000 (18:16 +0000)]
Codegen: Fix broken assumption in Tail Merge.

Tail merge was making the assumption that a layout successor or
predecessor was always a cfg successor/predecessor. Remove that
assumption. Changes to tests are necessary because the errant cfg edges
were preventing optimizations.

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

8 years agoUse FileCheck. NFC.
Rafael Espindola [Fri, 24 Jun 2016 18:04:39 +0000 (18:04 +0000)]
Use FileCheck. NFC.

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

8 years ago[codeview] Emit parameter variables in the right order
Reid Kleckner [Fri, 24 Jun 2016 17:55:40 +0000 (17:55 +0000)]
[codeview] Emit parameter variables in the right order

Clang emits them in reverse order to conform to the ABI, which requires
left-to-right destruction. As a result, the order doesn't fall out
naturally, and we have to sort things out in the backend.

Fixes PR28213

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

8 years agoLinker: Copy metadata when linking declarations.
Peter Collingbourne [Fri, 24 Jun 2016 17:42:21 +0000 (17:42 +0000)]
Linker: Copy metadata when linking declarations.

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

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

8 years ago[codeview] Use one byte for S_FRAMECOOKIE CookieKind and add flags byte
Reid Kleckner [Fri, 24 Jun 2016 17:23:49 +0000 (17:23 +0000)]
[codeview] Use one byte for S_FRAMECOOKIE CookieKind and add flags byte

We bailed out while printing codeview for an MSVC compiled
SemaExprCXX.cpp that used this record. The MS reference headers look
incorrect here, which is probably why we had this bug. They use a 32-bit
enum as the field type, but the actual record appears to use one byte
for the cookie kind followed by a flags byte.

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

8 years ago[MDT] Always verify machine dominfo if expensive checking is enabled.
Chad Rosier [Fri, 24 Jun 2016 17:15:04 +0000 (17:15 +0000)]
[MDT] Always verify machine dominfo if expensive checking is enabled.

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

8 years ago[codeview] Emit base class information from DW_TAG_inheritance nodes
Reid Kleckner [Fri, 24 Jun 2016 16:24:24 +0000 (16:24 +0000)]
[codeview] Emit base class information from DW_TAG_inheritance nodes

There are two remaining issues here:
1. No vbptr information
2. Need to mention indirect virtual bases

Getting indirect virtual bases is just a matter of adding an "indirect"
flag, emitting them in the frontend, and ignoring them when appropriate
for DWARF.

All virtual bases use the same artificial vbptr field, so I think the
vbptr offset will be best represented by an implicit __vbptr$ClassName
member similar to our existing __vptr$ member.

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

8 years ago[LV] Preserve order of dependences in interleaved accesses analysis
Matthew Simpson [Fri, 24 Jun 2016 15:33:25 +0000 (15:33 +0000)]
[LV] Preserve order of dependences in interleaved accesses analysis

The interleaved access analysis currently assumes that the inserted run-time
pointer aliasing checks ensure the absence of dependences that would prevent
its instruction reordering. However, this is not the case.

Issues can arise from how code generation is performed for interleaved groups.
For a load group, all loads in the group are essentially moved to the location
of the first load in program order, and for a store group, all stores in the
group are moved to the location of the last store. For groups having members
involved in a dependence relation with any other instruction in the loop, this
reordering can violate the dependence.

This patch teaches the interleaved access analysis how to avoid breaking such
dependences, and should fix PR27626.

An assumption of the original analysis was that the accesses had been collected
in "program order". The analysis was then simplified by visiting the accesses
bottom-up. However, this ordering was never guaranteed for anything other than
single basic block loops. Thus, this patch also enforces the desired ordering.

Reference: https://llvm.org/bugs/show_bug.cgi?id=27626
Differential Revision: http://reviews.llvm.org/D19984

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

8 years agoRemangle intrinsics names when types are renamed
Artur Pilipenko [Fri, 24 Jun 2016 15:10:29 +0000 (15:10 +0000)]
Remangle intrinsics names when types are renamed

This is a resubmittion of previously reverted rL273568.

This is a fix for the problem mentioned in "LTO and intrinsics mangling" llvm-dev mail thread:
http://lists.llvm.org/pipermail/llvm-dev/2016-April/098387.html

Reviewers: mehdi_amini, reames

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

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

8 years agoNFC. Move verifyIntrinsicIsVarArg from verifier to Intrinsic::matchIntrinsicVarArg...
Artur Pilipenko [Fri, 24 Jun 2016 14:47:27 +0000 (14:47 +0000)]
NFC. Move verifyIntrinsicIsVarArg from verifier to Intrinsic::matchIntrinsicVarArg since it will be reused for intrinsic remangling code

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

8 years agoExecutionEngine: silence unused value warning
Saleem Abdulrasool [Fri, 24 Jun 2016 14:31:09 +0000 (14:31 +0000)]
ExecutionEngine: silence unused value warning

The Value is only used in debug or asserts builds.  Just cast to void to silence
an unused variable warning.

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

8 years agoExecutionEngine: add preliminary support for COFF ARM
Saleem Abdulrasool [Fri, 24 Jun 2016 14:11:44 +0000 (14:11 +0000)]
ExecutionEngine: add preliminary support for COFF ARM

This adds rudimentary support for COFF ARM to the dynamic loader for the
exeuction engine.  This can be used by lldb to JIT code into a COFF ARM
environment.  This lays the foundation for the loader, though a few of the
relocation types are yet unhandled.

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

8 years agoMake sure Format is always initialized.
Rafael Espindola [Fri, 24 Jun 2016 13:47:29 +0000 (13:47 +0000)]
Make sure Format is always initialized.

Should fix the msan bots.

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

8 years ago[MachineDominatorTree] Add a MDT verifier.
Chad Rosier [Fri, 24 Jun 2016 13:32:22 +0000 (13:32 +0000)]
[MachineDominatorTree] Add a MDT verifier.

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

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

8 years agoUse existing predicate. NFC.
Rafael Espindola [Fri, 24 Jun 2016 13:28:26 +0000 (13:28 +0000)]
Use existing predicate. NFC.

This doesn't handle ELF, but neither did the previous code.

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

8 years agoMerge two identical if branches. NFC.
Rafael Espindola [Fri, 24 Jun 2016 13:08:06 +0000 (13:08 +0000)]
Merge two identical if branches. NFC.

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

8 years agoMerge two identical if branches. NFC.
Rafael Espindola [Fri, 24 Jun 2016 13:05:20 +0000 (13:05 +0000)]
Merge two identical if branches. NFC.

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

8 years agoclang-format a region. NFC.
Rafael Espindola [Fri, 24 Jun 2016 12:58:25 +0000 (12:58 +0000)]
clang-format a region. NFC.

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

8 years ago[LICM] Avoid repeating expensive call while promoting loads. NFC
Anna Thomas [Fri, 24 Jun 2016 12:38:45 +0000 (12:38 +0000)]
[LICM] Avoid repeating expensive call while promoting loads. NFC

Summary:
We can avoid repeating the check `isGuaranteedToExecute` when it's already called once while checking if the alignment can be widened for the load/store being hoisted.

The function is invariant for the same instruction `UI` in `isGuaranteedToExecute(*UI, DT, CurLoop, SafetyInfo);`

Reviewers: hfinkel, eli.friedman

Subscribers: llvm-commits

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

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

8 years agoRevert r273664
Hubert Tong [Fri, 24 Jun 2016 12:25:15 +0000 (12:25 +0000)]
Revert r273664

Revert change until build issues with MSVC can be resolved.

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

8 years ago[mips] Use --check-prefixes where appropriate. NFC.
Daniel Sanders [Fri, 24 Jun 2016 12:23:17 +0000 (12:23 +0000)]
[mips] Use --check-prefixes where appropriate. NFC.

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

8 years agoAdd FixedSizeStorage to TrailingObjects; NFC
Hubert Tong [Fri, 24 Jun 2016 11:34:16 +0000 (11:34 +0000)]
Add FixedSizeStorage to TrailingObjects; NFC

Summary: This change introduces two types, `FixedSizeStorage` and `FixedSizeStorageOwner`, which can be used to provide stack-allocated objects with trailing objects.

Reviewers: rsmith, faisalv, aaron.ballman

Subscribers: llvm-commits, cfe-commits, nwilson

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

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

8 years agoRevert "Revert "[misched] Extend scheduler to handle unsupported features""
Simon Dardis [Fri, 24 Jun 2016 08:43:27 +0000 (08:43 +0000)]
Revert "Revert "[misched] Extend scheduler to handle unsupported features""

This reverts commit r273565.

This was an over-eager revert.

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

8 years agoAMDGPU: Add stub custom CodeGenPrepare pass
Matt Arsenault [Fri, 24 Jun 2016 07:07:55 +0000 (07:07 +0000)]
AMDGPU: Add stub custom CodeGenPrepare pass

This will do various things including ones
CodeGenPrepare does, but with knowledge of uniform
values.

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

8 years agoRemove hack introduced by r273641.
George Burgess IV [Fri, 24 Jun 2016 06:58:15 +0000 (06:58 +0000)]
Remove hack introduced by r273641.

Hopefully the buildbots have had enough time to pick this up by now.

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

8 years agoAMDGPU: Un-xfail and add tests
Matt Arsenault [Fri, 24 Jun 2016 06:58:01 +0000 (06:58 +0000)]
AMDGPU: Un-xfail and add tests

Un XFAIL a few tests plus a few more I had lying around
in my tree, which seem to all work now but I don't see tests
that quite test the same things.

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

8 years agoAMDGPU: Remove disable-irstructurizer subtarget feature
Matt Arsenault [Fri, 24 Jun 2016 06:30:22 +0000 (06:30 +0000)]
AMDGPU: Remove disable-irstructurizer subtarget feature

The only real reason to use it is for testing, so replace
it with a command line option instead of a potentially function
dependent feature.

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

8 years agoAMDGPU: Cleanup subtarget handling.
Matt Arsenault [Fri, 24 Jun 2016 06:30:11 +0000 (06:30 +0000)]
AMDGPU: Cleanup subtarget handling.

Split AMDGPUSubtarget into amdgcn/r600 specific subclasses.
This removes most of the static_casting of the basic codegen
classes everywhere, and tries to restrict the features
visible on the wrong target.

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

8 years agoUse the same underlying type for bitfields
David Majnemer [Fri, 24 Jun 2016 04:05:25 +0000 (04:05 +0000)]
Use the same underlying type for bitfields

MSVC allocates fresh storage for consecutive bitfields with different
underlying types.

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

8 years agoSwitch more loops to be range-based
David Majnemer [Fri, 24 Jun 2016 04:05:21 +0000 (04:05 +0000)]
Switch more loops to be range-based

This makes the code a little more concise, no functional change is
intended.

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

8 years ago[X86] Combine two nearby calls to isSingleInputShuffleVector. NFC
Craig Topper [Fri, 24 Jun 2016 03:06:11 +0000 (03:06 +0000)]
[X86] Combine two nearby calls to isSingleInputShuffleVector. NFC

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

8 years ago[llvm-cov] Fix two warnings
Vedant Kumar [Fri, 24 Jun 2016 02:33:01 +0000 (02:33 +0000)]
[llvm-cov] Fix two warnings

They were using output streams inconsistently. One also had a grammar
bug.

I noticed these while trying to pare down D18278.

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

8 years agoTemporary hack to clean a file from buildbots.
George Burgess IV [Fri, 24 Jun 2016 02:19:11 +0000 (02:19 +0000)]
Temporary hack to clean a file from buildbots.

Some buildbots are complaining about a .s file under test/ that was
inadvertently created by a test earlier today, and is still hanging
around. I'll undo this change in ~1hr (or whenever the bots are done
getting rid of said file).

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

8 years agoTeaching SimplifyCFG to recognize the Or-Mask trick that InstCombine uses to
Chuang-Yu Cheng [Fri, 24 Jun 2016 01:59:00 +0000 (01:59 +0000)]
Teaching SimplifyCFG to recognize the Or-Mask trick that InstCombine uses to
reduce the number of comparisons.

Specifically, InstCombine can turn:
  (i == 5334 || i == 5335)
into:
  ((i | 1) == 5335)

SimplifyCFG was already able to detect the pattern:
  (i == 5334 || i == 5335)
to:
  ((i & -2) == 5334)

This patch supersedes D21315 and resolves PR27555
(https://llvm.org/bugs/show_bug.cgi?id=27555).

Thanks to David and Chandler for the suggestions!

Author: Thomas Jablin (tjablin)
Reviewers: majnemer chandlerc halfdan cycheng

http://reviews.llvm.org/D21397

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

8 years agoBitcodeWriter: Remove redundant (and incorrect) check for whether to emit module...
Peter Collingbourne [Fri, 24 Jun 2016 01:58:02 +0000 (01:58 +0000)]
BitcodeWriter: Remove redundant (and incorrect) check for whether to emit module summary.

The function name Module::empty() is slightly misleading in that it
only tests for the presence of functions in the module. However we
still want to emit the module summary if the module contains only
global variables or aliases. The presence of such entities can be
determined simply by checking the summary directly, as we are doing
below.

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

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

8 years agoAttempt to fix MSVC breakage caused by r273636.
George Burgess IV [Fri, 24 Jun 2016 01:41:29 +0000 (01:41 +0000)]
Attempt to fix MSVC breakage caused by r273636.

Apparently earlier versions of MSVC don't have constexpr bitset ctors.

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

8 years ago[CFLAA] Propagate StratifiedAttrs in interproc. analysis.
George Burgess IV [Fri, 24 Jun 2016 01:00:03 +0000 (01:00 +0000)]
[CFLAA] Propagate StratifiedAttrs in interproc. analysis.

This patch also has a refactor that kills StratifiedAttr, and leaves us
with StratifiedAttrs, because having both was mildly redundant.

This patch makes us correctly handle stratified attributes when doing
interprocedural analysis. It also adds another attribute, AttrCaller,
which acts like AttrUnknown. We can filter out AttrCaller values when
during interprocedural analysis, since the caller should have
information about what arguments it's passing to its callee.

Patch by Jia Chen.

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

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

8 years ago[llvm-cov] Use getOptions() instead of Options in SourceCoverageView, NFC
Vedant Kumar [Fri, 24 Jun 2016 00:41:26 +0000 (00:41 +0000)]
[llvm-cov] Use getOptions() instead of Options in SourceCoverageView, NFC

A lot of this code is going to move into the text-based coverage
renderer, and won't be able to use Options directly. Use the getter.

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

8 years ago[llvm-cov] Add SourceNames to SourceCoverageViews, NFC
Vedant Kumar [Fri, 24 Jun 2016 00:34:51 +0000 (00:34 +0000)]
[llvm-cov] Add SourceNames to SourceCoverageViews, NFC

A SourceName can be a file or a function. It makes sense to attach this
information to a SourceCoverageView, seeing as views (1) already point
to the text corresponding to the relevant source code and (2) are
already used to render that text along with the SourceNames.

This is a nice cleanup which is independent of the upcoming html patch.

While we're at it, document the fields in SourceCoverageView.

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

8 years ago[llvm-cov] Rename SourceCoverageView::LineCoverageInfo to LineCoverageStats, NFC
Vedant Kumar [Fri, 24 Jun 2016 00:34:48 +0000 (00:34 +0000)]
[llvm-cov] Rename SourceCoverageView::LineCoverageInfo to LineCoverageStats, NFC

Pull LineCoverageInfo out of SourceCoverageView and rename it so that it
doesn't conflict with another class of the same name in
CoverageSummaryInfo.h.

This cuts down on the amount of code we have to move into a `protected`
section of SourceCoverageView for the upcoming html patch. It also makes
the code a bit clearer: having two LineCoverageInfo's is strange.

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

8 years ago[ARM] Use aapcs_vfp for ___truncdfhf2 on v7k.
Ahmed Bougacha [Fri, 24 Jun 2016 00:08:01 +0000 (00:08 +0000)]
[ARM] Use aapcs_vfp for ___truncdfhf2 on v7k.

r215348 overrode the f16 libcalls to be soft-float, but
v7k uses the default (hard-float) calling convention.

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

8 years ago[AArch64] Model the cost of vector by element FP multiplies on Exynos M1. (NFC)
Evandro Menezes [Thu, 23 Jun 2016 23:43:23 +0000 (23:43 +0000)]
[AArch64] Model the cost of vector by element FP multiplies on Exynos M1. (NFC)

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

8 years agoSupport/ELF: Add R_AMDGPU_GOTPCREL relocation
Tom Stellard [Thu, 23 Jun 2016 23:11:29 +0000 (23:11 +0000)]
Support/ELF: Add R_AMDGPU_GOTPCREL relocation

Summary:
We will start generating this in a future patch.

Reviewers: arsenm, kzhuravl, rafael, ruiu, tony-tye

Subscribers: arsenm, llvm-commits, kzhuravl

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

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

8 years ago[MachOYAML] Use a temporary to avoid gcc strict-aliasing warning
Chris Bieneman [Thu, 23 Jun 2016 23:01:47 +0000 (23:01 +0000)]
[MachOYAML] Use a temporary to avoid gcc strict-aliasing warning

GCC complains about this with -Wstrict-aliasing. Using a temporary here should prevent the warning.

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

8 years ago[codeview] Add classes and unions to the Local/Global UDTs lists
Hans Wennborg [Thu, 23 Jun 2016 22:57:25 +0000 (22:57 +0000)]
[codeview] Add classes and unions to the Local/Global UDTs lists

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

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

8 years ago[LCG] Make the name of an SCC include more of the functions in it.
Chandler Carruth [Thu, 23 Jun 2016 22:51:14 +0000 (22:51 +0000)]
[LCG] Make the name of an SCC include more of the functions in it.

This makes it much easier to debug issues when the logging contains the
name of the SCC. It requires to create a temporary string, but for
logging and debugging uses that seems fine. I've added logic to try to
output all the function names with an elipsis if there are too many.
This was helpful fro me in debugging issues with the new pass manager.

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

8 years ago[yaml2macho] Removing asserts in favor of explicit yaml parse error
Chris Bieneman [Thu, 23 Jun 2016 22:36:31 +0000 (22:36 +0000)]
[yaml2macho] Removing asserts in favor of explicit yaml parse error

32-bit Mach headers don't have reserved fields. When generating the
mapping for 32-bit headers leaving off the reserved field will result in
parse errors if the field is present in the yaml.

Added a CHECK-NOT line to ensure that mach_header.yaml isn't adding a
reserved field, and a test to ensure that the parser error gets hit with
32-bit headers.

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

8 years ago[CMake] Add LLVM runtimes directory
Chris Bieneman [Thu, 23 Jun 2016 22:07:21 +0000 (22:07 +0000)]
[CMake] Add LLVM runtimes directory

Summary:
There are a few LLVM projects that produce runtime libraries. Ideally
runtime libraries should be built differently than other projects,
specifically they should be built using the just-built toolchain.

There is support for building compiler-rt in this way from the clang
build. Moving this logic into the LLVM build is interesting because it
provides a simpler way to extend the just-built toolchain to include
LLD and the LLVM object file tools.

Once this functionality is better fleshed out and tested we’ll want to
encapsulate it in a module that can be used for clang standalone
builds, and we’ll want to make it the default way to build compiler-rt.

With this patch applied there is no immediate change in the build.
Moving compiler-rt out from llvm/projects into llvm/runtimes enables
the functionality.

This code has a few improvements over the method provided by
LLVM_BUILD_EXTERNAL_COMPILER_RT. Specifically the sub-ninja command is
always invoked, so changes to compiler-rt source files will get built
properly, so this patch can be used for iterative development with
just-built tools.

This first patch only works with compiler-rt. Support for other
runtime projects will be coming in follow-up patches.

Reviewers: chandlerc, bogner

Subscribers: kubabrecka, llvm-commits

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

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

8 years agoMachineScheduler: Followup to debug message changes
Matthias Braun [Thu, 23 Jun 2016 21:43:28 +0000 (21:43 +0000)]
MachineScheduler: Followup to debug message changes

Do not dump intermediate state of the pending queue anymore now that we
always dump the final state before picking.

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

8 years agoCodegen: [X86] preservere memory refs for folded umul_lohi
Kyle Butt [Thu, 23 Jun 2016 21:40:35 +0000 (21:40 +0000)]
Codegen: [X86] preservere memory refs for folded umul_lohi

Memory references were not being propagated for this folded load. This
prevented optimizations like LICM from hoisting the load.

Added test to verify that this allows LICM to proceed.

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

8 years agoCodegen: LICM Remove check for exactly 1 register def.
Kyle Butt [Thu, 23 Jun 2016 21:38:49 +0000 (21:38 +0000)]
Codegen: LICM Remove check for exactly 1 register def.

When considering whether to split an instruction with a memory operand
into an explicit load and a register-based instruction, we currently
check that the resulting instruction has exactly 1 def. This prevents 2
important LICM optimizations: compares with memory operands, and double
indirect calls. All the tests and the test-suite pass without the check.
My guess as to original intent is to limit the additional register pressure
created by the new instruction, but given that we only split out a single
register, it is already limited.

The licm-dominance test now checks actual memory loads for hoisting instead of
undef, and it tests compares.
hoist-invariant-load.ll now checks for 2 hoists, the intended hoist, and a bonus
from calling a got-relative function in a loop.

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

8 years agoMachineScheduler: Improve debug messages
Matthias Braun [Thu, 23 Jun 2016 21:27:38 +0000 (21:27 +0000)]
MachineScheduler: Improve debug messages

Consistenly display available and pending queues immediately before the
scheduling choice is done.

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

8 years agoUses shouldAssumeDSOLocal.
Rafael Espindola [Thu, 23 Jun 2016 21:18:59 +0000 (21:18 +0000)]
Uses shouldAssumeDSOLocal.

With that SystemZ knows to avoid a GOT for PIE.

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