Commit Graph

85289 Commits

Author SHA1 Message Date
Dan Gohman 3397bb248f Say "bytes" instead of "address units", since that's what the
rest of LangRef uses.

llvm-svn: 164402
2012-09-21 18:41:30 +00:00
Dan Gohman e36188f30e Document the new !tbaa.struct metadata.
llvm-svn: 164398
2012-09-21 18:21:48 +00:00
David Blaikie f787f171a3 Add missing 'to' and rephrase an explanation of GCC's assumptions.
Wordsmithing by Matt Beaumont-Gay in response to r164389.

llvm-svn: 164395
2012-09-21 18:03:02 +00:00
David Blaikie 00bec9a4ad Document "do not use defaults in covered switch-over-enum" coding standard.
llvm-svn: 164389
2012-09-21 17:47:36 +00:00
Benjamin Kramer eba9aca5cd LoopIdiom: Give up when the loop is not in canonical form.
We rely on it when doing the transforms. This can happen when there is an
indirectbr in  the loop.

Fixes PR13892.

llvm-svn: 164383
2012-09-21 17:27:23 +00:00
Chad Rosier 8bf01fc663 [fast-isel] Fallback to SelectionDAG isel if we require strict alignment for
non-aligned i32 loads/stores.
rdar://12304911

llvm-svn: 164381
2012-09-21 16:58:35 +00:00
Benjamin Kramer efb4d34bcf InstCombine: Make sure we use the pre-zext type when creating a constant of a value that is zext'd.
Fixes PR13250.

llvm-svn: 164377
2012-09-21 16:26:41 +00:00
Bill Wendling 89442efddc Encapsulate the "construct*AlignmentFromInt" functions.
llvm-svn: 164373
2012-09-21 16:07:28 +00:00
Michael Liao 7325a9d08e Fix a typo in r164357
llvm-svn: 164372
2012-09-21 16:03:03 +00:00
Dmitri Gribenko 6e9fcd6215 Clarify comment.
llvm-svn: 164371
2012-09-21 15:26:34 +00:00
Bill Wendling 9be7759ee1 Make the 'get*AlignmentFromAttr' functions into member functions within the Attributes class. Now with fix.
llvm-svn: 164370
2012-09-21 15:26:31 +00:00
Benjamin Kramer 736a4fc4fb BitcodeReader: Correctly insert blockaddress constant referring to a already parsed function.
We inserted a placeholder that was never replaced because the function was
already visited. Assert that all placeholders have been resolved when tearing
down the bitcode reader.

Fixes PR13895.

llvm-svn: 164369
2012-09-21 14:34:31 +00:00
Alexey Samsonov ad1191fbb6 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.
llvm-svn: 164365
2012-09-21 07:08:08 +00:00
NAKAMURA Takumi be9ad01d27 llvm/test/CodeGen/X86/pr5145.ll: Tweak expressions to match for darwin target.
.LBB0_1: # Linux
LBB0_1:  # Darwin

llvm-svn: 164362
2012-09-21 05:19:19 +00:00
Andrew Trick 99cc7f6a3b Cortex-A9 latency fixes (w/ -schedmodel only).
Quick review against the manual revealed a few obvious mistakes.

llvm-svn: 164361
2012-09-21 05:06:40 +00:00
Michael Liao a880186030 Add missing i8 max/min/umax/umin support
- Fix PR5145 and turn on test 8-bit atomic ops

llvm-svn: 164358
2012-09-21 03:18:52 +00:00
Michael Liao c33bebff52 Revise td of X86 atomic instructions
- Rewirte most atomic instructions in templates for both better
  maintenance and future extensions, such as HLE in TSX.

llvm-svn: 164357
2012-09-21 03:00:17 +00:00
Sean Silva 835ef201ac docs: Fix Sphinx warning over Atomics.rst.
Atomics.rst was not linked into the toctree.

Docs now build warning-free!

llvm-svn: 164356
2012-09-21 02:46:32 +00:00
Sean Silva 9f0311deee docs: Fix Sphinx warning over yaml2obj.rst.
yaml2obj.rst was not included in the toctree

Input from Michael Spencer.

llvm-svn: 164355
2012-09-21 02:46:30 +00:00
NAKAMURA Takumi f51004bca5 Mips16FrameLowering.cpp: Remove unused TII introduced in r164349. [-Wunused-variable]
llvm-svn: 164354
2012-09-21 02:21:30 +00:00
NAKAMURA Takumi 1a38004c1b llvm/test/CodeGen/ARM/fast-isel.ll: Fix possible typos, s/@unaligned_i16_store/@unaligned_i16_load/g.
I guess this had apparently passed in +Asserts possibly due to verborsity.

llvm-svn: 164350
2012-09-21 01:15:05 +00:00
Akira Hatanaka cd04e2b8e2 Properly save and restore RA and Mips16 callee save registers S0,S1
Patch by Reed Kotler.

llvm-svn: 164349
2012-09-21 01:08:16 +00:00
Chad Rosier 8ff5a4aa79 Testcase does not need to be this strict.
llvm-svn: 164347
2012-09-21 00:47:08 +00:00
Chad Rosier 1fb301aa41 Add newline.
llvm-svn: 164346
2012-09-21 00:43:18 +00:00
Chad Rosier 2364f58326 [fast-isel] Fallback to SelectionDAG isel if we require strict alignment for
non-halfword-aligned i16 loads/stores.
rdar://12304911

llvm-svn: 164345
2012-09-21 00:41:42 +00:00
Jim Grosbach e2baa97d60 Tidy up. Whitespace.
llvm-svn: 164344
2012-09-21 00:36:42 +00:00
Jim Grosbach 9659ed9813 Tidy up. Formatting.
llvm-svn: 164343
2012-09-21 00:26:53 +00:00
Jim Grosbach 74b61c398c 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

llvm-svn: 164340
2012-09-21 00:18:20 +00:00
Jakob Stoklund Olesen b8707faba3 Ignore PHI-defs for -new-coalescer interference checks.
A PHI can't create interference on its own. If two live ranges interfere
at a PHI, they must also interfere when leaving one of the PHI
predecessors.

llvm-svn: 164330
2012-09-20 23:08:42 +00:00
Jakob Stoklund Olesen 09cd303655 Extend -new-coalescer SSA update to handle mapped values as well.
The old-fashioned many-to-one value mapping doesn't always work when
merging vector lanes. A value can map to multiple different values, and
it can even be necessary to insert new PHIs.

When a value number is defined by a copy from a value number that
required SSa update, include the live range of the copied value number
in the SSA update as well. It is not necessarily a copy of the original
value number any longer.

llvm-svn: 164329
2012-09-20 23:08:39 +00:00
Eric Christopher 3a3d529e0d Only emit DW_AT_object_pointer if this is a definition.
llvm-svn: 164326
2012-09-20 22:51:57 +00:00
Manman Ren 93ab64916f SimplifyCFG: sink common codes from IF, ELSE blocks down to END block.
We already have HoistThenElseCodeToIf, this patch implements
SinkThenElseCodeToEnd. When END block has only two predecessors and each
predecessor terminates with unconditional branches, we compare instructions in
IF and ELSE blocks backwards and check whether we can sink the common
instructions down.

