oota-llvm.git
11 years agoThis patch addresses two cleanup issues:
Bill Wendling [Thu, 18 Apr 2013 20:15:25 +0000 (20:15 +0000)]
This patch addresses two cleanup issues:

1. Verify::VerifyParameterAttrs in "lib/IR/Verifier.cpp" and
   AttrBuilder::removeFunctionOnlyAttrs in "lib/IR/Attributes.cpp" (only called
   by Verify::VerifyFunctionAttrs) separately maintained a list of function-only
   attribute types. I've consolidated the logic into a new function used for
   both cases in "lib/IR/Verifier.cpp", so this logic is in one place (other
   than the AsmParser front-end)

2. Various functions in "lib/IR/Verifier.cpp" passed AttributeSet around by
   reference needlessly, as it's just a handle to an immutable pimpl body.

Patch by Stephen Lin!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179790 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a -Wdocumentation warning
Dmitri Gribenko [Thu, 18 Apr 2013 20:13:04 +0000 (20:13 +0000)]
Fix a -Wdocumentation warning

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179789 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoIn the function InstCombiner::visitExtractElementInst() removed the limitation that...
Anat Shemer [Thu, 18 Apr 2013 19:56:44 +0000 (19:56 +0000)]
In the function InstCombiner::visitExtractElementInst() removed the limitation that extract is promoted over a cast only if the cast has only one use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179786 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoC API: Fix coding style
Tom Stellard [Thu, 18 Apr 2013 19:50:53 +0000 (19:50 +0000)]
C API: Fix coding style

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179785 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdded a function scalarizePHI() that sclarizes a vector phi instruction if it has...
Anat Shemer [Thu, 18 Apr 2013 19:35:39 +0000 (19:35 +0000)]
Added a function scalarizePHI() that sclarizes a vector phi instruction if it has only 2 uses: one to promote the vector phi in a loop and the other use is an extract operation of one element at a constant location.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179783 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix comment. Patch by Stephen Lin.
Bill Wendling [Thu, 18 Apr 2013 18:30:16 +0000 (18:30 +0000)]
Fix comment. Patch by Stephen Lin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179780 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAt Jim Grosbach's request detemplate Object/MachO.h.
Rafael Espindola [Thu, 18 Apr 2013 18:08:55 +0000 (18:08 +0000)]
At Jim Grosbach's request detemplate Object/MachO.h.

We are still able to handle mixed endian objects by swapping one struct at a
time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179778 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a comment, PR15777.
Chris Lattner [Thu, 18 Apr 2013 17:42:14 +0000 (17:42 +0000)]
Fix a comment, PR15777.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179775 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAllow misaligned stores in x86 fast-isel.
Derek Schuff [Thu, 18 Apr 2013 17:41:08 +0000 (17:41 +0000)]
Allow misaligned stores in x86 fast-isel.

In X86FastISel::X86SelectStore(), improperly aligned stores are rejected and
handled by the DAG-based ISel.  However, X86FastISel::X86SelectLoad() makes
no such requirement.  There doesn't appear to be an x86 architectural
correctness issue with allowing potentially unaligned store instructions.
This patch removes this restriction.

Patch by Jim Stichnot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179774 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLoopVectorizer: Recognize min/max reductions
Arnold Schwaighofer [Thu, 18 Apr 2013 17:22:34 +0000 (17:22 +0000)]
LoopVectorizer: Recognize min/max reductions

A min/max operation is represented by a select(cmp(lt/le/gt/ge, X, Y), X, Y)
sequence in LLVM. If we see such a sequence we can treat it just as any other
commutative binary instruction and reduce it.

This appears to help bzip2 by about 1.5% on an imac12,2.

radar://12960601

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179773 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix grammar in LLVMBuild.rst
Eli Bendersky [Thu, 18 Apr 2013 16:39:32 +0000 (16:39 +0000)]
Fix grammar in LLVMBuild.rst

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179768 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[ms-inline asm] Simplify some logic and add a FIXME for unhandled unary minus.
Chad Rosier [Thu, 18 Apr 2013 16:28:19 +0000 (16:28 +0000)]
[ms-inline asm] Simplify some logic and add a FIXME for unhandled unary minus.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179765 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake this private method.
Chad Rosier [Thu, 18 Apr 2013 16:13:18 +0000 (16:13 +0000)]
Make this private method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179764 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixes to LangRef.rst: incorrect attributes syntax and misplaced 'nobuiltin'
Eli Bendersky [Thu, 18 Apr 2013 16:11:44 +0000 (16:11 +0000)]
Fixes to LangRef.rst: incorrect attributes syntax and misplaced 'nobuiltin'

