Commit Graph

60043 Commits

Author SHA1 Message Date
David Blaikie
46561ce249 Remove unused "isMain" field from DICompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176910 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 22:43:04 +00:00
Michael J. Spencer
56772ebe9a [Support][Path] Don't inf loop if creating the parent directory fails.
Patch by Paul Robinson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176908 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 22:32:39 +00:00
David Blaikie
14891447ff Update debug info test cases with empty SplitDebugFilename field.
This could be 'null' or the empty string, DIDescriptor::getStringField
coalesces the two cases anyway so it's just a matter of legible/efficient
representation.

The change in behavior of the DICompileUnit::get* functions could be
subsumed by the full verification check - but ideally that should just be an
assertion if we could front-load the actual debug info metadata failure paths.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176907 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 22:25:36 +00:00
Arnold Schwaighofer
b6f4872d29 ARM cost model: Increase the cost for vector casts that use the stack
Increase the cost of v8/v16-i8 to v8/v16-i32 casts and truncates as the backend
currently lowers those using stack accesses.

This was responsible for a significant degradation on
MultiSource/Benchmarks/Trimaran/enc-pc1/enc-pc1
where we vectorize one loop to a vector factor of 16. After this patch we select
a vector factor of 4 which will generate reasonable code.

unsigned char cle[32];

void test(short c) {
  unsigned short compte;
  for (compte = 0; compte <= 31; compte++) {
    cle[compte] = cle[compte] ^ c;
  }
}

radar://13220512

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176898 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 21:19:22 +00:00
Manman Ren
9e999adb48 Debug Info: use SmallVector instead of std::vector in MCDwarfDirsCUMap and MCDwarfFilesCUMap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176893 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 20:17:00 +00:00
Michael J. Spencer
cc189bfb08 [Support][MemoryBuffer] Use sys::fs::mapped_file_region instead of sys::Path::MapInFilePages.
This gives us memory mapped file I/O on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176886 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 19:28:19 +00:00
Manman Ren
bc3e96f17b Debug Info: use DW_FORM_ref_addr instead of DW_FORM_ref4 if the referenced DIE
belongs to a different compile unit.

DW_FORM_ref_addr should be used for cross compile-unit reference.

When compiling a large application, we got a dwarfdump verification error where
abstract_origin points to nowhere.

This error can't be reproduced on any testing case in MultiSource.
We may have other cases where we use DW_FORM_ref4 unconditionally.

rdar://problem/13370501


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176882 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 18:27:15 +00:00
Richard Relph
1a5c0510ec Avoid generating ISD::SELECT for vector operands to SIGN_EXTEND
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176881 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 18:17:18 +00:00
Kevin Enderby
2ee69f1be6 Remove the assert()'s from the LLVMCreateDisasmCPU() library API and just
return 0 to indicate failure to create the disassembler.  A library routine
should not assert and just let the caller handler the error.  For example
darwin's otool(1) will simply print an error if it ends up using a library
that is not configured for a target it wants:

% otool -tv ViewController.o
ViewController.o:
(__TEXT,__text) section
can't create arm llvm disassembler

This is much better than an abort which appears as a crash to the user or
even the assert when using a Debug+Asserts built library:

Assertion failed: (MAI && "Unable to create target asm info!"), function LLVMCreateDisasmCPU, file /Volumes/SandBox/llvm/lib/MC/MCDisassembler/Disassembler.cpp, line 47.

radr://12539918


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176880 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 18:12:17 +00:00
Pete Cooper
8f8af529fc Add a doFinalization method to the DataLayout pass.
This pass is meant to be immutable, however it holds mutable state to cache StructLayouts.
This method will allow the pass manager to clear the mutable state between runs.

Note that unfortunately it is still necessary to have the destructor, even though it does the
same thing as doFinalization.  This is because most TargetMachines embed a DataLayout on which
doFinalization isn't run as its never added to the pass manager.

I also didn't think it was necessary to complication things with a deInit method for which
doFinalization and ~DataLayout both call as there's only one field of mutable state.  If we had
more fields to finalize i'd have added this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176877 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 17:37:31 +00:00
Dan Gohman
a15e708b1b Change the order of the operands in patchAndReplaceAllUsesWith so
that they're more consistent with Value::replaceAllUsesWith.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176872 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 16:22:56 +00:00
Hal Finkel
4d53e7798c Don't reserve R2 on Darwin/PPC
Now that only the register-scavenger version of the CR spilling code remains,
we no longer need the Darwin R2 hack. Darwin can use R0 as a spare register in
any case where the System V ABI uses it (R0 is special architecturally, and so
is reserved under all common ABIs).

