Commit Graph

104317 Commits

Author SHA1 Message Date
Bill Schmidt
5f81752533 [PPC64LE] Add test case for r210282 commit
Chandler correctly pointed out that I need an LLVM IR test for
r210282, which modified the vperm -> shuffle transform for little
endian PowerPC.  This patch provides that test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210297 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 22:57:38 +00:00
Eric Christopher
38ee55ddfa Remove X86Subtarget from the X86FrameLowering constructor since
we can just pass in the values we already know and we're not
caching the subtarget anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210292 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 22:10:58 +00:00
Jingyue Wu
6156e562ef Fixed several correctness issues in SeparateConstOffsetFromGEP
Most issues are on mishandling s/zext.

Fixes:

1. When rebuilding new indices, s/zext should be distributed to
sub-expressions. e.g., sext(a +nsw (b +nsw 5)) = sext(a) + sext(b) + 5 but not
sext(a + b) + 5. This also affects the logic of recursively looking for a
constant offset, we need to include s/zext into the context of the searching.

2. Function find should return the bitwidth of the constant offset instead of
always sign-extending it to i64.

3. Stop shortcutting zext'ed GEP indices. LLVM conceptually sign-extends GEP
indices to pointer-size before computing the address. Therefore, gep base,
zext(a + b) != gep base, a + b

Improvements:

1. Add an optimization for splitting sext(a + b): if a + b is proven
non-negative (e.g., used as an index of an inbound GEP) and one of a, b is
non-negative, sext(a + b) = sext(a) + sext(b)

