platform/upstream/llvm.git
12 years agoAdd intrinsic of MULX in BMI2 header
Michael Liao [Fri, 5 Oct 2012 18:50:09 +0000 (18:50 +0000)]
Add intrinsic of MULX in BMI2 header

llvm-svn: 165325

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.

llvm-svn: 165324

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.

llvm-svn: 165322

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.

llvm-svn: 165321

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

llvm-svn: 165320

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

llvm-svn: 165319

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.

llvm-svn: 165318

12 years agotsan: cache pc's that cause suppressions (this way we do not need to symbolize the...
Dmitry Vyukov [Fri, 5 Oct 2012 15:51:32 +0000 (15:51 +0000)]
tsan: cache pc's that cause suppressions (this way we do not need to symbolize the reports)

llvm-svn: 165317

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

llvm-svn: 165316

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(-)

llvm-svn: 165315

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

llvm-svn: 165314

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.

llvm-svn: 165313

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.

llvm-svn: 165312

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

llvm-svn: 165311

12 years agoFix incorrect setting of EI_DATA
Sid Manning [Fri, 5 Oct 2012 14:06:24 +0000 (14:06 +0000)]
Fix incorrect setting of EI_DATA

llvm-svn: 165310

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]

llvm-svn: 165309

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.

llvm-svn: 165308

12 years agoIf !asan_inited, call internal versions of libc functions where available.
Alexander Potapenko [Fri, 5 Oct 2012 12:11:06 +0000 (12:11 +0000)]
If !asan_inited, call internal versions of libc functions where available.
This is to remove unnecessary #if directives.

llvm-svn: 165307

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.

llvm-svn: 165306

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.

llvm-svn: 165305

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.

llvm-svn: 165304

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.

llvm-svn: 165303

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.

llvm-svn: 165302

12 years agoone more small fix for the gdb-comes-first column order
Jason Molenda [Fri, 5 Oct 2012 05:31:01 +0000 (05:31 +0000)]
one more small fix for the gdb-comes-first column order

llvm-svn: 165301

12 years agoChange the "bt" command alias defined in CommandInterpreter::LoadCommandDictionary.
Jason Molenda [Fri, 5 Oct 2012 05:29:32 +0000 (05:29 +0000)]
Change the "bt" command alias defined in CommandInterpreter::LoadCommandDictionary.
It is now a regex command alias that more faithfully emulates gdb's
behavior, most importantly, "bt 5" will backtrace 5 frames of the
currently selected thread.  "bt all" still backtraces all threads
(unlike gdb) and for users who have learned to use "bt -c 5", that
form is still accepted.

llvm-svn: 165300

12 years agoSymbols::LocateMacOSXFilesUsingDebugSymbols() - perform tilde
Jason Molenda [Fri, 5 Oct 2012 04:57:34 +0000 (04:57 +0000)]
Symbols::LocateMacOSXFilesUsingDebugSymbols() - perform tilde
expansion on the dSYM path we find if it starts with a tilde.

llvm-svn: 165299

12 years agoAdded forgotten break.
Abramo Bagnara [Fri, 5 Oct 2012 04:43:29 +0000 (04:43 +0000)]
Added forgotten break.

llvm-svn: 165298

12 years agotypeo
Jason Molenda [Fri, 5 Oct 2012 04:29:13 +0000 (04:29 +0000)]
typeo

llvm-svn: 165297

12 years agotypeo
Jason Molenda [Fri, 5 Oct 2012 04:28:53 +0000 (04:28 +0000)]
typeo

llvm-svn: 165296

12 years agoUpdate the intro paragraph of text describing the table below to
Jason Molenda [Fri, 5 Oct 2012 04:28:33 +0000 (04:28 +0000)]
Update the intro paragraph of text describing the table below to
reflect that the columns were just swapped.

llvm-svn: 165295

12 years agoSwap the columns in the lldb & gdb command comparison table. I
Jason Molenda [Fri, 5 Oct 2012 04:26:06 +0000 (04:26 +0000)]
Swap the columns in the lldb & gdb command comparison table.  I
often hear feedback from people that having the lldb commands on
the left hand side is non-intuitive -- they say "I want a *gdb* to
*lldb* table, not a *lldb* to *gdb* table".  It doesn't seem odious
to go from the right-hand column to the left hand column but I've
heard this same feedback enough that it's also pointless to keep
the format lldb-first, gdb-second when it was an arbitrary choice
to begin with.

llvm-svn: 165294

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.

llvm-svn: 165293

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.