Patch by Stephen Lin

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179763 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix comment spacing.
Chad Rosier [Thu, 18 Apr 2013 15:19:45 +0000 (15:19 +0000)]
Fix comment spacing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179761 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLoopVectorize: Use a set to avoid longer cycles in the reduction chain too.
Benjamin Kramer [Thu, 18 Apr 2013 14:29:13 +0000 (14:29 +0000)]
LoopVectorize: Use a set to avoid longer cycles in the reduction chain too.

Fixes PR15748.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179757 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix for PR14824, An ARM Load/Store Optimization bug
Hao Liu [Thu, 18 Apr 2013 09:11:08 +0000 (09:11 +0000)]
Fix for PR14824, An ARM Load/Store Optimization bug

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179751 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert "Combine bit test + conditional or into simple math"
David Majnemer [Thu, 18 Apr 2013 08:42:33 +0000 (08:42 +0000)]
Revert "Combine bit test + conditional or into simple math"

It is causing stage2 builds to fail, let's get them running again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179750 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCombine bit test + conditional or into simple math
David Majnemer [Thu, 18 Apr 2013 07:30:07 +0000 (07:30 +0000)]
Combine bit test + conditional or into simple math

Simplify:
(select (icmp eq (and X, C1), 0), Y, (or Y, C2))

Into:
(or (shl (and X, C1), C3), y)

Where:
C3 = Log(C2) - Log(C1)

If:
C1 and C2 are both powers of two

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179748 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[objc-arc] Do not mismatch up retains inside a for loop with releases outside said...
Michael Gottesman [Thu, 18 Apr 2013 05:39:45 +0000 (05:39 +0000)]
[objc-arc] Do not mismatch up retains inside a for loop with releases outside said for loop in the presense of differing provenance caused by escaping blocks.

This occurs due to an alloca representing a separate ownership from the
original pointer. Thus consider the following pseudo-IR:

  objc_retain(%a)
  for (...) {
    objc_retain(%a)
    %block <- %a
    F(%block)
    objc_release(%block)
  }
  objc_release(%a)

From the perspective of the optimizer, the %block is a separate
provenance from the original %a. Thus the optimizer pairs up the inner
retain for %a and the outer release from %a, resulting in segfaults.

This is fixed by noting that the signature of a mismatch of
retain/releases inside the for loop is a Use/CanRelease top down with an
None bottom up (since bottom up the Retain-CanRelease-Use-Release
sequence is completed by the inner objc_retain, but top down due to the
differing provenance from the objc_release said sequence is not
completed). In said case in CheckForCFGHazards, we now clear the state
of %a implying that no pairing will occur.

Additionally a test case is included.

rdar://12969722

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179747 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemoved trailing whitespace.
Michael Gottesman [Thu, 18 Apr 2013 04:34:11 +0000 (04:34 +0000)]
Removed trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179746 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoStreamline arc-annotation test (removing some cases which do not add any extra covera...
Michael Gottesman [Thu, 18 Apr 2013 04:34:06 +0000 (04:34 +0000)]
Streamline arc-annotation test (removing some cases which do not add any extra coverage) and set it up to use FileCheck variables to make the test more robust.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179745 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Rename function.
Akira Hatanaka [Thu, 18 Apr 2013 01:00:46 +0000 (01:00 +0000)]
[mips] Rename function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179741 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] DSP-ASE move from HI/LO register instructions.
Akira Hatanaka [Thu, 18 Apr 2013 00:52:44 +0000 (00:52 +0000)]
[mips] DSP-ASE move from HI/LO register instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179739 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMips assembler: formatting and comment changes.
Jack Carter [Thu, 18 Apr 2013 00:41:53 +0000 (00:41 +0000)]
Mips assembler: formatting and comment changes.

This patch should not have any functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179737 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd an option `-enable-old-style-attr-syntax' to print out function attributes in...
Bill Wendling [Wed, 17 Apr 2013 23:35:59 +0000 (23:35 +0000)]
Add an option `-enable-old-style-attr-syntax' to print out function attributes in the "old" style.

