oota-llvm.git
12 years agomisched: avoid scheduling an instruction twice.
Andrew Trick [Mon, 8 Oct 2012 18:53:53 +0000 (18:53 +0000)]
misched: avoid scheduling an instruction twice.

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

12 years agoPowerPC: Fix object creation with PPC::MTCRF8 instruction
Adhemerval Zanella [Mon, 8 Oct 2012 18:25:11 +0000 (18:25 +0000)]
PowerPC: Fix object creation with PPC::MTCRF8 instruction

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

12 years agoAdd floating-point to and from integer conversion
Adhemerval Zanella [Mon, 8 Oct 2012 17:27:24 +0000 (17:27 +0000)]
Add floating-point to and from integer conversion

This patch add altivec support for v4i32 to v4f32 and for v4f32 to
v4i32 vector rounding conversion.

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

12 years agoFix the ocaml binding breakage from TargetData -> DataLayout changes.
Micah Villmow [Mon, 8 Oct 2012 17:06:25 +0000 (17:06 +0000)]
Fix the ocaml binding breakage from TargetData -> DataLayout changes.

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

12 years agoMove TargetData to DataLayout.
Micah Villmow [Mon, 8 Oct 2012 16:40:38 +0000 (16:40 +0000)]
Move TargetData to DataLayout.

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

12 years agoMove TargetData to DataLayout.
Micah Villmow [Mon, 8 Oct 2012 16:39:34 +0000 (16:39 +0000)]
Move TargetData to DataLayout.

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

12 years agoMove TargetData to DataLayout.
Micah Villmow [Mon, 8 Oct 2012 16:38:25 +0000 (16:38 +0000)]
Move TargetData to DataLayout.

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

12 years agoMove TargetData to DataLayout.
Micah Villmow [Mon, 8 Oct 2012 16:37:04 +0000 (16:37 +0000)]
Move TargetData to DataLayout.

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

12 years agoSome regression tests which are testing the old jit and are exercising functionality...
James Molloy [Mon, 8 Oct 2012 13:06:30 +0000 (13:06 +0000)]
Some regression tests which are testing the old jit and are exercising functionality which is both known to be broken and not expected to be fixed in the old jit. To remove these from the regression test output, I've marked them XFAIL (for lit tests) and ifdef'd them out (unit tests). These modifications remove the last long-standing regression test failures from the buildbots (though updating the triple to reflect new ubuntu configuration has temporarily caused some new failures). Tested on x86-64 and ARM Linux.

Patch by David Tweed!

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

12 years agoRemove unused MachineInstr constructors that don't take a DebugLoc argument.
Craig Topper [Sun, 7 Oct 2012 23:03:22 +0000 (23:03 +0000)]
Remove unused MachineInstr constructors that don't take a DebugLoc argument.

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

12 years agoFix indentation. Remove 'else' after return. No functional change.
Craig Topper [Sun, 7 Oct 2012 20:31:05 +0000 (20:31 +0000)]
Fix indentation. Remove 'else' after return. No functional change.

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

12 years agoSilence Sphinx warnings.
Sean Silva [Sun, 7 Oct 2012 18:49:28 +0000 (18:49 +0000)]
Silence Sphinx warnings.

Found the fix on this page:
http://permalink.gmane.org/gmane.comp.python.sphinx.devel/112

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

12 years agoX86: fcmov doesn't handle all possible EFLAGS, fall back to a branch for the others.
Benjamin Kramer [Sun, 7 Oct 2012 15:34:27 +0000 (15:34 +0000)]
X86: fcmov doesn't handle all possible EFLAGS, fall back to a branch for the others.

Otherwise it will try to use SSE patterns and fail horribly if sse is disabled.
Fixes PR14035.

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

12 years agoMove more methods out-of-line. This is in preparation for changing the internal
Bill Wendling [Sun, 7 Oct 2012 08:55:05 +0000 (08:55 +0000)]
Move more methods out-of-line. This is in preparation for changing the internal
contents of the Attributes class over to an AttributesImpl.

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