A few test cases needed to be updated to reflect the register-allocation changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176868 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 15:18:14 +00:00
Hal Finkel
7285e8d98c PPC should always use the register scavenger for CR spilling
This removes the -disable-ppc[32|64]-regscavenger options; the code
that uses the register scavenger has been working well (and has been the default)
for some time, and we don't need options to enable the old (broken) CR spilling code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176865 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 14:12:16 +00:00
Patrik Hagglund
ac5b3915aa Small fix for cost analysis of ptrtoint.
This seems to be a "copy-paste error" introducecd in r156140.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176863 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 13:18:30 +00:00
Akira Hatanaka
f635ef4017 [mips] Rename function and variable names to start with proper case. Fix typos.
Delete commented-out code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176844 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 00:16:36 +00:00
Meador Inge
67cb638629 LibCallSimplifier: optimize speed for short-lived instances
Nadav reported a performance regression due to the work I did to
merge the library call simplifier into instcombine [1].  The issue
is that a new LibCallSimplifier object is being created whenever
InstCombiner::runOnFunction is called.  Every time a LibCallSimplifier
object is used to optimize a call it creates a hash table to map from
a function name to an object that optimizes functions of that name.
For short-lived LibCallSimplifier instances this is quite inefficient.
Especially for cases where no calls are actually simplified.

This patch fixes the issue by dropping the hash table and implementing
an explicit lookup function to correlate the function name to the object
that optimizes functions of that name.  This avoids the cost of always
building and destroying the hash table in cases where the LibCallSimplifier
object is short-lived and avoids the cost of building the table when no
simplifications are actually preformed.

On a benchmark containing 100,000 calls where none of them are simplified
I noticed a 30% speedup.  On a benchmark containing 100,000 calls where
all of them are simplified I noticed an 8% speedup.

[1] http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130304/167639.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176840 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 00:08:29 +00:00
David Blaikie
c0ec8a4f4d Remove support for versioned debug info.
Versioned debug info support has been a burden to maintain & also compromised
current debug info verification by causing test cases testing old debug info to
remain rather than being updated to the latest. It also makes it hard to add or
change the metadata schema by requiring various backwards-compatibility in the
DI* hierarchy.

So it's being removed in preparation for new changes to the schema to tidy up
old/unnecessary fields and add new fields needed for new debug info (well, new
to LLVM at least).

The more surprising part of this is the changes to DI*::Verify - this became
necessary due to the changes to AsmWriter. AsmWriter was relying on the version
test to decide which bits of metadata were actually debug info when printing
the comment annotations. Without the version information the tag numbers were
too common & it would print debug info on random metadata that happened to
start with an integer that matched a tag number. Instead this change makes the
Verify functions more precise (just adding "number of operands" checks - not
type checking those operands yet) & relies on that to decide which metadata is
debug info metadata.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176838 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-11 23:39:23 +00:00
David Blaikie
6643868498 Add asserts to DIBuilder & fix DINameSpace::Verify to allow unnamed namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176837 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-11 23:21:19 +00:00
Nick Lewycky
33cdfe9f19 Fix a crasher newly introduced in r176659/r176649, where fast-isel tries to
lower an expect intrinsic that is a constant expression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176830 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-11 21:44:37 +00:00
Kevin Enderby
12dccaed9c Fixes disassembler crashes on 2013 Haswell RTM instructions.
rdar://13318048


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176828 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-11 21:17:13 +00:00
Bill Wendling
d5bb20805e Don't remove a landing pad if the invoke requires a table entry.
An invoke may require a table entry. For instance, when the function it calls
is expected to throw.
<rdar://problem/13360379>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176827 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-11 20:53:00 +00:00
Vincent Lejeune
fd49dac48f R600: Fix JUMP handling so that MachineInstr verification can occur
This allows R600 Target to use the newly created -verify-misched llc flag

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176819 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-11 18:15:06 +00:00
NAKAMURA Takumi
3f179b59e5 R600MachineScheduler.cpp: Fix use cases of dbgs(). Don't include <iostream> here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176797 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-11 08:19:28 +00:00
Nick Lewycky
f3a64c00c1 Correct this error message, and most importantly make it distinct from the
error above. Based on a patch by Peter Zotov!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176794 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-10 22:01:44 +00:00
Nick Lewycky
0ebc084132 Use LLVMBool instead of 'bool' in the C API. Based on a patch by Peter Zotov!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176793 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-10 21:58:22 +00:00
Hal Finkel
76a05c93b1 BBVectorize: Fixup debugging statements
After the recent data-structure improvements, a couple of debugging statements
were broken (printing pointer values).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176791 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-10 20:57:42 +00:00
Jakub Staszak
760fa5dc80 Cleanup #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176787 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-10 13:11:23 +00:00
Jakub Staszak
ec3bb4b660 Remove unneeded #includes. Use forward declarations instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176783 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-10 00:34:01 +00:00
Craig Topper
ddde2082db Remove an unused member variable from HelpPrinter. Move another member variable to be a local variable in the only method that uses it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176778 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-09 23:29:37 +00:00
Lang Hames
f793de7a23 Don't glue users to extract_subreg when selecting the llvm.arm.ldrexd
intrinsic - it can cause impossible-to-schedule subgraphs to be
introduced.