It's sometimes beneficial to emit a testcase with the old style attribute
syntax. Allow someone to do this.
<rdar://problem/13563209>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179735 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[objc-arc] Added annotation option to only emit annotations for a specific ssa identi...
Michael Gottesman [Wed, 17 Apr 2013 21:59:41 +0000 (21:59 +0000)]
[objc-arc] Added annotation option to only emit annotations for a specific ssa identifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179729 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTwo small cleanups for ELF's templates.
Rafael Espindola [Wed, 17 Apr 2013 21:20:55 +0000 (21:20 +0000)]
Two small cleanups for ELF's templates.

* We only ever specialize these templates with an instantiation of ELFType,
  so we don't need a template template.
* Replace LLVM_ELF_COMMA with just passing the individual parameters to the
  macro. This requires a second macro for when we only have ELFT, but that
  is still a small win.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179726 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd support for subsections to the ELF assembler. Fixes PR8717.
Peter Collingbourne [Wed, 17 Apr 2013 21:18:16 +0000 (21:18 +0000)]
Add support for subsections to the ELF assembler. Fixes PR8717.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179725 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[ms-inline asm] These should be int64_t, not uint64_t.
Chad Rosier [Wed, 17 Apr 2013 21:14:38 +0000 (21:14 +0000)]
[ms-inline asm] These should be int64_t, not uint64_t.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179724 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixed typo.
Michael Gottesman [Wed, 17 Apr 2013 21:03:53 +0000 (21:03 +0000)]
Fixed typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179721 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[ms-inline asm] Add support for the minus unary operator. Previously, we were
Chad Rosier [Wed, 17 Apr 2013 21:01:45 +0000 (21:01 +0000)]
[ms-inline asm] Add support for the minus unary operator.  Previously, we were
unable to handle cases such as __asm mov eax, 8*-8.

This patch also attempts to simplify the state machine.  Further, the error
reporting has been improved.  Test cases included, but more will be added to
the clang side shortly.
rdar://13668445

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179719 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[objc-arc] Added descriptions for EnableARCAnnotations, EnableCheckForCFGHazards...
Michael Gottesman [Wed, 17 Apr 2013 20:48:03 +0000 (20:48 +0000)]
[objc-arc] Added descriptions for EnableARCAnnotations, EnableCheckForCFGHazards, EnableARCOptimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179718 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[objc-arc] Added an option to arc-annotations for turning off CheckForCFGHazard.
Michael Gottesman [Wed, 17 Apr 2013 20:48:01 +0000 (20:48 +0000)]
[objc-arc] Added an option to arc-annotations for turning off CheckForCFGHazard.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179717 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMore consistent formatting and tidying-up
Eli Bendersky [Wed, 17 Apr 2013 20:17:08 +0000 (20:17 +0000)]
More consistent formatting and tidying-up

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179716 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThis patch teaches x86 fast-isel to generate the native div/idiv instructions
Eli Bendersky [Wed, 17 Apr 2013 20:10:13 +0000 (20:10 +0000)]
This patch teaches x86 fast-isel to generate the native div/idiv instructions
for the sdiv/srem/udiv/urem bitcode instructions.  This is done for the i8,
i16, and i32 types, as well as i64 for the x86_64 target.

Patch by Jim Stichnoth

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179715 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoX86 cost model: Exit before calling getSimpleVT on non-simple VTs
Arnold Schwaighofer [Wed, 17 Apr 2013 20:04:53 +0000 (20:04 +0000)]
X86 cost model: Exit before calling getSimpleVT on non-simple VTs

getSimpleVT can only handle simple value types.

radar://13676022

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179714 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoA limit of 500 was still a bit too high for some tests.
Bill Wendling [Wed, 17 Apr 2013 20:02:32 +0000 (20:02 +0000)]
A limit of 500 was still a bit too high for some tests.

PR15000 has a testcase where the time to compile was bordering on 30s. When I
dropped the limit value to 100, it became a much more managable 6s. The compile
time seems to increase in a roughly linear fashion based on increasing the limit
value. (See the runtimes below.)

So, let's lower the limit to 100 so that they can get a more reasonable compile
time.