12 years agoSphinxify the GettinStarted documentation.
Bill Wendling [Sun, 7 Oct 2012 07:10:13 +0000 (07:10 +0000)]
Sphinxify the GettinStarted documentation.

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

12 years agoSphinxify the ExtendingLLVM documentation.
Bill Wendling [Sun, 7 Oct 2012 04:56:08 +0000 (04:56 +0000)]
Sphinxify the ExtendingLLVM documentation.

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

12 years agoSphinxify the compiler writer info documentation.
Bill Wendling [Sun, 7 Oct 2012 04:34:10 +0000 (04:34 +0000)]
Sphinxify the compiler writer info documentation.

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

12 years agoMake sure always-inline functions get inlined. <rdar://problem/12423986>
Bob Wilson [Sun, 7 Oct 2012 01:11:19 +0000 (01:11 +0000)]
Make sure always-inline functions get inlined. <rdar://problem/12423986>

Without this change, when the estimated cost for inlining a function with
an "alwaysinline" attribute was lower than the inlining threshold, the
getInlineCost function was returning that estimated cost rather than the
special InlineCost::AlwaysInlineCost value. That is fine in the normal
inlining case, but it can fail when the inliner considers the opportunity
cost of inlining into an internal or linkonce-odr function. It may decide
not to inline the always-inline function in that case. The fix here is just
to make getInlineCost always return the special value for always-inline
functions. I ran into this building clang with libc++. Tablegen failed to
link because of an always-inline function that was not inlined. I have been
unable to reduce the testcase down to a reasonable size.

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

12 years agoDocument MapVector.
Rafael Espindola [Sun, 7 Oct 2012 00:56:09 +0000 (00:56 +0000)]
Document MapVector.

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

12 years agoAdding support for instructions mfc0, mfc2, mtc0, mtc2
Jack Carter [Sat, 6 Oct 2012 01:17:37 +0000 (01:17 +0000)]
Adding support for instructions mfc0, mfc2, mtc0, mtc2
move from and to coprocessors 0 and 2.

Contributer: Vladimir Medic

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

12 years agoMinor changes based on post commit review:
Jack Carter [Sat, 6 Oct 2012 00:53:28 +0000 (00:53 +0000)]
Minor changes based on post commit review:

Contributer: Vladimir Medic

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

12 years agoMinor changes based on post commit review:
Jack Carter [Fri, 5 Oct 2012 23:55:28 +0000 (23:55 +0000)]
Minor changes based on post commit review:

Contributer: Vladimir Medic

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

12 years agoThis patch splits apart PPCISelLowering::LowerFormalArguments_Darwin_Or_64SVR4
Bill Schmidt [Fri, 5 Oct 2012 21:27:08 +0000 (21:27 +0000)]
This patch splits apart PPCISelLowering::LowerFormalArguments_Darwin_Or_64SVR4
into separate versions for the Darwin and 64-bit SVR4 ABIs.  This will
facilitate doing more major surgery on the 64-bit SVR4 ABI in the near future.

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

12 years agoHowToSetUpLLVMStyleRTTI.rst: remove unneeded semicolons in code examples.
Dmitri Gribenko [Fri, 5 Oct 2012 20:52:13 +0000 (20:52 +0000)]
HowToSetUpLLVMStyleRTTI.rst: remove unneeded semicolons in code examples.

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

12 years agoGoldPlugin.rst: minor typesetting fixes.
Dmitri Gribenko [Fri, 5 Oct 2012 20:50:05 +0000 (20:50 +0000)]
GoldPlugin.rst: minor typesetting fixes.

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

12 years agoRemove unused but set variable flagged by GCC.
Benjamin Kramer [Fri, 5 Oct 2012 20:08:45 +0000 (20:08 +0000)]
Remove unused but set variable flagged by GCC.

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

12 years ago[ms-inline asm] Add a comment describing the MapAndConstraints.
Chad Rosier [Fri, 5 Oct 2012 19:00:51 +0000 (19:00 +0000)]
[ms-inline asm] Add a comment describing the MapAndConstraints.

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