llvm-svn: 165292

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.

llvm-svn: 165291

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.

llvm-svn: 165290

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

llvm-svn: 165289

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.

llvm-svn: 165288

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

llvm-svn: 165287

12 years agoWorkaround for libstdc++4.6 <atomic> bug: make comment more explicit about what's...
Richard Smith [Fri, 5 Oct 2012 01:46:25 +0000 (01:46 +0000)]
Workaround for libstdc++4.6 <atomic> bug: make comment more explicit about what's going on, per Sean Silva's suggestion.

llvm-svn: 165286

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.

llvm-svn: 165285

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.

llvm-svn: 165284

12 years agoImplement -Wshift-op-parentheses for: a << b + c
David Blaikie [Fri, 5 Oct 2012 00:41:03 +0000 (00:41 +0000)]
Implement -Wshift-op-parentheses for: a << b + c

This appears to be consistent with GCC's implementation of the same warning
under -Wparentheses. Suppressing a << b + c for cases where 'a' is a user
defined type for compatibility with C++ stream IO. Otherwise suggest
parentheses around the addition or subtraction subexpression.

(this came up when MSVC was complaining (incorrectly, so far as I can tell)
about a perceived violation of this within the LLVM codebase, PR14001)

llvm-svn: 165283

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.

llvm-svn: 165282

12 years ago[libclang] Now that we have a CXModule object, pass it to the
Argyrios Kyrtzidis [Fri, 5 Oct 2012 00:22:40 +0000 (00:22 +0000)]
[libclang] Now that we have a CXModule object, pass it to the
importedASTFile indexing callback.

llvm-svn: 165281

12 years ago[libclang] Introduce new C functions that provide information about modules:
Argyrios Kyrtzidis [Fri, 5 Oct 2012 00:22:37 +0000 (00:22 +0000)]
[libclang] Introduce new C functions that provide information about modules:

clang_Cursor_getModule
clang_Module_getParent
clang_Module_getName
clang_Module_getFullName
clang_Module_getNumTopLevelHeaders
clang_Module_getTopLevelHeader

llvm-svn: 165280

12 years ago[Modules] Introduce Module::TopHeaders which is a set of top-level headers
Argyrios Kyrtzidis [Fri, 5 Oct 2012 00:22:33 +0000 (00:22 +0000)]
[Modules] Introduce Module::TopHeaders which is a set of top-level headers
that are associated with a (sub)module.

llvm-svn: 165279

12 years ago[preprocessing record] Have PPEntityID be independent of the size of the
Argyrios Kyrtzidis [Fri, 5 Oct 2012 00:22:28 +0000 (00:22 +0000)]
[preprocessing record] Have PPEntityID be independent of the size of the
loaded entities vector, otherwise its meaning will change when a module
is imported and the vector size changes.

llvm-svn: 165278

12 years ago[libclang] Introduce CXCursor_ModuleImportDecl cursor kind, used for a module
Argyrios Kyrtzidis [Fri, 5 Oct 2012 00:22:24 +0000 (00:22 +0000)]
[libclang] Introduce CXCursor_ModuleImportDecl cursor kind, used for a module
import declaration.

llvm-svn: 165277

12 years agoTest case for r165275.
Chad Rosier [Thu, 4 Oct 2012 23:59:54 +0000 (23:59 +0000)]
Test case for r165275.

llvm-svn: 165276

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.

llvm-svn: 165275

12 years ago<rdar://problem/12099999> renaming SBStream::Printf to Print in the scripting world...
Enrico Granata [Thu, 4 Oct 2012 23:54:09 +0000 (23:54 +0000)]
<rdar://problem/12099999> renaming SBStream::Printf to Print in the scripting world in order to avoid supporting varargs through SWIG

llvm-svn: 165274

12 years agoIf we flow off the end of a value-returning function:
Richard Smith [Thu, 4 Oct 2012 23:52:29 +0000 (23:52 +0000)]
If we flow off the end of a value-returning function:
 - outside C++, return undef (behavior is not undefined unless the value is used)
 - in C++, with -fcatch-undefined-behavior, perform an appropriate trap
 - in C++, produce an 'unreachable' (behavior is undefined immediately)

llvm-svn: 165273

12 years agoA tweak to the previous commit to ensure that we don't try to use -> on a NULL pointe...
Enrico Granata [Thu, 4 Oct 2012 23:17:01 +0000 (23:17 +0000)]
A tweak to the previous commit to ensure that we don't try to use -> on a NULL pointer (should not happen but better be safe than sorry)

