Commit Graph

92765 Commits

Author SHA1 Message Date
Ulrich Weigand 4c44032aa1 [PowerPC] Support extended sc mnemonic
A plain "sc" without argument is supposed to be treated like "sc 0"
by the assembler.  This patch adds a corresponding alias.

Problem reported by Joerg Sonnenberger.

llvm-svn: 183687
2013-06-10 17:19:43 +00:00
Ulrich Weigand aa4a2d71aa [PowerPC] Support branch mnemonics with implied CR0
The extended branch mnemonics are supposed to use an implied CR0
if there is no explicit condition register specified.  This patch
adds extra variants of the mnemonics to this effect.

Problem reported by Joerg Sonnenberger.

llvm-svn: 183686
2013-06-10 17:19:15 +00:00
Ulrich Weigand 397406259e [PowerPC] Use multiclass to generate extended branch mnemonics
This patch removes some redundancy by generating the extended branch
mnemonics via a multiclass.

No change in behaviour expected.

llvm-svn: 183685
2013-06-10 17:18:29 +00:00
Aaron Ballman ab1d27ed67 Silencing an MSVC warning about comparing signed and unsigned values.
llvm-svn: 183682
2013-06-10 16:45:40 +00:00
Rafael Espindola 872b29794e Remove the old IdentifyFileType now that lld was updated.
llvm-svn: 183671
2013-06-10 15:37:29 +00:00
Rafael Espindola 1dc43065a7 Pass a StringRef to sys::identifyFileType.
llvm-svn: 183669
2013-06-10 15:27:39 +00:00
Rafael Espindola 548e9d4834 Fix an out of bounds array access.
We were looking at Magic[5] without checking Length. Since this path would not
return unless Length >= 18 anyway, just move the >= 18 check up.

llvm-svn: 183666
2013-06-10 15:22:18 +00:00
Rafael Espindola 693b4750d1 Update for current naming conventions.
I will change identifyFileType to use a StringRef in the next patch.

llvm-svn: 183664
2013-06-10 14:56:16 +00:00
Amaury de la Vieuville bac917f383 Fix misleading comments in ARMAsmParser
llvm-svn: 183657
2013-06-10 14:17:15 +00:00
Amaury de la Vieuville 43cb13a5c9 ARM: ISB cannot be passed the same options as DMB
ISB should only accepts full system sync, other options are reserved

llvm-svn: 183656
2013-06-10 14:17:08 +00:00
Justin Holewinski b96d1395f6 [NVPTX] Remove old CONST_NOT_GEN address space that is not being used anymore and causes constants to be emitted in the global address space
llvm-svn: 183652
2013-06-10 13:29:47 +00:00
Duncan Sands 340cc5b13d Avoid warnings about unused parameters that tend to come up a lot when
building outside projects with a different compiler than that used to build
LLVM itself (eg switching between gcc and clang).

llvm-svn: 183650
2013-06-10 12:09:30 +00:00
JF Bastien c04341bb34 Add test for ARM FastISel load/store register classes
r183624 fixed an issue that was tested indirectly. Test it directly with this new test.

llvm-svn: 183634
2013-06-10 00:35:57 +00:00
Reed Kotler ce510830c5 Fix a regression I introduced when I expanded the complex pseudos in
the Mips16 port. A few of the psuedos could either take signed
or unsigned arguments and I did not distinguish the case and improperly
rejected some valid cases that the assembler had previously accepted
when they were pure pseudos that expanded as assembly instructions.

llvm-svn: 183633
2013-06-09 23:23:46 +00:00
Benjamin Kramer 58bd79c4b1 tblgen: always lookup values from the original vector as it could be grown under our feet.
PR16281.

llvm-svn: 183630
2013-06-09 15:20:23 +00:00
Benjamin Kramer 1bfb7a3934 Add a const version of findNearestCommonDominator to PostDom for convenience.
PR16283.

llvm-svn: 183629
2013-06-09 15:09:30 +00:00
Logan Chien 1bd6e13b70 Refine the ARM EHABI test cases.
Since we have ARM unwind directive parser and assembler, we
can check the correctness in two stages:

1. From LLVM assembly (.ll) to ARM assembly (.s)
2. From ARM assembly (.s) to ELF object file (.o)

We already have several "*.s to *.o" test cases.  This CL adds
some "*.ll to *.s" test cases and removes the redundant "*.ll to *.o"
test cases.

New test cases to check "*.ll to *.s" code generator:

- ehabi.ll: Check the correctness of the generated unwind directives.
- section-name.ll: Check the section name of functions.

Removed test cases:

- ehabi-mc-cantunwind.ll
  (Covered by ehabi-cantunwind.ll, and eh-directive-cantunwind.s)
- ehabi-mc-compact-pr0.ll
  (Covered by ehabi.ll, eh-compact-pr0.s, eh-directive-save.s, and
   eh-directive-setfp.s)
- ehabi-mc-compact-pr1.ll
  (Covered by ehabi.ll, eh-compact-pr1.s, eh-directive-save.s, and
   eh-directive-setfp.s)
- ehabi-mc.ll
  (Covered by ehabi.ll, and eh-directive-integrated-test.s)
- ehabi-mc-section-group.ll
  (Covered by section-name.ll, and eh-directive-section-comdat.s)
- ehabi-mc-section.ll
  (Covered by section-name.ll, and eh-directive-section.s)
- ehabi-mc-sh_link.ll
  (Covered by eh-directive-text-section.s, and eh-directive-section.s)

llvm-svn: 183628
2013-06-09 12:36:57 +00:00
Logan Chien 325823a189 Fix ARM unwind opcode assembler in several cases.
Changes to ARM unwind opcode assembler:

* Fix multiple .save or .vsave directives.  Besides, the
  order is preserved now.

* For the directives which will generate multiple opcodes,
  such as ".save {r0-r11}", the order of the unwind opcode
  is fixed now, i.e. the registers with less encoding value
  are popped first.

* Fix the $sp offset calculation.  Now, we can use the
  .setfp, .pad, .save, and .vsave directives at any order.

Changes to test cases:

* Add test cases to check the order of multiple opcodes
  for the .save directive.

* Fix the incorrect $sp offset in the test case.  The
  stack pointer offset specified in the test case was
  incorrect.  (Changed test cases: ehabi-mc-section.ll and
  ehabi-mc.ll)

