Commit Graph

128784 Commits

Author SHA1 Message Date
Sanjay Patel
52c58851ea fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263342 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 18:05:53 +00:00
Sanjay Patel
a5b740a791 use range loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263341 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 16:52:17 +00:00
Sanjay Patel
b1ec9c2aaf [x86, InstCombine] delete x86 SSE2 masked store with zero mask
This follows up on the related AVX instruction transforms, but this
one is too strange to do anything more with. Intel's behavioral
description of this instruction in its Software Developer's Manual
is tragi-comic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263340 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 15:16:59 +00:00
Nemanja Ivanovic
6f20310e9e Fix for PR 26378
This patch corresponds to review:
http://reviews.llvm.org/D17712

We were not clearing the TOC vector in PPCAsmPrinter when initializing it. This
caused duplicate definition asserts when the pass is reused on the module
(i.e. with -compile-twice or in JIT contexts).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263338 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 10:23:07 +00:00
Teresa Johnson
8335dded89 Use default destructor and remove unnecessary virtual destructor
Only the virtual destructor in the base class is needed, and can use the
default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263335 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 05:38:22 +00:00
Kostya Serebryany
258d1e6be7 [libFuzzer] refresh docs more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263332 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 03:23:02 +00:00
Kostya Serebryany
b3dcade510 [libFuzzer] refresh docs more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263331 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 03:11:27 +00:00
Kostya Serebryany
4b45ff1d5d [libFuzzer] refresh docs more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263330 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 03:05:37 +00:00
Chandler Carruth
cdb6339f8b [lit] Hack lit to allow a test suite to request that it is run "early".
This lets us for example start running the unit test suite early. For
'check-llvm' on my machine, this drops the tim e from 44s to 32s!!!!!

It's pretty ugly. I barely know how to write Python, so feel free to
just tell me how I should write it instead. =D Thanks to Filipe and
others for help.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263329 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 03:03:31 +00:00
Kostya Serebryany
409f59e332 [libFuzzer] refresh docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263328 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 02:56:25 +00:00
Sanjoy Das
4f234e79a3 Make gc relocates more strongly typed; NFC
Don't use a `Value *` where we can use a stronger `GCRelocateInst *`
type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263327 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 02:54:27 +00:00
Quentin Colombet
f02ed558bd [X86] Make sure we do not clobber RBX with cmpxchg when used as a base pointer.
cmpxchg[8|16]b uses RBX as one of its argument.
In other words, using this instruction clobbers RBX as it is defined to hold one
the input. When the backend uses dynamically allocated stack, RBX is used as a
reserved register for the base pointer. 

Reserved registers have special semantic that only the target understands and
enforces, because of that, the register allocator don’t use them, but also,
don’t try to make sure they are used properly (remember it does not know how
they are supposed to be used).

Therefore, when RBX is used as a reserved register but defined by something that
is not compatible with that use, the register allocator will not fix the
surrounding code to make sure it gets saved and restored properly around the
broken code. This is the responsibility of the target to do the right thing with
its reserved register.

To fix that, when the base pointer needs to be preserved, we use a different
pseudo instruction for cmpxchg that save rbx.
That pseudo takes two more arguments than the regular instruction:
- One is the value to be copied into RBX to set the proper value for the
  comparison.
- The other is the virtual register holding the save of the value of RBX as the
  base pointer. This saving is done as part of isel (i.e., we emit a copy from
  rbx).

cmpxchg_save_rbx <regular cmpxchg args>, input_for_rbx_reg, save_of_rbx_as_bp

This gets expanded into:
rbx = copy input_for_rbx_reg
cmpxchg <regular cmpxchg args>
rbx = save_of_rbx_as_bp

Note: The actual modeling of the pseudo is a bit more complicated to make sure
the interferes that appears after the pseudo gets expanded are properly modeled
before that expansion.

This fixes PR26883.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263325 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 02:25:27 +00:00
Kostya Serebryany
b30f32650e [libFuzzer] try to use max_len based on the items of the corpus instead of blindly defaulting to 64 bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263323 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 01:57:04 +00:00
Eric Christopher
3529ae09b5 Temporarily revert:
commit ae14bf6488
Author: Mehdi Amini <mehdi.amini@apple.com>
Date:   Fri Mar 11 17:15:50 2016 +0000

    Remove PreserveNames template parameter from IRBuilder

    Summary:
    Following r263086, we are now relying on a flag on the Context to
    discard Value names in release builds.

    Reviewers: chandlerc

    Subscribers: mzolotukhin, llvm-commits

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

    From: Mehdi Amini <mehdi.amini@apple.com>

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

until we can figure out what to do about clang and Release build testing.

This reverts commit 263258.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263321 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 01:47:22 +00:00
Eric Christopher
aac261190c Add Lanai.def to the module map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263319 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 01:31:53 +00:00
Michael Zolotukhin
150be6b78b [LoopUnroll] Convert some existing tests to unit-tests.
Summary: As we now have unit-tests for UnrollAnalyzer, we can convert some existing tests to this format. It should make the tests more robust.