12 years ago[ms-inline asm] Add a few typedefs to simplify future changes.
Chad Rosier [Fri, 5 Oct 2012 18:41:14 +0000 (18:41 +0000)]
[ms-inline asm] Add a few typedefs to simplify future changes.

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

12 years agoPatch for integer multiply, signed/unsigned, long/long long.
Reed Kotler [Fri, 5 Oct 2012 18:27:54 +0000 (18:27 +0000)]
Patch for integer multiply, signed/unsigned, long/long long.

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

12 years agoSimplify code, don't or a bool with an uint64_t.
Benjamin Kramer [Fri, 5 Oct 2012 18:19:44 +0000 (18:19 +0000)]
Simplify code, don't or a bool with an uint64_t.

No functionality change.

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

12 years agoRemove empty file.
Benjamin Kramer [Fri, 5 Oct 2012 17:41:49 +0000 (17:41 +0000)]
Remove empty file.

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

12 years agoRemove extraneous semicolon.
Chad Rosier [Fri, 5 Oct 2012 17:15:19 +0000 (17:15 +0000)]
Remove extraneous semicolon.

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

12 years agoImplement TargetData with the DataLayout class, this will allow LLVM projects to...
Micah Villmow [Fri, 5 Oct 2012 17:02:14 +0000 (17:02 +0000)]
Implement TargetData with the DataLayout class, this will allow LLVM projects to transition to DataLayout without loosing functionality.

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

12 years agoAdd ELF program header.
Hemant Kulkarni [Fri, 5 Oct 2012 15:16:53 +0000 (15:16 +0000)]
Add ELF program header.

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

12 years ago- Mark the BCC and BLR defs as isCodeGenOnly per error output from
Will Schmidt [Fri, 5 Oct 2012 15:16:11 +0000 (15:16 +0000)]
- Mark the BCC and BLR defs as isCodeGenOnly per error output from
llvm-tblgen -gen-asm-matcher.

 PPCInstrInfo.td |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

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

12 years agoAdd PowerPC64 definitions for ELF.h
Adhemerval Zanella [Fri, 5 Oct 2012 14:32:46 +0000 (14:32 +0000)]
Add PowerPC64 definitions for ELF.h

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

12 years agoEnable llvm/test/ExecutionEngine/MCJIT also for cygwin.
NAKAMURA Takumi [Fri, 5 Oct 2012 14:10:29 +0000 (14:10 +0000)]
Enable llvm/test/ExecutionEngine/MCJIT also for cygwin.

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

12 years agolli: [MCJIT] Suppress "__main" for cygming in LLIMCJITMemoryManager::getPointerToName...
NAKAMURA Takumi [Fri, 5 Oct 2012 14:10:23 +0000 (14:10 +0000)]
lli: [MCJIT] Suppress "__main" for cygming in LLIMCJITMemoryManager::getPointerToNamedFunction(), like legacy JITMemoryManager's.

CRT's __main (aka premain) invokes global ctors on cygming. See also PR3897.

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

12 years ago[CMake] Enhance add_llvm_external_project.
NAKAMURA Takumi [Fri, 5 Oct 2012 14:10:17 +0000 (14:10 +0000)]
[CMake] Enhance add_llvm_external_project.

  - Substitute hyphen to underscore, s/-/_/g, as the variable name.
  - Additional parameter can be specified as the name of directory.

e.g.) add_llvm_external_project(clang-tools-extra extra)

  - LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=/path/to/llvm-srcroot/tools/clang/tools/extra, by default.
  - Build directory is in ${CMAKE_CURRENT_BINARY_DIR}/extra

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

12 years agoSROA.cpp: Fix a warning, [-Wunused-variable]
NAKAMURA Takumi [Fri, 5 Oct 2012 13:56:23 +0000 (13:56 +0000)]
SROA.cpp: Fix a warning, [-Wunused-variable]

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

12 years agoConvert to unix line endings.
Rafael Espindola [Fri, 5 Oct 2012 13:32:38 +0000 (13:32 +0000)]
Convert to unix line endings.

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