rdar://12191395

llvm-svn: 164325
2012-09-20 22:37:36 +00:00
Evan Cheng 363d73c518 Try to make these tests more portable.
llvm-svn: 164320
2012-09-20 21:35:21 +00:00
Benjamin Kramer 8554206652 Fix broken check lines.
llvm-svn: 164317
2012-09-20 19:54:13 +00:00
Andrew Trick e6af4b9a35 Fix function names in coding style examples
llvm-svn: 164311
2012-09-20 17:02:04 +00:00
Bill Wendling c727bacb38 Revert r164308 to fix buildbots.
llvm-svn: 164309
2012-09-20 16:59:57 +00:00
Bill Wendling abac66150c Make the 'get*AlignmentFromAttr' functions into member functions within the Attributes class.
llvm-svn: 164308
2012-09-20 16:27:05 +00:00
Bill Wendling b4e211cd19 Remove more bare uses of the different Attribute enums.
llvm-svn: 164307
2012-09-20 15:20:36 +00:00
Roman Divacky 264f504077 Specify cpu to get the correct instruction ordering. Remove XFAIL.
llvm-svn: 164306
2012-09-20 14:59:42 +00:00
Bill Wendling de74cf50da Make the 'getAsString' function a method of the Attributes class.
llvm-svn: 164305
2012-09-20 14:44:42 +00:00
Nadav Rotem 841c9a84d0 Fix 80-col violations.
llvm-svn: 164297
2012-09-20 08:53:31 +00:00
Tim Northover 572d0698d2 Make sure lli compiles all code before invalidating instruction caches.
Patch from Amara Emerson.

llvm-svn: 164296
2012-09-20 08:46:30 +00:00
Craig Topper 980739afdf Change enum type in a static table to uint8_t instead. Saves about 700 hundred bytes of static data. Change unsigned char in same table to uint8_t for explicitness.
llvm-svn: 164285
2012-09-20 06:14:08 +00:00
Michael Liao 83bc2119dc Specify CPu to prevent failure on ATOM due to different code scheduling
llvm-svn: 164283
2012-09-20 03:34:04 +00:00
Sean Silva 98f84c998f Fix Sphinx warnings.
Toctree was not being interlinked properly.

llvm-svn: 164282
2012-09-20 03:20:53 +00:00
Michael Liao 3237662b65 Re-work X86 code generation of atomic ops with spin-loop
- Rewrite/merge pseudo-atomic instruction emitters to address the
  following issue:
  * Reduce one unnecessary load in spin-loop

    previously the spin-loop looks like

        thisMBB:
        newMBB:
          ld  t1 = [bitinstr.addr]
          op  t2 = t1, [bitinstr.val]
          not t3 = t2  (if Invert)
          mov EAX = t1
          lcs dest = [bitinstr.addr], t3  [EAX is implicit]
          bz  newMBB
          fallthrough -->nextMBB

    the 'ld' at the beginning of newMBB should be lift out of the loop
    as lcs (or CMPXCHG on x86) will load the current memory value into
    EAX. This loop is refined as:

        thisMBB:
          EAX = LOAD [MI.addr]
        mainMBB:
          t1 = OP [MI.val], EAX
          LCMPXCHG [MI.addr], t1, [EAX is implicitly used & defined]
          JNE mainMBB
        sinkMBB:

  * Remove immopc as, so far, all pseudo-atomic instructions has
    all-register form only, there is no immedidate operand.

  * Remove unnecessary attributes/modifiers in pseudo-atomic instruction
    td

  * Fix issues in PR13458

- Add comprehensive tests on atomic ops on various data types.
  NOTE: Some of them are turned off due to missing functionality.

- Revise tests due to the new spin-loop generated.

llvm-svn: 164281
2012-09-20 03:06:15 +00:00
Sean Silva 51fc86ddfe Sphinxify DebuggingJITedCode
LGTM by Michael Spencer

llvm-svn: 164280
2012-09-20 03:05:26 +00:00
Andrew Trick fc9420c006 Fix static function names in CodingStandards examples.
Try not to violate conventions immediately before explaining them.

llvm-svn: 164278
2012-09-20 02:01:06 +00:00
Bill Wendling 3bef2dd5f9 Convert some attribute existence queries over to use the predicate methods.
llvm-svn: 164268
2012-09-19 23:54:18 +00:00
Jim Grosbach 38bfa0c529 ARM: Tidy up IntrinsicsARM.td a bit.
Make the TargetPrefix setting one big setting instead of being spread out
everywhere. No functional change.

llvm-svn: 164265
2012-09-19 23:39:03 +00:00
Bill Wendling d6b2688130 Add predicates for queries on whether an attribute exists.
llvm-svn: 164264
2012-09-19 23:35:21 +00:00
Micah Villmow 75e29c4b78 Add in new data types that are used by AMDIL/ANL among others.
llvm-svn: 164261
2012-09-19 22:47:07 +00:00
Owen Anderson dee6583dfd Soften the pattern-can-never-match error in TableGen into a warning. This pattern can be very useful in cases where you want to define a multiclass that covers both commutative and non-commutative operators (say, add and sub).
llvm-svn: 164256
2012-09-19 22:15:06 +00:00
Owen Anderson 1fc793e926 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.

llvm-svn: 164251
2012-09-19 21:34:18 +00:00
Jakob Stoklund Olesen 7d3c9c0a2a Resolve conflicts involving dead vector lanes for -new-coalescer.
A common coalescing conflict in vector code is lane insertion:

  %dst = FOO
  %src = BAR
  %dst:ssub0 = COPY %src

The live range of %src interferes with the ssub0 lane of %dst, but that
lane is never read after %src would have clobbered it. That makes it
safe to merge the live ranges and eliminate the COPY:

  %dst = FOO
  %dst:ssub0 = BAR

This patch teaches the new coalescer to resolve conflicts where dead
vector lanes would be clobbered, at least as long as the clobbered
vector lanes don't escape the basic block.

llvm-svn: 164250
2012-09-19 21:29:18 +00:00
Andrew Kaylor 1f66100755 This patch adds memory support functions which will later be used to implement section-specific protection handling in MCJIT.
llvm-svn: 164249
2012-09-19 20:46:12 +00:00
Preston Gurd 055006475e 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.

llvm-svn: 164248
2012-09-19 20:36:12 +00:00
Duncan Sands 12ccbe7a8e Add support for accessing an MDNode's operands via the C binding. Patch by
Anthony Bryant.

llvm-svn: 164247
2012-09-19 20:29:39 +00:00
Preston Gurd 242ed3158a Support default parameters/arguments for assembler macros.
This patch is based on the one by PaX Team.

Patch by Andy Zhang!

llvm-svn: 164246
2012-09-19 20:29:04 +00:00
Preston Gurd eb3ebf16ab Enhance unmatched '.endr' directive error message in assembler.
The directive can be matched with directives other than '.rept'

Patch by Andy Zhang!