Reviewers: chandlerc, sanjoy

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263318 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 01:28:56 +00:00
Teresa Johnson
192d305276 Fix a memory leak due to missing virtual destructors
Caused a couple of sanitizer bot failures in ThinLTO tests due to
r263275.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263317 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 01:23:57 +00:00
Wilfred Hughes
0ba30ee421 Updating source languages entry in FAQ.
Dragonegg is no longer actively maintained[1], and the Pypy team is not
actively pursuing LLVM[2].

1: http://reviews.llvm.org/D9331
2: http://rpython.readthedocs.org/en/latest/faq.html#could-we-use-llvm



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263314 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 00:43:26 +00:00
Chris Matthews
053b5e9854 Fix the docs I broke
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263309 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 23:31:02 +00:00
Mike Aizatsky
b18a07cf76 [sancov] using md5 for anchors in attempt to reduce file size.
Differential Revision: http://reviews.llvm.org/D18102

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263308 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 23:28:28 +00:00
Mike Aizatsky
e9983cf9b4 Don't crash sancov if file is unreadable.
Summary:
Caller can provides the list of .so files where some files are
unreadable (e.g linux-vdso.so.1). It's more convenient to handler this in
sancov with warning then making all callers to check files.

Reviewers: aizatsky

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263307 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 23:26:41 +00:00
Chris Matthews
41cfc0be88 Extend test-suite docs to describe how to run test-suite with cmake+lit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263305 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 22:33:36 +00:00
Mehdi Amini
194378dd27 Minor cleanup and documentation to IRMover (NFC)
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263304 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 22:19:06 +00:00
Simon Pilgrim
ddeaf238c9 [X86][SSE] Simplify vector LOAD + EXTEND on pre-SSE41 hardware
Improve vector extension of vectors on hardware without dedicated VSEXT/VZEXT instructions.

We already convert these to SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG but can further improve this by using the legalizer instead of prematurely splitting into legal vectors in the combine as this only properly helps for lowering to VSEXT/VZEXT.

Removes a lot of unnecessary any_extend + mask pattern - (Fix for PR25718).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263303 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 22:18:05 +00:00
Ahmed Bougacha
cdae7a5e30 [AArch64] Don't blindly lower f16/f128 FCCMPs.
Instead, extend f16 (like we do when lowering a standalone SETCC),
and let f128 be legalized to the RT calls.

Fixes PR26803.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263301 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 22:02:58 +00:00
Teresa Johnson
632e48cb4b Initialize CalleeInfo to fix bot after r263275
Hopefully will fix garbage output in
http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/6901

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263297 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 21:34:45 +00:00
Rui Ueyama
ddeff4c27a Define NT_GNU_BUILD_ID constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263288 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 20:20:25 +00:00
Dan Gohman
7a0d68c080 [WebAssembly] Add final keywords to a few more subclasses, for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263287 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 19:45:37 +00:00
George Burgess IV
d2347160ec [MemorySSA] Make a return type reflect reality. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263286 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 19:34:03 +00:00
Sanjoy Das
f9e7219610 Introduce @llvm.experimental.deoptimize
Summary:
This intrinsic, together with deoptimization operand bundles, allow
frontends to express transfer of control and frame-local state from
one (typically more specialized, hence faster) version of a function
into another (typically more generic, hence slower) version.

In languages with a fully integrated managed runtime this intrinsic can
be used to implement "uncommon trap" like functionality.  In unmanaged
languages like C and C++, this intrinsic can be used to represent the
slow paths of specialized functions.

Note: this change does not address how `@llvm.experimental_deoptimize`
is lowered.  That will be done in a later change.

Reviewers: chandlerc, rnk, atrick, reames

Subscribers: llvm-commits, kmod, mjacob, maksfb, mcrosier, JosephTremoulet

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 19:08:34 +00:00
Vedant Kumar
eac2b3065f [PGO] Skip value profile instrumentation of inline asm
Value profile instrumentation treats inline asm calls like they are
indirect calls. This causes problems when the 'Callee' is passed to a
ptrtoint cast -- the verifier rightly claims that this is bogus and
crashes opt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263278 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 18:57:48 +00:00
Teresa Johnson
dc6615addb [ThinLTO] Support for reference graph in per-module and combined summary.
Summary:
This patch adds support for including a full reference graph including
call graph edges and other GV references in the summary.

The reference graph edges can be used to make importing decisions
without materializing any source modules, can be used in the plugin
to make file staging decisions for distributed build systems, and is
expected to have other uses.

The call graph edges are recorded in each function summary in the
bitcode via a list of <CalleeValueIds, StaticCount> tuples when no PGO
data exists, or <CalleeValueId, StaticCount, ProfileCount> pairs when
there is PGO, where the ValueId can be mapped to the function GUID via
the ValueSymbolTable. In the function index in memory, the call graph
edges reference the target via the CalleeGUID instead of the
CalleeValueId.