* The opcode to restore $sp are slightly reordered.  The
  behavior are not changed, and the new output is same
  as the output of GNU as.  (Changed test cases:
  eh-directive-pad.s and eh-directive-setfp.s)

llvm-svn: 183627
2013-06-09 12:22:30 +00:00
Elena Demikhovsky 89703c06f2 Removed PackedDouble domain from scalar instructions. Added more formats for the scalar stuff.
llvm-svn: 183626
2013-06-09 07:37:10 +00:00
Tim Northover 64280fbba1 Make DeadArgumentElimination more conservative on variadic functions
Variadic functions are particularly fragile in the face of ABI changes, so this
limits how much the pass changes them

llvm-svn: 183625
2013-06-09 02:17:27 +00:00
JF Bastien 652fa6a8b2 ARM FastISel fix load register classes
The register classes when emitting loads weren't quite restricting enough, leading to MI verification failure on the result register.

These are new failures that weren't there the first time I tried enabling ARM FastISel for new targets.

llvm-svn: 183624
2013-06-09 00:20:24 +00:00
David Majnemer 0fc8670cb0 TargetLowering: Clean up method description comments
llvm-svn: 183623
2013-06-08 23:51:45 +00:00
Aaron Ballman f0b5384ef9 sys::process::get_id() now returns the process ID instead of a process handle on Windows. Patch thanks to Kim Gräsman!
llvm-svn: 183621
2013-06-08 20:29:03 +00:00
Venkatraman Govindaraju 7dae9ce021 [Sparc] Delete FPMover Pass and remove Fp* Pseudo-instructions from Sparc backend.
llvm-svn: 183613
2013-06-08 15:32:59 +00:00
Amaury de la Vieuville f4ec0c8510 ARM: fix VMOVvnf32 decoding when ambiguous with VCVT
Enforce Table A7-15 (op=1, cmode=0b111) -> UNDEF

llvm-svn: 183612
2013-06-08 13:54:05 +00:00
Amaury de la Vieuville 68bcd021fd ARM: enforce SRS decoding constraints
llvm-svn: 183611
2013-06-08 13:43:59 +00:00
Amaury de la Vieuville 631df63e54 ARM: fix CPS decoding when ambiguous with QADD
Handle the case when the disassembler table can't tell
the difference between some encodings of QADD and CPS.

Add some necessary safe guards in CPS decoding as well.

llvm-svn: 183610
2013-06-08 13:38:52 +00:00
Amaury de la Vieuville ea7bb57058 ARM: fix VCVT decoding
UNPRED was reported instead of UNDEF

llvm-svn: 183608
2013-06-08 13:29:11 +00:00
Logan Chien 855b17d1bc Update code listings in LLVM tutorial.
Several LLVM headers are moved.  The code listings in
LLVM tutorial are not updated yet.

This CL removes the code replica in the .rst, and replace
them with a literalinclude directive, so that sphinx can
include the latest code automatically.

llvm-svn: 183607
2013-06-08 09:03:03 +00:00
Shuxin Yang 140d592d84 Fix a potential bug in r183584.
r183584 tries to derive some info from the code *AFTER* a call and apply
these derived info to the code *BEFORE* the call, which is not always safe
as the call in question may never return, and in this case, the derived
info is invalid.
  
  Thank Duncan for pointing out this potential bug.

rdar://14073661 

llvm-svn: 183606
2013-06-08 04:56:05 +00:00
Sean Silva 4bf5c4b746 Don't artifically restrict input object size.
sys::IdentifyFileType is already conscious of the length, and
object_error::invalid_file_type is returned below anyway if
sys::IdentifyFileType doesn't recognize the file.

llvm-svn: 183605
2013-06-08 04:32:59 +00:00
JF Bastien 60a2442476 Fix unused variable warning from my previous patch.
llvm-svn: 183601
2013-06-08 00:51:51 +00:00
Akira Hatanaka ae9d8e21d6 [mips] Use a helper function which compares the size of the source and
destination operands of an instruction.

No functionality changes.

llvm-svn: 183596
2013-06-08 00:14:54 +00:00
Quentin Colombet 249cb6756c Reapply r183552. This time, use a standard type for the option to avoid template
instantiation issue with non-standard type.

Add a backend option to warn on a given stack size limit.
Option: -mllvm -warn-stack-size=<limit>
Output (if limit is exceeded):
warning: Stack size limit exceeded (<actual size>) in <functionName>.

The longer term plan is to hook that to a clang warning.
PR:4072
<rdar://problem/13987214>.

llvm-svn: 183595
2013-06-08 00:07:54 +00:00
Vincent Lejeune d1a9d18120 R600: Use a refined heuristic to choose when switching clause
This is using a hint from AMD APP OpenCL Programming Guide with
empirically tweaked parameters.
I used Unigine Heaven 3.0 to determine best parameters on my system
(i7 2600/Radeon 6950/Kernel 3.9.4) the benchmark :
it went from 38.8 average fps to 39.6, which is ~3% gain.
(Lightmark 2008.2 gain is much more marginal: from 537 to 539)

There is no lit test provided as the parameter were determined
empirically and it it would be nearly impossiblet to find a test
program that check for optimal behavior.

llvm-svn: 183593
2013-06-07 23:30:34 +00:00
Vincent Lejeune 4d143328df R600: Anti dep better handled in tex clause
llvm-svn: 183592
2013-06-07 23:30:26 +00:00
Jakob Stoklund Olesen fdc9d0a991 Remember the anyext patterns.
llvm-svn: 183589
2013-06-07 22:59:29 +00:00
Jakob Stoklund Olesen 9f812b97ba Add missing zextloadi1 to i64 patterns. PR16721.
llvm-svn: 183587
2013-06-07 22:55:05 +00:00
Shuxin Yang bd254f2601 Fix an assertion in MemCpyOpt pass.
The MemCpyOpt pass is capable of optimizing:
      callee(&S); copy N bytes from S to D.
    into:
      callee(&D);
subject to some legality constraints. 

  Assertion is triggered when the compiler tries to evalute "sizeof(typeof(D))",
while D is an opaque-typed, 'sret' formal argument of function being compiled.
i.e. the signature of the func being compiled is something like this:
  T caller(...,%opaque* noalias nocapture sret %D, ...)

  The fix is that when come across such situation, instead of calling some