12 years agoMove this test a bit later, after the point at which we know that we either
Duncan Sands [Fri, 5 Oct 2012 07:29:46 +0000 (07:29 +0000)]
Move this test a bit later, after the point at which we know that we either
have an alloca or a parameter, since then the alloca test should make sense
to readers, while before it probably appears too specific.  No functionality
change.

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

12 years agoMove methods out-of-line.
Bill Wendling [Fri, 5 Oct 2012 06:44:41 +0000 (06:44 +0000)]
Move methods out-of-line.

The internal representation of the Attributes class will be opaque. All of the
query methods will need to query the opaque class. Therefore, these methods need
to be out-of-line.
No functionality change intended.

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

12 years agoUse method to query for attributes.
Bill Wendling [Fri, 5 Oct 2012 06:18:50 +0000 (06:18 +0000)]
Use method to query for attributes.

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

12 years agoRemove some encoding bits I forgot to remove from SETB_C16r and SETB_C64r in r165302.
Craig Topper [Fri, 5 Oct 2012 06:11:52 +0000 (06:11 +0000)]
Remove some encoding bits I forgot to remove from SETB_C16r and SETB_C64r in r165302.

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

12 years agoMove expansion of SETB_C(8/16/32/64)r from MCInstLower to ExpandPostRAPseudos and...
Craig Topper [Fri, 5 Oct 2012 06:05:15 +0000 (06:05 +0000)]
Move expansion of SETB_C(8/16/32/64)r from MCInstLower to ExpandPostRAPseudos and mark them as pseudos in the td file.

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

12 years agodocs: Add HowToSetUpLLVMStyleRTTI.rst.
Sean Silva [Fri, 5 Oct 2012 03:32:01 +0000 (03:32 +0000)]
docs: Add HowToSetUpLLVMStyleRTTI.rst.

This document describes how to set up LLVM-style RTTI for a class
hierarchy. Surprisingly, this was not previously documented.

Also, link it into ProgrammersManual.html.

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

12 years agotblgen: Use appropriate LLVM-style RTTI functions.
Sean Silva [Fri, 5 Oct 2012 03:32:00 +0000 (03:32 +0000)]
tblgen: Use appropriate LLVM-style RTTI functions.

Use isa<> or cast<> when semantically that is what is happening. Also
some trivial "style" cleanups at fix sites.

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

12 years agotblgen: Replace uses of dynamic_cast<XXXRecTy> with dyn_cast<>.
Sean Silva [Fri, 5 Oct 2012 03:31:58 +0000 (03:31 +0000)]
tblgen: Replace uses of dynamic_cast<XXXRecTy> with dyn_cast<>.

This is a mechanical change of dynamic_cast<> to dyn_cast<>. A number of
these uses are actually more like isa<> or cast<>, and will be changed
to the semanticaly appropriate one in a future patch.

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

12 years agotblgen: Put dyn_cast<> infrastructure in place for RecTy hierarchy.
Sean Silva [Fri, 5 Oct 2012 03:31:56 +0000 (03:31 +0000)]
tblgen: Put dyn_cast<> infrastructure in place for RecTy hierarchy.

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

12 years agoMake sure to generate the right kind of MDNode for enum forward declarations.
Eli Friedman [Fri, 5 Oct 2012 01:49:14 +0000 (01:49 +0000)]
Make sure to generate the right kind of MDNode for enum forward declarations.
PR14029, LLVM part.

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

12 years agoFollow up to r165072. Try a different approach: only move the load when it's going...
Evan Cheng [Fri, 5 Oct 2012 01:48:22 +0000 (01:48 +0000)]
Follow up to r165072. Try a different approach: only move the load when it's going to be folded into the call. rdar://12437604

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

12 years agoTeach the new SROA a new trick. Now we zap any memcpy or memmoves which
Chandler Carruth [Fri, 5 Oct 2012 01:29:09 +0000 (01:29 +0000)]
Teach the new SROA a new trick. Now we zap any memcpy or memmoves which
are in fact identity operations. We detect these and kill their
partitions so that even splitting is unaffected by them. This is
particularly important because Clang relies on emitting identity memcpy
operations for struct copies, and these fold away to constants very
often after inlining.

