Alp Toker [Fri, 6 Jun 2014 04:50:41 +0000 (04:50 +0000)]
config.h: remove clang-specific macro definitions
These had no business in LLVM core.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210307
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 6 Jun 2014 01:20:28 +0000 (01:20 +0000)]
Allow aliases to be unnamed_addr.
Alias with unnamed_addr were in a strange state. It is stored in GlobalValue,
the language reference talks about "unnamed_addr aliases" but the verifier
was rejecting them.
It seems natural to allow unnamed_addr in aliases:
* It is a property of how it is accessed, not of the data itself.
* It is perfectly possible to write code that depends on the address
of an alias.
This patch then makes unname_addr legal for aliases. One side effect is that
the syntax changes for a corner case: In globals, unnamed_addr is now printed
before the address space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210302
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 5 Jun 2014 23:12:43 +0000 (23:12 +0000)]
Fix markup for -debug-only option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210300
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 5 Jun 2014 23:10:19 +0000 (23:10 +0000)]
Fix null dereference with -debug-only=dwarfdebug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210299
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 5 Jun 2014 23:09:25 +0000 (23:09 +0000)]
Correctly set the comdat symbol on COFF.
We extended the .section syntax to allow multiple sections with the
same name but different comdats, but currently we don't make sure that
the output section has that comdat symbol.
That happens to work with the code llc produces currently because it looks like
.section secName, "dr", one_only, "COMDATSym"
.globl COMDATSym
COMDATSym:
....
but that is not very friendly to anyone coding in assembly or even to
llc once we get comdat support in the IR.
This patch changes the coff object writer to make sure the comdat symbol is
output just after the section symbol, as required by the coff spec.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210298
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Thu, 5 Jun 2014 22:57:38 +0000 (22:57 +0000)]
[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
Eric Christopher [Thu, 5 Jun 2014 22:10:58 +0000 (22:10 +0000)]
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
Jingyue Wu [Thu, 5 Jun 2014 22:07:33 +0000 (22:07 +0000)]
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
Eric Christopher [Thu, 5 Jun 2014 22:00:31 +0000 (22:00 +0000)]
Remove caching of the subtarget for X86FrameLowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210290
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 5 Jun 2014 21:42:54 +0000 (21:42 +0000)]
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
Tom Roeder [Thu, 5 Jun 2014 21:40:13 +0000 (21:40 +0000)]
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
Rafael Espindola [Thu, 5 Jun 2014 21:29:49 +0000 (21:29 +0000)]
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
Kevin Enderby [Thu, 5 Jun 2014 21:21:57 +0000 (21:21 +0000)]
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
Bill Schmidt [Thu, 5 Jun 2014 19:46:04 +0000 (19:46 +0000)]
[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
Tom Roeder [Thu, 5 Jun 2014 19:43:57 +0000 (19:43 +0000)]
Removing spurious dependency of IPO on JumpInstrTables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210281
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Roeder [Thu, 5 Jun 2014 19:29:43 +0000 (19:29 +0000)]
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
Yaron Keren [Thu, 5 Jun 2014 16:42:26 +0000 (16:42 +0000)]
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
Bill Schmidt [Thu, 5 Jun 2014 16:21:13 +0000 (16:21 +0000)]
[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
Evgeniy Stepanov [Thu, 5 Jun 2014 14:34:45 +0000 (14:34 +0000)]
[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
Evgeniy Stepanov [Thu, 5 Jun 2014 14:32:15 +0000 (14:32 +0000)]
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
Ulrich Weigand [Thu, 5 Jun 2014 14:20:54 +0000 (14:20 +0000)]
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
Ulrich Weigand [Thu, 5 Jun 2014 14:20:10 +0000 (14:20 +0000)]
[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
Sasa Stankovic [Thu, 5 Jun 2014 13:52:08 +0000 (13:52 +0000)]
[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
Sasa Stankovic [Thu, 5 Jun 2014 13:42:48 +0000 (13:42 +0000)]
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
Matheus Almeida [Thu, 5 Jun 2014 12:07:14 +0000 (12:07 +0000)]
[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
Iain Sandoe [Thu, 5 Jun 2014 08:49:55 +0000 (08:49 +0000)]
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
Matt Arsenault [Thu, 5 Jun 2014 08:00:36 +0000 (08:00 +0000)]
R600: Fix test. Using wrong check prefix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210244
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Thu, 5 Jun 2014 04:31:43 +0000 (04:31 +0000)]
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
David Blaikie [Thu, 5 Jun 2014 02:04:59 +0000 (02:04 +0000)]
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
David Blaikie [Thu, 5 Jun 2014 01:30:50 +0000 (01:30 +0000)]
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
David Blaikie [Thu, 5 Jun 2014 01:04:20 +0000 (01:04 +0000)]
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
David Blaikie [Thu, 5 Jun 2014 00:51:35 +0000 (00:51 +0000)]
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
Alexey Samsonov [Thu, 5 Jun 2014 00:25:30 +0000 (00:25 +0000)]
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
David Blaikie [Thu, 5 Jun 2014 00:25:26 +0000 (00:25 +0000)]
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
Eric Christopher [Thu, 5 Jun 2014 00:22:13 +0000 (00:22 +0000)]
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
Matt Arsenault [Thu, 5 Jun 2014 00:15:55 +0000 (00:15 +0000)]
R600/SI: Match rsq instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210226
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 5 Jun 2014 00:09:08 +0000 (00:09 +0000)]
80-columns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210224
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 5 Jun 2014 00:09:05 +0000 (00:09 +0000)]
Remove uses of the TargetMachine from X86FrameLowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210223
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 5 Jun 2014 00:01:12 +0000 (00:01 +0000)]
Use nullptr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210222
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 4 Jun 2014 23:50:52 +0000 (23:50 +0000)]
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
Nick Lewycky [Wed, 4 Jun 2014 21:47:19 +0000 (21:47 +0000)]
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
Hans Wennborg [Wed, 4 Jun 2014 21:04:54 +0000 (21:04 +0000)]
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
Rafael Espindola [Wed, 4 Jun 2014 19:01:48 +0000 (19:01 +0000)]
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
Rafael Espindola [Wed, 4 Jun 2014 18:51:31 +0000 (18:51 +0000)]
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
Yaron Keren [Wed, 4 Jun 2014 17:35:28 +0000 (17:35 +0000)]
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
David Blaikie [Wed, 4 Jun 2014 17:05:23 +0000 (17:05 +0000)]
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
Saleem Abdulrasool [Wed, 4 Jun 2014 16:03:20 +0000 (16:03 +0000)]
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
Saleem Abdulrasool [Wed, 4 Jun 2014 16:03:18 +0000 (16:03 +0000)]
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
Saleem Abdulrasool [Wed, 4 Jun 2014 15:47:15 +0000 (15:47 +0000)]
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
Saleem Abdulrasool [Wed, 4 Jun 2014 15:47:11 +0000 (15:47 +0000)]
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
Saleem Abdulrasool [Wed, 4 Jun 2014 15:47:07 +0000 (15:47 +0000)]
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
Saleem Abdulrasool [Wed, 4 Jun 2014 15:47:04 +0000 (15:47 +0000)]
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
Rafael Espindola [Wed, 4 Jun 2014 15:39:14 +0000 (15:39 +0000)]
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
Tilmann Scheller [Wed, 4 Jun 2014 12:40:35 +0000 (12:40 +0000)]
[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
Tilmann Scheller [Wed, 4 Jun 2014 12:36:28 +0000 (12:36 +0000)]
[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
Patrik Hagglund [Wed, 4 Jun 2014 11:21:11 +0000 (11:21 +0000)]
Fix gcc -Wparentheses warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210178
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Wed, 4 Jun 2014 07:45:54 +0000 (07:45 +0000)]
Fix a use of uninitialized value. OldCC is set when IsCmpZero || IsSwapped and read when ShouldUpdateCC || IsSwapped, and ShouldUpdateCC is independent. Fixes PR19932, but no test since I wasn't able to get any symptoms to appear, not even with valgrind and the testcase from the PR. It's clear what happened from inspection of the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210168
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 4 Jun 2014 07:06:27 +0000 (07:06 +0000)]
Add a subtarget hook: enablePostMachineScheduler.
As requested by AArch64 subtargets.
Note that this will have no effect until the
AArch64 target actually enables the pass like this:
substitutePass(&PostRASchedulerID, &PostMachineSchedulerID);
As soon as armv7 switches over, PostMachineScheduler will become the
default postRA scheduler, so this won't be necessary any more.
Targets using the old postRA schedule would then do:
substitutePass(&PostMachineSchedulerID, &PostRASchedulerID);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210167
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 4 Jun 2014 07:06:18 +0000 (07:06 +0000)]
Move GenericScheduler and PostGenericScheduler into a header.
These were not exposed previously because I didn't want out-of-tree
targets to be too dependent on their internals. They can be reused for
a very wide variety of processors with casual scheduling needs without
exposing the classes by instead using hooks defined in
MachineSchedPolicy (we can add more if needed). When targets are more
aggressively tuned or want to provide custom heuristics, they can
define their own MachineSchedStrategy. I tend to think this is better
once you start customizing heuristics because you can copy over only
what you need. I don't think that layering heuristics generally works
well.
However, Arch64 targets now want to reuse the Generic scheduling logic
but also provide extensions. I don't see much harm in exposing the
Generic scheduling classes with a major caveat: these scheduling
strategies may change in the future without validating performance on
less mainstream processors. If you want to be immune from changes,
just define your own MachineSchedStrategy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210166
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Wed, 4 Jun 2014 06:29:38 +0000 (06:29 +0000)]
docs: Remove documentation for legacy PGO options
Late last year r191835 removed a largely unmaintained legacy PGO
infrastructure, but some of the docs were missed. Since these docs are
for things that don't actually exist anymore, they should be removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210165
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Wed, 4 Jun 2014 05:51:44 +0000 (05:51 +0000)]
[Object][ELF] Range-based loop simplification.
No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210164
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Wed, 4 Jun 2014 04:11:12 +0000 (04:11 +0000)]
GraphWriter: try gv before xdg-open
Avoid changing behaviour for everyone who's used to the traditional ghostview
UI, especially since it knows how to stay in the foreground unlike xdg-open.
Amendment to r210147.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210148
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Wed, 4 Jun 2014 03:57:44 +0000 (03:57 +0000)]
GraphWriter: support the XDG open utility
This runs a suitable viewer on Unix desktop environments specified by
Freedesktop.org (GNOME, KDE, Linux distributions etc.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210147
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Wed, 4 Jun 2014 03:21:38 +0000 (03:21 +0000)]
config.h: fix layering and don't duplicate definitions
Also correct the llvm-config.h header guard so it doesn't depend on 'CONFIG_H'
which is commonly defined in external projects and caused trouble for
embedders.
In future llvm/Config/llvm-config.h will be installed, but not
the private llvm/Config/config.h header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210144
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 4 Jun 2014 01:30:59 +0000 (01:30 +0000)]
DebugInfo: Partial revert r209984 due to more cases where abstract DbgVariables do not have associated DIEs.
Along with a test case to demonstrate that due to inlining order there
are cases where abstract variable DIEs are not constructed since the
abstract subprogram was built due to a previous inlining that optimized
away those variables. This produces incorrect debug info (the 'missing'
abstract variable causes the inlined instance of that variable to be
emitted with a full description (name, line, file) rather than
referencing the abstract origin), but this commit at least ensures that
it doesn't crash...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210143
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 3 Jun 2014 23:06:13 +0000 (23:06 +0000)]
Fix typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210135
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Tue, 3 Jun 2014 22:42:10 +0000 (22:42 +0000)]
Calculate dead instructions when a live interval is created.
This gets us closer to being able to remove LiveVariables entirely which is where dead instructions are currently tagged as such.
Reviewed by Jakob Olesen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210132
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 3 Jun 2014 21:01:39 +0000 (21:01 +0000)]
Revert r209381 as it isn't a local variable. Add a testcase so that
we know next time this happens.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210127
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 3 Jun 2014 21:01:35 +0000 (21:01 +0000)]
Fixup formatting in the pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210126
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 3 Jun 2014 20:25:26 +0000 (20:25 +0000)]
Update comments to match reality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210125
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 3 Jun 2014 20:07:32 +0000 (20:07 +0000)]
Fix a small bug in the parsing of anonymous globals.
It was able to parse
hidden dllexport global i32 42
but not
dllexport global i32 42
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210121
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 3 Jun 2014 20:00:20 +0000 (20:00 +0000)]
Simplify the parsing of unnamed globals. No functionality changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210120
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 3 Jun 2014 19:38:37 +0000 (19:38 +0000)]
Update comment. This should have been part of r210062.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210119
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Tue, 3 Jun 2014 19:06:49 +0000 (19:06 +0000)]
Remove some redundant doc comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210118
91177308-0d34-0410-b5e6-
96231b3b80d8
Tilmann Scheller [Tue, 3 Jun 2014 16:33:13 +0000 (16:33 +0000)]
[AArch64] Fix typo in load/store optimizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210114
91177308-0d34-0410-b5e6-
96231b3b80d8
Tilmann Scheller [Tue, 3 Jun 2014 16:03:00 +0000 (16:03 +0000)]
[AArch64] Add regression tests for the load/store optimizer which cover post-index update folding with sub rather than add.
The tests check that the following transform happens:
(ldr|str) X, [x20]
...
sub x20, x20, #16
->
(ldr|str) X, [x20], #-16
with X being either w0, x0, s0, d0 or q0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210113
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 3 Jun 2014 15:06:22 +0000 (15:06 +0000)]
Implement one operator== with another.
Thanks for David Blaikie for the suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210107
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Tue, 3 Jun 2014 14:16:00 +0000 (14:16 +0000)]
[asan] Fix coverage instrumentation with -asan-globals=0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210103
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Tue, 3 Jun 2014 13:54:53 +0000 (13:54 +0000)]
AArch64: mark small types (i1, i8, i16) as promoted
This means the output of LowerFormalArguments returns a lowered
SDValue with the correct type (expected in SelectionDAGBuilder).
Without this, an assertion under a DEBUG macro triggers when those
types are passed on the stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210102
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 3 Jun 2014 13:26:18 +0000 (13:26 +0000)]
Add operator== and operator!= to compare with nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210100
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 3 Jun 2014 05:26:12 +0000 (05:26 +0000)]
Use an enum class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210078
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 3 Jun 2014 05:12:33 +0000 (05:12 +0000)]
Use an enum class.
Might also fix the windows build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210077
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 3 Jun 2014 05:05:15 +0000 (05:05 +0000)]
Remove the last unspecified_bool_type from llvm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210076
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 3 Jun 2014 04:54:15 +0000 (04:54 +0000)]
Make this operator bool() explicit to match the standard library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210073
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 3 Jun 2014 04:42:24 +0000 (04:42 +0000)]
Make this operator bool() explicit to match the standard library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210072
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Tue, 3 Jun 2014 04:25:36 +0000 (04:25 +0000)]
Ignore line numbers on debug intrinsics. Add an assert to ensure that we aren't emitting line number zero, the .gcno format uses this to indicate that the next field is a filename.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210068
91177308-0d34-0410-b5e6-
96231b3b80d8
Jiangning Liu [Tue, 3 Jun 2014 03:25:09 +0000 (03:25 +0000)]
[AArch64] Correctly deal with VPR stack parameter passing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210067
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Tue, 3 Jun 2014 03:01:03 +0000 (03:01 +0000)]
Process::GetRandomNumber(): fix insecure RNG
This could have generated non-random output under error conditions in release
builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210065
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 3 Jun 2014 02:41:57 +0000 (02:41 +0000)]
Allow alias to point to an arbitrary ConstantExpr.
This patch changes GlobalAlias to point to an arbitrary ConstantExpr and it is
up to MC (or the system assembler) to decide if that expression is valid or not.
This reduces our ability to diagnose invalid uses and how early we can spot
them, but it also lets us do things like
@test5 = alias inttoptr(i32 sub (i32 ptrtoint (i32* @test2 to i32),
i32 ptrtoint (i32* @bar to i32)) to i32*)
An important implication of this patch is that the notion of aliased global
doesn't exist any more. The alias has to encode the information needed to
access it in its metadata (linkage, visibility, type, etc).
Another consequence to notice is that getSection has to return a "const char *".
It could return a NullTerminatedStringRef if there was such a thing, but when
that was proposed the decision was to just uses "const char*" for that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210062
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 2 Jun 2014 22:01:04 +0000 (22:01 +0000)]
Add back commit r210029.
The code was actually correct. Sorry for the confusion. I have expanded the
comment saying why the analysis is valid to avoid me misunderstaning it
again in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210052
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 2 Jun 2014 21:23:54 +0000 (21:23 +0000)]
Convert test to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210049
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 2 Jun 2014 21:12:19 +0000 (21:12 +0000)]
Revert "Add the nsw flag when we detect that an add will not signed overflow."
This reverts commit r210029.
It was not correctly handling cases where LHS and RHS had multiple but different
sign bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210048
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 2 Jun 2014 20:51:49 +0000 (20:51 +0000)]
InitLibcallNames can take a Triple instead of a TargetMachine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210045
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 2 Jun 2014 19:19:04 +0000 (19:19 +0000)]
Added support to optimize comparisons with "lshr exact" of a constant.
Patch by Rahul Jain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210040
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Mon, 2 Jun 2014 18:08:27 +0000 (18:08 +0000)]
Remove sanitizer blacklist from ASan/TSan/MSan function passes.
Instrumentation passes now use attributes
address_safety/thread_safety/memory_safety which are added by Clang frontend.
Clang parses the blacklist file and adds the attributes accordingly.
Currently blacklist is still used in ASan module pass to disable instrumentation
for certain global variables. We should fix this as well by collecting the
set of globals we're going to instrument in Clang and passing it to ASan
in metadata (as we already do for dynamically-initialized globals and init-order
checking).
This change also removes -tsan-blacklist and -msan-blacklist LLVM commandline
flags in favor of -fsanitize-blacklist= Clang flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210038
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 2 Jun 2014 17:29:07 +0000 (17:29 +0000)]
Omit else branch after return.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210034
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Mon, 2 Jun 2014 16:00:27 +0000 (16:00 +0000)]
[X86] Fix checked arithmetic for i8 on X86.
When lowering a ISD::BRCOND into a test+branch, make sure that we
always use the correct condition code to emit the test operation.
This fixes PR19858: "i8 checked mul is wrong on x86".
Patch by Keno Fisher!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210032
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 2 Jun 2014 14:32:58 +0000 (14:32 +0000)]
Add the nsw flag when we detect that an add will not signed overflow.
We already had a function for checking this, we were just using it only in
specialized cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210029
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Mon, 2 Jun 2014 12:58:08 +0000 (12:58 +0000)]
[msan] Remove an out-of-date comment.
MSan is no longer an "early prototype".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210023
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 2 Jun 2014 12:54:32 +0000 (12:54 +0000)]
Remove path_tclsh.m4.
Looks like it was only used by dejagnu and is now dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210022
91177308-0d34-0410-b5e6-
96231b3b80d8