Commit Graph

132236 Commits

Author SHA1 Message Date
Chris Bieneman
e90cbf6c44 [yaml2obj] Removing debug code that scribbled 0xDEADBEEF
Now that MachO load command fields are fully covered we can fill unaccounted for bytes with 0. That allows us to sparsely specify YAML to simplify tests.

Simplifying load_commands test accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270158 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 23:26:31 +00:00
Lang Hames
8c34a3f83c [RuntimeDyld][MachO] Add support for SUBTRACTOR relocations between anonymous
symbols on x86-64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270157 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 23:26:05 +00:00
Rafael Espindola
02e249fb8e clang-format. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270156 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 23:17:37 +00:00
Sanjoy Das
069b376c47 Add const qualifiers to appease bots; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270155 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 23:15:59 +00:00
Easwaran Raman
ed8d5eadcc Allow -inline-threshold to override default threshold.
Before r257832, the threshold used by SimpleInliner was explicitly specified or generated from opt levels and passed to the base class Inliner's constructor. There, it was first overridden by explicitly specified -inline-threshold. The refactoring in r257832 did not preserve this behavior for all opt levels. This change brings back the original behavior.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270153 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 23:02:09 +00:00
Richard Smith
7534b79ef9 Forgotten file from r269992.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270152 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 22:56:37 +00:00
Sanjoy Das
4dace2a82e [GuardWidening] Introduce range check merging
Sequences of range checks expressed using guards, like

  guard((I - 2) u< L)
  guard((I - 1) u< L)
  guard((I + 0) u< L)
  guard((I + 1) u< L)
  guard((I + 2) u< L)

can sometimes be combined into a smaller sequence:

  guard((I - 2) u< L AND (I + 2) u< L)

if we can prove that (I - 2) u< L AND (I + 2) u< L implies all of checks
expressed in the previous sequence.

This change teaches GuardWidening to do this kind of merging when
feasible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270151 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 22:55:46 +00:00
Quentin Colombet
a499216ab6 Reapply r263460: [SpillPlacement] Fix a quadratic behavior in spill placement.
Using Chandler's words from r265331:
This commit was greatly exacerbating PR17409 and effectively regressed
build time for lot of (very large) code when compiled with ASan or MSan.

PR17409 is fixed by r269249, so this is fine to reapply r263460.

Original commit message:
The bad behavior happens when we have a function with a long linear
chain of basic blocks, and have a live range spanning most of this
chain, but with very few uses.

Let say we have only 2 uses.

The Hopfield network is only seeded with two active blocks where the
uses are, and each iteration of the outer loop in
`RAGreedy::growRegion()` only adds two new nodes to the network due to
the completely linear shape of the CFG.  Meanwhile,
`SpillPlacer->iterate()` visits the whole set of discovered nodes, which
adds up to a quadratic algorithm.

This is an historical accident effect from r129188.

When the Hopfield network is expanding, most of the action is happening
on the frontier where new nodes are being added. The internal nodes in
the network are not likely to be flip-flopping much, or they will at
least settle down very quickly. This means that while
`SpillPlacer->iterate()` is recomputing all the nodes in the network, it
is probably only the two frontier nodes that are changing their output.

Instead of recomputing the whole network on each iteration, we can
maintain a SparseSet of nodes that need to be updated:

- `SpillPlacement::activate()` adds the node to the todo list.
- When a node changes value (i.e., `update()` returns true), its
  neighbors are added to the todo list.
- `SpillPlacement::iterate()` only updates the nodes in the list.

The result of Hopfield iterations is not necessarily exact. It should
converge to a local minimum, but there is no guarantee that it will find
a global minimum. It is possible that updating nodes in a different
order will cause us to switch to a different local minimum. In other
words, this is not NFC, but although I saw a few runtime improvements
and regressions when I benchmarked this change, those were side effects
and actually the performance change is in the noise as expected.

Huge thanks to Jakob Stoklund Olesen <stoklund@2pi.dk> for his
feedbacks, guidance and time for the review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270149 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 22:40:37 +00:00
Rafael Espindola
c2d48e6efd Record a TargetMachine instead of a Reloc::Model.
Addresses r270095's code review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 22:07:57 +00:00
Dan Liew
86af2862c5 [LibFuzzer]
Work around crashes in ``__sanitizer_malloc_hook()`` under Mac OSX.