Fixes the last big performance FIXME I have on my plate.

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

12 years agoLift the speculation visitor above all the helpers that are targeted at
Chandler Carruth [Fri, 5 Oct 2012 01:29:06 +0000 (01:29 +0000)]
Lift the speculation visitor above all the helpers that are targeted at
the rewrite visitor to make the fact that the speculation is completely
independent a bit more clear.

I promise that this is just a cut/paste of the one visitor and adding
the annonymous namespace wrappings. The diff may look completely
preposterous, it does in git for some reason.

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

12 years agoUse -object_path_lto when linking executables if building Apple style.
Bill Wendling [Fri, 5 Oct 2012 00:22:46 +0000 (00:22 +0000)]
Use -object_path_lto when linking executables if building Apple style.

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

12 years ago[ms-inline asm] Add support for parsing [Intel dialect] memory operands that use
Chad Rosier [Thu, 4 Oct 2012 23:59:38 +0000 (23:59 +0000)]
[ms-inline asm] Add support for parsing [Intel dialect] memory operands that use
segmented registers.  Test case to come.

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

12 years agoRename the Target specific passes in the DataLayout class to be Target agnostic.
Micah Villmow [Thu, 4 Oct 2012 23:01:22 +0000 (23:01 +0000)]
Rename the Target specific passes in the DataLayout class to be Target agnostic.

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

12 years agoWhen merging connsecutive stores, use vectors to store the constant zero.
Nadav Rotem [Thu, 4 Oct 2012 22:35:15 +0000 (22:35 +0000)]
When merging connsecutive stores, use vectors to store the constant zero.

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

12 years agoResubmit the copying of TargetData to DataLayout without any changes to the files...
Micah Villmow [Thu, 4 Oct 2012 22:08:14 +0000 (22:08 +0000)]
Resubmit the copying of TargetData to DataLayout without any changes to the files, this should fix the problems and the changes to rename to DataLayout will come next.

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

12 years agoThis patch corrects commit 165126 by using an integer bit width instead of
Preston Gurd [Thu, 4 Oct 2012 21:33:40 +0000 (21:33 +0000)]
This patch corrects commit 165126 by using an integer bit width instead of
a pointer to a type, in order to remove the uses of getGlobalContext().

Patch by Tyler Nowicki.

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

12 years agoARM: locate user-defined text sections next to default text.
Jim Grosbach [Thu, 4 Oct 2012 21:33:24 +0000 (21:33 +0000)]
ARM: locate user-defined text sections next to default text.

Make sure functions located in user specified text sections (via the
section attribute) are located together with the default text sections.
Otherwise, for large object files, the relocations for call instructions
are more likely to be out of range. This becomes even more likely in the
presence of LTO.

rdar://12402636

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

12 years agoBacking out my changes, something screwed up from my patches, starting over.
Micah Villmow [Thu, 4 Oct 2012 21:08:50 +0000 (21:08 +0000)]
Backing out my changes, something screwed up from my patches, starting over.

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

12 years agoRename TargetData to DataLayout in DataLayout.cpp. This should fix a build failure...
Micah Villmow [Thu, 4 Oct 2012 20:49:16 +0000 (20:49 +0000)]
Rename TargetData to DataLayout in DataLayout.cpp. This should fix a build failure from r165249 where the wrong version of the file was submitted.

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

12 years agoUpdate this a bit more to represent how the prologue should work:
Eric Christopher [Thu, 4 Oct 2012 20:46:14 +0000 (20:46 +0000)]
Update this a bit more to represent how the prologue should work:

a) frame setup instructions define the prologue
b) we shouldn't change our location mid-stream

Add a test to make sure that the stack adjustment stays within
the prologue.

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

12 years agoCreate the DataLayout class, as a direct copy of TargetData.
Micah Villmow [Thu, 4 Oct 2012 20:44:22 +0000 (20:44 +0000)]
Create the DataLayout class, as a direct copy of TargetData.

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