PR15053.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176777 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-09 22:56:09 +00:00
Benjamin Kramer
0d932717d8 Remove a source of nondeterminism from the LoopVectorizer.
This made us emit runtime checks in a random order. Hopefully bootstrap
miscompares will go away now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176775 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-09 19:22:40 +00:00
Arnold Schwaighofer
738295e457 LoopVectorizer: Ignore all dbg intrinisic
Ignore all DbgIntriniscInfo instructions instead of just DbgValueInst.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176769 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-09 16:27:27 +00:00
Arnold Schwaighofer
56ee544a3a LoopVectorizer: Ignore dbg.value instructions
We want vectorization to happen at -g. Ignore calls to the dbg.value intrinsic
and don't transfer them to the vectorized code.

radar://13378964

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176768 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-09 15:56:34 +00:00
Benjamin Kramer
576f62c1ea TLI: Microoptimize calls to strlen+memcmp to strncmp.
The strlen+memcmp was hidden in a call to StringRef::operator==. We check if
there are any null bytes in the string upfront so we can simplify the comparison
Small speedup when compiling code with many function calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176766 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-09 13:48:23 +00:00
Jakub Staszak
e629a33d16 Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176765 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-09 11:18:59 +00:00
Nick Lewycky
60d16a27da Use the correct index variable. This is the meat of what was supposed to be in
r176751. Also, learn a lesson about applying patches by hand/eyeball.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176764 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-09 10:13:26 +00:00
Nick Lewycky
7394c5a37c Commit the right files for r176762. Sigh.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176763 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-09 09:32:16 +00:00
Nick Lewycky
462bba39c2 We need a shndx if the number of sections breaks SHN_LORESERVE. This condition
for choosing to emit a shndx was simply testing the wrong variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176762 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-09 09:31:44 +00:00
Nick Lewycky
8fa6dc431d Fix bug introduced in r176616 when making function identifier numbers stable.
Count the subprograms, not the compile units.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176751 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-09 02:06:37 +00:00
Nick Lewycky
17d2f77601 Don't emit the extra checksum into the .gcda file if the user hasn't asked for
it. Fortunately, versions of gcov that predate the extra checksum also ignore
any extra data, so this isn't a problem. There will be a matching commit in
compiler-rt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176745 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-09 01:33:06 +00:00
Jakob Stoklund Olesen
24babfd234 Remove wrong and unnecessary assertion.
PHIs are allowed to have multiple operand pairs per predecessor, and
this code works just fine when it happens.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176734 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 23:00:13 +00:00
Jan Wen Voung
fa785cb22d Disable statistics on Release builds and move tests that depend on -stats.
Summary:
Statistics are still available in Release+Asserts (any +Asserts builds),
and stats can also be turned on with LLVM_ENABLE_STATS.

Move some of the FastISel stats that were moved under DEBUG()
back out of DEBUG(), since stats are disabled across the board now.