2. Function Distributable checks whether both sext and zext can be distributed
to operands of a binary operator. This helps us split zext(sext(a + b)) to
zext(sext(a) + zext(sext(b)) when a + b does not signed or unsigned overflow.

Refactoring:

Merge some common logic of handling add/sub/or in find.

Testing:

Add many tests in split-gep.ll and split-gep-and-gvn.ll to verify the changes
we made.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210291 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 22:07:33 +00:00
Eric Christopher
d334d25a10 Remove caching of the subtarget for X86FrameLowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210290 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 22:00:31 +00:00
Eric Christopher
6d18c24e99 Remove duplicate copy of InstrItineraryData from the TargetMachine,
it's already on the subtarget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210289 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 21:42:54 +00:00
Tom Roeder
d94cd00219 Adding explicit triples to the ARM jumptable tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210288 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 21:40:13 +00:00
Rafael Espindola
64bcc6d81e Add a testcase where there is an overflow when combining two constants.
I noticed that a proposed optimization would have prevented this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210287 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 21:29:49 +00:00
Kevin Enderby
ecbc72405e Add "-format darwin" to llvm-nm to be like darwin's nm(1) -m output.
This is a first step in seeing if it is possible to make llvm-nm produce
the same output as darwin's nm(1).  Darwin's default format is bsd but its
-m output prints the longer Mach-O specific details.  For now I added the
"-format darwin" to do this (whos name may need to change in the future).
As there are other Mach-O specific flags to nm(1) which I'm hoping to add some
how in the future.  But I wanted to see if I could get the correct output for
-m flag using llvm-nm and the libObject interfaces.

I got this working but would love to hear what others think about this approach
to getting object/format specific details printed with llvm-nm.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210285 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 21:21:57 +00:00
Bill Schmidt
542fdf5fba [PPC64LE] Correct vperm -> shuffle transform for little endian
As discussed in cfe commit r210279, the correct little-endian
semantics for the vec_perm Altivec interfaces are implemented by
reversing the order of the input vectors and complementing the permute
control vector.  This converts the desired permute from little endian
element order into the big endian element order that the underlying
PowerPC vperm instruction uses.  This is represented with a
ppc_altivec_vperm intrinsic function.

The instruction combining pass contains code to convert a
ppc_altivec_vperm intrinsic into a vector shuffle operation when the
intrinsic has a permute control vector (mask) that is a constant.
However, the vector shuffle operation assumes that vector elements are
in natural order for their endianness, so for little endian code we
will get the wrong result with the existing transformation.

This patch reverses the semantic change to vec_perm that was performed
in altivec.h by once again swapping the input operands and
complementing the permute control vector, returning the element
ordering to little endian.

The correctness of this code is tested by the new perm.c test added in
a previous patch, and by other tests in the test suite that fail
without this patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210282 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 19:46:04 +00:00
Tom Roeder
ef31a79323 Removing spurious dependency of IPO on JumpInstrTables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210281 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 19:43:57 +00:00
Tom Roeder
5d0f7af3dc Add a new attribute called 'jumptable' that creates jump-instruction tables for functions marked with this attribute.
It includes a pass that rewrites all indirect calls to jumptable functions to pass through these tables.

This also adds backend support for generating the jump-instruction tables on ARM and X86.
Note that since the jumptable attribute creates a second function pointer for a
function, any function marked with jumptable must also be marked with unnamed_addr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210280 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 19:29:43 +00:00
Yaron Keren
4db3ad47fc Document how to select build configuration with Visual C++ IDE or command line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210273 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 16:42:26 +00:00
Bill Schmidt
e1e0d4f367 [PPC64LE] Temporarily disable VSX support in little-endian mode
This is a preliminary patch for the PowerPC64LE support.  In stage 1
of the vector support, we will support the VMX (Altivec) instruction
set, but will not yet support the VSX instructions.  This is merely a
staging issue to provide functional vector support as soon as
possible.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210271 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 16:21:13 +00:00
Evgeniy Stepanov
b49c13cc84 [asancov] Fix coverage line info some more.
Now it should always point to the opening brace of the function (in
-asan-coverage=1 mode).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210266 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 14:34:45 +00:00
Evgeniy Stepanov
0eacd38666 Add missing const specifier to a const method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210265 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 14:32:15 +00:00
Ulrich Weigand
f5999d6cb3 XFAIL: test/DebugInfo/missing-abstract-variable.ll on s390x as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210264 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 14:20:54 +00:00
Ulrich Weigand
e076b357aa [SystemZ] Do not install IfConverter pass at -O0
When not optimizing, do not run the IfConverter pass, this makes
debugging more difficult (and causes a testsuite failure in
DebugInfo/unconditional-branch.ll).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210263 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 14:20:10 +00:00
Sasa Stankovic
2181b2319e [mips] Modify long branch for NaCl:
* Move the instruction that changes sp outside of the branch delay slot.
  * Bundle-align the target of indirect branch.

Differential Revision: http://llvm-reviews.chandlerc.com/D3928


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210262 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 13:52:08 +00:00
Sasa Stankovic
44215458bd Prevent hoisting the instruction whose def might be clobbered by the terminator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210261 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 13:42:48 +00:00
Matheus Almeida
3a2156d1b5 [mips] Fix triple.
Mips2 is a 32-bit architecture.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210254 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 12:07:14 +00:00
Iain Sandoe
ced4056f2c lld (build with configur and make) Enable build
r210177 added Makefiles to the lld project. 
This revision enables the automatic build of lld when the sources are found in tools/lld.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210245 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 08:49:55 +00:00
Matt Arsenault
3cea6e797e R600: Fix test. Using wrong check prefix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210244 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 08:00:36 +00:00
Nick Lewycky
59aecc1cf0 Fix coverage for files with global constructors again. Adds a testcase to the commit from r206671, as requested by David Blaikie.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210239 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 04:31:43 +00:00
David Blaikie
0bc7690e34 Revert r210221 again, due to a crash Richard Smith has provided involving self-hosting LLVM with libc++.
Test case coming, once I reduce it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210236 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 02:04:59 +00:00
David Blaikie
7a986ec4de DebugInfo: Reuse existing LexicalScope to retrieve the scope's MDNode, rather than looking it up through the DebugLoc.
No functional change intended, just streamlines the abstract variable
lookup/construction to use a common entry point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210234 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 01:30:50 +00:00
David Blaikie
75096077d4 DebugInfo: Roll argument insertion into variable insertion to ensure arguments are correctly handled in all cases.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210233 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 01:04:20 +00:00
David Blaikie
ad03fa6d3f PR19388: DebugInfo: Emit dead arguments in their originally declared order.
Unused arguments were not being added to the argument list, but instead
treated as arbitrary scope variables. This meant they weren't carefully
added in the original argument order.

In this particular example, though, it turns out the argument is only
/mostly/ unused (well, actually it's entirely used, but in a specific
way). It's a struct that, due to ABI reasons, is decomposed into chunks
(exactly one chunk, since it has one member) and then passed. Since only
one of those chunks is used (SROA, etc, kill the original reconstitution
code) we don't have a location to describe the whole variable.

In this particular case, since the struct consists of just the one int,
once we have partial location information, this should have a location
that describes the entire variable (since the piece is the entirety of
the object).

And at some point we'll need to describe the location of even /entirely/
unused arguments so that they can at least be printed on function entry.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210231 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 00:51:35 +00:00
Alexey Samsonov
a66075fdd1 Use AArch64 instead of now removed ARM64 in test configs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210229 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 00:25:30 +00:00
David Blaikie
d4af856cfb DebugInfo: Add comments/assert description to r209674 based on Eric Christopher's post-commit review feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210228 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 00:25:26 +00:00
Eric Christopher
7a8272d73c We've got a getSlotSize call already that we use everywhere else,
use it here too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210227 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 00:22:13 +00:00
Matt Arsenault
798a829eca R600/SI: Match rsq instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210226 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 00:15:55 +00:00
Eric Christopher
1eb9c050ff 80-columns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210224 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 00:09:08 +00:00
Eric Christopher
1e135990c7 Remove uses of the TargetMachine from X86FrameLowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210223 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 00:09:05 +00:00
Matt Arsenault
6db82d3819 Use nullptr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210222 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 00:01:12 +00:00
David Blaikie
06ac3ffc8f DebugInfo: Reapply r209984 (reverted in r210143), asserting that abstract DbgVariables have DIEs.
Abstract variables within abstract scopes that are entirely optimized
away in their first inlining are omitted because their scope is not
present so the variable is never created. Instead, we should ensure the
scope is created so the variable can be added, even if it's been
optimized away in its first inlining.

This fixes the incorrect debug info in missing-abstract-variable.ll
(added in r210143) and passes an asserts self-hosting build, so
hopefully there's not more of these issues left behind... *fingers
crossed*.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210221 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 23:50:52 +00:00
Nick Lewycky
7afb107a27 Explain why we skip DbgInfoIntrinsics when looking at line numbers in .gcno file emission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210218 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 21:47:19 +00:00
Hans Wennborg
6248abf28d Don't emit structors for available_externally globals (PR19933)
We would previously assert here when trying to figure out the section
for the global.

This makes us handle the situation more gracefully since the IR isn't
malformed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210215 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 21:04:54 +00:00
Rafael Espindola
cfee6c49ea Add a Constant version of stripPointerCasts.
Thanks to rnk for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210205 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 19:01:48 +00:00
Rafael Espindola
dcac1523c0 Clauses in a landingpad are always Constant. Use a stricter type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210203 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 18:51:31 +00:00
Yaron Keren
c45bee91b8 Two small enhancements for the JIT.
When JITting a large project such as Boost it's quite hard to figure out the problematic inline asm without debug location. This patch provides debug location printout before the JIT aborts due to inline asm. printDebugLoc() was exposed from MachineInstr.cpp and reused here.

If the JIT run with debug info, don't bomb on DBG_VALUE but ignore them.

http://reviews.llvm.org/D3416



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210201 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 17:35:28 +00:00
David Blaikie
024b693ca7 XFAIL: test/DebugInfo/missing-abstract-variable.ll on mips and ppc64 due to an inlined parameter that goes missing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210200 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 17:05:23 +00:00
Saleem Abdulrasool
510315c386 tools: fix parenthesis warning from GCC
Add parenthesis as suggested by GCC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210194 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 16:03:20 +00:00
Saleem Abdulrasool
fbb7c20395 tools: fix silly typo in llvm-readobj
Case insensitive case preserving file systems are not a good choice for
development.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210193 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 16:03:18 +00:00
Saleem Abdulrasool
fe3b74ec71 tools: initial implementation of WoA EH decoding
Add support to llvm-readobj to decode Windows ARM Exception Handling data.  This
uses the previously added datastructures to decode the information into a format
that can be used by tests.  This is a necessary step to add support for emitting
Windows on ARM exception handling information.

A fair amount of formatting inspiration is drawn from the Win64 EH printer as
well as the ARM EHABI printer.  This allows for a reasonably thorough look into
the encoded data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210192 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 15:47:15 +00:00
Saleem Abdulrasool
b35de82adc tools: introduce StreamWriter::printBoolean
Add a helper print method to print a boolean value as "Yes" or "No".  This is
intended to be used by the Windows ARM EH printer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210191 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 15:47:11 +00:00
Saleem Abdulrasool
0b25d84c27 Support: style/documentation cleanup for format
This is purely a documentation/whitespace cleanup for the format support
functions.

The current style does not duplicate the function/class names in the
documentation; conform to this style.

Additionally, there was a large amount of duplication of comments that added no
real value.  Use block comments for the related sets of functions which are used
for type deduction and parameter container classes.

No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210190 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 15:47:07 +00:00
Saleem Abdulrasool
bf9290fb48 Support: add additional comment for ARM EH structure
Replicate the fact that ARM::WinEH::RuntimeFunction purposefully does not merge
functions to accommodate raw data access use cases in tools such as readobj.
Pointed out by Renato during post-commit review.

No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210189 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 15:47:04 +00:00
Rafael Espindola
82db274d15 InstCombine: Improvement to check if signed addition overflows.
This patch implements two things:

1. If we know one number is positive and another is negative, we return true as
    signed addition of two opposite signed numbers will never overflow.

2. Implemented TODO : If one of the operands only has one non-zero bit, and if
    the other operand has a known-zero bit in a more significant place than it
    (not including the sign bit) the ripple may go up to and fill the zero, but
    won't change the sign. e.x -  (x & ~4) + 1

We make sure that we are ignoring 0 at MSB.

Patch by Suyog Sarda.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210186 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 15:39:14 +00:00
Tilmann Scheller
45a8d99f59 [AArch64] clang-format the load/store optimizer.
No change in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210182 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 12:40:35 +00:00
Tilmann Scheller
b2caf9766e [AArch64] Fix some LLVM Coding Standards violations in the load/store optimizer.
Variable names should start with an upper case letter.

No change in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210181 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 12:36:28 +00:00