llvm-svn: 164245
2012-09-19 20:23:43 +00:00
Michael Liao 8372539543 Unify the logic in SelectAtomicLoadAdd and SelectAtomicLoadArith
- Merge the processing of LOAD_ADD with other atomic load-arith
  operations
- Separate the logic getting target constant for atomic-load-op and add
  an optimization for atomic-load-add on i16 with negative value
- Optimize a minor case for atomic-fetch-add i16 with negative operand. Test
  case is revised.

llvm-svn: 164243
2012-09-19 19:36:58 +00:00
Michael Ilseman 5117db54ff Renaming functions to match coding style guidelines
llvm-svn: 164238
2012-09-19 18:14:45 +00:00
Jordan Rose b64c123453 Really XFAIL test/CodeGen/PowerPC/structsinregs.ll.
XFAIL needs a trailing colon. Hopefully this will get the buildbots
happy again while Bill works on getting it passing.

llvm-svn: 164237
2012-09-19 17:03:11 +00:00
Michael Ilseman 370a1a1c94 Doxygen-ify comments
llvm-svn: 164235
2012-09-19 16:25:57 +00:00
Bill Schmidt 479a4588b9 XFAIL test/CodeGen/PowerPC/structsinregs.ll
llvm-svn: 164233
2012-09-19 16:18:23 +00:00
Michael Ilseman 1db690d15e Put the * and & next to the variable, rather than the type.
llvm-svn: 164232
2012-09-19 16:17:20 +00:00
Michael Ilseman c4149a10b4 Document the interface for integer expansion, using doxygen-style comments
llvm-svn: 164231
2012-09-19 16:03:57 +00:00
Michael Ilseman 623c5cda08 Forward declarations
llvm-svn: 164230
2012-09-19 15:55:03 +00:00
Duncan Sands aef83e5f03 GCC doesn't understand that OrigAliasResult having a value is correlated with
ArePhisAssumedNoAlias, and warns that OrigAliasResult may be used uninitialized.
Pacify GCC.

llvm-svn: 164229
2012-09-19 15:43:44 +00:00
Bill Schmidt 019cc6fe03 Small structs for PPC64 SVR4 must be passed right-justified in registers.
lib/Target/PowerPC/PPCISelLowering.{h,cpp}
 Rename LowerFormalArguments_Darwin to LowerFormalArguments_Darwin_Or_64SVR4.
 Rename LowerFormalArguments_SVR4 to LowerFormalArguments_32SVR4.
 Receive small structs right-justified in LowerFormalArguments_Darwin_Or_64SVR4.
 Rename LowerCall_Darwin to LowerCall_Darwin_Or_64SVR4.
 Rename LowerCall_SVR4 to LowerCall_32SVR4.
 Pass small structs right-justified in LowerCall_Darwin_Or_64SVR4.

test/CodeGen/PowerPC/structsinregs.ll
 New test.

llvm-svn: 164228
2012-09-19 15:42:13 +00:00
Hans Wennborg f744fa917d SimplifyCFG: Don't generate invalid code for switch used to initialize
two variables where the first variable is returned and the second
ignored.

I don't think this occurs in practice (other passes should have cleaned
up the unused phi node), but it should still be handled correctly.

Also make the logic for determining if we should return early less
sketchy.

llvm-svn: 164225
2012-09-19 14:24:21 +00:00
Will Dietz cdd62e3560 Fix minor typo in IntervalPartition.h
llvm-svn: 164222
2012-09-19 13:45:43 +00:00
Rafael Espindola 297e598620 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.

llvm-svn: 164221
2012-09-19 13:42:51 +00:00
Benjamin Kramer ae9a23fc8a InlineCost: Make TotalAllocaSizeRecursiveCaller unsigned to avoid sign-compare warnings.
It's a size, not a cost.

llvm-svn: 164219
2012-09-19 13:22:27 +00:00
Benjamin Kramer 47196e6cd5 IntegerDivision: Style cleanups, avoid warning about mixing || and && without parens.
llvm-svn: 164216
2012-09-19 13:03:07 +00:00
Benjamin Kramer a36f387181 Remove unused and broken CloneFunction wrapper.
It converted the CodeInfo argument to bool implicitly.

llvm-svn: 164215
2012-09-19 13:03:01 +00:00
Hans Wennborg ff9b5a8465 Move load_to_switch.ll to test/CodeGen/SPARC/
Because the test invokes llc -march=sparc, it needs to be in a directory
which is only run when the sparc target is built.

llvm-svn: 164211
2012-09-19 09:25:03 +00:00
Nadav Rotem 0b66119141 rename test
llvm-svn: 164210
2012-09-19 09:22:17 +00:00
Nadav Rotem 4eb3d4b2cf 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

llvm-svn: 164207
2012-09-19 08:08:04 +00:00
Hans Wennborg 02fbc71647 CodeGenPrep: turn lookup tables into switches for some targets.
This is a follow-up from r163302, which added a transformation to
SimplifyCFG that turns some switches into loads from lookup tables.

It was pointed out that some targets, such as GPUs and deeply embedded
targets, might not find this appropriate, but SimplifyCFG doesn't have
enough information about the target to decide this.

This patch adds the reverse transformation to CodeGenPrep: it turns
loads from lookup tables back into switches for targets where we do not
build jump tables (assuming these are also the targets where lookup
tables are inappropriate).

Hopefully we will eventually get to have target information in
SimplifyCFG, and then this CodeGenPrep transformation can be removed.

llvm-svn: 164206
2012-09-19 07:48:16 +00:00
Craig Topper 3f23c1a8b9 Remove code for setting the VEX L-bit as a function of operand size from the code emitters and the disassembler table builder. Fix a couple instructions that were still missing VEX_L.
llvm-svn: 164204
2012-09-19 06:37:45 +00:00
Nadav Rotem 88ec52d580 whitespace.
llvm-svn: 164203
2012-09-19 06:24:00 +00:00
Craig Topper a73be890a1 Add explicit VEX_L tags to all 256-bit instructions. This will allow us to remove code from the code emitters that examined operands to set the L-bit.
llvm-svn: 164202
2012-09-19 06:06:34 +00:00
Andrew Trick becbbbe112 Silence -Wnon-virtual-dtor in llvm-stress.
This was making it hard to scan my builds for new warnings. The
warning still fires with ToT clang. But if my workaround is unnecessary
for whatever reason, feel free to revert.

llvm-svn: 164201
2012-09-19 05:08:30 +00:00
Andrew Trick cfe222c2a9 SchedMachineModel: compress the CPU's WriteLatencyTable.
llvm-svn: 164199
2012-09-19 04:43:19 +00:00
Sean Silva 8f43c6f0d5 De-nest if's and fix mix-up
Two deeply nested if's obscured that the sense of the conditions was
mixed up. Amazingly, TableGen's output is exactly the same even with the
sense of the tests fixed; it seems that all of TableGen's conversions
are symmetric so that the inverted sense was nonetheless correct "by
accident". As such, I couldn't come up with a test case.

If there does in fact exist a non-symmetric conversion in TableGen's
type system, then a test case should be prepared.

Despite the symmetry, both if's are left in place for robustness in the
face of future changes.