llvm-svn: 165272

12 years ago<rdar://problem/12413390> Fixing an issue where synthetic ValueObjects do not properl...
Enrico Granata [Thu, 4 Oct 2012 23:13:00 +0000 (23:13 +0000)]
<rdar://problem/12413390> Fixing an issue where synthetic ValueObjects do not properly resolve their value

llvm-svn: 165271

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.

llvm-svn: 165270

12 years agoRan the sources through the compiler with -Wshadow warnings
Jason Molenda [Thu, 4 Oct 2012 22:47:07 +0000 (22:47 +0000)]
Ran the sources through the compiler with -Wshadow warnings
enabled after we'd found a few bugs that were caused by shadowed
local variables; the most important issue this turned up was
a common mistake of trying to obtain a mutex lock for the scope
of a code block by doing

        Mutex::Locker(m_map_mutex);

This doesn't assign the lock object to a local variable; it is
a temporary that has its dtor called immediately.  Instead,

        Mutex::Locker locker(m_map_mutex);

does what is intended.  For some reason -Wshadow happened to
highlight these as shadowed variables.

I also fixed a few obivous and easy shadowed variable issues
across the code base but there are a couple dozen more that
should be fixed when someone has a free minute.
<rdar://problem/12437585>

llvm-svn: 165269

12 years agoRemoved a directive to delete the test subdirectories
Sean Callanan [Thu, 4 Oct 2012 22:37:53 +0000 (22:37 +0000)]
Removed a directive to delete the test subdirectories
from LLVM and Clang.  This made "svn update" very
unpleasant if the original repository was fetched by
build-llvm.pl.

llvm-svn: 165268

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.

llvm-svn: 165267

12 years agoMade the i386 ABI mark EBP as non-volatile,
Sean Callanan [Thu, 4 Oct 2012 22:24:27 +0000 (22:24 +0000)]
Made the i386 ABI mark EBP as non-volatile,
because the unwinders typically can find its
value.

llvm-svn: 165266

12 years agolibstdc++-4.6 needs the same common_type fix as libstdc++-4.7. Other than that,
Richard Smith [Thu, 4 Oct 2012 22:23:07 +0000 (22:23 +0000)]
libstdc++-4.6 needs the same common_type fix as libstdc++-4.7. Other than that,
Clang can now cope with its eccentricities in C++11 mode.

llvm-svn: 165265

12 years agoClangASTContext::GetIndexOfChildWithName - increment the child index we plan to retur...
Jim Ingham [Thu, 4 Oct 2012 22:22:16 +0000 (22:22 +0000)]
ClangASTContext::GetIndexOfChildWithName - increment the child index we plan to return as we iterate through the ivars.

<rdar://problem/12433299>

llvm-svn: 165264

12 years agoEgriegious hack to support libstdc++4.6's broken <atomic> header, which defines
Richard Smith [Thu, 4 Oct 2012 22:13:39 +0000 (22:13 +0000)]
Egriegious hack to support libstdc++4.6's broken <atomic> header, which defines
a non-inline namespace, then reopens it as inline to try to add its symbols to
the surrounding namespace. In this one special case, permit the namespace to be
reopened as inline, and patch up the name lookup tables to match.

llvm-svn: 165263

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.

llvm-svn: 165262

12 years agoFixed an assertion in the SymbolFile resulting
Sean Callanan [Thu, 4 Oct 2012 22:06:29 +0000 (22:06 +0000)]
Fixed an assertion in the SymbolFile resulting
from a NULL ObjCInterfaceDecl.

llvm-svn: 165261

12 years ago<rdar://problem/12424824> Making sure that we correctly update our synthetic children...
Enrico Granata [Thu, 4 Oct 2012 21:46:06 +0000 (21:46 +0000)]
<rdar://problem/12424824> Making sure that we correctly update our synthetic children provider for NSDictionary - providing better support for dynamic types by letting the filter recalculate itself when the type of the object changes

llvm-svn: 165260

12 years agoFixed FunctionTypeLoc source range.
Abramo Bagnara [Thu, 4 Oct 2012 21:42:10 +0000 (21:42 +0000)]
Fixed FunctionTypeLoc source range.

llvm-svn: 165259

12 years agoFixed instantiated operators source range.
Abramo Bagnara [Thu, 4 Oct 2012 21:40:42 +0000 (21:40 +0000)]
Fixed instantiated operators source range.

llvm-svn: 165258