utility functions to get the size of D's type (which will crash), we simply
assume D has at least N bytes as implified by the copy-instruction.

rdar://14073661 

llvm-svn: 183584
2013-06-07 22:45:21 +00:00
Hal Finkel fa5f6f7440 Disallow i64 div/rem in PPC32 counter loops
On PPC32, [su]div,rem on i64 types are transformed into runtime library
function calls. As a result, they are not allowed in counter-based loops (the
counter-loops verification pass caught this error; this change fixes PR16169).

llvm-svn: 183581
2013-06-07 22:16:19 +00:00
Quentin Colombet bd5a201c85 Revert commits related to stack warning.
llvm-svn: 183579
2013-06-07 22:14:50 +00:00
Quentin Colombet 9b08a0df1c Explicit triple in warn stack size test cases to not depend on OS.
llvm-svn: 183574
2013-06-07 21:09:42 +00:00
Bill Wendling 999dacc55b Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

No functionality change intended.

llvm-svn: 183572
2013-06-07 21:04:35 +00:00
Bill Wendling 8f26840c5a Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

No functionality change intended.

llvm-svn: 183571
2013-06-07 21:00:34 +00:00
Bill Wendling 52ca447fdd Remove unused c'tor.
llvm-svn: 183570
2013-06-07 20:59:31 +00:00
Tom Stellard d74583777f R600: Fix calculation of stack offset in AMDGPUFrameLowering
We weren't computing structure size correctly and we were relying on
the original alloca instruction to compute the offset, which isn't
always reliable.

Reviewed-by: Vincent Lejeune <vljn@ovi.com>
llvm-svn: 183568
2013-06-07 20:52:05 +00:00
Bill Wendling 637d97dd51 Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

No functionality change intended.

llvm-svn: 183567
2013-06-07 20:42:15 +00:00
Tom Stellard a6c6e1bfc2 R600: Rework subtarget info and remove AMDILDevice classes
This should simplify the subtarget definitions and make it easier to
add new ones.

Reviewed-by: Vincent Lejeune <vljn@ovi.com>
llvm-svn: 183566
2013-06-07 20:37:48 +00:00
Bill Wendling 6235c06ff8 Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

No functionality change intended.

llvm-svn: 183565
2013-06-07 20:35:25 +00:00
Rui Ueyama 1b0a949482 [docs] Add link to Microsoft PE/COFF Spec.
llvm-svn: 183562
2013-06-07 20:30:27 +00:00
Bill Wendling 37e9adb091 Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

No functionality change intended.

llvm-svn: 183561
2013-06-07 20:28:55 +00:00
Tom Stellard 3498e4ff1d R600: Fix the fetch limits for R600 generation GPUs
Reviewed-by: Vincent Lejeune <vljn@ovi.com>

https://bugs.freedesktop.org/show_bug.cgi?id=64257

llvm-svn: 183560
2013-06-07 20:28:55 +00:00
Tom Stellard 99792774a4 R600: Move Subtarget feature definitions into AMDGPU.td
This is the convention used by the other targets.

Reviewed-by: Vincent Lejeune <vljn@ovi.com>
llvm-svn: 183559
2013-06-07 20:28:49 +00:00
Tom Stellard b0804ec2ad R600: Remove unnecessary include
Reviewed-by: Vincent Lejeune <vljn@ovi.com>
llvm-svn: 183558
2013-06-07 20:28:43 +00:00
Eli Bendersky 0220e6bd85 Add more explicit link targets to headers in LangRef.rst
llvm-svn: 183555
2013-06-07 20:24:43 +00:00
Quentin Colombet 6baf581b93 Add a backend option to warn on a given stack size limit.
Option: -mllvm -warn-stack-size=<limit>
Output (if limit is exceeded):
warning: Stack size limit exceeded (<actual size>) in <functionName>.

The longer term plan is to hook that to a clang warning.
PR:4072
<rdar://problem/13987214>

llvm-svn: 183552
2013-06-07 20:18:12 +00:00
JF Bastien 06ce03d141 ARM FastISel integer sext/zext improvements
My recent ARM FastISel patch exposed this bug:
  http://llvm.org/bugs/show_bug.cgi?id=16178
The root cause is that it can't select integer sext/zext pre-ARMv6 and
asserts out.

The current integer sext/zext code doesn't handle other cases gracefully
either, so this patch makes it handle all sext and zext from i1/i8/i16
to i8/i16/i32, with and without ARMv6, both in Thumb and ARM mode. This
should fix the bug as well as make FastISel faster because it bails to
SelectionDAG less often. See fastisel-ext.patch for this.

fastisel-ext-tests.patch changes current tests to always use reg-imm AND
for 8-bit zext instead of UXTB. This simplifies code since it is
supported on ARMv4t and later, and at least on A15 both should perform
exactly the same (both have exec 1 uop 1, type I).

2013-05-31-char-shift-crash.ll is a bitcode version of the above bug
16178 repro.

fast-isel-ext.ll tests all sext/zext combinations that ARM FastISel
should now handle.

Note that my ARM FastISel enabling patch was reverted due to a separate
failure when dealing with MCJIT, I'll fix this second failure and then
turn FastISel on again for non-iOS ARM targets.

I've tested "make check-all" on my x86 box, and "lnt test-suite" on A15
hardware.

llvm-svn: 183551
2013-06-07 20:10:37 +00:00
Benjamin Kramer 705d841bb6 R600: Don't compare iterators of different maps.
Found be libstdc's debug mode.

llvm-svn: 183549
2013-06-07 19:59:34 +00:00
Eli Bendersky fdc529ad95 Add explicit link targets to some headers in LangRef.rst
llvm-svn: 183548
2013-06-07 19:40:08 +00:00
Manman Ren 95429cde58 No functionality change.
Constify a few member functions.

llvm-svn: 183546
2013-06-07 18:53:29 +00:00
Quentin Colombet ba366011c8 Teach AsmPrinter how to print odd constants.
Fix an assertion when the compiler encounters big constants whose bit width is
not a multiple of 64-bits.
Although clang would never generate something like this, the backend should be
able to handle any legal IR.

<rdar://problem/13363576>

llvm-svn: 183544
2013-06-07 18:36:03 +00:00
Manman Ren 3c6acec02a DIBuilder: No functionality change.
Use the correct DIType when creating types in DIBuilder.