Review by Jakob.

llvm-svn: 164195
2012-09-19 02:14:59 +00:00
Sean Silva 835139bfe4 Iterate deterministicaly over ClassInfo*'s
Fixes an observed instance of nondeterministic TableGen output.

Review by Jakob.

llvm-svn: 164191
2012-09-19 01:47:03 +00:00
Sean Silva c8f5657f91 Iterate deterministically over register classes
Fixes an observed instance of nondeterministic TableGen output.

Review by Jakob.

llvm-svn: 164190
2012-09-19 01:47:01 +00:00
Sean Silva a4e2c5fc86 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.

llvm-svn: 164189
2012-09-19 01:47:00 +00:00
NAKAMURA Takumi dfc60de2b3 llvm/test/MC/X86/x86_nop.s: Make sure -arch=x86 when -mcpu=geode.
-mcpu doesn't infer -arch. Consider non-x86 host.

llvm-svn: 164185
2012-09-19 00:56:20 +00:00
Jim Grosbach 0aac6ce759 Tidy up. Minor formatting.
llvm-svn: 164182
2012-09-18 23:05:18 +00:00
Jim Grosbach b12b71ae6e Tidy up. 80 columns.
llvm-svn: 164181
2012-09-18 23:05:12 +00:00
Andrew Trick 6a35f197a7 comment typo
llvm-svn: 164180
2012-09-18 22:57:42 +00:00
Chandler Carruth 3f882d4cf5 Fix the last crasher I've gotten a reproduction for in SROA. This one
from the dragonegg build bots when we turned on the full version of the
pass. Included a much reduced test case for this pesky bug, despite
bugpoint's uncooperative behavior.

Also, I audited all the similar code I could find and didn't spot any
other cases where this mistake cropped up.

llvm-svn: 164178
2012-09-18 22:37:19 +00:00
Sean Silva c99b54d095 Test commit
llvm-svn: 164174
2012-09-18 22:21:43 +00:00
Michael Ilseman 52059da858 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.

llvm-svn: 164173
2012-09-18 22:02:40 +00:00
Evan Cheng 1de7ec8c7c MOVi16 (movw) is only legal on cpus with V6T2 support. rdar://12300648
llvm-svn: 164169
2012-09-18 21:24:16 +00:00
Benjamin Kramer ef878a832b FileCheck: Fix off-by-one bug that made CHECK-NOT: ignore the next character after the colon.
llvm-svn: 164165
2012-09-18 20:51:39 +00:00
Roman Divacky 947148aa45 Add test for r164155 and remove two tests superseded by ppc64-calls.ll.
llvm-svn: 164162
2012-09-18 19:51:44 +00:00
Jan Sjödin 4d0c299f39 Add hidden flag to exclude aliases from output.
llvm-svn: 164158
2012-09-18 18:47:58 +00:00
Rafael Espindola 99c2acbb05 Add a MapVector class. It provides a regular set iteration, but
also provides a insertion order iteration over the values.

llvm-svn: 164157
2012-09-18 18:43:21 +00:00
Roman Divacky 09adf3decc Fix the isLocalCall() by checking for linker weakness as well.
llvm-svn: 164155
2012-09-18 18:27:49 +00:00
Andrew Trick f2b70d9f3a TargetSchedule: cleanup computeOperandLatency logic & diagnostics.
llvm-svn: 164154
2012-09-18 18:20:02 +00:00
Andrew Trick 9b63513ac6 misched: Make ScheduleDAGInstrs use the TargetSchedule interface.
llvm-svn: 164153
2012-09-18 18:20:00 +00:00
Akira Hatanaka 40cf08dd08 Revert r164051.
llvm-svn: 164150
2012-09-18 18:08:25 +00:00
Andrew Trick 402edbbe39 LSR critical edge splitting fix for PR13756.
llvm-svn: 164147
2012-09-18 17:51:33 +00:00
Chandler Carruth d356fd02a9 Fix getCommonType in a different way from the way I fixed it when
working on FCA splitting. Instead of refusing to form a common type when
there are uses of a subsection of the alloca as well as a use of the
entire alloca, just skip the subsection uses and continue looking for
a whole-alloca use with a type that we can use.

This produces slightly prettier IR I think, and also fixes the other
failure in the test.

llvm-svn: 164146
2012-09-18 17:49:37 +00:00
Benjamin Kramer a59ef5795d Fix build for compilers that don't understand injected class names properly.
llvm-svn: 164142
2012-09-18 17:11:47 +00:00
Roman Divacky 0be33598ce Avoid symbol name clash when filling TOC.
Patch by Adhemerval Zanella.

llvm-svn: 164141
2012-09-18 17:10:37 +00:00
Benjamin Kramer 73a9e4a1f9 SROA: Use CRTP for OpSplitter to get rid of virtual dispatch and the virtual-dtor warnings that come with it.
llvm-svn: 164140
2012-09-18 17:06:32 +00:00
Roman Divacky d4f6f421a9 On PPC64 emit the environment pointer. Patch by Adhemerval Zanella.
llvm-svn: 164139
2012-09-18 16:55:29 +00:00
Roman Divacky 762930637c Optimize local func calls to not emit nop for TOC restoration.
Patch by Adhemerval Zanella.

llvm-svn: 164138
2012-09-18 16:47:58 +00:00
Roman Divacky be42c1e0aa Add PowerPC64 relocation definitions. Patch by Adhemerval Zanella!
llvm-svn: 164137
2012-09-18 16:38:02 +00:00
Benjamin Kramer 65f8c88242 SROA: Replace the member function template contraption for recursively splitting aggregates into a real class.
No intended functionality change.

llvm-svn: 164135
2012-09-18 16:20:46 +00:00
Roman Divacky 24653d41e9 Add test for r164132.
llvm-svn: 164134
2012-09-18 16:19:10 +00:00
Roman Divacky 5dd4ccb402 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.

llvm-svn: 164132
2012-09-18 16:08:49 +00:00
NAKAMURA Takumi eb2c8f0fc6 SROA.cpp: Appease msvc.
...I don't know why this could appease msvc...baad.

llvm-svn: 164130
2012-09-18 15:29:02 +00:00
NAKAMURA Takumi 78e009d799 llvm/test/DebugInfo: Move two tests, 2010-04-13-PubType.ll and linkage-name.ll to X86.
llvm-svn: 164129
2012-09-18 14:57:11 +00:00
Benjamin Kramer d4d37db071 XFAIL SROA test until Chandler can get to it.
llvm-svn: 164128
2012-09-18 14:27:53 +00:00
Dmitri Gribenko be88f563bf Coding standards: fix typo: '= deleted' -> '= delete'.
llvm-svn: 164126
2012-09-18 14:00:58 +00:00
Tom Stellard 1b5585a350 Make MachinePostDominatorTree::DT private
llvm-svn: 164125
2012-09-18 13:49:54 +00:00
Benjamin Kramer 9bc3efc81c LNT builders have picked up new SROA, disable it to get the remaining builders green again.
llvm-svn: 164124
2012-09-18 13:43:00 +00:00
Chandler Carruth a34f3567e0 Fix a warning in release builds and a test case I forgot to update with
a fix to getCommonType in the previous patch.