Under Mac OSX we intercept calls to malloc before thread local
storage is initialised leading to a crash when accessing
``AllocTracer``. To workaround this ``AllocTracer`` is only accessed
in the hook under Linux. For symmetry ``__sanitizer_free_hook()``
is also modified in the same way.

To support this change a set of new macros
LIBFUZZER_LINUX and LIBFUZZER_APPLE has been defined which can be
used to check the target being compiled for.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 22:00:33 +00:00
Easwaran Raman
30c760d801 Remove specializations of ProfileSummary
This removes the subclasses of ProfileSummary, moves the members of the derived classes to the base class.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270143 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 21:53:28 +00:00
Matthew Simpson
e40864cee2 [ARM, AArch64] Match additional patterns to ldN instructions
When matching an interleaved load to an ldN pattern, the interleaved access
pass checks that all users of the load are shuffles. If the load is used by an
instruction other than a shuffle, the pass gives up and an ldN is not
generated. This patch considers users of the load that are extractelement
instructions. It attempts to modify the extracts to use one of the available
shuffles rather than the load. After the transformation, the load is only used
by shuffles and will then be matched with an ldN pattern.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270142 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 21:39:00 +00:00
Matt Arsenault
2ddec05599 AMDGPU: Remove pointless conversions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270139 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 21:09:58 +00:00
Dan Gohman
15399a989c [WebAssembly] Simplify code that never has to handle physical registers. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270137 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 21:07:20 +00:00
Easwaran Raman
17e7f1191f Move ProfileSummary to IR.
This splits ProfileSummary into two classes: a ProfileSummary class that has methods to convert from/to metadata and a ProfileSummaryBuilder class that computes the profiles summary which is in ProfileData.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270136 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 21:07:12 +00:00
Guozhi Wei
4f4b87e938 [InstCombine] Avoid combining the bitcast of a var that is used as both address and result of load instructions
This patch fixes https://llvm.org/bugs/show_bug.cgi?id=27703.

If there is a sequence of one or more load instructions, each loaded value is used as address of later load instruction, bitcast is necessary to change the value type, don't optimize it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270135 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 21:07:01 +00:00
Sanjay Patel
890e6002dc comment out line that is causing UBSAN bot failures
Patch is awaiting review here:
http://reviews.llvm.org/D20434


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270128 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 21:00:02 +00:00
Chris Bieneman
09166ea25b [obj2yaml] [yaml2obj] Support for MachO Load Command data
This re-applies r270115.

Many of the MachO load commands can have data appended after the command structure. This data is frequently strings, but can actually be anything. This patch adds support for three optional fields on load command yaml descriptions.

The new PayloadString YAML field is populated with the data after load commands known to have strings as extra data.

The new ZeroPadBytes YAML field is a count of zero'd bytes after the end of the load command structure before the next command. This can apply anywhere in the file. MachO2YAML verifies that bytes are zero before populating this field, and YAML2MachO will add zero'd bytes.

The new PayloadBytes YAML field stores all bytes after the end of the load command structure before the next command if they are non-zero. This is a catch all for all unhandled bytes. If MachO2Yaml populates PayloadBytes it will not populate ZeroPadBytes, instead zero'd bytes will be in the PayloadBytes structure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270124 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 20:54:43 +00:00
Chris Bieneman
ac5b9174b6 Revert "[obj2yaml] [yaml2obj] Support for MachO Load Command data"
This reverts commit r270115.

This failed on several builders using GCC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270121 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 20:48:54 +00:00
David Blaikie
80f6f5594a Fix -Wunused-variable in non-Asserts build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270118 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 20:44:22 +00:00
Chris Bieneman
dadbde9f38 [obj2yaml] [yaml2obj] Support for MachO Load Command data
Many of the MachO load commands can have data appended after the command structure. This data is frequently strings, but can actually be anything. This patch adds support for three optional fields on load command yaml descriptions.

The new PayloadString YAML field is populated with the data after load commands known to have strings as extra data.