llvm-svn: 183543
2013-06-07 18:35:53 +00:00
Benjamin Kramer ebe0be9ca4 Vincent says the element is at most once in the vector, so we don't need a full std::remove.
llvm-svn: 183541
2013-06-07 18:18:12 +00:00
Rafael Espindola 8d477dc08f Use isxdigit.
Thanks to Benjamin Kramer for the suggestion.

llvm-svn: 183540
2013-06-07 18:05:03 +00:00
Rafael Espindola a8d766d6fd Make operator== non-member for greater symmetry.
Thanks to David Blaikie for the suggestion.

llvm-svn: 183539
2013-06-07 18:00:04 +00:00
Roman Divacky 158d8069ad Fix a typo in asm string of BP* family of instructions. With this fix
I am able to compile/assemble/link/run /bin/echo from FreeBSD.

llvm-svn: 183537
2013-06-07 17:46:57 +00:00
Rui Ueyama 6d0004cd78 [Object/COFF] BaseOfData field should be absent in PE32+.
llvm-svn: 183534
2013-06-07 16:58:30 +00:00
Rafael Espindola aad6c24422 Support OpenBSD's native frame protection conventions.
OpenBSD's stack smashing protection differs slightly from other
platforms:

  1. The smash handler function is "__stack_smash_handler(const char
     *funcname)" instead of "__stack_chk_fail(void)".

  2. There's a hidden "long __guard_local" object that gets linked
     into each executable and DSO.

Patch by Matthew Dempsky.

llvm-svn: 183533
2013-06-07 16:35:57 +00:00
Benjamin Kramer a857fe115b R600: Fix a potential iterator invalidation issue.
As a bonus this reduces the loop from O(n^2) to O(n).

llvm-svn: 183532
2013-06-07 16:13:49 +00:00
Vincent Lejeune 931bb768fd R600: Remove an extra break in R600OptimizeVectorRegisters.cpp
llvm-svn: 183528
2013-06-07 15:44:53 +00:00
Alexey Samsonov 35c987dc11 [llvm-symbolizer] rewrite r183213 in a more clear way
llvm-svn: 183526
2013-06-07 15:25:27 +00:00
Benjamin Kramer 9675a0dbec BitVector: Do the right thing in all() when Size is a multiple of BITWORD_SIZE.
llvm-svn: 183525
2013-06-07 15:14:31 +00:00
Benjamin Kramer 2566e0498c Optimize BitVector::all().
llvm-svn: 183521
2013-06-07 14:14:38 +00:00
Benjamin Kramer f0ec199448 Fold variable that's only used in assert into the assert.
Avoids unused variable warnings in Release builds.

llvm-svn: 183512
2013-06-07 11:23:35 +00:00
Bill Wendling ee30e83ca8 Add a script to help us create source tar balls for the release.
llvm-svn: 183509
2013-06-07 11:15:30 +00:00
Bill Wendling e82e1ff8e6 Use proper exit code.
llvm-svn: 183508
2013-06-07 11:14:37 +00:00
Duncan Sands e0a607e376 Correct wrong register in this example, pointed out by Baoshan Pang.
llvm-svn: 183495
2013-06-07 08:30:55 +00:00
Bill Wendling 5e7656bf0c Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

No functionality change intended.

llvm-svn: 183494
2013-06-07 07:55:53 +00:00
Bill Wendling ead89ef63e Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

llvm-svn: 183493
2013-06-07 07:04:14 +00:00
Bill Wendling f535821364 Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

llvm-svn: 183492
2013-06-07 06:30:15 +00:00
Bill Wendling 90bee83c38 Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

llvm-svn: 183491
2013-06-07 06:26:43 +00:00
Bill Wendling 4a7a408eaa Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

llvm-svn: 183490
2013-06-07 06:19:56 +00:00
Michael Gottesman 9e7261c874 [objc-arc] Ensure that the cfg path count does not overflow when we multiply TopDownPathCount/BottomUpPathCount.
rdar://12480535

llvm-svn: 183489
2013-06-07 06:16:49 +00:00
Bill Wendling f95178e679 Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

llvm-svn: 183488
2013-06-07 05:54:19 +00:00
Bill Wendling 496dc33b9f Don't cache the instruction info and register info objects.
These objects are internal to the TargetMachine object and may change.

llvm-svn: 183485
2013-06-07 05:00:11 +00:00
Manman Ren 60711600da DIBuilder: No functionality change.
Use the correct DIType when creating vector types.

llvm-svn: 183484
2013-06-07 03:13:46 +00:00
Arnold Schwaighofer c5893da32d ARM sched model: Use the right resources for DIV
llvm-svn: 183477
2013-06-07 01:16:15 +00:00
Arnold Schwaighofer 5f0a2ce542 ARM sched model: Add VFP div instruction on Swift
Reapply 183271.

llvm-svn: 183472
2013-06-07 01:10:36 +00:00
Arnold Schwaighofer f84a03a589 CodeGenSchedule: Use resize instead of copying a vector
llvm-svn: 183465
2013-06-07 00:04:30 +00:00
Arnold Schwaighofer a30936a33b ARM sched model: Add SIMD/VFP load/store instructions on Swift
Reapply 183270 again (because three is a magic number).

This should now no longer seg fault after r183459.

llvm-svn: 183464
2013-06-07 00:04:28 +00:00
Venkatraman Govindaraju dc82ac0dcc [Sparc]: Use cmp instruction instead of subcc to compare integers.
llvm-svn: 183463
2013-06-07 00:03:36 +00:00
Jakub Staszak 96ff4d6d3b Simplify code. No functionality change.
llvm-svn: 183461
2013-06-06 23:34:59 +00:00
Jakub Staszak 7df67fced7 Remove unneeded #include.
llvm-svn: 183460
2013-06-06 23:34:11 +00:00
Arnold Schwaighofer 3bd2524b60 CodeGenSchedule: smallvector.push_back(smallvector[0]) is dangerous
The element passed to push_back is not copied before the vector reallocates.
The client needs to copy the element first before passing it to push_back.

No test case, will be tested by follow-up swift scheduler model change (it
segfaults without this change).

