Commit Graph

85055 Commits

Author SHA1 Message Date
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