llvm-svn: 164120
2012-09-18 13:02:06 +00:00
Chandler Carruth 42cb9cb14f Add a major missing piece to the new SROA pass: aggressive splitting of
FCAs. This is essential in order to promote allocas that are used in
struct returns by frontends like Clang. The FCA load would block the
rest of the pass from firing, resulting is significant regressions with
the bullet benchmark in the nightly test suite.

Thanks to Duncan for repeated discussions about how best to do this, and
to both him and Benjamin for review.

This appears to have blocked many places where the pass tries to fire,
and so I'm expect somewhat different results with this fix added.

As with the last big patch, I'm including a change to enable the SROA by
default *temporarily*. Ben is going to remove this as soon as the LNT
bots pick up the patch. I'm just trying to get a round of LNT numbers
from the stable machines in the lab.

NOTE: Four clang tests are expected to fail in the brief window where
this is enabled. Sorry for the noise!

llvm-svn: 164119
2012-09-18 12:57:43 +00:00
Richard Osborne b68053e266 Fix instcombine to obey requested alignment when merging allocas.
llvm-svn: 164117
2012-09-18 09:31:44 +00:00
James Molloy ea05256b58 More domain conversion; convert VFP VMOVS to NEON instructions in more cases - when we may clobber the other S-lane by converting an S to a D instruction, make an effort to work out if the S lane is clobberable or not.
llvm-svn: 164114
2012-09-18 08:31:15 +00:00
Craig Topper 7ecfa6d960 Make custom operand parsing mnemonic indices use the same mnemonic table as the match table. Reorder fields in OperandMatchEntry to provide the least amount of padding for in tree targets.
llvm-svn: 164109
2012-09-18 07:02:21 +00:00
Craig Topper e2cfeb30a1 Use variable type for index into mnemonic table. Shrinks size of index field on in tree targets. Saving static data space.
llvm-svn: 164108
2012-09-18 06:10:45 +00:00
Andrew Trick ba7b921fcb 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.

llvm-svn: 164105
2012-09-18 05:33:15 +00:00
Craig Topper 1740e05c31 Add LLVM_DELETED_FUNCTION to coding standards.
llvm-svn: 164101
2012-09-18 04:43:40 +00:00
Craig Topper 3215f836b5 Fix a typo. No functional change.
llvm-svn: 164100
2012-09-18 04:43:05 +00:00
Andrew Trick a67b2a702c Let NULL slip through again.
llvm-svn: 164099
2012-09-18 04:18:39 +00:00
Andrew Trick 6e6d597b1c TargetSchedModel API. Implement latency lookup, disabled.
llvm-svn: 164098
2012-09-18 04:03:34 +00:00
Andrew Trick ea28dbdf93 comment typo
llvm-svn: 164097
2012-09-18 04:03:30 +00:00
Andrew Trick a88f1bddc6 TableGen subtarget emitter. Use getSchedClassIdx.
llvm-svn: 164096
2012-09-18 03:55:55 +00:00
Andrew Trick c6c88151bb TableGen subtarget emitter. Generate resolveSchedClass generated hook for resolving instruction variants.
llvm-svn: 164095
2012-09-18 03:41:43 +00:00
Andrew Trick 1188e439b2 TableGen subtarget emitter. Remove unnecessary header dependence.
llvm-svn: 164094
2012-09-18 03:32:57 +00:00
Craig Topper bac8168fb3 Mark unimplemented operator new as LLVM_DELETED_FUNCTION.
llvm-svn: 164093
2012-09-18 03:25:49 +00:00
Andrew Trick ab722bdd50 TableGen subtarget emitter. Initialize MCSubtargetInfo with the new machine model.
llvm-svn: 164092
2012-09-18 03:18:56 +00:00
Craig Topper d4f8b3cb55 Mark constructors, destructors, and operator new commented as 'do not implement' with LLVM_DELETED_FUNCTION instead.
llvm-svn: 164091
2012-09-18 02:05:45 +00:00
Craig Topper b1d83e8c72 Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION.
llvm-svn: 164090
2012-09-18 02:01:41 +00:00
Evan Cheng 90ae8f8442 Use vld1 / vst2 for unaligned v2f64 load / store. e.g. Use vld1.16 for 2-byte
aligned address. Based on patch by David Peixotto.

Also use vld1.64 / vst1.64 with 128-bit alignment to take advantage of alignment
hints. rdar://12090772, rdar://12238782

llvm-svn: 164089
2012-09-18 01:42:45 +00:00
Craig Topper 9150610db7 Mark asm matcher conversion table as const.
llvm-svn: 164088
2012-09-18 01:41:49 +00:00
Evan Cheng c573599137 Fix some funky indentation.
llvm-svn: 164087
2012-09-18 01:34:40 +00:00
Craig Topper aae8fb801e Fix typo in comment. No functional change.
llvm-svn: 164086
2012-09-18 01:13:36 +00:00
Manman Ren 5657555357 PGO: preserve branch-weight metadata when simplifying Switch to a sub, an icmp
and a conditional branch; also when removing dead cases from a switch.

llvm-svn: 164084
2012-09-18 00:47:33 +00:00
Andrew Trick 8038ceb731 Backout the wrong subtarget emitter fix
llvm-svn: 164078
2012-09-17 23:14:15 +00:00
Manman Ren ce48ea7e25 PGO: preserve branch-weight metadata when simplifying Switch
Hanlde the case when we split the default edge if the default target has "icmp"
and unconditinal branch.

llvm-svn: 164076
2012-09-17 23:07:43 +00:00
Andrew Trick 3e5546add7 Fix release build after reverting
llvm-svn: 164075
2012-09-17 23:05:04 +00:00
Jakob Stoklund Olesen 0bb3dd78c4 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.

llvm-svn: 164074
2012-09-17 23:03:25 +00:00
Jakob Stoklund Olesen af50f17df4 Stop adding <imp-def> operands when expanding REG_SEQUENCE.
These extra operands are not needed by register allocators using
VirtRegRewriter, and RAFast don't need them any longer.

By omitting the <imp-def> operands, it becomes possible for the new
register coalescer to track which lanes are valid and which are undef.

llvm-svn: 164073
2012-09-17 23:03:21 +00:00
Andrew Trick 8e7f202e32 Revert r164061-r164067. Most of the new subtarget emitter.
I have to work out the Target/CodeGen header dependencies
before putting this back.

