134378 Commits

Author SHA1 Message Date
NAKAMURA Takumi
db39d89932 Fix a typo in FindAvailableLoadedValue, introduced by r273734. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273774 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25 06:03:14 +00:00
Vedant Kumar
5e86ac74a4 [llvm-cov] Make an API more consistent, NFC
Make renderExpansionView() look a bit more like renderLine(), and
clarify its doxygen comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273773 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25 05:48:59 +00:00
Vedant Kumar
a6154f98d5 [llvm-cov] Flesh out some doxygen comments, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273772 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25 05:48:54 +00:00
Vedant Kumar
49b4592c1a 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
2016-06-25 03:27:29 +00:00
Konstantin Zhuravlyov
20c7a48718 [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
2016-06-25 03:11:28 +00:00
Saleem Abdulrasool
005f32a475 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
2016-06-25 03:05:56 +00:00
Vedant Kumar
a9bf312be4 [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
2016-06-25 02:58:30 +00:00
Matthias Braun
2feb69ebcd 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
2016-06-25 02:03:36 +00:00
Tom Stellard
16fa6f1061 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
2016-06-25 01:59:16 +00:00
Sanjoy Das
1874db9575 [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
2016-06-25 01:40:54 +00:00
Sanjoy Das
1096c785d9 [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
2016-06-25 01:14:19 +00:00
David Majnemer
115455e435 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
2016-06-25 00:55:12 +00:00
Michael Kuperstein
7360cd168a 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
2016-06-25 00:47:21 +00:00
Peter Collingbourne
02296e214b 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
2016-06-25 00:23:04 +00:00
Matthias Braun
f011e37181 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
2016-06-25 00:23:00 +00:00
David Majnemer
c1fd19fd0b 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
2016-06-25 00:04:10 +00:00
David Majnemer
0a621f42a4 Silence a -Wsign-compare warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273752 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25 00:04:06 +00:00
Matthias Braun
0791b66fef 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
2016-06-24 23:52:11 +00:00
Michael Kuperstein
840a0dd147 [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
2016-06-24 23:32:02 +00:00
Dehao Chen
51f85a493d 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
2016-06-24 22:57:06 +00:00
Xinliang David Li
153829f199 [MBP] show function name in debug dump
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273744 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 22:54:21 +00:00
Nico Weber
336eefdaa0 Revert r273711, it caused PR28298.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273743 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 22:52:39 +00:00
Kevin Enderby
cf2cc47aa3 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
2016-06-24 22:38:30 +00:00
Rafael Espindola
3cc072135d 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
2016-06-24 22:19:54 +00:00
Peter Collingbourne
8a380d8f16 Fix unused variable warning in -asserts builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273737 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 21:37:11 +00:00
Adrian Prantl
72fda70f27 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
2016-06-24 21:35:09 +00:00
Eli Friedman
d9ae0824a4 Fix documentation for FindAvailableLoadedValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273734 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 21:32:15 +00:00
Krzysztof Parzyszek
99719f40ee [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
2016-06-24 21:27:17 +00:00
Sanjoy Das
cb2753f32e [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
2016-06-24 21:23:32 +00:00
Peter Collingbourne
dba9146333 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
2016-06-24 21:21:32 +00:00
David Majnemer
87d5e72f1d [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
2016-06-24 21:15:36 +00:00
Rafael Espindola
ab8ffadc13 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
2016-06-24 21:14:33 +00:00
Chris Bieneman
5b01931d4c [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
2016-06-24 21:06:52 +00:00
Michael Kuperstein
783d353e52 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
2016-06-24 21:05:41 +00:00
George Burgess IV
122fe57ae3 [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
2016-06-24 21:02:12 +00:00
David Majnemer
536b1bc60e [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
2016-06-24 20:51:47 +00:00
Chris Bieneman
e92acf1526 [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
2016-06-24 20:42:28 +00:00
Ahmed Bougacha
26f3c3b0c4 [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
2016-06-24 20:38:00 +00:00
Ahmed Bougacha
5e751c7749 [X86] Remove dead ISD opcodes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273716 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 20:37:55 +00:00
Sanjay Patel
1fdd592ebc [InstCombine] use m_APInt; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273715 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 20:36:34 +00:00
Michael Kuperstein
f3f8fc6a20 [PM] Port PreISelIntrinsicLowering to the new PM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273713 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 20:13:42 +00:00
David Majnemer
7748b9996e 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
2016-06-24 19:34:46 +00:00
David Majnemer
82c356cae4 [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
2016-06-24 19:34:41 +00:00
Evandro Menezes
28ea97622f [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
2016-06-24 18:58:54 +00:00
Peter Collingbourne
2f7c4b22bb 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
2016-06-24 18:57:29 +00:00
Sanjay Patel
cc2e81eaf2 [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
2016-06-24 18:55:27 +00:00
Rafael Espindola
fddccef6cb 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
2016-06-24 18:48:36 +00:00
Reid Kleckner
c0b6cd2c10 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
2016-06-24 18:42:58 +00:00
Sanjay Patel
efe34a4c9d [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
2016-06-24 18:26:02 +00:00
Kevin Enderby
317de7ce5b 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
2016-06-24 18:24:42 +00:00