127694 Commits

Author SHA1 Message Date
Mehdi Amini
0f2eb3b005 Add the ability to initialize a StringSet from a pair of iterators (NFC)
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260461 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 23:24:21 +00:00
Davide Italiano
e1244044f3 [llvm-nm] Prefer range-based loop over explicit iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260459 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 23:16:17 +00:00
Mehdi Amini
f181d046e0 Add a new insert_as() method to DenseMap and use it for ConstantUniqueMap
Summary:
Just like the existing find_as() method, the new insert_as() accepts
an extra parameter which is used as a key to find the bucket in the
map.
When creating a Constant, we want to check the map before actually
creating the object. In this case we have to perform two queries to
the map, and this extra parameter can save recomputing the hash value
for the second query.

Reviewers: dexonsmith, chandlerc

Subscribers: llvm-commits

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260458 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 23:07:29 +00:00
Quentin Colombet
de48097969 [CMake] Add a macro definition to detect if we are building GlobalISel:
LLVM_BUILD_GLOBAL_ISEL


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260457 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 23:00:57 +00:00
Quentin Colombet
f62b31051b [GlobalISel] More detailed skeleton for the IRTranslator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260456 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 22:59:27 +00:00
Mehdi Amini
5e9b7afcd9 Bitcode reader: replace DecodeChar6() with a lookup table (NFC)
Summary: Measured to be more performant when reading bitcode.

Reviewers: rafael, dexonsmith

Subscribers: llvm-commits

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260455 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 22:47:48 +00:00
Mehdi Amini
4c69696279 Simplify handleOperandChangeImpl() removing last argument (NFC)
The Use argument was used to compute the operand number for a fast
path when replacing only one operand. However we always have to go
through all the operands. So the argument number can be recomputed
locally anyway.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260454 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 22:47:15 +00:00
Philip Reames
18fb862ea7 Follow up to 260439, Speculative fix to clang builders
It looks like clang has a couple of test cases which caught the fact LVI was not slightly more precise after 260439.  When looking at the failures, it struck me as wasteful to be querying nullness of a constant via LVI, so instead of tweaking the clang tests, let's just stop querying constants from this source.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260451 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 22:22:41 +00:00
Rong Xu
2465700839 [PGO] Make the number of records for each value site metada adjustable
The patch adds a parameter in annotateValueSite() to control the max number
of records written to the value profile meta data for each value site. The
default is kept as the current value of 3.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260450 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 22:19:43 +00:00
Matthias Braun
6bf8999e3a APInt: Simplify EqualSlowCase
Previously the code used getActiveBits() to determine the highest set
bit of each APInt first. However doing so requires the same amount of
memory accesses as simply comparing both numbers right away.

Removing all the active bit checks leads to simpler code and is faster
in my benchmark.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260447 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 22:13:10 +00:00
Xinliang David Li
7e57e07d4e Fix buildbot failure (hosts without zlib)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260446 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 22:05:41 +00:00
Teresa Johnson
0060160bcf Restore "[ThinLTO] Use MD5 hash in function index." with fix
This restores commit r260408, along with a fix for a bot failure.

The bot failure was caused by dereferencing a unique_ptr in the same
call instruction parameter list where it was passed via std::move.
Apparently due to luck this was not exposed when I built the compiler
with clang, only with gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260442 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 21:55:02 +00:00
Philip Reames
1d9f7a9b38 [LVI] Handle constants defensively
There's nothing preventing callers of LVI from asking for lattice values representing a Constant.  In fact, given that several callers are walking back through PHI nodes and trying to simplify predicates, such queries are actually quite common.  This is mostly harmless today, but we start volatiling assertions if we add new calls to getBlockValue in otherwise reasonable places.

Note that this change is not NFC.  Specifically:
1) The result returned through getValueAt will now be more precise.  In principle, this could trigger any latent infinite optimization loops in callers, but in practice, we're unlikely to see this.
2) The result returned through getBlockValueAt is potentially weakened for non-constants that were previously queried.  With the old code, you had the possibility that a later query might bypass the cache and discover some information the original query did not.  I can't find a scenario which actually causes this to happen, but it was in principle possible.  On the other hand, this may end up reducing compile time when the same value is queried repeatedly.  



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260439 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 21:46:32 +00:00
Derek Schuff
b73ab6b083 [WebAssembly] Re-triage list of compilation failures for torture tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260438 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 21:43:16 +00:00
Reid Kleckner
430dfb18e5 [codeview] Describe int local variables using .cv_def_range
Summary:
Refactor common value, scope, and label tracking logic out of DwarfDebug
into a common base class called DebugHandlerBase.

Update an old LLVM IR test case to avoid an assertion in LexicalScopes.