llvm-svn: 183459
2013-06-06 23:23:14 +00:00
Vincent Lejeune 0030362ed9 R600: Rewrite an awkward loop in R600MachineScheduler
llvm-svn: 183458
2013-06-06 23:08:32 +00:00
Nadav Rotem 99e529ea3c Jeffrey Yasskin volunteered to benchmark the vectorizer on -O2 or -Os when compiling chrome. This patch adds a new flag to enable vectorization on all levels and not only on -O3. It should go away once we make a decision.
llvm-svn: 183456
2013-06-06 22:35:47 +00:00
David Blaikie b272a75328 Fix break in r183446 - helps to increment the iterator in a loop
llvm-svn: 183454
2013-06-06 22:28:26 +00:00
Arnold Schwaighofer e5f6a8f649 Revert "ARM sched model: Add SIMD/VFP load/store instructions on Swift"
Breaks linux build bots (I thought the problem was something else).

llvm-svn: 183447
2013-06-06 21:08:18 +00:00
David Blaikie 36d5d2f08d Debug Info: simplify parameter ordering preservation
Seems we emit the parameter ordering number (spuriously named 'arg
number') in the debug info, so there's no need to search through the
variable list to figure out the parameter ordering. This implementation
does 'always' do the work, even in non-optimized debug info (the
previous implementation checked the existence of the 'variables' list on
the subprogram which is only present in optimized builds).

No intended functionality change.

llvm-svn: 183446
2013-06-06 21:04:51 +00:00
Arnold Schwaighofer cfe830dc52 ARM sched model: Add SIMD/VFP load/store instructions on Swift
Reapply 183270.

llvm-svn: 183445
2013-06-06 21:02:18 +00:00
Kevin Enderby fb5bddfd0a Move the test for the data in code into the ARM directory as it is an ARM
binary that is used for the test.  Caught by Jim Grosbach!

rdar://11791371

llvm-svn: 183442
2013-06-06 20:28:28 +00:00
Arnold Schwaighofer eac54473dd ARM sched model: Add integer VFP/SIMD instructions on Swift
Reapply 183269.

llvm-svn: 183441
2013-06-06 20:26:18 +00:00
Jakub Staszak bddea11bc5 Re-apply "Use IRBuilder instead of ConstantInt methods." with the fixed issues.
llvm-svn: 183439
2013-06-06 20:18:46 +00:00
Arnold Schwaighofer dff8e4c488 ARM sched model: Add integer load/store instructions on Swift
Reapply 183268.

llvm-svn: 183438
2013-06-06 20:11:56 +00:00
Arnold Schwaighofer 41a7b06888 ARM sched model: Add integer arithmetic instructions on Swift
Reapply 183267.

llvm-svn: 183436
2013-06-06 19:49:46 +00:00
Arnold Schwaighofer 57142859e1 ARM sched model: Cortex A9 - More InstRW sched resources
Add more InstRW mappings.

Reapply 183266.

llvm-svn: 183435
2013-06-06 19:30:21 +00:00
Rafael Espindola 932470bcd9 Add a testcase from pr16244.
llvm-svn: 183433
2013-06-06 19:15:23 +00:00
Arnold Schwaighofer f1395b695e ARM sched model: Add branch thumb instructions
Reapply 183265.

llvm-svn: 183432
2013-06-06 18:51:01 +00:00
Arnold Schwaighofer 10ccc99c53 ARM sched model: Add branch thumb2 instructions
Reapply 183264.

llvm-svn: 183430
2013-06-06 18:42:09 +00:00
Arnold Schwaighofer 91d4ee3759 ARM sched model: Add branch instructions
Reapply 183263.

llvm-svn: 183428
2013-06-06 18:21:13 +00:00
Arnold Schwaighofer 577279778e ARM sched model: Add preload thumb2 instructions
Reapply 183262.

llvm-svn: 183427
2013-06-06 18:06:30 +00:00
Jakub Staszak 8f58b730ab Remove unimplemented definition. Found using [-Wunused-member-function].
llvm-svn: 183426
2013-06-06 17:52:45 +00:00
Arnold Schwaighofer 1b41330460 ARM sched model: Add preload instructions
Reapply 183261.

llvm-svn: 183425
2013-06-06 17:26:12 +00:00
Kevin Enderby 273ae01b03 Teach llvm-objdump with the -macho parser how to use the data in code table
from the LC_DATA_IN_CODE load command.  And when disassembling print
the data in code formatted for the kind of data it and not disassemble those
bytes.

I added the format specific functionality to the derived class MachOObjectFile
since these tables only appears in Mach-O object files. This is my first
attempt to modify the libObject stuff so if folks have better suggestions
how to fit this in or suggestions on the implementation please let me know.

rdar://11791371

llvm-svn: 183424
2013-06-06 17:20:50 +00:00
Arnold Schwaighofer 654649dd0b ARM sched model: Add more ALU and CMP thumb instructions
Reapply of 183260.

llvm-svn: 183423
2013-06-06 17:03:13 +00:00
Rafael Espindola a7bbc0b740 Revert "Use IRBuilder instead of ConstantInt methods. It simplifies code a little bit."
This reverts commit 183328. It caused pr16244 and broke the bots.

llvm-svn: 183422
2013-06-06 17:03:05 +00:00
Arnold Schwaighofer 972ce4778f ARM sched model: Add more ALU and CMP thumb2 instructions
Reapply of 183259.

llvm-svn: 183421
2013-06-06 16:35:25 +00:00
Vincent Lejeune 54476a1503 R600: Remove leftover code in R600MachineScheduler.cpp
Spotted by Benjamin Kramer.

llvm-svn: 183413
2013-06-06 14:18:29 +00:00
Rafael Espindola e2e741ecdd Print symbol names in relocations when dumping COFF as YAML.
llvm-svn: 183403
2013-06-06 13:06:17 +00:00
Bill Wendling b91216817f Cast to the correct type. Pointer, not reference.
llvm-svn: 183385
2013-06-06 05:39:29 +00:00
NAKAMURA Takumi 4a8f079371 R600OptimizeVectorRegisters.cpp: Tweak a warning. [-Wsometimes-uninitialized]
FIXME: Is it false alarm?
llvm-svn: 183371
2013-06-06 02:15:12 +00:00
NAKAMURA Takumi e5555fc238 R600OptimizeVectorRegisters.cpp: Suppress a warning. [-Wunused-variable]
llvm-svn: 183370
2013-06-06 02:15:06 +00:00
NAKAMURA Takumi 372574d447 Trailing linefeed.
llvm-svn: 183369
2013-06-06 02:15:00 +00:00
Bill Wendling e410576865 Cast to the proper type.
llvm-svn: 183365
2013-06-06 01:04:21 +00:00
Jakub Staszak 9de494e0ee Remove unneeded cast<>.
llvm-svn: 183363
2013-06-06 00:49:57 +00:00
Sean Silva 81f83ad93d Add some class documentation to BinaryRef.
llvm-svn: 183362
2013-06-06 00:47:12 +00:00
Bill Wendling f77190855d Cache the TargetLowering info object as a pointer.
Caching it as a pointer allows us to reset it if the TargetMachine object
changes.

llvm-svn: 183361
2013-06-06 00:43:09 +00:00
Jakub Staszak 461d1fe6fc Use IRBuilder instead of ConstantInt methods.
llvm-svn: 183360
2013-06-06 00:37:23 +00:00
Bill Wendling 8db01cb262 Don't cache the TargetLoweringInfo object inside of the FunctionLowering object.
The TargetLoweringInfo object is owned by the TargetMachine. In the future, the
TargetMachine object may change, which may also change the TargetLoweringInfo
object.

llvm-svn: 183356
2013-06-06 00:11:39 +00:00
Sean Silva 2d73d15f83 Rename operator== parameter to `RHS`.
The previous name `Ref` is overly generic.

llvm-svn: 183354
2013-06-05 23:58:14 +00:00
Sean Silva 7ea7d76b72 Remove error-prone methods of BinaryRef.
A user shouldn't care about the internal state, and these methods by
their very nature require asserting a predicate on the internal state.
As such, they cannot be used safely without introducing hidden
long-distance dependencies on the manner of construction of the
BinaryRef.

Use writeAsBinary(raw_ostream &) and writeAsHex(raw_ostream &) if you
need to access the data in a binary or hex format.

llvm-svn: 183353
2013-06-05 23:55:26 +00:00
Sean Silva 42fa38f55b Add writeAsHex(raw_ostream &) method to BinaryRef.
This hides the implementation. A future commit will remove the
error-prone getHex() and getBinary() methods.

llvm-svn: 183352
2013-06-05 23:47:23 +00:00
Tom Stellard acec99c948 R600: Replace predicate loop with predicate function
llvm-svn: 183351
2013-06-05 23:39:50 +00:00
Sean Silva b7e82adb72 Rename BinaryRef::isBinary to more descriptive DataIsHexString.
And add a doxygen comment.

llvm-svn: 183350
2013-06-05 23:32:31 +00:00
Sean Silva 5fbb154d04 Add BinaryRef binary_size() method.
This avoids making assumptions about the data representation.

llvm-svn: 183349
2013-06-05 23:32:27 +00:00
Sean Silva b4e21201d7 Comment BinaryRef::Data.
Also, state an invariant.

llvm-svn: 183348
2013-06-05 23:32:23 +00:00
Bill Wendling 6fd15ca02e Add space to assert message.
llvm-svn: 183346
2013-06-05 23:13:26 +00:00
Sean Silva 23f3b82790 Add writeAsBinary(raw_ostream &) method to BinaryRef.
Previously, yaml2coff.cpp had a writeHexData static helper function to
do this, but it is generally useful functionality.

Also, validate hex strings up-front to avoid running having to handle
errors "deep inside" the yaml2obj code (it also gives better diagnostics
than it used to).

llvm-svn: 183345
2013-06-05 22:59:00 +00:00
Vincent Lejeune dec1875207 R600: Add a pass that merge Vector Register
Previously commited @183279 but tests were failing, reverted @183286
It was broken because @183336 was missing, now it's there.

llvm-svn: 183343
2013-06-05 21:38:04 +00:00
Sean Silva 69fd257802 [docs] Add link to C++ ABI document.
llvm-svn: 183342
2013-06-05 21:11:16 +00:00
Sean Silva ce4bb3cb12 [docs] Add link to SysV ABI document.
llvm-svn: 183341
2013-06-05 21:11:11 +00:00
Sean Silva 23bcd0ad81 [ELF] Add ELFOSABI_GNU.
ELFOSABI_LINUX is a historical alias for ELFOSABI_GNU according to
<http://www.sco.com/developers/gabi/latest/ch4.eheader.html>.

llvm-svn: 183339
2013-06-05 20:55:58 +00:00
Rafael Espindola 7c346c2cc9 Don't hide the first ELF symbol.
The first symbol on ELF is dummy, but it has a defined content and readelf
normally displays it. With this change llvm-readobj also displays it and we
can check that llvm-mc output is correct according to the standard.

llvm-svn: 183337
2013-06-05 20:33:54 +00:00
Vincent Lejeune 4b5b849753 R600: Schedule copy from phys register at beginning of block
It allows regalloc pass to remove them by trivially assigning associated reg

llvm-svn: 183336
2013-06-05 20:27:35 +00:00
Sean Silva 3b76e4044b yaml2obj: split out COFF logic into separate file
llvm-svn: 183335
2013-06-05 19:56:47 +00:00
Akira Hatanaka da4496c860 [mips] brcond + setgt/setugt instruction selection patterns.
llvm-svn: 183334
2013-06-05 19:49:55 +00:00
Sean Silva 741cebbea0 yaml2obj: add -format=<fmt> to choose input YAML interpretation
See the comment in yaml2obj.cpp for why this is currently needed.
Eventually we can get rid of this, but for now it is needed in order to
make forward progress with adding ELF support, and should be
straightforward to remove later.

Also, preserve the default of COFF, to avoid breaking existing tests.
This policy can easily be changed later though.

llvm-svn: 183332
2013-06-05 18:51:34 +00:00
Jakub Staszak 2f390b755a Use IRBuilder instead of ConstantInt methods. It simplifies code a little bit.
llvm-svn: 183328
2013-06-05 18:27:02 +00:00
Michael Liao 00b20cc924 [PATCH] Fix VGATHER* operand constraints
Add earlyclobber constaints to prevent input register being allocated as
the output register because, according to Intel spec [1], "If any pair
of the index, mask, or destination registers are the same, this
instruction results a UD fault."

---
[1] http://software.intel.com/sites/default/files/319433-014.pdf

llvm-svn: 183327
2013-06-05 18:12:26 +00:00
Rafael Espindola 4e75df1560 Represent symbols with a SymbolIndex,SectionIndex pair.
With this patch we use the SectionIndex directly, instead of counting the
number of symbol tables. This saves a DenseMap lookup every time we want to
find which symbol a relocation refers to.

Also simplify based on the fact that there is at most one SHT_SYMTAB and one
SHT_DYNSYM.

llvm-svn: 183326
2013-06-05 17:54:19 +00:00
Arnold Schwaighofer 81910d0ee1 ARM sched model: Add more ALU and CMP instructions
Reapply of 183258.

llvm-svn: 183321
2013-06-05 16:36:51 +00:00
Arnold Schwaighofer 2773f1deb4 ARM sched model: Add divsion, loads, branches, vfp cvt
Add some generic SchedWrites and assign resources for Swift and Cortex A9.

Reapply of r183257. (Removed empty InstRW for division on swift)

llvm-svn: 183319
2013-06-05 16:06:11 +00:00
Arnold Schwaighofer e937592ef2 ARMInstrInfo: Improve isSwiftFastImmShift
An instruction with less than 3 inputs is trivially a fast immediate shift.

Reapply of 183256, should not have caused the tablegen segfault on linux either.

llvm-svn: 183314
2013-06-05 14:59:36 +00:00
Arnold Schwaighofer 218f6d8f59 SubtargetEmitter fix
Don't output data if we are supposed to ignore the record.

Reapply of 183255, I don't think this was causing the tablegen segfault on linux
testers.

llvm-svn: 183311
2013-06-05 14:06:50 +00:00
Mihai Popa 0e9892fe3a This is a simple patch that changes RRX and RRXS to accept all registers as operands.
According to the ARM reference manual, RRX(S) have defined encodings for lr, pc and sp.

llvm-svn: 183307
2013-06-05 13:23:51 +00:00
Sylvestre Ledru 15a5eea3a1 The GNU/HURD is also using the libc. Therefor, endian.h should be included, not machine/endian.h. See full build log https://buildd.debian.org/status/fetch.php?pkg=llvm-toolchain-3.3&arch=hurd-i386&ver=1%3A3.3~%2Brc3-1~exp1&stamp=1370358869
llvm-svn: 183303
2013-06-05 09:17:26 +00:00
Andrew Trick 78a085170a Fix a tblgen subtargetemitter bug, for future Swift support.
This fixes some of the ridiculously complex code for optimizing the
machine model tables that are shared among all processors of a given
target. A9 and Swift both use the "special" feature that maps old
itinerary classes to new machine model defs. They map different
overlapping subsets of instructions, which wasn't handled correctly.

llvm-svn: 183302
2013-06-05 06:55:20 +00:00
David Blaikie 6f1a8067fb PR15662: Optimized debug info produces out of order function parameters
When a function is inlined we lazily construct the variables
representing the function's parameters. After that, we add any remaining
unused parameters.

If the function doesn't use all the parameters, or uses them out of
order, then the DWARF would produce them in that order, producing a
parameter order that doesn't match the source.

This fix causes us to always keep the arg variables at the start of the
variable list & in the original order from the source.

llvm-svn: 183297
2013-06-05 05:39:59 +00:00
Tom Stellard aad5376fb6 R600: Make sure to schedule AR register uses and defs in the same clause
Reviewed-by: vljn at ovi.com
llvm-svn: 183294
2013-06-05 03:43:06 +00:00
Rafael Espindola 0fd21ca699 Don't print default values for NumberOfAuxSymbols and AuxiliaryData.
llvm-svn: 183293
2013-06-05 03:20:13 +00:00
Rafael Espindola 7595447b15 Handle (at least don't crash on) relocations with no symbols.
Should fix the MCJIT tests on PPC.

llvm-svn: 183288
2013-06-05 02:55:01 +00:00
Rafael Espindola 8e71301637 Move BinaryRef to a new include/llvm/Object/YAML.h file.
It will be used for ELF dumping too.

llvm-svn: 183287
2013-06-05 02:32:26 +00:00
Rafael Espindola beef23fe21 Revert "R600: Add a pass that merge Vector Register"
This reverts commit r183279. CodeGen/R600/texture-input-merge.ll was failing.

llvm-svn: 183286
2013-06-05 01:48:30 +00:00
Rafael Espindola 806f006490 Handle relocations that don't point to symbols.
In ELF (as in MachO), not all relocations point to symbols. Represent this
properly by using a symbol_iterator instead of a SymbolRef. Update llvm-readobj
ELF's dumper to handle relocatios without symbols.

llvm-svn: 183284
2013-06-05 01:33:53 +00:00
Sean Silva 0d65a762ac [docs] Replace non-existent LLVM_YAML_UNIQUE_TYPE() macro
LLVM_YAML_STRONG_TYPEDEF() is the correct macro to perform this function.

llvm-svn: 183280
2013-06-04 23:36:41 +00:00
Vincent Lejeune a45aafabfe R600: Add a pass that merge Vector Register
llvm-svn: 183279
2013-06-04 23:17:26 +00:00
Vincent Lejeune c689679173 R600: Const/Neg/Abs can be folded to dot4
llvm-svn: 183278
2013-06-04 23:17:15 +00:00
Evan Cheng 4ec309700b Cortex-R5 can issue Thumb2 integer division instructions.
llvm-svn: 183275
2013-06-04 22:52:09 +00:00
Arnold Schwaighofer 2a70c69d31 Revert series of sched model patches until I figure out what is going on.
llvm-svn: 183273
2013-06-04 22:35:17 +00:00
Arnold Schwaighofer 0024b8bd73 ARM sched model: Add VFP div instruction on Swift
llvm-svn: 183271
2013-06-04 22:16:08 +00:00
Arnold Schwaighofer 89901730b1 ARM sched model: Add SIMD/VFP load/store instructions on Swift
llvm-svn: 183270
2013-06-04 22:16:07 +00:00
Arnold Schwaighofer bc61f0912c ARM sched model: Add integer VFP/SIMD instructions on Swift
llvm-svn: 183269
2013-06-04 22:16:05 +00:00
Arnold Schwaighofer 83a4197085 ARM sched model: Add integer load/store instructions on Swift
llvm-svn: 183268
2013-06-04 22:16:04 +00:00
Arnold Schwaighofer f77ea45488 ARM sched model: Add integer arithmetic instructions on Swift
llvm-svn: 183267
2013-06-04 22:16:02 +00:00
Arnold Schwaighofer be3a06c85f ARM sched model: Cortex A9 - More InstRW sched resources
Add more InstRW mappings.

llvm-svn: 183266
2013-06-04 22:16:00 +00:00
Arnold Schwaighofer 76e2394799 ARM sched model: Add branch thumb instructions
llvm-svn: 183265
2013-06-04 22:15:59 +00:00
Arnold Schwaighofer 17359d9ba2 ARM sched model: Add branch thumb2 instructions
llvm-svn: 183264
2013-06-04 22:15:57 +00:00
Arnold Schwaighofer bdb5687468 ARM sched model: Add branch instructions
llvm-svn: 183263
2013-06-04 22:15:56 +00:00
Arnold Schwaighofer e971b08765 ARM sched model: Add preload thumb2 instructions
llvm-svn: 183262
2013-06-04 22:15:54 +00:00
Arnold Schwaighofer ab88312f51 ARM sched model: Add preload instructions
llvm-svn: 183261
2013-06-04 22:15:52 +00:00
Arnold Schwaighofer 83fa45629e ARM sched model: Add more ALU and CMP thumb instructions
llvm-svn: 183260
2013-06-04 22:15:51 +00:00
Arnold Schwaighofer 529c2be334 ARM sched model: Add more ALU and CMP thumb2 instructions
llvm-svn: 183259
2013-06-04 22:15:49 +00:00
Arnold Schwaighofer b6843f17eb ARM sched model: Add more ALU and CMP instructions
llvm-svn: 183258
2013-06-04 22:15:47 +00:00
Arnold Schwaighofer d5b9794a53 ARM sched model: Add divsion, loads, branches, vfp cvt
Add some generic SchedWrites and assign resources for Swift and Cortex A9.

llvm-svn: 183257
2013-06-04 22:15:46 +00:00
Arnold Schwaighofer 279c0aff1a ARMInstrInfo: Improve isSwiftFastImmShift
An instruction with less than 3 inputs is trivially a fast immediate shift.

llvm-svn: 183256
2013-06-04 22:15:43 +00:00
Arnold Schwaighofer afe7d5c8f5 SubtargetEmitter fix
Don't output data if we are supposed to ignore the record.

llvm-svn: 183255
2013-06-04 22:15:41 +00:00
Richard Smith 939889f6a4 Fix link.
llvm-svn: 183248
2013-06-04 20:42:42 +00:00
Venkatraman Govindaraju a54533ed78 Sparc: No functionality change. Cleanup whitespaces, comment formatting etc.,
llvm-svn: 183243
2013-06-04 18:33:25 +00:00
David Majnemer 29130c5e8d IndVarSimplify: check if loop invariant expansion can trap
IndVarSimplify is willing to move divide instructions outside of their
loop bodies if they are invariant of the loop.  However, it may not be
safe to expand them if we do not know if they can trap.

Instead, check to see if it is not safe to expand the instruction and
skip the expansion.

This fixes PR16041.

Testcase by Rafael Ávila de Espíndola.

llvm-svn: 183239
2013-06-04 17:51:58 +00:00
David Majnemer 452f1f97bd ARM: Fix crash in ARM backend inside of ARMConstantIslandPass
The ARM backend did not expect LDRBi12 to hold a constant pool operand.
Allow for LLVM to deal with the instruction similar to how it deals with
LDRi12.

This fixes PR16215.

llvm-svn: 183238
2013-06-04 17:46:15 +00:00
Bob Wilson 16522c01dc Remove "-Wl,-seg1addr -Wl,0xE0000000" from link options.
Specifying the load address for Darwin i386 dylibs was a performance
optimization for dyld that is not relevant for x86_64 or arm. We can just
remove this now.

llvm-svn: 183230
2013-06-04 15:26:37 +00:00
Vincent Lejeune 276ceb8d5f R600: Swizzle texture/export instructions
llvm-svn: 183229
2013-06-04 15:04:53 +00:00
Vincent Lejeune db185c08cd R600: Add a test for r183108
llvm-svn: 183228
2013-06-04 15:03:35 +00:00
Rafael Espindola a5e536ab0e Second part of pr16069
The problem this time seems to be a thinko. We were assuming that in the CFG

A
| \
|  B
| /
C

speculating the basic block B would cause only the phi value for the B->C edge
to be speculated. That is not true, the phi's are semantically in the edges, so
if the A->B->C path is taken, any code needed for A->C is not executed and we
have to consider it too when deciding to speculate B.

llvm-svn: 183226
2013-06-04 14:11:59 +00:00
Hans Wennborg 5cf30be6e4 Typo: s/caes/cases/ in SimplifyCFG
llvm-svn: 183219
2013-06-04 11:22:30 +00:00
Benjamin Kramer 7910e6cb0e Preserve const correctness.
GCC complains about casting away const.

llvm-svn: 183216
2013-06-04 09:09:15 +00:00
Vladimir Medic ea381916b0 Test commit for user vmedic, to verify commit access. One line of comment is added to MipsAsmParser.cpp.
llvm-svn: 183215
2013-06-04 08:28:53 +00:00
Alexey Samsonov 5239d58c8e [llvm-symbolizer] Avoid calling slow getSymbolSize for Mach-O files. Assume that symbols with zero size are in fact large enough.
llvm-svn: 183213
2013-06-04 07:57:38 +00:00
Bill Wendling af8c57c7b3 We are now in 3.4 land. We don't need the 3.3 releaese notes in ToT anymore.
llvm-svn: 183210
2013-06-04 06:12:31 +00:00
Michael Gottesman 3acedb6329 IEEE-754R 5.7.2 General Operations is* operations (except for isCanonical).
Specifically the following work was done:

1. If the operation was not implemented, I implemented it.

2. If the operation was already implemented, I just moved its location
in the APFloat header into the IEEE-754R 5.7.2 section. If the name was
incorrect, I put in a comment giving the true IEEE-754R name.

Also unittests have been added for all of the functions which did not
already have a unittest.

llvm-svn: 183179
2013-06-04 03:46:25 +00:00