llvm-svn: 164072
2012-09-17 23:00:42 +00:00
Richard Smith 2b006e4231 Remove redundant semicolons to fix -pedantic-errors build break with older Clangs.
llvm-svn: 164071
2012-09-17 22:52:05 +00:00
NAKAMURA Takumi 443c8dd57f llvm/Target/TargetSubtargetInfo.h: Fix case in #include, s#llvm/Codegen/#llvm/CodeGen#.
llvm-svn: 164070
2012-09-17 22:34:56 +00:00
Manman Ren 774246a3a9 PGO: preserve branch-weight metadata when simplifying SwitchOnSelect.
llvm-svn: 164068
2012-09-17 22:28:55 +00:00
Andrew Trick e95e9666ea Don't use NULL as a fake keyword
llvm-svn: 164067
2012-09-17 22:26:34 +00:00
Andrew Trick 692b87c18f InitMCProcessor
llvm-svn: 164066
2012-09-17 22:19:12 +00:00
Andrew Trick f403ee7937 TargetSchedModel API. Implement latency lookup, disabled.
llvm-svn: 164065
2012-09-17 22:19:08 +00:00
Andrew Trick c00f4314ce comment typo
llvm-svn: 164064
2012-09-17 22:19:04 +00:00
Andrew Trick 36e07eb83e TableGen subtarget emitter. Use getSchedClassIdx.
llvm-svn: 164063
2012-09-17 22:19:01 +00:00
Andrew Trick 7a1faa2c8a TableGen subtarget emitter. Generate resolveSchedClass generated hook for resolving instruction variants.
llvm-svn: 164062
2012-09-17 22:18:58 +00:00
Andrew Trick 0923f8183b TableGen subtarget emitter. Initialize MCSubtargetInfo with the new machine model.
llvm-svn: 164061
2012-09-17 22:18:55 +00:00
Andrew Trick a72fca6bec TableGen subtarget emitter. Format and emit data tables for the new machine model.
llvm-svn: 164060
2012-09-17 22:18:50 +00:00
Andrew Trick 9ef0882b72 TableGen subtarget emitter. Generate data tables for the new machine model.
Map the CodeGenSchedule object model onto data tables. The structure
of the data tables is defined in MC, so for convenience we include
MCSchedule.h. The alternative is maintaining a redundant copy of the
table structure definitions. Mapping the object model onto data tables
is sufficiently complicated that it should not be interleaved with
emitting source code. This avoids major problem with the backend for
itinerary generation.

llvm-svn: 164059
2012-09-17 22:18:48 +00:00
Andrew Trick 23f3c65e4b TableGen subtarget emitter. Emit processor resources for the new machine model.
llvm-svn: 164058
2012-09-17 22:18:45 +00:00
Andrew Trick 8fa00f5069 TableGen subtarget parser: Add getProcResourcesIdx().
llvm-svn: 164057
2012-09-17 22:18:43 +00:00
Jan Wen Voung 4ce1d7b4f1 Add some cases to x86 OptimizeCompare to handle DEC and INC, too.
While we are setting the earlier def to true, also make it live.

llvm-svn: 164056
2012-09-17 22:04:23 +00:00
Manman Ren 2d4c10fc49 PGO: preserve branch-weight metadata when simplifying two branches with a common
destination in SimplifyCondBranchToCondBranch.

llvm-svn: 164054
2012-09-17 21:30:40 +00:00
Akira Hatanaka 9068706bb6 Make sure there is enough room for RA. getStackSize needs to be cleaned up but
we will do that when we implement the full save/restore.

Patch by Reed Kotler.

llvm-svn: 164051
2012-09-17 20:02:42 +00:00
Michael Ilseman 4f0e00a5b8 Increase the static sizes of some SmallSets. finalizeBundle() is very frequently called for some backends, and growing into an std::set is overkill for these numbers.
llvm-svn: 164044
2012-09-17 18:31:15 +00:00
Michael Ilseman 3a8336379c whitespace
llvm-svn: 164043
2012-09-17 18:25:23 +00:00
Michael Liao b503b323f3 Fix PR13859
- Preserve the original NOutVT during casting from vector to integer by
  extracting vector elements.

llvm-svn: 164042
2012-09-17 18:05:20 +00:00
Jim Grosbach 4c36349de9 TableGen: Add initializer.
Keep GCC's warnings happy. It can't reason out that the state machine won't
ever hit the potentially uninitialized use in OPC_FilterValue.

llvm-svn: 164041
2012-09-17 18:00:53 +00:00
Bill Wendling 636f1a1d99 s/__llvm_gcov_flush/__gcov_flush/g
llvm-svn: 164040
2012-09-17 17:57:05 +00:00
Benjamin Kramer 0d874f775a LLVM_ATTRIBUTE_USED forces emission of a function. To silence unused function warnings use LLVM_ATTRIBUTE_UNUSED.
llvm-svn: 164036
2012-09-17 16:46:22 +00:00
Benjamin Kramer 02a4dff492 NewSROA: Provide a full set of operator< for ByteRanges.
MSVC8 won't compile lower_bound if one is missing.

llvm-svn: 164035
2012-09-17 16:42:36 +00:00
Axel Naumann 4a1270691e Fix a few vars that can end up being used without initialization.
The cases where no initialization happens should still be checked for logic flaws.

llvm-svn: 164032
2012-09-17 14:20:57 +00:00
Silviu Baranga 7bd2914683 Removed the VMLxForwarding feature for the Cortex-A15 target.
llvm-svn: 164030
2012-09-17 14:10:54 +00:00
Tom Stellard 86af62c1ad Add a MachinePostDominator pass
This is used in the AMDIL and R600 backends.

llvm-svn: 164029
2012-09-17 14:08:37 +00:00
Sid Manning a5a06ea11d Add Michael Spencer's iterator class for stepping through relocations. Add method that, given a symbol index, will return the symbol's data.
llvm-svn: 164026
2012-09-17 12:27:39 +00:00
Nadav Rotem 2ae810a51f Disable the protection from escaped allocas in an attempt to find violating passes. This may break the buildbots. I plan to revert it in a few hours.
llvm-svn: 164024
2012-09-17 10:21:55 +00:00
Craig Topper 77ac52bdcf Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION.
llvm-svn: 164017
2012-09-17 07:16:40 +00:00
Craig Topper f7c99f9f1a Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION.
llvm-svn: 164016
2012-09-17 06:59:23 +00:00
Craig Topper 2663e5a7cd Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION.
llvm-svn: 164015
2012-09-17 06:43:55 +00:00
Craig Topper 9a86e5a35a Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION.
llvm-svn: 164014
2012-09-17 06:31:17 +00:00
Craig Topper de2f3887d7 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.
llvm-svn: 164013
2012-09-17 06:05:39 +00:00
Michael Liao ebeedd0ed6 Fix typo
llvm-svn: 164012
2012-09-17 04:43:39 +00:00
Craig Topper 7fdbd2820e Add include of Compiler.h to fix build bot failures.
llvm-svn: 164009
2012-09-16 21:56:23 +00:00
Craig Topper fa8fe0e289 Add includes of Compiler.h to fix build bot failures.
llvm-svn: 164008
2012-09-16 21:50:09 +00:00
Craig Topper 23c5a8c450 Use LLVM_DELETED_FUNCTION for copy constructors and copy assignment operators that aren't implemented.
llvm-svn: 164007
2012-09-16 21:43:09 +00:00
Craig Topper 5f974ce2c4 Use LLVM_DELETED_FUNCTION for copy constructors and copy assignment operators that aren't implemented.
llvm-svn: 164006
2012-09-16 21:37:56 +00:00
Craig Topper eeb967940e Add LLVM_OVERRIDE and LLVM_FINAL C++11 compatibility macros.
llvm-svn: 164005
2012-09-16 20:53:30 +00:00
Chandler Carruth 9712117a07 Refactor the SROA visitors for partitioning an alloca and building
partition use lists a bit. No functionality changed.

