Commit Graph

129143 Commits

Author SHA1 Message Date
Mike Aizatsky
9647ee51e2 [sancov] -print-coverage-stats option to print various coverage statistics.
Differential Revision: http://reviews.llvm.org/D18418

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264222 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 00:00:08 +00:00
Lang Hames
d34f785662 [Support] Make all Errors convertible to std::error_code.
This is a temporary crutch to enable code that currently uses std::error_code
to be incrementally moved over to Error. Requiring all Error instances be
convertible enables clients to call errorToErrorCode on any error (not just
ECErrors created by conversion *from* an error_code).

This patch also moves code for Error from ErrorHandling.cpp into a new
Error.cpp file.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264221 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 23:57:28 +00:00
Matt Arsenault
b883372896 APFloat: Fix signalling nans for scalbn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264219 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 23:51:45 +00:00
Matt Arsenault
54f7128a27 AMDGPU: Remove atomic inc/dec patterns
There is no benefit to these since materializing the constant 1
requires the same number of instructions as materializing uint_max

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264215 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 23:23:38 +00:00
Matt Arsenault
fc80e900d8 AMDGPU: Promote alloca should skip volatiles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264214 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 23:17:29 +00:00
Mike Aizatsky
bbc99ea0f8 [sancov] code readability improvement.
Summary: Reply to http://reviews.llvm.org/D18341

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 23:15:03 +00:00
Justin Bogner
8b620f3783 docs: Fix a missing language in a code-block
This should fix the docs build.
Spotted by spstarr, thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 22:54:19 +00:00
Justin Lebar
fe3378bb83 [CUDA] Update docs to reflect that we no longer define __NVCC__.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264208 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 22:43:10 +00:00
Pete Cooper
552f3d8472 StringRef::copy shouldn't allocate anything for length 0 strings.
The BumpPtrAllocator currently doesn't handle zero length allocations well.
The discussion for how to fix that is ongoing.  However, there's no need
for StringRef::copy to actually allocate anything here anyway, so just
return StringRef() when we get a zero length copy.

Reviewed by David Blaikie

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 21:49:31 +00:00
Matt Arsenault
222f9e97f6 AMDGPU: Insert moves of frame index to value operands
Strengthen tests of storing frame indices.

Right now this just creates irrelevant scheduling changes.

We don't want to have multiple frame index operands
on an instruction. There seem to be various assumptions
that at least the same frame index will not appear twice
in the LocalStackSlotAllocation pass.

There's no reason to have this happen, and it just
makes it easy to introduce bugs where the immediate
offset is appplied to the storing instruction when it should
really be applied to the value being stored as a separate
add.