Limit Value  Time
-----------  ----
10           0.9744s
20           1.8035s
30           2.3618s
40           2.9814s
50           3.6988s
60           4.5486s
70           4.9314s
80           5.8012s
90           6.4246s
100          7.0852s
110          7.6634s
120          8.3553s
130          9.0552s
140          9.6820s
150          9.8804s
160         10.8901s
170         10.9855s
180         12.0114s
190         12.6816s
200         13.2754s
210         13.9942s
220         13.8097s
230         14.3272s
240         15.7753s
250         15.6673s
260         16.0541s
270         16.7625s
280         17.3823s
290         18.8213s
300         18.6120s
310         20.0333s
320         19.5165s
330         20.2505s
340         20.7068s
350         21.1833s
360         22.9216s
370         22.2152s
380         23.9390s
390         23.4609s
400         24.0426s
410         24.6410s
420         26.5208s
430         27.7155s
440         26.4142s
450         28.5646s
460         27.3494s
470         29.7255s
480         29.4646s
490         30.5001s

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179713 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix treatment of ARM unallocated hint instructions.
Quentin Colombet [Wed, 17 Apr 2013 18:46:12 +0000 (18:46 +0000)]
Fix treatment of ARM unallocated hint instructions.
The reference manual defines only 5 permitted values for the immediate field of the "hint" instruction:
1. nop (imm == 0)
2. yield (imm == 1)
3. wfe (imm == 2)
4. wfi (imm == 3)
5. sev (imm == 4)

Therefore, restrict the permitted values for the "hint" instruction to 0 through 4.

Patch by Mihail Popa <Mihail.Popa@arm.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179707 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAppease a gcc warning about an overflow in a constant conversion.
Bill Wendling [Wed, 17 Apr 2013 18:26:02 +0000 (18:26 +0000)]
Appease a gcc warning about an overflow in a constant conversion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179703 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't store AttributeSet::FunctionIndex as an int.
Benjamin Kramer [Wed, 17 Apr 2013 17:51:19 +0000 (17:51 +0000)]
Don't store AttributeSet::FunctionIndex as an int.

GCC complains: Core.cpp:1449:27: warning: overflow in implicit constant conversion [-Woverflow]
I'm not sure if that's really a problem here, but using the enum type is better
style anyways.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179696 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPowerPC: Mark some more patterns as isCodeGenOnly.
Ulrich Weigand [Wed, 17 Apr 2013 17:19:05 +0000 (17:19 +0000)]
PowerPC: Mark some more patterns as isCodeGenOnly.

A couple of recently introduced conditional branch patterns
also need to be marked as isCodeGenOnly since they cannot
be handled by the asm parser.

No change in generated code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179690 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake formatting more consistent and tidy-up.
Eli Bendersky [Wed, 17 Apr 2013 17:17:20 +0000 (17:17 +0000)]
Make formatting more consistent and tidy-up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179689 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Make Export Instruction not duplicable
Vincent Lejeune [Wed, 17 Apr 2013 15:17:39 +0000 (15:17 +0000)]
R600: Make Export Instruction not duplicable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179686 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Export is emitted as a CF_NATIVE inst
Vincent Lejeune [Wed, 17 Apr 2013 15:17:32 +0000 (15:17 +0000)]
R600: Export is emitted as a CF_NATIVE inst

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179685 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Emit used GPRs count
Vincent Lejeune [Wed, 17 Apr 2013 15:17:25 +0000 (15:17 +0000)]
R600: Emit used GPRs count

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179684 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse StringSwitch instead of long chain of if-else. No functionality change.
Alexey Samsonov [Wed, 17 Apr 2013 14:27:04 +0000 (14:27 +0000)]
Use StringSwitch instead of long chain of if-else. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179682 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCreate a stub for DWARF parser unittests
Alexey Samsonov [Wed, 17 Apr 2013 08:29:02 +0000 (08:29 +0000)]
Create a stub for DWARF parser unittests

Moves one DWARF-specific header to include/llvm/DebugInfo from lib/.
Add a short unittest for r179095.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179678 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix -Werror build.
Evgeniy Stepanov [Wed, 17 Apr 2013 06:45:11 +0000 (06:45 +0000)]
Fix -Werror build.

Broken in r179657.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179669 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThis appears to be no longer necessary for the testsuite.
Eric Christopher [Wed, 17 Apr 2013 06:37:30 +0000 (06:37 +0000)]
This appears to be no longer necessary for the testsuite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179667 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agotest
Anat Shemer [Wed, 17 Apr 2013 05:34:03 +0000 (05:34 +0000)]
test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179665 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPR15149/r174304 improvement - print hex for unknown dwarf language codes & add a...
David Blaikie [Wed, 17 Apr 2013 03:41:36 +0000 (03:41 +0000)]
PR15149/r174304 improvement - print hex for unknown dwarf language codes & add a test case