These visitors are actually visiting a tuple of a Use and an offset into
the alloca. However, we use the InstVisitor to handle the dispatch over
the users, and so the Use and Offset are stored in class member
variables and set just before each call to visit(). This is fairly
awkward and makes the functions a bit harder to read, but its the only
real option we have until InstVisitor can be rewritten to use variadic
templates.

However, this pattern shouldn't be followed on the helper member
functions where there is no interface constraint from the visitor. We
already were passing the instruction as a normal parameter rather than
use the Use to get at it, start passing the offset as well. This will
become more important in subsequent patches as the offset will in some
cases change while visiting a single instruction.

llvm-svn: 164003
2012-09-16 19:39:50 +00:00
Craig Topper a583df034a Add 'virtual' keywoards to output file for overridden functions.
llvm-svn: 164002
2012-09-16 18:25:36 +00:00
Craig Topper 462c31b3da Change unsigned to uint32_t to match base class declaration and other targets.
llvm-svn: 164001
2012-09-16 18:10:23 +00:00
Craig Topper 04b4e83cf7 Fix bad comment. No functional change.
llvm-svn: 164000
2012-09-16 16:48:25 +00:00
Craig Topper 8dcaf4998c Add 'virtual' keywoards to output file for overridden functions.
llvm-svn: 163999
2012-09-16 16:35:22 +00:00
Nadav Rotem ae6809b19a Fix the testcase to work on all platforms.
llvm-svn: 163997
2012-09-16 07:58:47 +00:00
Craig Topper f4214c0f85 Add explicit virtual keywords for methods that override base class.
llvm-svn: 163996
2012-09-16 07:39:55 +00:00
Nadav Rotem 37521aa89c The PMOVZXWD family of functions had patterns extends narrow vector types to wide vector types.
It had patterns for zext-loading and extending. This commit adds patterns for loading a wide type, performing a bitcast,
and extending. This is an odd pattern, but it is commonly used when writing code with intrinsics.

rdar://11897677

llvm-svn: 163995
2012-09-16 07:39:07 +00:00
Andrew Trick 04b38b0d97 Guard fields by NDEBUG until they get used in the release build.
llvm-svn: 163993
2012-09-16 05:55:04 +00:00
Craig Topper b5319a0acc Tidy up formatting of some elses on a separate line from preceding bracing. No functional change.
llvm-svn: 163992
2012-09-16 03:00:03 +00:00
Jakob Stoklund Olesen 17e2185543 Add alternative coalescing algorithm under a flag.
The live range of an SSA value forms a sub-tree of the dominator tree.
That means the live ranges of two values overlap if and only if the def
of one value lies within the live range of the other.

This can be used to simplify the interference checking a bit: Visit each
def in the two registers about to be joined. Check for interference
against the value that is live in the other register at the def point
only. It is not necessary to scan the set of overlapping live ranges,
this interference check can be done while computing the value mapping
required for the final live range join.

The new algorithm is prepared to handle more complicated conflict
resolution - We can allow overlapping live ranges with different values
as long as the differing lanes are undef or unused in the other
register.

The implementation in this patch doesn't do that yet, it creates code
that is nearly identical to the old algorithm's, except:

- The new stripCopies() function sees through multiple copies while
  the old RegistersDefinedFromSameValue() only can handle one.

- There are a few rare cases where the new algorithm can erase an
  IMPLICIT_DEF instuction that RegistersDefinedFromSameValue() couldn't
  handle.

llvm-svn: 163991
2012-09-16 02:15:36 +00:00
Jakob Stoklund Olesen 932e3d7e2d 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.

llvm-svn: 163990
2012-09-16 02:15:33 +00:00
Craig Topper 1c0fcdab2e Tidy up trailing whitespace.
llvm-svn: 163988
2012-09-16 01:20:35 +00:00
Craig Topper 4ee5a2d53e Remove unneeded header.
llvm-svn: 163987
2012-09-16 01:18:51 +00:00
Dmitri Gribenko 8d30240939 Fix Doxygen issues: wrap code examples in \code and use \p to refer to
parameters.

llvm-svn: 163984
2012-09-15 20:22:05 +00:00
Craig Topper bc40d7e023 Fix includes of llvm files that used angle brackets.
llvm-svn: 163979
2012-09-15 18:45:38 +00:00
Craig Topper 53d08e4f0c Fix a couple include directives that used angle brackets for llvm files.
llvm-svn: 163978
2012-09-15 18:41:37 +00:00
Craig Topper a60c0f1163 Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.
llvm-svn: 163974
2012-09-15 17:09:36 +00:00
Craig Topper 2ed23ce767 Remove unused private fields to silence -Wunused-private-field.
llvm-svn: 163973
2012-09-15 17:08:51 +00:00
Jakob Stoklund Olesen b7d27a3dd7 Don't depend on kill flags in removeCopyByCommutingDef().
Kill flags are removed more and more aggressively during the register
allocation passes, it is better to get information from LiveIntervals.

llvm-svn: 163972
2012-09-15 16:32:11 +00:00
Jakob Stoklund Olesen d98e6c9fb5 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.

llvm-svn: 163971
2012-09-15 16:29:49 +00:00
Craig Topper 2e6644c260 Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.
llvm-svn: 163970
2012-09-15 16:23:52 +00:00
Craig Topper da386573c7 Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.
llvm-svn: 163969
2012-09-15 16:22:27 +00:00
Benjamin Kramer ed11e35e57 Disable new sroa now that all buildbots have tested it.
What we have so far:
- Some clang test failures (these were known already)

- Perf results are mixed, some big regressions
  http://llvm.org/perf/db_default/v4/nts/3844
  http://llvm.org/perf/db_default/v4/nts/3845

  bullet suffers a lot. matmul is interesting: slower scalar code, faster with -vectorize.

- Some dragonegg selfhost bots crash in SROA during selfhost now
  http://lab.llvm.org:8011/builders/dragonegg-x86_64-linux-gcc-4.6-self-host-checks/builds/1632
  http://lab.llvm.org:8011/builders/dragonegg-x86_64-linux-gcc-4.5-self-host/builds/1891

llvm-svn: 163968
2012-09-15 15:11:10 +00:00
Benjamin Kramer ece434252c X86: Emitting x87 fsin/fcos for sinf/cosf is not safe without unsafe fp math.
This was only an issue if sse is disabled.

llvm-svn: 163967
2012-09-15 12:44:27 +00:00
Chandler Carruth 70b44c5ccf 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.

llvm-svn: 163965
2012-09-15 11:43:14 +00:00
Akira Hatanaka 3e7ba76157 Remove aligned/unaligned load/store fragments defined in MipsInstrInfo.td and
use load/store fragments defined in TargetSelectionDAG.td in place of them.
Unaligned loads/stores are either expanded or lowered to target-specific nodes,
so instruction selection should see only aligned load/store nodes.

No changes in functionality.