12 years agoAdding MCJIT and MemoryBuffer unit tests
Andrew Kaylor [Thu, 4 Oct 2012 20:29:44 +0000 (20:29 +0000)]
Adding MCJIT and MemoryBuffer unit tests

Patch by Daniel Malea.

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

12 years agoAccidently checked in the files, only wanted to copy them.
Micah Villmow [Thu, 4 Oct 2012 20:08:28 +0000 (20:08 +0000)]
Accidently checked in the files, only wanted to copy them.

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

12 years agogit-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165243 91177308-0d34-0410...
Micah Villmow [Thu, 4 Oct 2012 20:06:07 +0000 (20:06 +0000)]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165243 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agogit-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165242 91177308-0d34-0410...
Micah Villmow [Thu, 4 Oct 2012 20:05:12 +0000 (20:05 +0000)]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165242 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd register encoding support in X86 backend
Michael Liao [Thu, 4 Oct 2012 19:50:43 +0000 (19:50 +0000)]
Add register encoding support in X86 backend

- Add 'HwEncoding' for X86 registers and call getEncodingValue() to
  retrieve their encoding values.
- This's the first step to adopt new scheme. Furthur revising is onging.

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

12 years agoFix doxygen comment to match parameters' names.
Jakub Staszak [Thu, 4 Oct 2012 19:10:44 +0000 (19:10 +0000)]
Fix doxygen comment to match parameters' names.

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

12 years agoAdd a comment to the commit r165187.
Jakub Staszak [Thu, 4 Oct 2012 19:08:30 +0000 (19:08 +0000)]
Add a comment to the commit r165187.

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

12 years ago- add tokens to PPCInstrInfo.td and PPCInstr64Bit.td to resolve
Will Schmidt [Thu, 4 Oct 2012 18:14:28 +0000 (18:14 +0000)]
- add tokens to PPCInstrInfo.td and PPCInstr64Bit.td to resolve
"Instruction 'foo' has no tokens" errors during llvm-tblgen
-gen-asm-matcher attempts.  At this time, the added
tokens are "#comment" style rather than the actual mnemonic.  This will
be revisited once the rest of the base asmparser bits get straightened
out for ppc64-elf-linux.

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

12 years agoGet MCSchedModel directly from the subtarget.
Jakob Stoklund Olesen [Thu, 4 Oct 2012 17:30:43 +0000 (17:30 +0000)]
Get MCSchedModel directly from the subtarget.

Not all targets have itineraries, but the subtarget always has an
MCSchedModel.

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

12 years agoSwitch MachineTraceMetrics to the new TargetSchedModel interface.
Jakob Stoklund Olesen [Thu, 4 Oct 2012 17:30:40 +0000 (17:30 +0000)]
Switch MachineTraceMetrics to the new TargetSchedModel interface.

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

12 years agotest commit / whitespace
Will Schmidt [Thu, 4 Oct 2012 16:20:24 +0000 (16:20 +0000)]
test commit / whitespace

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

12 years agoSimplifyCFG: Enhance the "remove CFG edge that leads to null pointer dereference...
Benjamin Kramer [Thu, 4 Oct 2012 16:11:49 +0000 (16:11 +0000)]
SimplifyCFG: Enhance the "remove CFG edge that leads to null pointer dereference" optimization to also handle instructions with multiple uses.

We conservatively only check the first use to avoid walking long use chains.
This catches the common case of having both a load and a store to a pointer
supplied by a PHI node.

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

12 years agoIn my recent change to avoid use of underaligned memory I didn't notice that
Duncan Sands [Thu, 4 Oct 2012 13:53:21 +0000 (13:53 +0000)]
In my recent change to avoid use of underaligned memory I didn't notice that
cpyDest can be mutated in some cases, which would then cause a crash later if
indeed the memory was underaligned.  This brought down several buildbots, so
I guess the underaligned case is much more common than I thought!

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