This might not be sufficient. It might still be problematic
to have an add fi, fi situation, but that's even less unlikely
to happen in real code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 21:49:25 +00:00
Cong Hou
58aed69858 Allow X86::COND_NE_OR_P and X86::COND_NP_OR_E to be reversed.
Currently, AnalyzeBranch() fails non-equality comparison between floating points
on X86 (see https://llvm.org/bugs/show_bug.cgi?id=23875). This is because this
function can modify the branch by reversing the conditional jump and removing
unconditional jump if there is a proper fall-through. However, in the case of
non-equality comparison between floating points, this can turn the branch
"unanalyzable". Consider the following case:

jne.BB1
jp.BB1
jmp.BB2
.BB1:
...
.BB2:
...

AnalyzeBranch() will reverse "jp .BB1" to "jnp .BB2" and then "jmp .BB2" will be
removed:

jne.BB1
jnp.BB2
.BB1:
...
.BB2:
...

However, AnalyzeBranch() cannot analyze this branch anymore as there are two
conditional jumps with different targets. This may disable some optimizations
like block-placement: in this case the fall-through behavior is enforced even if
the fall-through block is very cold, which is suboptimal.

Actually this optimization is also done in block-placement pass, which means we
can remove this optimization from AnalyzeBranch(). However, currently
X86::COND_NE_OR_P and X86::COND_NP_OR_E are not reversible: there is no defined
negation conditions for them.

In order to reverse them, this patch defines two new CondCode X86::COND_E_AND_NP
and X86::COND_P_AND_NE. It also defines how to synthesize instructions for them.
Here only the second conditional jump is reversed. This is valid as we only need
them to do this "unconditional jump removal" optimization.


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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264199 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 21:45:37 +00:00
Kevin Enderby
67e57feb4e Fix a cut-and-paste error in the changes for r264187 which I think is
the cause of the tools/llvm-objdump/X86/macho-symbolized-disassembly.test
crashing on linux.  Either way clearly incorrect code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264198 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 21:45:21 +00:00
Sanjay Patel
c062937b5e reorganize llc checks script to allow more flexibility; NFCI
The goal is to enhance this script to be used with opt and clang:
Group all of the regexes together, so it's easier to see what's going on.
This will make it easier to break main() up into pieces too. 
Also, note that some of the regexes are for x86-specific asm. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264197 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 21:40:53 +00:00
Kevin Enderby
825efc59cb More more change need as part of r264187 where ErrorOr<> was added
to getSymbolType().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 21:20:16 +00:00
Rafael Espindola
d7bb2de671 Fix logic for which symbols to keep with comdats.
If a comdat is dropped, all symbols in it are dropped.
If a comdat is kept, the symbols survive to pass regular symbol
resolution.
With this patch we do that for all global symbols.

The added test is a copy of test/tools/gold/X86/comdat.ll that we now
pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 21:16:33 +00:00
Kevin Enderby
46e35edc2d Fix a crash in running llvm-objdump -t with an invalid Mach-O file already
in the test suite. While this is not really an interesting tool and option to run
on a Mach-O file to show the symbol table in a generic libObject format
it shouldn’t crash.

The reason for the crash was in MachOObjectFile::getSymbolType() when it was
calling MachOObjectFile::getSymbolSection() without checking its return value
for the error case.

What makes this fix require a fair bit of diffs is that the method getSymbolType() is
in the class ObjectFile defined without an ErrorOr<> so I needed to add that all
the sub classes.  And all of the uses needed to be updated and the return value
needed to be checked for the error case.

The MachOObjectFile version of getSymbolType() “can” get an error in trying to
come up with the libObject’s internal SymbolRef::Type when the Mach-O symbol
symbol type is an N_SECT type because the code is trying to select from the
SymbolRef::ST_Data or SymbolRef::ST_Function values for the SymbolRef::Type.
And it needs the Mach-O section to use isData() and isBSS to determine if
it will return SymbolRef::ST_Data.

One other possible fix I considered is to simply return SymbolRef::ST_Other
when MachOObjectFile::getSymbolSection() returned an error.  But since in
the past when I did such changes that “ate an error in the libObject code” I
was asked instead to push the error out of the libObject code I chose not
to implement the fix this way.

As currently written both the COFF and ELF versions of getSymbolType()
can’t get an error.  But if isReservedSectionNumber() wanted to check for
the two known negative values rather than allowing all negative values or
the code wanted to add the same check as in getSymbolAddress() to use
getSection() and check for the error then these versions of getSymbolType()
could return errors.

At the end of the day the error printed now is the generic “Invalid data was
encountered while parsing the file” for object_error::parse_failed.  In the
future when we thread Lang’s new TypedError for recoverable error handling
though libObject this will improve.  And where the added // Diagnostic(…
comment is, it would be changed to produce and error message
like “bad section index (42) for symbol at index 8” for this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264187 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 20:27:00 +00:00
Sanjay Patel
090f2ae626 [x86] make peekThroughBitcasts() a helper function
This should be hoisted further up so it can be used in DAGCombiner and other backends,
but I'm limiting the scope in the interest of patch minimalism.

It's not quite NFC because some of the replaced code was using an 'if' check rather
than a 'while' loop, so those cases would only look through a single bitcast.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264186 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 20:16:37 +00:00
Chad Rosier
7f0ee88e1f [AArch64] Replace return 0 with return false. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264185 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 20:07:28 +00:00
Kyle Butt
03d7c088c2 Codegen: [PPC] Word Rotates are Zero Extending.
Add Word rotates to the list of instructions that are zero extending.
This allows them to be used in dot form to compare with zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 19:51:22 +00:00
George Burgess IV
0a451a3606 Fix bugs in the MemorySSA walker.
There are a few bugs in the walker that this patch addresses.
Primarily:
- Caching can break when we have multiple BBs without phis
- We weren't optimizing some phis properly
- Because of how the DFS iterator works, there were times where we
  wouldn't cache any results of our DFS

I left the test cases with FIXMEs in, because I'm not sure how much
effort it will take to get those to work (read: We'll probably
ultimately have to end up redoing the walker, or we'll have to come up
with some creative caching tricks), and more test coverage = better.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264180 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 18:31:55 +00:00
Easwaran Raman
e34db46356 Add getBlockProfileCount method to BlockFrequencyInfo
Differential Revision: http://reviews.llvm.org/D18233



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264179 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 18:18:26 +00:00
Justin Bogner
6b4391cd9c SelectionDAG: Remove a tautological dyn_cast. NFC
Index is already a StoreSDNode, so this dyn_cast doesn't do anything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264177 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 18:15:33 +00:00
Artyom Skrobov
2d2221d7fb Replace a string comparison in ARMSubtarget.h with a tablegen entry in ARM.td (NFC)
Reviewers: rengolin, t.p.northover

Subscribers: aemerson, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264165 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 16:18:13 +00:00
Silviu Baranga
0905413218 [SCEV] Change the SCEV Predicates interfaces for conversion to AddRecExpr to return SCEVAddRecExpr* instead of SCEV*
Summary:
This changes the conversion functions from SCEV * to SCEVAddRecExpr from
ScalarEvolution and PredicatedScalarEvolution to return a SCEVAddRecExpr*
instead of a SCEV* (which removes the need of most clients to do a
dyn_cast right after calling these functions).

We also don't add new predicates if the transformation was not successful.

This is not entirely a NFC (as it can theoretically remove some predicates
from LAA when we have an unknown dependece), but I couldn't find an obvious
regression test for it.

Reviewers: sanjoy

Subscribers: sanjoy, mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 15:29:30 +00:00
Simon Pilgrim
14e214149c [X86] Regenerated WidenArith test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264157 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 14:00:28 +00:00
Oliver Stannard
67240a7684 [AArch64] Replace some uses of report_fatal_error with reportError in AArch64 ELF object writer
If we can't handle a relocation type, report it as an error in the source,
rather than asserting. I've added a more descriptive message and a test for the
only cases of this that I've been able to trigger.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264156 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 13:45:03 +00:00
Andrey Turetskiy
2228d07bc0 [X86] Introduction of FeatureX87.
Add FeatureX87 in X86 backend to be able to define CPUs which doesn't have x87.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264148 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 11:13:54 +00:00
Hrvoje Varga
e7adbcc7a2 [mips][microMIPS] Delay slot filler modifications
Differential Revision: http://reviews.llvm.org/D18181


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 10:29:38 +00:00
Justin Bogner
2515d26400 FAQ: Remove the entire Build Problems section
This is all horribly outdated, and is mostly about the autoconf build
system that doesn't even exist anymore. These questions aren't
frequent, and these answers aren't useful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264141 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 06:54:42 +00:00
Justin Bogner
ce3a62bee8 FAQ: We require GCC 4.7 - nobody's asking about build failures with 3.3.2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264139 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 06:38:53 +00:00
Vedant Kumar
4b4e6ab6be [docs] Fix typo in ProgrammersManual.rst
Patch by Miod Vallat!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264138 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 05:18:50 +00:00
Valery Pykhtin
7c2672b778 [AMDGPU] Fix missing assembler predicates.
Differential Revision: http://reviews.llvm.org/D18351

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264137 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 04:27:26 +00:00
Lang Hames
3821992393 [Docs] Clarify boolean conversion for Error and Expected<T> in the Programmer's
Manual.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264135 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 03:18:16 +00:00
Sanjoy Das
ab71fdec0a Remove stale comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264131 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 02:28:35 +00:00
Sanjoy Das
613b7c3337 [StatepointLowering] Don't do two DenseMap lookups; nfci
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 02:24:15 +00:00
Sanjoy Das
df46390b38 [StatepointLowering] Minor NFC cleanups
- Use auto
 - Name variables in LLVM style
 - Use llvm::find instead of std::find
 - Blank lines between declarations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264129 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 02:24:13 +00:00
Sanjoy Das
0479e1aad2 [StatepointLowering] Minor nfc refactoring
Now that StatepointLoweringInfo represents base pointers, derived
pointers and gc relocates as SmallVectors and not ArrayRefs, we no
longer need to allocate "backing storage" on stack in LowerStatepoint.
So elide the backing storage, and inline the trivial body of
getIncomingStatepointGCValues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264128 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 02:24:10 +00:00
Sanjoy Das
5fb8106b47 [StatepointLowering] Schedule gc relocates before uniqueing them
Otherwise we can see an "unexpected" gc.relocate that we uniqued away.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264127 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 02:24:07 +00:00
Tom Stellard
835c01151e AMDGPU: Cache information about register pressure sets
We can statically decide whether or not a register pressure set is for
SGPRs or VGPRs, so we don't need to re-compute this information in
SIRegisterInfo::getRegPressureSetLimit().

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264126 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 01:53:22 +00:00
Junmo Park
1da710de1f Minor code cleanup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264124 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 01:38:35 +00:00
Davide Italiano
11e71d65b2 [ModuleUtils] Use range-based loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264122 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 00:43:35 +00:00
Sean Silva
1495b908cb [docs] Use reST link.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264121 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 00:31:21 +00:00
Sean Silva
00b768bfef Bring back Makefile.sphinx
It is not part of autoconf and should not have been removed in r258861.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264120 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 00:30:57 +00:00
Sean Silva
806688c673 [docs] Clarify the sense of --compile-command
In retrospect, it seems "obvious" that the sense of the return code is
the same as if it crashed on "interesting" inputs. But that didn't stop
me from spending more time than I care to admit verifying this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264119 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 00:25:13 +00:00
Joerg Sonnenberger
c8740297ca Typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264110 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 22:24:52 +00:00
Justin Bogner
6d476e60b2 MC: Don't access the filesystem in MCContext's constructor
MCContext shouldn't be accessing the filesystem - that's a gross
layering violation and makes it awkward to use as a library or in a
daemon where it may not even be allowed filesystem access.

The CWD lookup here is normally redundant anyway, since the calling
context either also looks up the CWD or sets this to something more
specific. Here, we fix up the one caller that doesn't already set up a
debug compilation dir and make it clear that the responsibility for
such set up is in the users of MCContext.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264109 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 22:24:29 +00:00
Justin Lebar
f7ed584658 [NVVM] Remove noduplicate attribute from synchronizing intrinsics.
Summary:
I've completed my audit of all the code that looks at noduplicate and
added handling of convergent where appropriate, so we no longer need
noduplicate on these intrinsics.

Reviewers: jholewinski

Subscribers: llvm-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264107 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 22:08:01 +00:00
Rafael Espindola
a8fd65832a Drop comdats from the dst module if they are not selected.
A really unfortunate design of llvm-link and related libraries is that
they operate one module at a time.

This means they can copy a GV to the destination module that should not
be there in the final result because a later bitcode file takes
precedence.

We already handled cases like a strong GV replacing a weak for example.

One case that is not currently handled is a comdat replacing another.
This doesn't happen in ELF, but with COFF largest selection kind it is
possible.

In "llvm-link a.ll b.ll" if the selected comdat was from a.ll,
everything will work and we will not copy the comdat from b.ll.

But if we run "llvm-link b.ll a.ll", we fail to delete the already
copied comdat from b.ll. This patch fixes that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264103 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 21:35:47 +00:00
George Burgess IV
58cad7988f Keep CodeGenPrepare from preserving the domtree.
CGP modifies the domtree in some cases, so saying that it preserves the
domtree is a lie. We'll be able to selectively preserve it with the new
pass manager.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264099 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 21:25:08 +00:00
Matthias Braun
a31e891389 Revert "Support arbitrary addrspace pointers in masked load/store intrinsics"
This commit broke LTO builds. Reverting it to unbreak the bots while the
issue is investigated. See also:

http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160321/341002.html

This reverts r263158

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 20:24:34 +00:00