llvm-svn: 163960
2012-09-15 01:52:08 +00:00
Craig Topper f8f0a23ce7 Revert r163878 as it breaks on targets with alternate register names. Such targets do not exist in the main tree so this was not noticed.
llvm-svn: 163959
2012-09-15 01:22:42 +00:00
Akira Hatanaka 189d0adde9 Handled unaligned load/stores properly in Mips16
Patch by Reed Kotler.

llvm-svn: 163956
2012-09-15 01:02:03 +00:00
Manman Ren bfb9d435e4 PGO: preserve branch-weight metadata when simplifying two branches with a common
destination.

Updated previous implementation to fix a case not covered:
// PBI: br i1 %x, TrueDest, BB
// BI:  br i1 %y, TrueDest, FalseDest
The other case was handled correctly.
// PBI: br i1 %x, BB, FalseDest
// BI:  br i1 %y, TrueDest, FalseDest

Also tried to use 64-bit arithmetic instead of APInt with scale to simplify the
computation. Let me know if you have other opinions about this.

llvm-svn: 163954
2012-09-15 00:39:57 +00:00
Andrew Trick 1e46d48814 TableGen subtarget parser. Handle new machine model.
Collect processor resources from the subtarget defs.

llvm-svn: 163953
2012-09-15 00:20:02 +00:00
Andrew Trick 33401e8469 TableGen subtarget parser. Handle new machine model.
Infer SchedClasses from variants defined by the target or subtarget.

llvm-svn: 163952
2012-09-15 00:19:59 +00:00
Andrew Trick 766864963b TableGen subtarget parser. Handle new machine model.
Collect SchedClasses and SchedRW types from the subtarget defs.

llvm-svn: 163951
2012-09-15 00:19:57 +00:00
Daniel Dunbar b93a2ceba5 cmake: Fix file path.
llvm-svn: 163950
2012-09-14 23:36:56 +00:00
Daniel Dunbar 9affb245a5 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.

llvm-svn: 163948
2012-09-14 23:15:56 +00:00
Bill Wendling 25cc99fa44 Some small reorganization to get read for Attributes overhaul.
llvm-svn: 163947
2012-09-14 23:05:52 +00:00
Bill Wendling 8d26bc38f5 Remove comment.
llvm-svn: 163945
2012-09-14 22:35:49 +00:00
David Blaikie 21e27ce264 Fix up erroneous alignas usage while making this portable to GCC 4.7
Review by Chandler Carruth.

llvm-svn: 163944
2012-09-14 22:26:11 +00:00
Manman Ren 8691e5220b PGO: preserve branch-weight metadata when simplifying a switch with a single
case to a conditional branch and when removing dead cases.

llvm-svn: 163942
2012-09-14 21:53:06 +00:00
Evan Cheng 71be12b35b Stylistic and 80-col fixes
llvm-svn: 163940
2012-09-14 21:25:34 +00:00
Andrew Trick 46846fcdc8 comment typo
llvm-svn: 163935
2012-09-14 20:27:25 +00:00
Andrew Trick d2a19da1b8 TargetSchedModel interface. To be implemented...
llvm-svn: 163934
2012-09-14 20:26:46 +00:00
Andrew Trick ac36af470c Define MC data tables for the new scheduling machine model.
llvm-svn: 163933
2012-09-14 20:26:41 +00:00
Andrew Trick 39cf40a2ae whitespace
llvm-svn: 163932
2012-09-14 20:26:39 +00:00
Alex Rosenberg af2808cb72 Review feedback from Duncan Sands. Alphabetize includes and simplify
lit config.

llvm-svn: 163928
2012-09-14 19:19:57 +00:00
Manman Ren 5e5049d9a6 Try to fix the bots by detecting inconsistant branch-weight metadata.
llvm-svn: 163926
2012-09-14 19:05:19 +00:00
Andrew Trick 2ac6f7d6f6 Implement getNumLDMAddresses and expose through ARMBaseInstrInfo.
llvm-svn: 163922
2012-09-14 18:48:46 +00:00
Andrew Trick 985dc0dd64 Cortex-A9 instruction-level scheduling machine model.
This models the A9 processor at the level of instruction operands, as
opposed to the itinerary, which models each operation at the level of
pipeline stages.

The two primary motivations are:

1) Allow MachineScheduler to model A9 as an out-of-order processor. It
can now distinguish between hazards that force interlocking vs.
buffered resources.

2) Reduce long-term maintenance by allowing the itinerary and target
hooks to eventually be removed. Note that almost all of the complexity
in the new model exists to model instruction variants, which the
itinerary cannot handle. Instead the scheduler previously relied on
processor-specific target hooks which are incomplete and buggy.

llvm-svn: 163921
2012-09-14 18:31:58 +00:00
Manman Ren d81b8e88e3 PGO: preserve branch-weight metadata when merging two switches where
the default target of the first switch is not the basic block the second switch
is in (PredDefault != BB).

llvm-svn: 163916
2012-09-14 17:29:56 +00:00
Andrew Trick a2733e9549 misched: add a hook for custom DAG postprocessing.
llvm-svn: 163915
2012-09-14 17:22:42 +00:00
Micah Villmow e2da82afe3 Add in comments that explain what the indexing and the size of the arrays is about.
llvm-svn: 163904
2012-09-14 15:36:50 +00:00
Sergei Larin 2db64a7031 DAG post-process for Hexagon MI scheduler
This patch introduces a possibility for Hexagon MI scheduler
to perform some target specific post- processing on the scheduling
DAG prior to scheduling.

llvm-svn: 163903
2012-09-14 15:07:59 +00:00
Dmitri Gribenko 5485acd440 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.

llvm-svn: 163902
2012-09-14 14:57:36 +00:00
Benjamin Kramer 4622cd7edd SROA: Silence unused variable warnings in Release builds.
The NDEBUG hack is ugly, but I see no better solution.

llvm-svn: 163900
2012-09-14 13:08:09 +00:00
Benjamin Kramer 61f6708eee Remove redundant private field.
clang warned about this being unused in Release builds.

llvm-svn: 163899
2012-09-14 12:19:58 +00:00
Chandler Carruth 054a40a4ff Rework the computation of a sub-structure natural type. There were
pointless checks in here, bad asserts, and just confusing code. I've
also added a bit more to the comment to clarify what this function is
really trying to do as it was not obvious to Duncan when studying it.

Thanks to Duncan for helping me dig through the issue.

No real functionality changed here in practical cases, and certainly no
test case. This is just cleanup spotted by inspection.

llvm-svn: 163897
2012-09-14 11:08:31 +00:00
Chandler Carruth 0cc59250d5 Rely on the recursive check for pointer types rather than adding an
explicit check before recursing. A simplification requested by Duncan
during review.

llvm-svn: 163896
2012-09-14 10:30:44 +00:00
Chandler Carruth cabd96cbaa Be a bit more aggressive in bailing out of this routine. Spotted by
inspection by Duncan during review. My suspicion is that we would still
have returned 0 anyways in this case, but doing it sooner is better.

llvm-svn: 163895
2012-09-14 10:30:42 +00:00