Reviewers: dblaikie, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260432 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 20:55:49 +00:00
Hemant Kulkarni
54f4d3a066 [llvm-readobj] Option to emit readelf like output
New option --elf-output-style=LLVM or GNU
Enables -file-headers in readelf style when elf-output-style=GNU

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260430 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 20:40:55 +00:00
Derek Schuff
ded8212063 [WebAssembly] Address comments left over from r260421
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260429 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 20:14:15 +00:00
Xinliang David Li
feb624a121 [Coverage] add covmap v2 binary format regression test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260428 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 20:14:04 +00:00
Nicolai Haehnle
ac2300f5ed AMDGPU: Release the scavenged offset register during VGPR spill
Summary:
This fixes a crash where subsequent spills would be unable to scavenge
a register. In particular, it fixes a crash in piglit's
spec@glsl-1.50@execution@geometry@max-input-components (the test still
has a shader that fails to compile because of too many SGPR spills, but
at least it doesn't crash any more).

This is a candidate for the release branch.

Reviewers: arsenm, tstellarAMD

Subscribers: qcolombet, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260427 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 20:13:58 +00:00
Sanjay Patel
76f5f56312 [x86] refactor masked load/store combine logic ; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260426 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 20:02:45 +00:00
Derek Schuff
d239e9c2e5 [WebAssembly] Switch varags calling convention to use a register
Instead of passing varargs directly on the user stack, allocate a buffer in
the caller's stack frame and pass a pointer to it. This simplifies the C
ABI (e.g. non-C callers of C functions do not need to use C's user stack if
they have their own mechanism) and allows further optimizations in the future
(e.g. fewer functions may need to use the stack).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260421 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 19:51:04 +00:00
Chad Rosier
43fe5fc136 [AArch64] Refactor is logic into a helper function. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260419 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 19:45:48 +00:00
Reid Kleckner
3833b9b8d1 Fix a -Wsign-compare in Support Path unittests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 19:29:01 +00:00
Reid Kleckner
575b993830 Disable MSVC 2015's warning about zero extending after ~ and others
Very often in LLVM we have APIs that take a bitwidth and a uint64_t that
we pass immediates such as ~0U to. Consider APInt, Constant, and
MachineInstrBuilder::addImm. Fixing all uses of these APIs to manually
extend their arguments to uint64_t doesn't seem worth it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260416 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 19:25:51 +00:00
Reid Kleckner
6f306397f3 Silence some MSVC warnings about zero extending unsigned to void*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260413 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 19:11:15 +00:00
Teresa Johnson
bc947a0d8d Revert "[ThinLTO] Use MD5 hash in function index." due to bot failure
This reverts commit r260408. Bot failure that I need to investigate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260412 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 19:11:15 +00:00
Reid Kleckner
88dea5d1ef Enable constexpr on Visual Studio 2015, add support for two equivalent attributes
Patch by Alexander Riccio

This patch enables `constexpr` on Visual Studio 2015 by adding `||
LLVM_MSC_PREREQ(1900)` to the preprocessor `#if` statement. Since VS2013
doesn't support `constexpr`, that's purposely excluded. The
`LLVM_CONSTEXPR` macro is used in ~25 places.

I also added the MSVC/SAL equivalent of:

  - `__attribute__((__warn_unused_result__))` as an
    `LLVM_ATTRIBUTE_UNUSED_RESULT` definition

  - `__attribute__((returns_nonnull))` as an
    `LLVM_ATTRIBUTE_RETURNS_NONNULL` definition

...in case anybody ever decides to run `/analyze` on LLVM (probably
myself, if anybody)

Reviewers: rnk, aaron.ballman

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260410 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 19:07:47 +00:00
Matt Arsenault
5b0e331ef6 Fix return type of bool function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260409 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 19:04:12 +00:00
Teresa Johnson
f38049c501 [ThinLTO] Use MD5 hash in function index.
Summary:
This patch uses the lower 64-bits of the MD5 hash of a function name as
a GUID in the function index, instead of storing function names. Any
local functions are first given a global name by prepending the original
source file name. This is the same naming scheme and GUID used by PGO in
the indexed profile format.

This change has a couple of benefits. The primary benefit is size
reduction in the combined index file, for example 483.xalancbmk's
combined index file was reduced by around 70%. It should also result in
memory savings for the index file in memory, as the in-memory map is
also indexed by the hash instead of the string.

Second, this enables integration with indirect call promotion, since the
indirect call profile targets are recorded using the same global naming
convention and hash. This will enable the function importer to easily
locate function summaries for indirect call profile targets to enable
their import and subsequent promotion.

The original source file name is recorded in the bitcode in a new
module-level record for use in the ThinLTO backend pipeline.

Reviewers: davidxl, joker.eph

Subscribers: llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260408 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:57:54 +00:00
Jordan Rose
94873e8e3b [ADT] Add "return *this;" to PointerEmbeddedInt::operator=.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260407 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:54:41 +00:00
Chad Rosier
0b08398212 [AArch64] Update comment to match reality. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260406 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:49:28 +00:00
Reid Kleckner
952c84f10b Disable the new Orc lazy JIT tests on Windows, they do not pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260405 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:46:42 +00:00
Matt Arsenault
b9f1dbe18d SelectionDAG: Make Properties a field of SDPatternOperator
Currently you can't specify node properties like commutativity on
a PatFrag. If you want to create a PatFrag on a commutative node
with a hasOneUse predicate, this enables you to specify that the
PatFrag is also commutable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260404 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:40:04 +00:00
Matt Arsenault
472b217160 SelectionDAG: Make min/max commutative and associative
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260403 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:39:57 +00:00
Colin LeMahieu
89dcdff198 [MC] Merge VK_PPC_TPREL in to generic VK_TPREL.
Differential Revision: http://reviews.llvm.org/D17038

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260401 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:32:01 +00:00
Rong Xu
7a71e16708 [PGO] Indirect-call profile annotation in IR level profiling
This patch reads the indirect-call value records in the profile and makes the
annotation in the indirect-call instruction. This is for IR level profile
instrumentation.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260400 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:24:45 +00:00
Matt Arsenault
41d5fe81a2 AMDGPU: Fix indentation and variable names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260399 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:21:45 +00:00
Matt Arsenault
e6640ee461 AMDGPU: Split R600 and SI load lowering
These weren't actually sharing anything in the common
LowerLOAD.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260398 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:21:39 +00:00
Hemant Kulkarni
dc8e8f2ccc Revert "[llvm-readobj] Option to emit readelf like output"
This reverts commit a58765909660a7195b32e0cc8c7476168b913750.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260397 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:21:01 +00:00
Reid Kleckner
79d09f0773 [pdbdump] Fix test for different type ordering with DIA 2015
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260396 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:17:17 +00:00
Teresa Johnson
c6f574dfd7 [ThinLTO] Move global processing from Linker to TransformUtils (NFC)
Summary:
As discussed on IRC, move the ThinLTOGlobalProcessing code out of
the linker, and into TransformUtils. The name of the class is changed
to FunctionImportGlobalProcessing.

Reviewers: joker.eph, rafael

Subscribers: joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260395 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:11:31 +00:00
Xinliang David Li
99aaced786 [PGO] coverage map bug with cov data produced for 32bit target
Fix the result truncation bug: [PR26560]
Test case is following (compiler-rt).
 





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260393 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 17:57:08 +00:00
Hemant Kulkarni
d712968e30 [llvm-nm] Add -radix option
Differential Revision: http://reviews.llvm.org/D16822

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260392 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 17:51:39 +00:00
Hemant Kulkarni
fce97aeb2d [llvm-readobj] Option to emit readelf like output
New option --elf-output-style=LLVM or GNU
Enables -file-headers in readelf style when elf-output-style=GNU

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260391 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 17:51:28 +00:00
James Y Knight
c7f8b27879 [SPARC] Repair floating-point condition encodings in assembly parser.
The encodings for floating point conditions A(lways) and N(ever) were
incorrectly specified for the assembly parser, per Sparc manual v8 page
121. This change corrects that mistake.

Also, strangely, all of the branch instructions already had MC test
cases, except for the broken ones. Added the tests.

Patch by Chris Dewhurst

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260390 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 17:47:20 +00:00
Daniel Berlin
a70447cea6 Rename a member variable to be more accurate with how it is used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260389 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 17:41:25 +00:00
Daniel Berlin
ff47e0a2ba Constify two functions, make them accessible to unit tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260387 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 17:39:43 +00:00
Ehsan Akhgari
e5aba2bcf6 Disable all llvm-config tests for now, will investigate later
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260386 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 17:29:50 +00:00
Rong Xu
c7d7fb02f4 [PGO] Differentiate Clang instrumentation and IR level instrumentation profiles
This patch uses one bit in profile version to differentiate Clang
instrumentation and IR level instrumentation profiles.

PGOInstrumenation generates a COMDAT variable __llvm_profile_raw_version so
that the compiler runtime can set the right profile kind.
For Maco-O platform, we generate the variable as linkonce_odr linkage as
COMDAT is not supported.

PGOInstrumenation now checks this bit to make sure it's an IR level
instrumentation profile.

The patch was submitted as r260164 but reverted due to a Darwin test breakage.
Original Differential Revision: http://reviews.llvm.org/D15540

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260385 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 17:18:30 +00:00
Chad Rosier
d013f79f46 [AArch64] This bit of logic is specific to pairing. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260383 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 15:52:46 +00:00