12 years agoFixed friend decl source range.
Abramo Bagnara [Thu, 4 Oct 2012 21:39:47 +0000 (21:39 +0000)]
Fixed friend decl source range.

llvm-svn: 165257

12 years agoFixed ParamDecl source range for implicit typed k&r parameters.
Abramo Bagnara [Thu, 4 Oct 2012 21:38:29 +0000 (21:38 +0000)]
Fixed ParamDecl source range for implicit typed k&r parameters.

llvm-svn: 165256

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.

llvm-svn: 165255

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

llvm-svn: 165254

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.

llvm-svn: 165253

12 years ago<rdar://problem/12424824> Making sure that we correctly update our synthetic children...
Enrico Granata [Thu, 4 Oct 2012 21:04:46 +0000 (21:04 +0000)]
<rdar://problem/12424824> Making sure that we correctly update our synthetic children provider for NSArray - the same work will need to be done for NSDictionary

llvm-svn: 165252

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.

llvm-svn: 165251

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.

llvm-svn: 165250

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.

llvm-svn: 165249

12 years agoFix the CodeGen/ppc64-varargs-struct.c test case to tolerate release builds.
Bill Schmidt [Thu, 4 Oct 2012 20:33:57 +0000 (20:33 +0000)]
Fix the CodeGen/ppc64-varargs-struct.c test case to tolerate release builds.

llvm-svn: 165247

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.

llvm-svn: 165246

12 years agoAdd a test case for r156143, which enabled general varargs support for the
Bill Schmidt [Thu, 4 Oct 2012 20:18:38 +0000 (20:18 +0000)]
Add a test case for r156143, which enabled general varargs support for the
64-bit PPC SVR4 ABI.

The test verifies passing of structures, items with 16-byte alignment, and
small items that are passed right-justified in the parameter save area slot.

llvm-svn: 165245

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.

llvm-svn: 165244

12 years ago(no commit message)
Micah Villmow [Thu, 4 Oct 2012 20:06:07 +0000 (20:06 +0000)]
(no commit message)

llvm-svn: 165243

12 years ago(no commit message)
Micah Villmow [Thu, 4 Oct 2012 20:05:12 +0000 (20:05 +0000)]
(no commit message)

llvm-svn: 165242

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.

llvm-svn: 165241

12 years agoDriver: Link crtfastmath.o if it's available and -ffast-math is specified.
Benjamin Kramer [Thu, 4 Oct 2012 19:42:20 +0000 (19:42 +0000)]
Driver: Link crtfastmath.o if it's available and -ffast-math is specified.

crtfastmath.o contains routines to set the floating point flags to a faster,
unsafe mode. Linking it in speeds up code dealing with denormals significantly
(PR14024).

For now this is only enabled on linux where I can test it and crtfastmath.o is
widely available. We may want to provide a similar file with compiler-rt
eventually and/or enable it on other platforms too.

llvm-svn: 165240

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.

llvm-svn: 165239

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.

llvm-svn: 165238

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.

llvm-svn: 165237

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.

llvm-svn: 165236

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.

llvm-svn: 165235

12 years agoFix scope location when parsing GNU attributes.
Michael Han [Thu, 4 Oct 2012 16:42:52 +0000 (16:42 +0000)]
Fix scope location when parsing GNU attributes.

For GNU attributes, instead of reusing attribute source
location for the scope location, use SourceLocation() since
GNU attributes don not have scope tokens.

llvm-svn: 165234

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

llvm-svn: 165233

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.

llvm-svn: 165232

12 years agoRevert 165129
Preston Gurd [Thu, 4 Oct 2012 15:26:04 +0000 (15:26 +0000)]
Revert 165129

llvm-svn: 165231

12 years agotsan for Go: support mallocs before __tsan_init() (required to support cgo code)
Dmitry Vyukov [Thu, 4 Oct 2012 13:54:49 +0000 (13:54 +0000)]
tsan for Go: support mallocs before __tsan_init() (required to support cgo code)

llvm-svn: 165229

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!

llvm-svn: 165228

12 years agoAvoid calling __asan_init from memcpy(), memmove(), memset() during libSystem initial...
Alexander Potapenko [Thu, 4 Oct 2012 13:41:28 +0000 (13:41 +0000)]
Avoid calling __asan_init from memcpy(), memmove(), memset() during libSystem initialization.
Fixes http://code.google.com/p/address-sanitizer/issues/detail?id=117.

llvm-svn: 165227

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.

llvm-svn: 165226

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.

llvm-svn: 165225

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.

llvm-svn: 165224

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.

llvm-svn: 165223