The new ZeroPadBytes YAML field is a count of zero'd bytes after the end of the load command structure before the next command. This can apply anywhere in the file. MachO2YAML verifies that bytes are zero before populating this field, and YAML2MachO will add zero'd bytes.

The new PayloadBytes YAML field stores all bytes after the end of the load command structure before the next command if they are non-zero. This is a catch all for all unhandled bytes. If MachO2Yaml populates PayloadBytes it will not populate ZeroPadBytes, instead zero'd bytes will be in the PayloadBytes structure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270115 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 20:40:03 +00:00
Wei Mi
7aaac1e6e2 Recommit r255691 since PR26509 has been fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270113 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 20:38:03 +00:00
David Blaikie
803d656038 Simplify conditional unreachable into an assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270111 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 20:28:40 +00:00
Reid Kleckner
dadccffa36 Fix -Wmicrosoft-enum-value warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270110 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 20:20:22 +00:00
Hans Wennborg
eda241a530 X86: Don't reset the stack after calls that don't return (PR27117)
Since the calls don't return, the instruction afterwards will never run,
and is just taking up unnecessary space in the binary.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270109 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 20:15:33 +00:00
Adrian McCarthy
be9d2489d1 Modify emitTypeInformation to use MemoryTypeTableBuilder
A baby step toward translating DIType records to CodeView.

This does not (yet) combine the record length with the record data. I'm going back and forth trying to determine if that's a good idea.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270106 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 20:12:56 +00:00
Matthew Simpson
d06ea8a8f4 [ARM, AArch64] Properly initialize InterleavedAccessPass
InterleavedAccessPass is an IR-level pass, so this change will enable testing
it with opt. This is part of D20250.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270101 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 20:08:32 +00:00
David Majnemer
73cd9cf448 [Target] Don't return a std::string in getRegAsmName
getRegAsmName ends up making a copy of the register's name in order to
make a lower-case version of it.  This is bad because
getRegForInlineAsmConstraint, it's sole caller, does a lowercase
comparison anyway.

This resulted in a significant regression in compile time for the Linux
kernel because getRegAsmName is called in a loop by
getRegForInlineAsmConstraint.

Instead, forgo the call to lower in getRegAsmName and have it return a
StringRef.

No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270099 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 20:03:16 +00:00
Sanjay Patel
57c3a79e65 [x86] add tests for urem lowering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270096 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 18:57:54 +00:00
Rafael Espindola
187ca85319 Remember the relocation model. NFC.
This avoids passing a TargetMachine in a few places.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270095 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 18:49:29 +00:00
Rafael Espindola
0323a2e3a3 Style fixes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270093 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 18:34:20 +00:00
Zhan Jun Liau
7c8f8b736f [SystemZ] Test commit - remove idea from README
Remove a comment about not supporting LRVH/STRVH from the README
LRVH/STRVH are being generated as of r269688

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270092 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 18:30:17 +00:00
Matt Arsenault
bbac091f56 AMDGPU: Also look for s_cbranch_vccz
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270091 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 18:20:25 +00:00
Rui Ueyama
cc76d42fd3 pdbdump: Rename NumberOfSymbols -> SymbolRecordStreamIndex.
Differential Revision: http://reviews.llvm.org/D20441

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 18:05:58 +00:00
Ron Lieberman
f92376ea02 Fix a covnersion from string to bool issue used in an assert
Problem Was exposed by -Wstring-conversion
    



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270087 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 18:05:56 +00:00
Simon Pilgrim
9ea46b8e15 [X86][SSE] Added fast-isel tests to sync with clang/test/CodeGen/sse-builtins.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270081 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 16:55:52 +00:00
Simon Pilgrim
625707515f [X86][SSE2] Fixed shuffle of results in _mm_cmpnge_sd/_mm_cmpngt_sd tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270080 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 16:49:53 +00:00
Mitch Bodart
27d8b837b7 CodeGen: Move check of EnablePostRAScheduler to avoid disabling antidependency breaker
Previously, specifying -post-RA-scheduler=true had the side effect of
disabling the antidependency breaker, yielding different behavior than
if the post-RA-scheduler was enabled via the scheduling model.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270077 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 16:40:49 +00:00
George Rimar
b29ea6447e Temporarily revert r270070
It broke buildbot:
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/4817/steps/ninja%20check%201/logs/stdio