Many tests depend on grepping "-stats" output.  Move those into
a orig_dir/Stats/. so that they can be marked as unsupported
when building without statistics.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176733 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 22:56:31 +00:00
Eli Bendersky
d25c05efd5 Clean up out-of-date comments and some stray whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176729 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 22:29:44 +00:00
Michael Ilseman
cacf971079 Early exit from getAllocationData() and isFreeCall() for intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176722 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 21:15:00 +00:00
David Blaikie
eda774a6c6 Assert to bounds check MDNode::getOperand.
The getOperandPtr utility already bounds checks, but allows one-off-the-end.
This assert should catch the cases that could previously have been dereferencing
these one-off-the-end pointer. Happily, no cases of this came up with this
change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176721 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 21:08:23 +00:00
Michael Ilseman
9333ffb6db Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176720 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 21:03:09 +00:00
David Blaikie
423de3f047 Remove -print-dbginfo as it is unused & bitrotten.
This pass hasn't been touched in two years & would fail with assertions against
the current debug info metadata format (the only test case for it still uses a
many-versions old debug info metadata format)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176707 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 18:17:46 +00:00
Jakob Stoklund Olesen
778ef97c76 Rewrite the physreg part of findLastUseBefore().
To find the last use of a register unit, start from the bottom and scan
upwards until a user is found.

<rdar://problem/13353090>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176706 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 18:08:57 +00:00
Benjamin Kramer
7a58099f0a Remove default from fully covered switch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176703 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 17:03:19 +00:00
Benjamin Kramer
f22d9cfa6d Insert the reduction start value into the first bypass block to preserve domination.
Fixes PR15344.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176701 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 16:58:37 +00:00
Tom Stellard
7893d29c62 R600: Optimize another selectcc case
fold selectcc (selectcc x, y, a, b, cc), b, a, b, setne ->
     selectcc x, y, a, b, cc

Reviewed-by: Christian König <christian.koenig@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176700 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 15:37:11 +00:00
Tom Stellard
1454cb86be R600: Improve custom lowering of select_cc
Two changes:
1. Prefer SET* instructions when possible
2. Handle the CND*_INT case with floating-point args

Reviewed-by: Christian König <christian.koenig@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176699 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 15:37:09 +00:00
Tom Stellard
d416505906 R600: Change operation action from Custom to Expand for BR_CC
Reviewed-by: Christian König <christian.koenig@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176698 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 15:37:07 +00:00
Tom Stellard
9c6b0b0cce R600: Change operation action from Custom to Expand for SETCC
Reviewed-by: Christian König <christian.koenig@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176697 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 15:37:05 +00:00
Tom Stellard
ff1ccdf9c5 R600: Set BooleanContents to ZeroOrNegativeOneBooleanContent
Reviewed-by: Christian König <christian.koenig@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176696 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 15:37:03 +00:00
Tom Stellard
03abf2f2aa LegalizeDAG: Respect the result of TLI.getBooleanContents() when expanding SETCC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176695 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 15:37:02 +00:00
Tom Stellard
3ef5383b35 DAGCombiner: Use correct value type for checking legality of BR_CC v3
LegalizeDAG.cpp uses the value of the comparison operands when checking
the legality of BR_CC, so DAGCombiner should do the same.

v2:
  - Expand more BR_CC value types for NVPTX

v3:
  - Expand correct BR_CC value types for Hexagon, Mips, and XCore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176694 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 15:36:57 +00:00
Jyotsna Verma
86df21767a Hexagon: Add patterns for zero extended loads from i1->i64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176689 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 14:15:15 +00:00
Tim Northover
69fe178f77 AArch64: expand sincos operations, we don't support them.
Patch based on Mans Rullgard's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176688 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 13:55:07 +00:00
Michel Danzer
d787c047bc R600/SI: Use source scheduler
This is certainly not the last word on scheduling for this target, but
right now this allows a few apps to run / finish with radeonsi, most
notably UT2004 / Lightsmark. They fail to compile some shaders with the
default scheduler because it ends up trying to spill registers, which
we don't support yet (and which is probably a bad idea in general for
performance if it can be avoided).

NOTE: This is a candidate for the Mesa stable branch.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176687 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 10:58:01 +00:00
Andrew Trick
fff2d3aed9 Add -verify-misched option.
This verifies live intervals both before and after scheduling. It's
useful for anyone hacking on live interval update.

Note that we don't yet pass verification all the time. We don't yet
handle updating nonallocatable live intervals perfectly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176685 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 05:40:34 +00:00
Bill Wendling
e36b47e17b Revert r176154 in favor of a better approach.
Code generation makes some basic assumptions about the IR it's been given. In
particular, if there is only one 'invoke' in the function, then that invoke
won't be going away. However, with the advent of the `llvm.donothing' intrinsic,
those invokes may go away. If all of them go away, the landing pad no longer has
any users. This confuses the back-end, which asserts.

