Commit Graph

16347 Commits

Author SHA1 Message Date
Benjamin Kramer
deda7b6e75 Provide malloc-free sentinels for the SparseBitVector internals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164823 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-28 15:36:41 +00:00
Benjamin Kramer
53347ed2f8 Make backtraces work again with both the configure and cmake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164817 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-28 10:10:46 +00:00
Craig Topper
8bb12aeeb4 Remove a LLVM_DELETED_FUNCTION from destructor to fix -std=c++11 build on gcc 4.7.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164813 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-28 07:17:01 +00:00
Sylvestre Ledru
94c22716d6 Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164768 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-27 10:14:43 +00:00
Sylvestre Ledru
7e2c793a2b Fix a typo 'iff' => 'if'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164767 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-27 09:59:43 +00:00
Bill Wendling
37d3ef3140 Add constructors to the attribute builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164762 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-27 07:22:30 +00:00
Nick Lewycky
e2d02349c3 Add missing function CreateFPCast to the TargetFolder. It's there in the other
folders and not having it here fails to compile if you actually try to use it.

Also, CreatePointerCast was failing to do the part where it does TD-aware
constant folding. Granted there is exactly one case where that it will ever
do anything, but there's no reason to skip it. For reference, that case is a
subtraction between two constant offsets on the same global variable, eg.,
"&A[123] - &A[4].f".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164760 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-27 06:33:40 +00:00
Bill Wendling
59e6586ee0 Buildbot Fix.
This method can be called with a '0' argument which checks the return
value. However, the method it calls doesn't expect '0' as a valid value. Call the
correct method when it's 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164735 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-26 23:38:00 +00:00
Dan Gohman
8a63f99f03 Add IRBuilder code for adding !tbaa.struct metadata tags to llvm.memcpy calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164728 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-26 22:17:14 +00:00
Bill Wendling
896f37f0f9 Query the parameter attributes directly instead of using the Attribute symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164727 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-26 22:15:19 +00:00
Bill Wendling
2c18906118 Remove the `hasFnAttr' method from Function.
The hasFnAttr method has been replaced by querying the Attributes explicitly. No
intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164725 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-26 21:48:26 +00:00
Bill Wendling
2c79ecbd70 Initial commit for the AttributesImpl class.
This opaque class will contain all of the attributes. All attribute queries will
go through this object. This object will also be uniqued in the LLVMContext.
Currently not used, so no implementation change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164722 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-26 21:07:29 +00:00
Hans Wennborg
50b7d70707 Address Duncan's comments on r164684:
- Put statistics in alphabetical order
- Don't use getZextValue when building TableInt, just use APInts
- Introduce Create{Z,S}ExtOrTrunc in IRBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164696 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-26 14:01:53 +00:00
Chandler Carruth
4d7aa6dbce Add some convenience methods to IRBuilder for constructing aligned loads
and stores. These will be used in subsequnet patches to SROA to more
systematically manage the alignment on loads and stores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164688 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-26 10:27:40 +00:00
Craig Topper
02f790e534 Revert r164663 due to buildbot failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164670 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-26 07:43:06 +00:00
Craig Topper
0f841b4f95 Add is16BitVector and is32BitVector to MVT and call them from EVT. Matches other similar methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164668 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-26 07:17:37 +00:00
Craig Topper
4bb51cc83b Rename virtual table anchors from Anchor() to anchor() for consistency with the rest of the tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164666 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-26 06:36:36 +00:00
Craig Topper
1313785558 Mark extended type querying methods as 'readonly' to reduce compile size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164663 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-26 06:28:26 +00:00
Michael Ilseman
b55462bcfb Expansions for u/srem, using the udiv expansion. More unit tests for udiv and u/srem.
Fixed issue with Release build.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164654 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-26 01:55:01 +00:00
Bill Wendling
2039a8f834 Move remaining methods inside the Attributes class. Merge the 'Attribute' namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164631 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-25 20:57:48 +00:00
Bill Wendling
853a8c5f2e Move Attribute::typeIncompatible inside of the Attributes class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164629 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-25 20:38:59 +00:00
Sebastian Pop
1a37d7e807 TargetLowering interface to set/get minimum block entries for jump tables.
Provide interface in TargetLowering to set or get the minimum number of basic
blocks whereby jump tables are generated for switch statements rather than an
if sequence.

    getMinimumJumpTableEntries() defaults to 4.
    setMinimumJumpTableEntries() allows target configuration.

    This patch changes the default for the Hexagon architecture to 5
    as it improves performance on some benchmarks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164628 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-25 20:35:36 +00:00
Chad Rosier
442ffc346f Revert r164614 to appease the buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164627 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-25 19:57:20 +00:00
Michael Ilseman
1309844399 Expansions for u/srem, using the udiv expansion. More unit tests for udiv and u/srem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164614 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-25 17:56:47 +00:00
Chad Rosier
7f8f3f7f64 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164570 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-24 23:04:25 +00:00
Chad Rosier
2590c2e1e9 Rather then have a wrapper function, have tblgen instantiate the implementation.
Also remove an unused argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164567 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-24 22:57:55 +00:00
Craig Topper
a96a182474 Add LLVM_OVERRIDE to methods that override their base classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164471 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-23 02:12:10 +00:00
Andrew Trick
9264988311 Machine Model (-schedmodel only). Added SchedAliases.
Allow subtargets to tie SchedReadWrite types to processor specific
sequences or variants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164451 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-22 02:24:21 +00:00
Jordan Rose
a2df2ba16a Add llvm::getOrdinalSuffix to get the appropriate -st, -nd, -rd, -th suffix.
Used by clang to print parameter indexes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164440 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-22 01:24:21 +00:00
Jordan Rose
f5091b476c Casting: assert that pointer arguments to isa<> are non-null.
This silences several analyzer warnings within LLVM, and provides a slightly
nicer crash experience when someone calls isa<>, cast<>, or dyn_cast<> with
a null pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164439 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-22 01:24:18 +00:00
Jordan Rose
3bbdddf527 DenseMap: assert that we have found a bucket before we try to insert into it.
This silences literally dozens of analyzer warnings on LLVM (since DenseMap
is such a commonly-used class).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164438 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-22 01:24:16 +00:00
Eric Christopher
c69bdadac9 Add an --enable-backtraces option to configure to determine
whether or not we want to print out backtrace information. Useful
for libraries that don't need backtrace information on a crash.

rdar://11844710

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164426 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-21 23:03:29 +00:00
Dan Gohman
c912494855 Add an MDBuilder utility for creating !tbaa.struct nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164425 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-21 23:00:37 +00:00
Chad Rosier
d717a066c6 [ms-inline asm] Expose the mnemonicIsValid() function in the AsmParser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164420 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-21 22:21:26 +00:00
Bill Wendling
30b483c940 Encapsulate the "construct*AlignmentFromInt" functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164373 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-21 16:07:28 +00:00
Bill Wendling
ef99fe8efa Make the 'get*AlignmentFromAttr' functions into member functions within the Attributes class. Now with fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164370 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-21 15:26:31 +00:00
Alexey Samsonov
01fa41a106 Fix SymbolRef::getAddress implementation for ELF. The 'value' field in symbol table entry should be treated differently for relocatable and relocated files. This patch fixes symbol addresses printed by llvm-nm for executables and shared objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164365 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-21 07:08:08 +00:00
Jim Grosbach
ced674e470 ARM: Use a dedicated intrinsic for vector bitwise select.
The expression based expansion too often results in IR level optimizations
splitting the intermediate values into separate basic blocks, preventing
the formation of the VBSL instruction as the code author intended. In
particular, LICM would often hoist part of the computation out of a loop.

rdar://11011471

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164340 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-21 00:18:20 +00:00
Bill Wendling
4aa189909a Revert r164308 to fix buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164309 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-20 16:59:57 +00:00
Bill Wendling
f2e89e00b4 Make the 'get*AlignmentFromAttr' functions into member functions within the Attributes class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164308 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-20 16:27:05 +00:00
Bill Wendling
342cea9a0a Remove more bare uses of the different Attribute enums.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164307 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-20 15:20:36 +00:00
Bill Wendling
8ce1e432d1 Make the 'getAsString' function a method of the Attributes class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164305 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-20 14:44:42 +00:00
Jim Grosbach
f5958e9dea ARM: Tidy up IntrinsicsARM.td a bit.
Make the TargetPrefix setting one big setting instead of being spread out
everywhere. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164265 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-19 23:39:03 +00:00
Bill Wendling
e853d2e250 Add predicates for queries on whether an attribute exists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164264 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-19 23:35:21 +00:00
Micah Villmow
3e9b6db60f Add in new data types that are used by AMDIL/ANL among others.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164261 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-19 22:47:07 +00:00
Owen Anderson
cdac1be34a Implement a correct copy constructor for Record. Now that we're using the ID number as a key in maps (for determinism), it is imperative that ID numbers be globally unique, even when we copy construct a Record.
This fixes some obscure failure cases involving registers defined inside multiclasses or foreach constructs that would not receive a unique ID, and would end up being omitted from the AsmMatcher tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164251 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-19 21:34:18 +00:00
Andrew Kaylor
bbf628b6ce This patch adds memory support functions which will later be used to implement section-specific protection handling in MCJIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164249 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-19 20:46:12 +00:00
Preston Gurd
7b6f2034ac Add support for macro parameters/arguments delimited by spaces,
to improve compatibility with GNU as.

Based on a patch by PaX Team.

Fixed assertion failures on non-Darwin and added additional test cases.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164248 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-19 20:36:12 +00:00
Michael Ilseman
16514de50a Document the interface for integer expansion, using doxygen-style comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164231 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-19 16:03:57 +00:00
Michael Ilseman
4c8f2dd6ab Forward declarations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164230 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-19 15:55:03 +00:00
Will Dietz
adb4a40cb6 Fix minor typo in IntervalPartition.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164222 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-19 13:45:43 +00:00
Rafael Espindola
c312f09899 Make MapVector a bit more expensive but harder to misuse. We now only
provide insertion order iteration, instead of the old option of
DenseMap order iteration over keys and insertion order iteration over
values.
This is implemented by keeping two copies of each key.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164221 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-19 13:42:51 +00:00
Benjamin Kramer
9455a61009 InlineCost: Make TotalAllocaSizeRecursiveCaller unsigned to avoid sign-compare warnings.
It's a size, not a cost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164219 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-19 13:22:27 +00:00
Benjamin Kramer
aa6dad9f40 Remove unused and broken CloneFunction wrapper.
It converted the CodeInfo argument to bool implicitly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164215 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-19 13:03:01 +00:00
Nadav Rotem
92df026f0d Prevent inlining of callees which allocate lots of memory into a recursive caller.
Example:

void foo() {
 ... foo();   // I'm recursive!

  bar();
}

bar() {  int a[1000];  // large stack size }

rdar://10853263



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164207 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-19 08:08:04 +00:00
Sean Silva
90fee07298 Refactor Record* by-ID comparator to Record.h
This is a generally useful utility; there's no reason to have it hidden
in CodeGenDAGPatterns.cpp.

Also, rename it to fit the other comparators in Record.h

Review by Jakob.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164189 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-19 01:47:00 +00:00
Michael Ilseman
d2014649e0 New utility for expanding integer division for targets that don't support it.
Implementation derived from compiler-rt's implementation of signed and unsigned integer division.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164173 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 22:02:40 +00:00
Rafael Espindola
3b62b01f9a Add a MapVector class. It provides a regular set iteration, but
also provides a insertion order iteration over the values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164157 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 18:43:21 +00:00
Roman Divacky
f145c135f3 Avoid symbol name clash when filling TOC.
Patch by Adhemerval Zanella.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164141 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 17:10:37 +00:00
Roman Divacky
10a4318248 Add PowerPC64 relocation definitions. Patch by Adhemerval Zanella!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164137 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 16:38:02 +00:00
Roman Divacky
536a88ad5b When creating MCAsmBackend pass the CPU string as well. In X86AsmBackend
store this and use it to not emit long nops when the CPU is geode which
doesnt support them.

Fixes PR11212.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164132 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 16:08:49 +00:00
Tom Stellard
879d90f23c Make MachinePostDominatorTree::DT private
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164125 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 13:49:54 +00:00
Andrew Trick
34aadd6334 Replaced ReInitMCSubtargetInfo with InitMCProcessor.
Now where we used to call ReInitMCSubtargetInfo, we actually recompute
the same information as InitMCSubtargetInfo instead of only setting
the feature bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164105 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 05:33:15 +00:00
Craig Topper
cee033188f Fix a typo. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164100 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 04:43:05 +00:00
Andrew Trick
39adb180bc Let NULL slip through again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164099 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 04:18:39 +00:00
Andrew Trick
34301ceca8 TargetSchedModel API. Implement latency lookup, disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164098 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 04:03:34 +00:00
Andrew Trick
ee290ba35a TableGen subtarget emitter. Remove unnecessary header dependence.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164094 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 03:32:57 +00:00
Craig Topper
ef1623fb59 Mark unimplemented operator new as LLVM_DELETED_FUNCTION.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164093 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 03:25:49 +00:00
Andrew Trick
e127dfd0b1 TableGen subtarget emitter. Initialize MCSubtargetInfo with the new machine model.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164092 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 03:18:56 +00:00
Craig Topper
0cb0a35337 Mark constructors, destructors, and operator new commented as 'do not implement' with LLVM_DELETED_FUNCTION instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164091 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 02:05:45 +00:00
Craig Topper
c2945e44d5 Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164090 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 02:01:41 +00:00
Jakob Stoklund Olesen
87f7864c6d Merge into undefined lanes under -new-coalescer.
Add LIS::pruneValue() and extendToIndices(). These two functions are
used by the register coalescer when merging two live ranges requires
more than a trivial value mapping as supported by LiveInterval::join().

The pruneValue() function can remove the part of a value number that is
going to conflict in join(). Afterwards, extendToIndices can restore the
live range, using any new dominating value numbers and updating the SSA
form.

Use this complex value mapping to support merging a register into a
vector lane that has a conflicting value, but the clobbered lane is
undef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164074 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 23:03:25 +00:00
Andrew Trick
e1b5328717 Revert r164061-r164067. Most of the new subtarget emitter.
I have to work out the Target/CodeGen header dependencies
before putting this back.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164072 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 23:00:42 +00:00
Richard Smith
419e5b9d4f Remove redundant semicolons to fix -pedantic-errors build break with older Clangs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164071 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 22:52:05 +00:00
NAKAMURA Takumi
89a4058da1 llvm/Target/TargetSubtargetInfo.h: Fix case in #include, s#llvm/Codegen/#llvm/CodeGen#.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164070 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 22:34:56 +00:00
Andrew Trick
97d552e5c7 Don't use NULL as a fake keyword
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164067 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 22:26:34 +00:00
Andrew Trick
a2a47d1c50 InitMCProcessor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164066 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 22:19:12 +00:00
Andrew Trick
12886db4a7 TargetSchedModel API. Implement latency lookup, disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164065 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 22:19:08 +00:00
Andrew Trick
021ba269b2 TableGen subtarget emitter. Generate resolveSchedClass generated hook for resolving instruction variants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164062 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 22:18:58 +00:00
Andrew Trick
db7afac457 TableGen subtarget emitter. Initialize MCSubtargetInfo with the new machine model.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164061 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 22:18:55 +00:00
Tom Stellard
a52c3acc14 Add a MachinePostDominator pass
This is used in the AMDIL and R600 backends.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164029 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 14:08:37 +00:00
Sid Manning
9b7ca41062 Add Michael Spencer's iterator class for stepping through relocations. Add method that, given a symbol index, will return the symbol's data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164026 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 12:27:39 +00:00
Craig Topper
9f9ce61972 Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164017 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 07:16:40 +00:00
Craig Topper
001d3dc976 Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164016 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 06:59:23 +00:00
Craig Topper
de8091708f Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164015 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 06:43:55 +00:00
Craig Topper
fc601db2ed Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164014 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 06:31:17 +00:00
Craig Topper
7ffafe4102 Remove a couple unused fields. Not detected by Wunused-private-field because of unimplemented copy constructor and copy assignment operator that make the class look incomplete. Upcoming patch will mark them deleted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164013 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 06:05:39 +00:00
Craig Topper
3fee0fe517 Add include of Compiler.h to fix build bot failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164009 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-16 21:56:23 +00:00
Craig Topper
daca73f9be Add includes of Compiler.h to fix build bot failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164008 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-16 21:50:09 +00:00
Craig Topper
a558d91ced Use LLVM_DELETED_FUNCTION for copy constructors and copy assignment operators that aren't implemented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164007 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-16 21:43:09 +00:00
Craig Topper
f630e49efc Use LLVM_DELETED_FUNCTION for copy constructors and copy assignment operators that aren't implemented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164006 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-16 21:37:56 +00:00
Craig Topper
fbb13471ed Add LLVM_OVERRIDE and LLVM_FINAL C++11 compatibility macros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164005 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-16 20:53:30 +00:00
Craig Topper
ef072c3315 Add explicit virtual keywords for methods that override base class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163996 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-16 07:39:55 +00:00
Andrew Trick
3c0e5c9ece Guard fields by NDEBUG until they get used in the release build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163993 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-16 05:55:04 +00:00
Craig Topper
910cf7f712 Tidy up formatting of some elses on a separate line from preceding bracing. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163992 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-16 03:00:03 +00:00
Jakob Stoklund Olesen
2131eb4887 Fix problem when using LiveRangeQuery with block entries.
A value that is live in to a basic block should be returned by valueIn()
in LiveRangeQuery(getMBBStartIdx(MBB)), unless it is a PHI-def which
should be returned by valueDefined() instead.

Current code isn't using this functionality. Future code will.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163990 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-16 02:15:33 +00:00
Craig Topper
644b3840b9 Tidy up trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163988 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-16 01:20:35 +00:00
Craig Topper
0c08f5d2b9 Remove unneeded header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163987 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-16 01:18:51 +00:00
Dmitri Gribenko
4e0ae44b3a Fix Doxygen issues: wrap code examples in \code and use \p to refer to
parameters.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163984 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-15 20:22:05 +00:00
Craig Topper
dfa997992b Fix a couple include directives that used angle brackets for llvm files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163978 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-15 18:41:37 +00:00
Jakob Stoklund Olesen
9ae03fa69f Make LiveRangeQuery work for PHIDefs as well.
If a PHI value happens to be live out from the layout predecessor of its
def block, the def slot index will be in the middle of the segment:

%vreg11 = [192r,240B:0)[352r,416B:2)[416B,496r:1)  0@192r 1@480B-phi %2@352r

A LiveRangeQuery for 480 should return NULL from valueIn() since the
PHI value is defined at the block entry, not live in to the block.

No test case, future code depends on this functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163971 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-15 16:29:49 +00:00
Craig Topper
09bc9373f2 Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163969 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-15 16:22:27 +00:00
Chandler Carruth
1c8db50a9a Port the SSAUpdater-based promotion logic from the old SROA pass to the
new one, and add support for running the new pass in that mode and in
that slot of the pass manager. With this the new pass can completely
replace the old one within the pipeline.

The strategy for enabling or disabling the SSAUpdater logic is to do it
by making the requirement of the domtree analysis optional. By default,
it is required and we get the standard mem2reg approach. This is usually
the desired strategy when run in stand-alone situations. Within the
CGSCC pass manager, we disable requiring of the domtree analysis and
consequentially trigger fallback to the SSAUpdater promotion.

In theory this would allow the pass to re-use a domtree if one happened
to be available even when run in a mode that doesn't require it. In
practice, it lets us have a single pass rather than two which was
simpler for me to wrap my head around.

There is a hidden flag to force the use of the SSAUpdater code path for
the purpose of testing. The primary testing strategy is just to run the
existing tests through that path. One notable difference is that it has
custom code to handle lifetime markers, and one of the tests has been
enhanced to exercise that code.

This has survived a bootstrap and the test suite without serious
correctness issues, however my run of the test suite produced *very*
alarming performance numbers. I don't entirely understand or trust them
though, so more investigation is on-going.

To aid my understanding of the performance impact of the new SROA now
that it runs throughout the optimization pipeline, I'm enabling it by
default in this commit, and will disable it again once the LNT bots have
picked up one iteration with it. I want to get those bots (which are
much more stable) to evaluate the impact of the change before I jump to
any conclusions.

NOTE: Several Clang tests will fail because they run -O3 and check the
result's order of output. They'll go back to passing once I disable it
again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163965 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-15 11:43:14 +00:00
Daniel Dunbar
10097bd023 formatted_raw_ostream: Fix a serious bug in tell().
- The current_pos function is supposed to return all the written bytes, not the
   current position of the underlying stream.
 - This caused tell() to be broken whenever the underlying stream had buffered
   content.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163948 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 23:15:56 +00:00
Bill Wendling
d426a642a2 Some small reorganization to get read for Attributes overhaul.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163947 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 23:05:52 +00:00
David Blaikie
48b6a79b2d Fix up erroneous alignas usage while making this portable to GCC 4.7
Review by Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163944 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 22:26:11 +00:00
Evan Cheng
911908dcb8 Stylistic and 80-col fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163940 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 21:25:34 +00:00
Andrew Trick
1ef65d61d1 comment typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163935 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 20:27:25 +00:00
Andrew Trick
99ab6c6035 TargetSchedModel interface. To be implemented...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163934 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 20:26:46 +00:00
Andrew Trick
72d048b697 Define MC data tables for the new scheduling machine model.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163933 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 20:26:41 +00:00
Andrew Trick
0303d92b73 whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163932 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 20:26:39 +00:00
Andrew Trick
d039b383e7 misched: add a hook for custom DAG postprocessing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163915 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 17:22:42 +00:00
Micah Villmow
d15e657690 Add in comments that explain what the indexing and the size of the arrays is about.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163904 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 15:36:50 +00:00
Dmitri Gribenko
c5252da873 Fix Doxygen issues:
* wrap code blocks in \code ... \endcode;
* refer to parameter names in paragraphs correctly (\arg is not what most
  people want -- it starts a new paragraph);
* use \param instead of \arg to document parameters in order to be consistent
  with the rest of the codebase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163902 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 14:57:36 +00:00
Chandler Carruth
713aa9431d Introduce a new SROA implementation.
This is essentially a ground up re-think of the SROA pass in LLVM. It
was initially inspired by a few problems with the existing pass:
- It is subject to the bane of my existence in optimizations: arbitrary
  thresholds.
- It is overly conservative about which constructs can be split and
  promoted.
- The vector value replacement aspect is separated from the splitting
  logic, missing many opportunities where splitting and vector value
  formation can work together.
- The splitting is entirely based around the underlying type of the
  alloca, despite this type often having little to do with the reality
  of how that memory is used. This is especially prevelant with unions
  and base classes where we tail-pack derived members.
- When splitting fails (often due to the thresholds), the vector value
  replacement (again because it is separate) can kick in for
  preposterous cases where we simply should have split the value. This
  results in forming i1024 and i2048 integer "bit vectors" that
  tremendously slow down subsequnet IR optimizations (due to large
  APInts) and impede the backend's lowering.

The new design takes an approach that fundamentally is not susceptible
to many of these problems. It is the result of a discusison between
myself and Duncan Sands over IRC about how to premptively avoid these
types of problems and how to do SROA in a more principled way. Since
then, it has evolved and grown, but this remains an important aspect: it
fixes real world problems with the SROA process today.

First, the transform of SROA actually has little to do with replacement.
It has more to do with splitting. The goal is to take an aggregate
alloca and form a composition of scalar allocas which can replace it and
will be most suitable to the eventual replacement by scalar SSA values.
The actual replacement is performed by mem2reg (and in the future
SSAUpdater).

The splitting is divided into four phases. The first phase is an
analysis of the uses of the alloca. This phase recursively walks uses,
building up a dense datastructure representing the ranges of the
alloca's memory actually used and checking for uses which inhibit any
aspects of the transform such as the escape of a pointer.

Once we have a mapping of the ranges of the alloca used by individual
operations, we compute a partitioning of the used ranges. Some uses are
inherently splittable (such as memcpy and memset), while scalar uses are
not splittable. The goal is to build a partitioning that has the minimum
number of splits while placing each unsplittable use in its own
partition. Overlapping unsplittable uses belong to the same partition.
This is the target split of the aggregate alloca, and it maximizes the
number of scalar accesses which become accesses to their own alloca and
candidates for promotion.

Third, we re-walk the uses of the alloca and assign each specific memory
access to all the partitions touched so that we have dense use-lists for
each partition.

Finally, we build a new, smaller alloca for each partition and rewrite
each use of that partition to use the new alloca. During this phase the
pass will also work very hard to transform uses of an alloca into a form
suitable for promotion, including forming vector operations, speculating
loads throguh PHI nodes and selects, etc.

After splitting is complete, each newly refined alloca that is
a candidate for promotion to a scalar SSA value is run through mem2reg.

There are lots of reasonably detailed comments in the source code about
the design and algorithms, and I'm going to be trying to improve them in
subsequent commits to ensure this is well documented, as the new pass is
in many ways more complex than the old one.

Some of this is still a WIP, but the current state is reasonbly stable.
It has passed bootstrap, the nightly test suite, and Duncan has run it
successfully through the ACATS and DragonEgg test suites. That said, it
remains behind a default-off flag until the last few pieces are in
place, and full testing can be done.

Specific areas I'm looking at next:
- Improved comments and some code cleanup from reviews.
- SSAUpdater and enabling this pass inside the CGSCC pass manager.
- Some datastructure tuning and compile-time measurements.
- More aggressive FCA splitting and vector formation.

Many thanks to Duncan Sands for the thorough final review, as well as
Benjamin Kramer for lots of review during the process of writing this
pass, and Daniel Berlin for reviewing the data structures and algorithms
and general theory of the pass. Also, several other people on IRC, over
lunch tables, etc for lots of feedback and advice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163883 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 09:22:59 +00:00
Andrew Trick
a2ed0e8e8b misched: Generic tablegen classes for the new machine model.
This is mostly documentation for the new machine model. It is designed
to be flexible, easy to incrementally refine for a subtarget, and
provide all the information that MachineScheduler will need.

If all goes well, I will follow up with an example of the new model in
use for ARM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163877 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 06:18:55 +00:00
Andrew Trick
1008f8c789 comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163876 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 06:18:52 +00:00
Andrew Trick
8fa5319504 comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163875 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 06:18:50 +00:00
Jim Grosbach
45d81bdde8 MachO: Correctly mark symbol-difference variables as N_ABS.
.set a, b - c + CONSTANT
d = b - c + CONSTANT

Both 'a' and 'd' should be marked as absolute symbols (N_ABS).

rdar://12219394

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163853 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13 23:11:25 +00:00
Jim Grosbach
e940c1bb6c Better const handling for RuntimeDyld and MCJIT.
mapSectionAddress() wasn't consistent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163843 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13 21:50:06 +00:00
Richard Smith
0067567927 Fix some code which is invalid in C++11: an expression of enumeration type
can't be used as a non-type template argument of type bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163840 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13 21:18:18 +00:00
Dmitri Gribenko
065c0f800c Fix documentation: parameter being documented was removed in r98220.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163834 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13 20:28:31 +00:00
Dan Gohman
b54834b7e6 Define an official slot for the new !tbaa.struct metadata tag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163815 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13 17:56:17 +00:00
Micah Villmow
af40a5be77 The current implementation does not allow more than 32 types to be properly handled with target lowering. This doubles the size to 64bit types and easily allows extension to more types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163806 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13 15:24:43 +00:00
Dmitri Gribenko
2d9eb72178 Fix Doxygen issues:
* wrap code blocks in \code ... \endcode;
* refer to parameter names in paragraphs correctly (\arg is not what most
  people want -- it starts a new paragraph).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163790 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13 12:34:29 +00:00
Dmitri Gribenko
36f396e873 Fix a doxygen issue: these examples are supposed to be displayed preformatted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163787 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13 11:42:30 +00:00
Craig Topper
a1deb4e763 Fix function name in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163783 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13 07:26:59 +00:00
Nick Lewycky
b2eb740671 Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163782 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13 07:01:25 +00:00
Eric Christopher
e521278f00 Recommit, with fixes:
Add some support for dealing with an object pointer on arguments.

    Part of rdar://9797999

which now supports adding the object pointer attribute to the
subprogram as it should.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163754 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12 23:36:19 +00:00
Michael Liao
6c7ccaa3fd Fix PR11985
- BlockAddress has no support of BA + offset form and there is no way to
  propagate that offset into machine operand;
- Add BA + offset support and a new interface 'getTargetBlockAddress' to
  simplify target block address forming;
- All targets are modified to use new interface and X86 backend is enhanced to
  support BA + offset addressing.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163743 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12 21:43:09 +00:00
Jakob Stoklund Olesen
01b50ca5b3 Delete dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163735 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12 20:04:17 +00:00
Eric Christopher
fd1cd57221 Revert "Add some support for dealing with an object pointer on arguments."
This should be done on the subprogram, not the variable itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163734 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12 18:42:31 +00:00
Dmitri Gribenko
67c8978617 Fix a couple of Doxygen comment issues pointed out by -Wdocumentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163721 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12 16:59:47 +00:00
Alexander Potapenko
db9ba339b1 Suppress the warnings about unused parameters in changeColor()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163714 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12 15:01:33 +00:00
James Molloy
c4f70d437d Add a function computeRegisterLiveness() to MachineBasicBlock. This uses analyzePhysReg() from r163694 to heuristically try and determine the liveness state of a physical register upon arrival at a particular instruction in a block.
The search for liveness is clipped to a specific number of instructions around the target MachineInstr, in order to avoid degenerating into an O(N^2) algorithm. It tries to use various clues about how instructions around (both before and after) a given MachineInstr use that register, to determine its state at the MachineInstr.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163695 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12 10:18:23 +00:00
James Molloy
b17cf29784 Add an analyzePhysReg() function to MachineOperandIteratorBase that analyses an instruction's use of a physical register, analogous to analyzeVirtReg.
Rename RegInfo to VirtRegInfo so as not to be confused with the new PhysRegInfo.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163694 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12 10:03:31 +00:00
Eric Christopher
2c57a334d7 Add some support for dealing with an object pointer on arguments.
Part of rdar://9797999

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163667 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12 00:26:55 +00:00
Owen Anderson
83c0eefa3b Improve tblgen code cleanliness: create an unknown_class, from which the unknown def inherits. Make tblgen check for that class, rather than checking for the def itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163664 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 23:47:08 +00:00
Chad Rosier
2a3fcb382e Add documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163658 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 23:20:20 +00:00
Chad Rosier
fde528fa2b Add a few virtual functions to the abstract MCParsedAsmOperand class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163655 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 23:03:44 +00:00
Jakob Stoklund Olesen
a6035773d8 Add TRI::getSubRegIndexLaneMask().
Sub-register lane masks are bitmasks that can be used to determine if
two sub-registers of a virtual register will overlap. For example, ARM's
ssub0 and ssub1 sub-register indices don't overlap each other, but both
overlap dsub0 and qsub0.

The lane masks will be accurate on most targets, but on targets that use
sub-register indexes in an irregular way, the masks may conservatively
report that two sub-register indices overlap when the eventually
allocated physregs don't.

Irregular register banks also mean that the bits in a lane mask can't be
mapped onto register units, but the concept is similar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163630 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 16:34:08 +00:00
Jakob Stoklund Olesen
59f45e4610 Add MCRI::getNumSubRegIndices() and start checking SubRegIndex ranges.
Apparently, NumSubRegIndices was completely unused before. Adjust it by
one to include the null subreg index, just like getNumRegs() includes
the null register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163628 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 16:34:02 +00:00
Alex Rosenberg
95f1ef4ac7 Add a pass that renames everything with metasyntatic names. This works well after using bugpoint to reduce the confusion presented by the original names, which no longer mean what they used to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163592 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 02:46:18 +00:00
Andrew Trick
78e5efe1b2 Reorganize MachineScheduler interfaces and publish them in the header.
The Hexagon target decided to use a lot of functionality from the
target-independent scheduler. That's fine, and other targets should be
able to do the same. This reorg and API update makes that easy.

For the record, ScheduleDAGMI was not meant to be subclassed. Instead,
new scheduling algorithms should be able to implement
MachineSchedStrategy and be done. But if need be, it's nice to be
able to extend ScheduleDAGMI, so I also made that easier. The target
scheduler is somewhat more apt to break that way though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163580 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 00:39:15 +00:00
Andrew Trick
88df977d4a Remove unused declaration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163579 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 00:39:12 +00:00
Michael J. Spencer
2c38a6615a [Object] Extract Elf_Ehdr. Patch by Hemant Kulkarni!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163532 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-10 19:04:02 +00:00
Benjamin Kramer
04142bc845 Move bypassSlowDivision into the llvm namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163503 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-10 11:52:08 +00:00
Aaron Ballman
236bcf1fcd Fixing a type width warning with MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163481 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-09 20:34:25 +00:00
Ted Kremenek
0d651e0c9d Add operator< for FoldingSetNodeID.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163454 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-08 04:25:29 +00:00
Benjamin Kramer
a9e37c5eaf Fix alignment of .comm and .lcomm on mingw32.
For some reason .lcomm uses byte alignment and .comm log2 alignment so we can't
use the same setting for both. Fix this by reintroducing the LCOMM enum.
I verified this against mingw's gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163420 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-07 21:08:01 +00:00