CR feedback from Rafael Espindola and Paul Robinson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179664 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix random typo.
Eric Christopher [Wed, 17 Apr 2013 03:18:49 +0000 (03:18 +0000)]
Fix random typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179663 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDo not optimise fprintf() calls if its return value is used.
Peter Collingbourne [Wed, 17 Apr 2013 02:01:10 +0000 (02:01 +0000)]
Do not optimise fprintf() calls if its return value is used.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179661 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMips assembler: Enable handling of nested expressions
Jack Carter [Wed, 17 Apr 2013 00:18:04 +0000 (00:18 +0000)]
Mips assembler: Enable handling of nested expressions

This patch allows the Mips assembler to parse and emit nested
expressions as instruction operands. It also extends the
expansion of memory instructions when an offset is given as
an expression.

Contributer: Vladimir Medic

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179657 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[ms-inline asm] Add support for parsing complex immediate expressions. Test
Chad Rosier [Wed, 17 Apr 2013 00:11:46 +0000 (00:11 +0000)]
[ms-inline asm] Add support for parsing complex immediate expressions.  Test
cases to be submitted on clang side shortly.
rdar://13663768 and PR15760

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179655 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoC API: Add LLVMTargetMachineEmitToMemoryBuffer()
Tom Stellard [Tue, 16 Apr 2013 23:12:56 +0000 (23:12 +0000)]
C API: Add LLVMTargetMachineEmitToMemoryBuffer()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179648 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoC API: Add LLVMGetBufferSize()
Tom Stellard [Tue, 16 Apr 2013 23:12:51 +0000 (23:12 +0000)]
C API: Add LLVMGetBufferSize()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179647 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoC API: Add LLVMGetBufferStart()
Tom Stellard [Tue, 16 Apr 2013 23:12:47 +0000 (23:12 +0000)]
C API: Add LLVMGetBufferStart()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179646 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoC API: Add LLVMAddTargetDependentFunctionAttr()
Tom Stellard [Tue, 16 Apr 2013 23:12:43 +0000 (23:12 +0000)]
C API: Add LLVMAddTargetDependentFunctionAttr()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179645 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPrint out the target-independent attributes in a comment before the function definition.
Bill Wendling [Tue, 16 Apr 2013 20:55:47 +0000 (20:55 +0000)]
Print out the target-independent attributes in a comment before the function definition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179622 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[XCore] Extend test to check positve offsets are folded into addresses.
Richard Osborne [Tue, 16 Apr 2013 20:05:52 +0000 (20:05 +0000)]
[XCore] Extend test to check positve offsets are folded into addresses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179621 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[XCore] Give test more generic name.
Richard Osborne [Tue, 16 Apr 2013 19:56:55 +0000 (19:56 +0000)]
[XCore] Give test more generic name.

I intend to extend the test with more offset folding checks

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179620 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[XCore] Convert a couple of tests to FileCheck.
Richard Osborne [Tue, 16 Apr 2013 19:41:19 +0000 (19:41 +0000)]
[XCore] Convert a couple of tests to FileCheck.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179619 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unused variable from previous refactor.
Chad Rosier [Tue, 16 Apr 2013 18:20:10 +0000 (18:20 +0000)]
Remove unused variable from previous refactor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179611 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[ms-inline asm] Refactor. No functional change intended.
Chad Rosier [Tue, 16 Apr 2013 18:15:40 +0000 (18:15 +0000)]
[ms-inline asm] Refactor. No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179610 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[ms-inline asm] Remove some dead code.
Chad Rosier [Tue, 16 Apr 2013 17:27:40 +0000 (17:27 +0000)]
[ms-inline asm] Remove some dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179607 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCleanup naming: DataLayout s/TD/DL/
Eli Bendersky [Tue, 16 Apr 2013 15:41:18 +0000 (15:41 +0000)]
Cleanup naming: DataLayout s/TD/DL/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179601 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix build failure introduced in 179591 when assertions are disabled.
Logan Chien [Tue, 16 Apr 2013 14:02:30 +0000 (14:02 +0000)]
Fix build failure introduced in 179591 when assertions are disabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179593 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoImplement ARM unwind opcode assembler.
Logan Chien [Tue, 16 Apr 2013 12:02:21 +0000 (12:02 +0000)]
Implement ARM unwind opcode assembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179591 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agollvm-objdump: Don't print contents of BSS sections: it makes no sense and crashes...
Alexey Samsonov [Tue, 16 Apr 2013 10:53:11 +0000 (10:53 +0000)]
llvm-objdump: Don't print contents of BSS sections: it makes no sense and crashes llvm-objdump on relocated objects with large bss

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179589 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd four new functions and one new enum to the C API:
Hans Wennborg [Tue, 16 Apr 2013 08:58:59 +0000 (08:58 +0000)]
Add four new functions and one new enum to the C API:

LLVMGetThreadLocalMode - exposes GlobalVariable::getThreadLocalMode
LLVMSetThreadLocalMode - exposes GlobalVariable::setThreadLocalMode
LLVMIsExternallyInitialized - exposes GlobalVariable::isExternallyInitialized
LLVMSetExternallyInitialized - exposes GlobalVariable::setExternallyInitialized
LLVMThreadLocalMode - maps to GlobalVariable::ThreadLocalMode

Patch by Moritz Maxeiner!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179588 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agosimplifycfg: Fix integer overflow converting switch into icmp.
Hans Wennborg [Tue, 16 Apr 2013 08:35:36 +0000 (08:35 +0000)]
simplifycfg: Fix integer overflow converting switch into icmp.

If a switch instruction has a case for every possible value of its type,
with the same successor, SimplifyCFG would replace it with an icmp ult,
but the computation of the bound overflows in that case, which inverts
the test.

Patch by Jed Davis!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179587 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd 64-bit multiply and divide instructions for SPARC v9.
Jakob Stoklund Olesen [Tue, 16 Apr 2013 02:57:02 +0000 (02:57 +0000)]
Add 64-bit multiply and divide instructions for SPARC v9.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179582 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: Add VACLT and VACLE assembly aliases.
Jim Grosbach [Mon, 15 Apr 2013 22:42:50 +0000 (22:42 +0000)]
ARM: Add VACLT and VACLE assembly aliases.

These are aliases for VACGT and VACGE, respectively, with the source
operands reversed.

rdar://13638090

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179575 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWe are not able to bitcast a pointer to an integral value.
Bill Wendling [Mon, 15 Apr 2013 22:33:50 +0000 (22:33 +0000)]
We are not able to bitcast a pointer to an integral value.

Two return types are not equivalent if one is a pointer and the other is an
integral. This is because we cannot bitcast a pointer to an integral value.
PR15185

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179569 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMips assembler: Explicit floating point condition register recognition.
Jack Carter [Mon, 15 Apr 2013 22:21:55 +0000 (22:21 +0000)]
Mips assembler: Explicit floating point condition register recognition.

This patch allows the assembler to recognize $fcc0
as a valid register for conditional move instructions.

Corresponding test cases have been added.

Contributer: Vladimir Medic

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179567 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a grammar mistake, and add a line about the two phases that the BB/SLP vectorizer...
Nadav Rotem [Mon, 15 Apr 2013 22:21:25 +0000 (22:21 +0000)]
Fix a grammar mistake, and add a line about the two phases that the BB/SLP vectorizers have (top-down and bottom-up).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179566 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix the internal link.
Nadav Rotem [Mon, 15 Apr 2013 22:11:07 +0000 (22:11 +0000)]
Fix the internal link.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179565 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate the release notes about the vectorizers.
Nadav Rotem [Mon, 15 Apr 2013 22:10:39 +0000 (22:10 +0000)]
Update the release notes about the vectorizers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179564 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSLPVectorizer: Make it a function pass and add code for hoisting the vector-gather...
Nadav Rotem [Mon, 15 Apr 2013 22:00:26 +0000 (22:00 +0000)]
SLPVectorizer: Make it a function pass and add code for hoisting the vector-gather sequence out of loops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179562 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix silly typo that broke big endian hosts.
Rafael Espindola [Mon, 15 Apr 2013 20:13:59 +0000 (20:13 +0000)]
Fix silly typo that broke big endian hosts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179551 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix endianness on some MSVC versions.
Rafael Espindola [Mon, 15 Apr 2013 19:28:45 +0000 (19:28 +0000)]
Fix endianness on some MSVC versions.

Looks like it was evaluating undef == undef to true.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179549 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Emit config values in register value pairs.
Tom Stellard [Mon, 15 Apr 2013 17:51:35 +0000 (17:51 +0000)]
R600/SI: Emit config values in register value pairs.