Actually it is just because D20273 not yet commited, but these 2 were crossing with each other,
and I`ll better find the way to land them separatelly soon.

Initial commit message:

[llvm-mc] - Teach llvm-mc to generate compressed debug sections in zlib style.

Before this patch llvm-mc generated zlib-gnu styled sections. 
That means no SHF_COMPRESSED flag was set, magic 'zlib' signature
was used in combination with full size field. Sections were renamed to "*.z*".
This patch reimplements the compression style to zlib one as zlib-gnu looks
to be depricated everywhere.

Differential revision: http://reviews.llvm.org/D20331

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270075 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 15:58:05 +00:00
Davide Italiano
88f5077adc [SCCP] Prefer class to struct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270074 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 15:58:02 +00:00
Sanjay Patel
c105a37f5e [SelectionDAG] rename/move isKnownToBeAPowerOfTwo() from TargetLowering (NFC)
There are at least 2 places (DAGCombiner, X86ISelLowering) where this could be used instead
of ad-hoc and watered down code that is trying to match a power-of-2 pattern.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270073 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 15:53:52 +00:00
Matthew Simpson
204e3200ad [LAA] Check independence of strided accesses before forward case
This patch changes the order in which we attempt to prove the independence of
strided accesses. We previously did this after we knew the dependence distance
was positive. With this change, we check for independence before handling the
negative distance case. The patch prevents LAA from reporting forward
dependences for independent strided accesses.

This change was requested in the review of D19984.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270072 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 15:37:19 +00:00
George Rimar
c9c693751f [llvm-mc] - Teach llvm-mc to generate compressed debug sections in zlib style.
Before this patch llvm-mc generated zlib-gnu styled sections. 
That means no SHF_COMPRESSED flag was set, magic 'zlib' signature
was used in combination with full size field. Sections were renamed to "*.z*".
This patch reimplements the compression style to zlib one as zlib-gnu looks
to be depricated everywhere.

Differential revision: http://reviews.llvm.org/D20331

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270070 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 15:08:31 +00:00
Chad Rosier
ae7c8ddf94 [AArch64 ] Generate a BFXIL from 'or (and X, Mask0Imm),(and Y, Mask1Imm)'.
Mask0Imm and ~Mask1Imm must be equivalent and one of the MaskImms is a shifted
mask (e.g., 0x000ffff0).  Both 'and's must have a single use.

This changes code like:

  and w8, w0, #0xffff000f
  and w9, w1, #0x0000fff0
  orr w0, w9, w8

into

  lsr w8, w1, #4
  bfi w0, w8, #4, #12

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270063 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 14:19:47 +00:00
Ranjeet Singh
ab4af72527 [ARM] Add cdp intrinsic tests.
- Renamed intrinsics.ll to intrinsics-coprocessor.ll
  as all the tests were testing coprocessor instructions,
  also made the test checks match the full instruction.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270057 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 12:59:17 +00:00
Ranjeet Singh
8f225b96ad Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270056 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 12:44:39 +00:00
Artem Tamazov
d8bb9ecd8c [AMDGPU][llvm-mc] Fixes to support buffer atomics.
Fixes for MUBUF_Atomic instructions to make operand list valid:
 - For RTN insns, make a copy of $vdata_in operand as $vdata.
 - Do not add operand for GLC, it is hardcoded and comes as a token.
Workaround to avoid adding multiple default optional operands.
Tests added.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270049 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 12:22:39 +00:00
Zoran Jovanovic
785d7f7fbf ps][microMIPS] Add R_MICROMIPS_PC21_S1 relocation
Differential Revision: http://reviews.llvm.org/D15526


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270048 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 12:20:40 +00:00
Simon Pilgrim
e4c02144d1 [X86][SSE2] Added _mm_move_* tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270046 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 11:59:57 +00:00
Simon Pilgrim
a861f2e16e [X86][SSE2] Added _mm_cast* and _mm_set* tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270041 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 10:58:54 +00:00