The reference graph edges are recorded in each summary record with a
list of referenced value IDs, which can be mapped to value GUID via the
ValueSymbolTable.

Addtionally, a new summary record type is added to record references
from global variable initializers. A number of bitcode records and data
structures have been renamed to reflect the newly expanded scope of the
summary beyond functions. More cleanup will follow.

Reviewers: joker.eph, davidxl

Subscribers: joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263275 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 18:52:24 +00:00
Mike Spertus
fcb50867e5 Type correct Visual Studio native visualization for PointerUnions
Visualize pointer unions by their actual type rather than as void *.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263270 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 18:26:47 +00:00
Chad Rosier
9c9879a621 Update test case to appease bots after 263255.
I'll follow up with Matt to confirm this is the correct fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263268 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 17:33:36 +00:00
Simon Pilgrim
0cf8ba232e Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263266 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 17:31:43 +00:00
Quentin Colombet
36053724e3 [IRTranslator] Translate unconditional branches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263265 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 17:28:03 +00:00
Quentin Colombet
a801132f2a [MachineIRBuilder] Rework buildInstr API to maximize code reuse.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263264 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 17:27:58 +00:00
Quentin Colombet
acd8367766 [IRTranslator] Update getOrCreateVReg API to use references.
A value that we want to keep in a virtual register cannot be null.
Reflect that in the API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263263 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 17:27:54 +00:00
Quentin Colombet
743ea3e236 [MachineIRBuilder] Rename the setter of MF for consistency with the getter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263262 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 17:27:51 +00:00
Quentin Colombet
b62ecc87ce [MachineIRBuilder] Rename the setter for MBB for consistency with the getter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263261 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 17:27:47 +00:00
Quentin Colombet
3cf9237ecf [IRTranslator] Update getOrCreateBB API to use references.
A null basic block is invalid, so just pass a reference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263260 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 17:27:43 +00:00
Quentin Colombet
132c140240 [GlobalISel][Target] Add an opcode for unconditional branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263259 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 17:27:38 +00:00
Mehdi Amini
ae14bf6488 Remove PreserveNames template parameter from IRBuilder
Summary:
Following r263086, we are now relying on a flag on the Context to
discard Value names in release builds.

Reviewers: chandlerc

Subscribers: mzolotukhin, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263258 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 17:15:50 +00:00
Mehdi Amini
cba5def1cd Do not specialize IRBuilder to strip names in SROA
Summary:
Following r263086, we are replacing this by a runtime check.
More cleanup will follow on the IRBuilder itself, but I submitted
this patch separately as SROA has a fancy "prefixInserter" class
that needs extra-love.

Reviewers: chandlerc

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263256 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 17:15:34 +00:00
Chad Rosier
8c362cf8d4 [misched] Fix a truncation issue from r263021.
The truncation was causing the sorting algorithm to behave oddly when comparing
positive and negative offsets.  Fortunately, this doesn't currently happen in
practice and was exposed by a WIP.  Thus, I can't test this change now, but the
follow on patch will.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263255 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 16:54:07 +00:00
Chandler Carruth
913bb512ce [PM] Sink the "Expression" type for GVN into the class as a private
member type.

Because of how this type is used by the ValueTable, it cannot actually
have hidden visibility. GCC actually nicely warns about this but Clang
just silently ... I don't even know. =/ We should do a better job either
way though.

This should resolve a bunch of the GCC warnings about visibility that
the port of GVN triggered and make the visibility story a bit more
correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263250 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 16:25:19 +00:00
Marianne Mailhot-Sarrasin
07ef9b6010 More UTF string conversion wrappers
Added new string conversion wrappers that convert between `std::string` (of UTF-8 bytes) and `std::wstring`, which is particularly useful for Win32 interop. Also fixed a missing string conversion for `getenv` on Win32, using these new wrappers.
The motivation behind this is to provide the support functions required for LLDB to work properly on Windows with non-ASCII data; however, the functions are not LLDB specific.

Patch by cameron314

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263247 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 15:59:32 +00:00
Valery Pykhtin
c4ca9a1246 [AMDGPU] Fix VOPC instruction operand namings
Differential Revision: http://reviews.llvm.org/D17966

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263242 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 14:53:28 +00:00
Simon Pilgrim
91f04ade7e [X86][AVX] Fixed issue where a long chain of shuffles could attempt to combine to a single (illegal) PSHUFB instruction.
Its not enough that we test for SSSE3 - that's only OK for 128-bit vectors - we also need to test for AVX2 / AVX512BW for 256/512 bit vector cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263239 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 14:39:10 +00:00
Chandler Carruth
746124bd5b [AA] Make BasicAA just require domtree.
This doesn't change how many times we construct domtrees in the normal
pipeline, and it removes fragility and instability where basic-aa may
not be run in time to see domtrees because they happen to be constructed
afterward.

This isn't quite as clean as the change to memdep because there is
a mode where basic-aa specifically runs without domtrees -- in the
hacking version used by function-attrs with the legacy pass manager.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263234 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 13:53:18 +00:00