Instead of emitting config values in a predefined order, the code
emitter will now emit a 32-bit register index followed by the 32-bit
config value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179546 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Emit configuration value in the .AMDGPU.config ELF section
Tom Stellard [Mon, 15 Apr 2013 17:51:30 +0000 (17:51 +0000)]
R600/SI: Emit configuration value in the .AMDGPU.config ELF section

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179545 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Emit ELF formatted code rather than raw ISA.
Tom Stellard [Mon, 15 Apr 2013 17:51:21 +0000 (17:51 +0000)]
R600: Emit ELF formatted code rather than raw ISA.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179544 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a typo in comment.
Jim Grosbach [Mon, 15 Apr 2013 17:40:48 +0000 (17:40 +0000)]
Fix a typo in comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179542 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplify the MCInst operator iterator declaration.
Jim Grosbach [Mon, 15 Apr 2013 17:40:45 +0000 (17:40 +0000)]
Simplify the MCInst operator iterator declaration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179541 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoGrammar and punctuation fixes.
John Criswell [Mon, 15 Apr 2013 17:38:06 +0000 (17:38 +0000)]
Grammar and punctuation fixes.
No content changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179540 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTry to fix the mingw builds.
Rafael Espindola [Mon, 15 Apr 2013 16:46:43 +0000 (16:46 +0000)]
Try to fix the mingw builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179536 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix bit size of v64i8 and v32i16 vector types.
Arnold Schwaighofer [Mon, 15 Apr 2013 16:11:25 +0000 (16:11 +0000)]
Fix bit size of v64i8 and v32i16 vector types.

Patch by Cameron McInally <cameron.mcinally@nyu.edu>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179535 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove getters now that we can specialize structs on the host endianness.
Rafael Espindola [Mon, 15 Apr 2013 16:08:02 +0000 (16:08 +0000)]
Remove getters now that we can specialize structs on the host endianness.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179534 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAvoid outputting temporary test file into source tree.
Tim Northover [Mon, 15 Apr 2013 15:49:13 +0000 (15:49 +0000)]
Avoid outputting temporary test file into source tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179532 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unused function.
Rafael Espindola [Mon, 15 Apr 2013 15:13:10 +0000 (15:13 +0000)]
Remove unused function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179530 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake the host endianness check an integer constant expression.
Rafael Espindola [Mon, 15 Apr 2013 14:44:24 +0000 (14:44 +0000)]
Make the host endianness check an integer constant expression.

I will remove the isBigEndianHost function once I update clang.

The ifdef logic is designed to
* not use configure/cmake to avoid breaking -arch i686 -arch ppc.
* default to little endian
* be as small as possible

It looks like sys/endian.h is the preferred header on most modern BSD systems,
but it is better to change this in a followup patch as machine/endian.h is
available on FreeBSD, OpenBSD, NetBSD and OS X.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179527 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReplace uses of the deprecated std::auto_ptr with OwningPtr.
Andy Gibbs [Mon, 15 Apr 2013 12:06:32 +0000 (12:06 +0000)]
Replace uses of the deprecated std::auto_ptr with OwningPtr.

This is a rework of the broken parts in r179373 which were subsequently reverted in r179374 due to incompatibility with C++98 compilers.  This version should be ok under C++98.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179520 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEnable all targets by default on Visual Studio.
Tim Northover [Mon, 15 Apr 2013 11:53:05 +0000 (11:53 +0000)]
Enable all targets by default on Visual Studio.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179518 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert "Recommit r179497 after fixing uninitialized variable." until
Eric Christopher [Mon, 15 Apr 2013 07:31:37 +0000 (07:31 +0000)]
Revert "Recommit r179497 after fixing uninitialized variable." until
I can fix the testcases here:

http://lab.llvm.org:8011/builders/clang-native-arm-cortex-a9/builds/6952

This reverts commit r179512 due to testcases specifying triples
that they didn't actually mean and causing failures on other platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179513 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRecommit r179497 after fixing uninitialized variable.
Eric Christopher [Mon, 15 Apr 2013 07:07:21 +0000 (07:07 +0000)]
Recommit r179497 after fixing uninitialized variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179512 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDocument our desire to enable the loop vectorizer on -Os in future releases.
Nadav Rotem [Mon, 15 Apr 2013 05:56:55 +0000 (05:56 +0000)]
Document our desire to enable the loop vectorizer on -Os in future releases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179511 91177308-0d34-0410-b5e6-96231b3b80d8