12 years agoThe alignment of an sret parameter is known: it must be at least the
Duncan Sands [Thu, 4 Oct 2012 13:36:31 +0000 (13:36 +0000)]
The alignment of an sret parameter is known: it must be at least the
alignment of the return type.  Teach the optimizers this.

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

12 years agoHoist some grossly duplicated code from the COFF/ELF/MachO streamers into MCObjectStr...
Benjamin Kramer [Thu, 4 Oct 2012 13:12:43 +0000 (13:12 +0000)]
Hoist some grossly duplicated code from the COFF/ELF/MachO streamers into MCObjectStreamer.

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

12 years agoFix wrong name in comment.
Duncan Sands [Thu, 4 Oct 2012 13:07:26 +0000 (13:07 +0000)]
Fix wrong name in comment.

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

12 years agoFix PR13969, a mini-phase-ordering issue with the new SROA pass.
Chandler Carruth [Thu, 4 Oct 2012 12:33:50 +0000 (12:33 +0000)]
Fix PR13969, a mini-phase-ordering issue with the new SROA pass.

Currently, we re-visit allocas when something changes about the way they
might be *split* to allow better scalarization to take place. However,
we weren't handling the case when the *promotion* is what would change
the behavior of SROA. When an address derived from an alloca is stored
into another alloca, we consider the first to have escaped. If the
second is ever promoted to an SSA value, we will suddenly be able to run
the SROA pass on the first alloca.

This patch adds explicit support for this form if iteration. When we
detect a store of a pointer derived from an alloca, we flag the
underlying alloca for reprocessing after promotion. The logic works hard
to only do this when there is definitely going to be promotion and it
might remove impediments to the analysis of the alloca.

Thanks to Nick for the great test case and Benjamin for some sanity
check review.

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

12 years agoThe memcpy optimizer was happily doing call slot forwarding when the new memory
Duncan Sands [Thu, 4 Oct 2012 10:54:40 +0000 (10:54 +0000)]
The memcpy optimizer was happily doing call slot forwarding when the new memory
was less aligned than the old.  In the testcase this results in an overaligned
memset: the memset alignment was correct for the original memory but is too much
for the new memory.  Fix this by either increasing the alignment of the new
memory or bailing out if that isn't possible.  Should fix the gcc-4.7 self-host
buildbot failure.

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

12 years agoTeach the integer-promotion rewrite strategy to be endianness aware.
Chandler Carruth [Thu, 4 Oct 2012 10:39:28 +0000 (10:39 +0000)]
Teach the integer-promotion rewrite strategy to be endianness aware.
Sorry for this being broken so long. =/

As part of this, switch all of the existing tests to be Little Endian,
which is the behavior I was asserting in them anyways! Add in a new
big-endian test that checks the interesting behavior there.

Another part of this is to tighten the rules abotu when we perform the
full-integer promotion. This logic now rejects cases where there fully
promoted integer is a non-multiple-of-8 bitwidth or cases where the
loads or stores touch bits which are in the allocated space of the
alloca but are not loaded or stored when accessing the integer. Sadly,
these aren't really observable today as the rest of the pass will
already ensure the invariants hold. However, the latter situation is
likely to become a potential concern in the future.

Thanks to Benjamin and Duncan for early review of this patch. I'm still
looking into whether there are further endianness issues, please let me
know if anyone sees BE failures persisting past this.

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

12 years agoUse method to query if there are attributes.
Bill Wendling [Thu, 4 Oct 2012 07:19:46 +0000 (07:19 +0000)]
Use method to query if there are attributes.

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

12 years agoAdd method to query for NoCapture attribute.
Bill Wendling [Thu, 4 Oct 2012 07:18:12 +0000 (07:18 +0000)]
Add method to query for NoCapture attribute.

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

12 years agoUse method to query for NoAlias attribute.
Bill Wendling [Thu, 4 Oct 2012 07:17:46 +0000 (07:17 +0000)]
Use method to query for NoAlias attribute.

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

12 years agoUse attribute query methods.
Bill Wendling [Thu, 4 Oct 2012 07:08:30 +0000 (07:08 +0000)]
Use attribute query methods.

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