This happens with SjLj exceptions, because that's the model that modifies the IR
based on there being invokes, etc. in the function.

Remove any invokes of `llvm.donothing' during SjLj EH preparation. This will
give us a CFG that the back-end won't be confused about. If all of the invokes
in a function are removed, then the SjLj EH prepare pass won't insert the bogus
code the relies upon the invokes being there.
<rdar://problem/13228754&13316637>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176677 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 02:21:08 +00:00
Jakob Stoklund Olesen
c9efaeb53b Add a getPassName() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176669 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 23:55:51 +00:00
Jakob Stoklund Olesen
6ffcd5efe1 Rename isEarlierInSameTrace to isUsefulDominator.
In very rare cases caused by irreducible control flow, the dominating
block can have the same trace head without actually being part of the
trace.

As long as such a dominator still has valid instruction depths, it is OK
to use it for computing instruction depths.

Rename the function to avoid lying, and add a check that instruction
depths are computed for the dominator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176668 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 23:55:49 +00:00
Jakub Staszak
11687d4982 Keep coding stanard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176661 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 22:20:06 +00:00
Jakub Staszak
9497005d38 Don't create IRBuilder if we can return from the method earlier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176660 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 22:10:33 +00:00
Chad Rosier
4fde76db46 [fast-isel] Seriously, add support for the expect intrinsic.
rdar://13370942

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176659 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 21:38:33 +00:00
Benjamin Kramer
4e4cc7dae8 Replace temporary vectors with arrays.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176651 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 20:53:34 +00:00
Chad Rosier
33947b4391 [fast-isel] Add support for the expect intrinsic.
rdar://13370942

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176649 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 20:42:17 +00:00
Benjamin Kramer
3853f74aba ArrayRefize some code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176648 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 20:33:29 +00:00
Jyotsna Verma
a4dd8d6732 Hexagon: Handle i8, i16 and i1 Var Args.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176647 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 20:28:34 +00:00
Jakub Staszak
b1b6c17081 Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176646 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 20:22:39 +00:00
Jakub Staszak
a9cd5164c4 Change NULL to 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176642 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 20:01:47 +00:00
Jakub Staszak
b6aebf1cf3 ArrayRef ca accept one element. Simplify code a little bit, also it matches now
coding in the other places of the file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176641 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 20:01:19 +00:00
Andrew Trick
877fcf52d1 pre-RA-sched debug-only fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176638 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 19:21:08 +00:00
Jyotsna Verma
b6716187ca Hexagon: Add support to lower block address.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176637 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 19:10:28 +00:00
Andrew Trick
ccd38f4efb pre-RA-sched assertion fix. This bug was exposed by r176037.
rdar:13370002 [pre-RA-sched] assertion: released too many times

I tracked this down to an earlier hack that is no longer applicable
and interfered with normal scheduler logic. With the changes in
r176037, it was causing an instruction to be scheduled multiple times.

I have an external test case that I tried hard to reduce and
failed. I can't even reproduce with llc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176636 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 19:07:57 +00:00
Benjamin Kramer
02c2ecf9f1 X86: Fold EXTRACT_SUBVECTORs of a BUILD_VECTOR into a smaller BUILD_VECTOR.
That can usually be lowered efficiently and is common in sandybridge code.
It would be nice to do this in DAGCombiner but we can't insert arbitrary
BUILD_VECTORs this late.

Fixes PR15462.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176634 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 18:48:40 +00:00
Pekka Jaaskelainen
784ae47413 Fixed a crash when cloning a function into a function with
different size argument list and without attributes in the
arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176632 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 16:46:43 +00:00
Christian Konig
cc22640c4c R600/SI: rework input interpolation v2
v2: update CMakeLists.txt as well

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176626 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 09:04:14 +00:00
Christian Konig
4cce3d02a0 R600/SI: remove SI_vs_load_buffer_index
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176625 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 09:04:04 +00:00
Christian Konig
ff408c0728 R600/SI: remove SGPR address space v2
v2: fix R600 regressions

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176624 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 09:03:59 +00:00
Christian Konig
90c64cbaa1 R600/SI: add proper formal parameter handling for SI
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176623 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 09:03:52 +00:00
Christian Konig
c3c169c884 R600/SI: remove shader type intrinsic
Just encode the type as target specific attribute.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176622 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 09:03:46 +00:00
Christian Konig
204a2d32ba R600/SI: switch types of SGPRs to v*i8
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176621 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 09:03:38 +00:00
Christian Konig
5e8833646d R600/SI: fix unused variable warning
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176620 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 09:03:30 +00:00
Nick Lewycky
d9686a98b8 Switch from a version 4.2/4.4 switch to a four-byte version string to be put
into the actual gcov file.

Instead of using the bottom 4 bytes as the function identifier, use a counter.
This makes the identifier numbers stable across multiple runs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176616 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 08:28:49 +00:00
Nadav Rotem
4d895455fe No need to go through int64 and APInt when generating a new constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176615 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 06:34:49 +00:00
Jim Grosbach
34fd0d2b93 SDAG: Handle scalarizing an extend of a <1 x iN> vector.
Just scalarize the element and rebuild a vector of the result type
from that.

rdar://13281568

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176614 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 05:47:54 +00:00
Manman Ren
3de61b4c01 Debug Info: store the files and directories for each compile unit.
We now emit a line table for each compile unit. To reduce the prologue size
of each line table, the files and directories used by each compile unit are
stored in std::map<unsigned, std::vector< > > instead of std::vector< >.

The prologue for a lto'ed image can be as big as 93K. Duplicating 93K for each
compile unit causes a huge increase of debug info. With this patch, each
prologue will only emit the files required by the compile unit.

rdar://problem/13342023


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176605 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 01:42:00 +00:00
Nadav Rotem
55d8f6d490 ArrayRef has a OneElt constructor. Beautify the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176604 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 01:38:04 +00:00
Nadav Rotem
82e905aae4 Switch from std::vector to ArrayRef. Speedup FoldBitCast by 5x.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176602 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 01:30:40 +00:00
Andrew Trick
119003f2a2 SimplifyCFG fix for volatile load/store.
Fixes rdar:13349374.

Volatile loads and stores need to be preserved even if the language
standard says they are undefined. "volatile" in this context means "get
out of the way compiler, let my platform handle it".

Additionally, this is the only way I know of with llvm to write to the
first page (when hardware allows) without dropping to assembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176599 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 01:03:35 +00:00
Michael Liao
fe9dbe0066 Fix two remaining issue after fixing PR15355 when CMOV is not available
- Phi nodes should be replaced/updated after lowering CMOV into branch
  because 'mainMBB' updating operand in Phi node is changed.
- Add EFLAGS in livein before lowering the 2nd CMOV. It's necessary as
  we will reuse the EFLAGS generated before the 1st lowered CMOV, which
  won't clobber EFLAGS. However, we need explicitly specify that.
- '-attr=-cmov' test case are added.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176598 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 01:01:29 +00:00
Akira Hatanaka
b7656a9cc4 [mips] Custom-legalize BR_JT.
In N64-static, GOT address is needed to compute the branch address.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176580 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06 21:32:03 +00:00
Andrew Trick
76c25dc2bf Generalize my previous fix for -print-options.
Always print options that differ from their implicit default. At least
for simple option types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176572 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06 19:04:56 +00:00
Andrew Trick
122136b119 Give -loop-vectorize an explicit default.
This way, clang -mllvm -print-options shows that the driver is overriding it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176569 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06 18:22:22 +00:00
Shuxin Yang
985dac6579 Memory Dependence Analysis (not mem-dep test) take advantage of "invariant.load" metadata.
The "invariant.load" metadata indicates the memory unit being accessed is immutable.
A load annotated with this metadata can be moved across any store.

As I am not sure if it is legal to move such loads across barrier/fence, this
change dose not allow such transformation.

rdar://11311484

Thank Arnold for code review.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176562 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06 17:48:48 +00:00
Jim Grosbach
186d8a3d67 InstCombine: Don't shrink allocas when combining with a bitcast.
When considering folding a bitcast of an alloca into the alloca itself,
make sure we don't shrink the amount of memory being allocated, or
things rapidly go sideways.

rdar://13324424

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176547 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06 05:44:53 +00:00
Michael Liao
c537f79dcd Fix PR15355
- Clear 'mayStore' flag when loading from the atomic variable before the
  spin loop
- Clear kill flag from one use to multiple use in registers forming the
  address to that atomic variable
- don't use a physical register as live-in register in BB (neither entry
  nor landing pad.) by copying it into virtual register

(patch by Cameron Zwarich)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176538 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06 00:17:04 +00:00