12 years agoUse method to query for attributes.
Bill Wendling [Thu, 4 Oct 2012 06:58:52 +0000 (06:58 +0000)]
Use method to query for attributes.

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

12 years agoAdd method to query for 'NoAlias' attribute on call/invoke instructions.
Bill Wendling [Thu, 4 Oct 2012 06:52:09 +0000 (06:52 +0000)]
Add method to query for 'NoAlias' attribute on call/invoke instructions.

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

12 years agoUse method to query for attributes.
Bill Wendling [Thu, 4 Oct 2012 06:49:41 +0000 (06:49 +0000)]
Use method to query for attributes.

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

12 years agoQuery for attributes via the correct method call.
Bill Wendling [Thu, 4 Oct 2012 06:48:57 +0000 (06:48 +0000)]
Query for attributes via the correct method call.

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

12 years agoUse new accessor methods to query for attributes.
Bill Wendling [Thu, 4 Oct 2012 06:43:21 +0000 (06:43 +0000)]
Use new accessor methods to query for attributes.

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

12 years ago[tsan] add 3 internal flags for fine-grain control of what is instrumented and what...
Kostya Serebryany [Thu, 4 Oct 2012 05:28:50 +0000 (05:28 +0000)]
[tsan] add 3 internal flags for fine-grain control of what is instrumented and what is not.

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

12 years agoRemove template from function that is only used with one type after r165092.
Craig Topper [Thu, 4 Oct 2012 05:18:31 +0000 (05:18 +0000)]
Remove template from function that is only used with one type after r165092.

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

12 years agoFix reg mask slot test, and preserve LiveIntervals and VirtRegMap in the PBQP
Lang Hames [Thu, 4 Oct 2012 04:50:53 +0000 (04:50 +0000)]
Fix reg mask slot test, and preserve LiveIntervals and VirtRegMap in the PBQP
allocator. Fixes PR13945.

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

12 years agodocs: Fix typo on front page
Sean Silva [Thu, 4 Oct 2012 04:41:27 +0000 (04:41 +0000)]
docs: Fix typo on front page

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

12 years agoImplement methods that enable expansion of load immediate
Jack Carter [Thu, 4 Oct 2012 04:03:53 +0000 (04:03 +0000)]
Implement methods that enable expansion of load immediate
macro instruction (li) in the assembler.

We have identified three possible expansions depending on
the size of immediate operand:
  1) for 0 ≤ j ≤ 65535.
     li d,j =>
     ori d,$zero,j

  2) for −32768 ≤ j < 0.
     li d,j =>
     addiu d,$zero,j

  3) for any other value of j that is representable as a 32-bit integer.
     li d,j =>
     lui d,hi16(j)
     ori d,d,lo16(j)

All of the above have been implemented in ths patch.

Contributer: Vladimir Medic

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

12 years agodocs: Sphinxify GoldPlugin document.
Sean Silva [Thu, 4 Oct 2012 03:56:23 +0000 (03:56 +0000)]
docs: Sphinxify GoldPlugin document.

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

12 years agoThis patch is a partial implementation of mips .set assembler directive. Directive...
Jack Carter [Thu, 4 Oct 2012 02:29:46 +0000 (02:29 +0000)]
This patch is a partial implementation of mips .set assembler directive. Directive is defined as follows:
.set option
The patch implements following options

    at - lets the assembler use the $at register for macros,
         but generates warnings if the source program uses $at

    noat - let source programs use $at without issuingwarnings.

    noreorder - prevents the assembler from reordering machine
                language instructions.
    nomacro - causes the assembler to print a warning whenever
              an assembler operation generates more than one
              machine language instruction.
    macro - lets the assembler generate multiple machine instructions
            from a single assembler instruction
    reorder - lets the assembler reorder machine language
               instructions to improve performance

The above variants are parsed and their boolean values set or unset.
The code to actually use them will come later.

Following options are not implemented yet:

nomips16
nomicromips
move
nomove

Contributer: Vladimir Medic

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