platform/upstream/llvm.git
11 years agoFix build failure from r165722
Derek Schuff [Thu, 11 Oct 2012 18:21:13 +0000 (18:21 +0000)]
Fix build failure from r165722

llvm-svn: 165731

11 years ago<rdar://problem/12331741>
Greg Clayton [Thu, 11 Oct 2012 18:07:21 +0000 (18:07 +0000)]
<rdar://problem/12331741>

Dynamic type code must be efficient and fast. Now it is.

Added ObjC v1 support for getting the complete list of ISA values.

The main flow of the AppleObjCRuntime subclasses is now they must override "virtual bool UpdateISAToDescriptorMap_Impl();". This function will update the complete list of ISA values and create ClassDescriptorSP objects for each one. Now we have the complete list of valid ISA values which we can use for verification when doing dynamic typing.

Refactored a bunch of stuff so that the AppleObjCRuntime subclasses don't have to implement as many functions as they used to.

llvm-svn: 165730

11 years agoIntroduce a simple "hint" scheme to eliminate the quadratic behavior
Douglas Gregor [Thu, 11 Oct 2012 17:41:54 +0000 (17:41 +0000)]
Introduce a simple "hint" scheme to eliminate the quadratic behavior
associated with deserializing macro history for an identifier.

llvm-svn: 165729

11 years agoPatch from Andrew Kaylor that fixes Linux default host triple values.
Greg Clayton [Thu, 11 Oct 2012 17:38:58 +0000 (17:38 +0000)]
Patch from Andrew Kaylor that fixes Linux default host triple values.

llvm-svn: 165728

11 years agoMake the deserialization of PendingMacroIDs deterministic.
Douglas Gregor [Thu, 11 Oct 2012 17:31:34 +0000 (17:31 +0000)]
Make the deserialization of PendingMacroIDs deterministic.

llvm-svn: 165727

11 years agoAdd in the first iteration of support for llvm/clang/lldb to allow variable per addre...
Micah Villmow [Thu, 11 Oct 2012 17:21:41 +0000 (17:21 +0000)]
Add in the first iteration of support for llvm/clang/lldb to allow variable per address space pointer sizes to be optimized correctly.

llvm-svn: 165726

11 years ago-Warc-repeated-use-of-weak: fix a use-of-uninitialized and add a test case.
Jordan Rose [Thu, 11 Oct 2012 17:02:00 +0000 (17:02 +0000)]
-Warc-repeated-use-of-weak: fix a use-of-uninitialized and add a test case.

Fix-up for r165718, should get the buildbots back online.

llvm-svn: 165723

11 years agoProperly factor Native Client defines to support NaCl as an OS
Derek Schuff [Thu, 11 Oct 2012 16:55:58 +0000 (16:55 +0000)]
Properly factor Native Client defines to support NaCl as an OS
with x86/ARM architecture

llvm-svn: 165722

11 years agoPass an explicit operand number to addLiveIns.
Jakob Stoklund Olesen [Thu, 11 Oct 2012 16:46:07 +0000 (16:46 +0000)]
Pass an explicit operand number to addLiveIns.

Not all instructions define a virtual register in their first operand.
Specifically, INLINEASM has a different format.

<rdar://problem/12472811>

llvm-svn: 165721

11 years agoHandle gnu_inline in c++ in a gcc compatible way. Original patch by Tobias
Rafael Espindola [Thu, 11 Oct 2012 16:32:25 +0000 (16:32 +0000)]
Handle gnu_inline in c++ in a gcc compatible way. Original patch by Tobias
Grosser.

llvm-svn: 165720

11 years ago-Warc-repeated-use-of-weak: Don't warn on a single read followed by writes.
Jordan Rose [Thu, 11 Oct 2012 16:10:19 +0000 (16:10 +0000)]
-Warc-repeated-use-of-weak: Don't warn on a single read followed by writes.

This is a "safe" pattern, or at least one that cannot be helped by using
a strong local variable. However, if the single read is within a loop,
it should /always/ be treated as potentially dangerous.

<rdar://problem/12437490>

llvm-svn: 165719

11 years ago-Warc-repeated-use-of-weak: Check messages to property accessors as well.
Jordan Rose [Thu, 11 Oct 2012 16:06:21 +0000 (16:06 +0000)]
-Warc-repeated-use-of-weak: Check messages to property accessors as well.

Previously, [foo weakProp] was not being treated the same as foo.weakProp.
Now, for every explicit message send, we check if it's a property access,
and if so, if the property is weak. Then for every assignment of a
message, we have to do the same thing again.

This is a potentially expensive increase because determining whether a
method is a property accessor requires searching through the methods it
overrides. However, without it -Warc-repeated-use-of-weak will miss cases
from people who prefer not to use dot syntax. If this turns out to be
too expensive, we can try caching the result somewhere, or even lose
precision by not checking superclass methods. The warning is off-by-default,
though.

<rdar://problem/12407765>

llvm-svn: 165718

11 years ago[libclang] Improve AST serialization done by ASTUnit::Save().
Argyrios Kyrtzidis [Thu, 11 Oct 2012 16:05:00 +0000 (16:05 +0000)]
[libclang] Improve AST serialization done by ASTUnit::Save().

The ASTUnit needs to initialize an ASTWriter at the beginning of
parsing to fully handle serialization of a translation unit that
imports modules. Do this by introducing an option to enable it, which
corresponds to CXTranslationUnit_ForSerialization on the C API side.

llvm-svn: 165717

11 years agoObjCMethodDecl::findPropertyDecl: bail out early if not an instance method.
Jordan Rose [Thu, 11 Oct 2012 16:02:02 +0000 (16:02 +0000)]
ObjCMethodDecl::findPropertyDecl: bail out early if not an instance method.

Currently, Objective-C does not support class properties, even though it
allows calling class methods with dot syntax.

No intended functionality change; purely optimization.

llvm-svn: 165716

11 years agoMake X86_64ABIInfo clean for ABIs with 32 bit pointers, such as X32
Derek Schuff [Thu, 11 Oct 2012 15:52:22 +0000 (15:52 +0000)]
Make X86_64ABIInfo clean for ABIs with 32 bit pointers, such as X32
and Native Client

llvm-svn: 165715

11 years agoThis patch addresses PR13947.
Bill Schmidt [Thu, 11 Oct 2012 15:38:20 +0000 (15:38 +0000)]
This patch addresses PR13947.

For function calls on the 64-bit PowerPC SVR4 target, each parameter
is mapped to as many doublewords in the parameter save area as
necessary to hold the parameter.  The first 13 non-varargs
floating-point values are passed in registers; any additional
floating-point parameters are passed in the parameter save area.  A
single-precision floating-point parameter (32 bits) must be mapped to
the second (rightmost, low-order) word of its assigned doubleword
slot.

Currently LLVM violates this ABI requirement by mapping such a
parameter to the first (leftmost, high-order) word of its assigned
doubleword slot.  This is internally self-consistent but will not
interoperate correctly with libraries compiled with an ABI-compliant
compiler.

This patch corrects the problem by adjusting the parameter addressing
on both sides of the calling convention.

llvm-svn: 165714

11 years agoAdd test cases for correct parsing of register names in 32- and 64-bit modes.
David Chisnall [Thu, 11 Oct 2012 12:42:49 +0000 (12:42 +0000)]
Add test cases for correct parsing of register names in 32- and 64-bit modes.

llvm-svn: 165713

11 years agoclang/test/CodeGenCXX/microsoft-uuidof.cpp: Fix for -Asserts.
NAKAMURA Takumi [Thu, 11 Oct 2012 11:20:31 +0000 (11:20 +0000)]
clang/test/CodeGenCXX/microsoft-uuidof.cpp: Fix for -Asserts.

llvm-svn: 165712

11 years agoExpose move to/from coprocessor instructions in MIPS64 mode.
David Chisnall [Thu, 11 Oct 2012 10:21:34 +0000 (10:21 +0000)]
Expose move to/from coprocessor instructions in MIPS64 mode.

Note: [D]M{T,F}CP2 is just a recommended encoding.  Vendors often provide a
custom CP2 that interprets instructions differently and may wish to add their
own instructions that use this opcode.  We should ensure that this is easy to
do.  I will probably add a 'has custom CP{0-3}' subtarget flag to make this
easy: We want to avoid the GCC situation where every MIPS vendor makes a custom
fork that breaks every other MIPS CPU and so can't be merged upstream.

llvm-svn: 165711

11 years agoAdd codegen support for __uuidof().
Nico Weber [Thu, 11 Oct 2012 10:13:44 +0000 (10:13 +0000)]
Add codegen support for __uuidof().

llvm-svn: 165710

11 years agollvm/Analysis/Passes.h: Fix copypasto in createDependenceAnalysisPass().
NAKAMURA Takumi [Thu, 11 Oct 2012 08:26:52 +0000 (08:26 +0000)]
llvm/Analysis/Passes.h: Fix copypasto in createDependenceAnalysisPass().

llvm-svn: 165709

11 years agodependence analysis
Sebastian Pop [Thu, 11 Oct 2012 07:32:34 +0000 (07:32 +0000)]
dependence analysis

Patch from Preston Briggs <preston.briggs@gmail.com>.

This is an updated version of the dependence-analysis patch, including an MIV
test based on Banerjee's inequalities.

It's a fairly complete implementation of the paper

    Practical Dependence Testing
    Gina Goff, Ken Kennedy, and Chau-Wen Tseng
    PLDI 1991

It cannot yet propagate constraints between coupled RDIV subscripts (discussed
in Section 5.3.2 of the paper).

It's organized as a FunctionPass with a single entry point that supports testing
for dependence between two instructions in a function. If there's no dependence,
it returns null. If there's a dependence, it returns a pointer to a Dependence
which can be queried about details (what kind of dependence, is it loop
independent, direction and distance vector entries, etc). I haven't included
every imaginable feature, but there's a good selection that should be adequate
for supporting many loop transformations. Of course, it can be extended as
necessary.

Included in the patch file are many test cases, commented with C code showing
the loops and array references.

llvm-svn: 165708

11 years agoFollow the same routine to add target float expansion hook
Michael Liao [Thu, 11 Oct 2012 07:22:01 +0000 (07:22 +0000)]
Follow the same routine to add target float expansion hook

llvm-svn: 165707

11 years agoAdd prologue text for list of potential checkers.
Ted Kremenek [Thu, 11 Oct 2012 06:26:56 +0000 (06:26 +0000)]
Add prologue text for list of potential checkers.

llvm-svn: 165705

11 years agoWhen OptionValueFileSpec is given a filename starting
Jason Molenda [Thu, 11 Oct 2012 06:05:54 +0000 (06:05 +0000)]
When OptionValueFileSpec is given a filename starting
with ~, we need to realpath it.  Fixes the case where

settings set target.expr-prefix ~/lldb.prefix.header

wouldn't read this prefix header file.  <rdar://problem/12475676>

llvm-svn: 165704

11 years agoChange the scratch buffer for x86 assembly instructions in AssemblyParse_x86 from
Jason Molenda [Thu, 11 Oct 2012 06:04:37 +0000 (06:04 +0000)]
Change the scratch buffer for x86 assembly instructions in AssemblyParse_x86 from
malloc'ed heap to an llvm SmallVector.

llvm-svn: 165703

11 years agomisched: Handle "transient" non-instructions.
Andrew Trick [Thu, 11 Oct 2012 05:37:06 +0000 (05:37 +0000)]
misched: Handle "transient" non-instructions.

llvm-svn: 165701

11 years agoDon't crash when !tbaa.struct contents is invalid.
Nick Lewycky [Thu, 11 Oct 2012 02:05:23 +0000 (02:05 +0000)]
Don't crash when !tbaa.struct contents is invalid.

llvm-svn: 165693

11 years agoRevert r165661, "Patch by Shuxin Yang <shuxin.llvm@gmail.com>."
NAKAMURA Takumi [Thu, 11 Oct 2012 02:02:05 +0000 (02:02 +0000)]
Revert r165661, "Patch by Shuxin Yang <shuxin.llvm@gmail.com>."

It broke stage2 clang and test-suite/MultiSource/Benchmarks/mediabench/g721/g721encode.

llvm-svn: 165692

11 years agoGettingStarted.rst: s/&amp;/&/g
NAKAMURA Takumi [Thu, 11 Oct 2012 01:10:37 +0000 (01:10 +0000)]
GettingStarted.rst: s/&amp;/&/g

llvm-svn: 165690

11 years agoGettingStarted.rst: Fix the label to DeveloperPolicy.html.
NAKAMURA Takumi [Thu, 11 Oct 2012 01:10:27 +0000 (01:10 +0000)]
GettingStarted.rst: Fix the label to DeveloperPolicy.html.

llvm-svn: 165689

11 years agoclang/lib/Headers/CMakeLists.txt: Add f16cintrin.h.
NAKAMURA Takumi [Thu, 11 Oct 2012 01:10:04 +0000 (01:10 +0000)]
clang/lib/Headers/CMakeLists.txt: Add f16cintrin.h.

llvm-svn: 165688

11 years agoAdd the LLVM context to this c'tor. It will be needed in the future.
Bill Wendling [Thu, 11 Oct 2012 01:10:00 +0000 (01:10 +0000)]
Add the LLVM context to this c'tor. It will be needed in the future.

llvm-svn: 165687

11 years agoSupport a common idiom on how to build an Attributes class with a single attribute.
Bill Wendling [Thu, 11 Oct 2012 01:05:52 +0000 (01:05 +0000)]
Support a common idiom on how to build an Attributes class with a single attribute.

llvm-svn: 165686

11 years agoX86: add F16C support in Clang
Manman Ren [Thu, 11 Oct 2012 00:59:55 +0000 (00:59 +0000)]
X86: add F16C support in Clang

Support the following intrinsics:
  _mm_cvtph_ps, _mm256_cvtph_ps, _mm_cvtps_ph, _mm256_cvtps_ph

rdar://12407875

llvm-svn: 165685

11 years agoRemove the ASTDeserializationListener's MacroVisible() callback, which
Douglas Gregor [Thu, 11 Oct 2012 00:51:27 +0000 (00:51 +0000)]
Remove the ASTDeserializationListener's MacroVisible() callback, which
is no longer necessary, as well as the little bit of infrastructure in
the AST writer that used it.

llvm-svn: 165684

11 years agoRemove an unused bit from the serialized IdentifierInfo
Douglas Gregor [Thu, 11 Oct 2012 00:48:48 +0000 (00:48 +0000)]
Remove an unused bit from the serialized IdentifierInfo

llvm-svn: 165683

11 years agoDeserialize macro history when we deserialize an identifier that has
Douglas Gregor [Thu, 11 Oct 2012 00:46:49 +0000 (00:46 +0000)]
Deserialize macro history when we deserialize an identifier that has
macro history.

When deserializing macro history, we arrange history such that the
macros that have definitions (that haven't been #undef'd) and are
visible come at the beginning of the list, which is what the
preprocessor and other clients of Preprocessor::getMacroInfo()
expect. If additional macro definitions become visible later, they'll
be moved toward the front of the list. Note that it's possible to have
ambiguities, but we don't diagnose them yet.

There is a partially-implemented design decision here that, if a
particular identifier has been defined or #undef'd within the
translation unit, that definition (or #undef) hides any macro
definitions that come from imported modules. There's still a little
work to do to ensure that the right #undef'ing happens.

Additionally, we'll need to scope the update records for #undefs, so
they only kick in when the submodule containing that update record
becomes visible.

llvm-svn: 165682

11 years agoTeach set-xcode-analyzer that the new default value for ExecPath is CLANG_ANALYZER_EXEC.
Ted Kremenek [Thu, 11 Oct 2012 00:40:41 +0000 (00:40 +0000)]
Teach set-xcode-analyzer that the new default value for ExecPath is CLANG_ANALYZER_EXEC.

llvm-svn: 165681

11 years agoDon't crash if a .ll file contains a forward-reference that looks like a global
Nick Lewycky [Thu, 11 Oct 2012 00:38:25 +0000 (00:38 +0000)]
Don't crash if a .ll file contains a forward-reference that looks like a global
value but later turns out to be a function.

Unfortunately, we can't fold tests into a single file because we only get one
error out of llvm-as.

llvm-svn: 165680

11 years agoMinor cleanup for r165678; no functional change.
Eli Friedman [Thu, 11 Oct 2012 00:34:15 +0000 (00:34 +0000)]
Minor cleanup for r165678; no functional change.

llvm-svn: 165679

11 years agoMake sure we perform the variadic method check correctly for calls to a member operat...
Eli Friedman [Thu, 11 Oct 2012 00:30:58 +0000 (00:30 +0000)]
Make sure we perform the variadic method check correctly for calls to a member operator().  PR14057.

llvm-svn: 165678

11 years agoChange MachineInstrBuilder::addDisp to copy over target flags by default.
Evan Cheng [Thu, 11 Oct 2012 00:15:48 +0000 (00:15 +0000)]
Change MachineInstrBuilder::addDisp to copy over target flags by default.

llvm-svn: 165677

11 years agoReapply "[analyzer] Treat fields of unions as having symbolic offsets."
Jordan Rose [Wed, 10 Oct 2012 23:23:21 +0000 (23:23 +0000)]
Reapply "[analyzer] Treat fields of unions as having symbolic offsets."

This time, actually uncomment the code that's supposed to fix the problem.

This reverts r165671 / 8ceb837585ed973dc36fba8dfc57ef60fc8f2735.

llvm-svn: 165676

11 years agoFix a crash-on-invalid when parsing a reference to an invalid auto declaration
David Blaikie [Wed, 10 Oct 2012 23:15:05 +0000 (23:15 +0000)]
Fix a crash-on-invalid when parsing a reference to an invalid auto declaration

  auto x((unknown));
  int& y = x;

would crash because we were not flagging 'x' as an invalid declaration here.

llvm-svn: 165675

11 years agoobjective-C IRgen: When sending a method to 'super'
Fariborz Jahanian [Wed, 10 Oct 2012 23:11:18 +0000 (23:11 +0000)]
objective-C IRgen: When sending a method to 'super'
in a category class method, don't read 'isa' pointer. Instead,
save the desired OBJC_METACLASS_$_ClassName in
__DATA,__objc_superrefs and read that without reading any
isa pointers. // rdar://12459358

llvm-svn: 165674

11 years agoAdd isel patterns for v2f32 / v4f32 neon.vbsl intrinsics. rdar://12471808
Evan Cheng [Wed, 10 Oct 2012 23:06:34 +0000 (23:06 +0000)]
Add isel patterns for v2f32 / v4f32 neon.vbsl intrinsics. rdar://12471808

llvm-svn: 165673

11 years ago<rdar://problem/12462744> Implement a new SBDeclaration class to wrap an lldb_private...
Enrico Granata [Wed, 10 Oct 2012 22:54:17 +0000 (22:54 +0000)]
<rdar://problem/12462744> Implement a new SBDeclaration class to wrap an lldb_private::Declaration - make a GetDeclaration() API on SBValue to return a declaration. This will only work for vroot variables as they are they only objects for which we currently provide a valid Declaration

llvm-svn: 165672

11 years agoTemporarily Revert "[analyzer] Treat fields of unions as having symbolic offsets."
Eric Christopher [Wed, 10 Oct 2012 22:49:05 +0000 (22:49 +0000)]
Temporarily Revert "[analyzer] Treat fields of unions as having symbolic offsets."

Author: Jordan Rose <jordan_rose@apple.com>
Date:   Wed Oct 10 21:31:21 2012 +0000

    [analyzer] Treat fields of unions as having symbolic offsets.

    This allows only one field to be active at a time in RegionStore.
    This isn't quite the correct behavior for unions, but it at least
    would handle the case of "value goes in, value comes out" from the
    same field.

    RegionStore currently has a number of places where any access to a union
    results in UnknownVal being returned. However, it is clearly missing
    some cases, or the original issue wouldn't have occurred. It is probably
    now safe to remove those changes, but that's a potentially destabilizing
    change that should wait for more thorough testing.

    Fixes PR14054.

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

This reverts commit cf9030e480f77ab349672f00ad302e216c26c92c.

llvm-svn: 165671

11 years agoAdd getters for the MIPS TargetTransform classes
Nadav Rotem [Wed, 10 Oct 2012 22:45:53 +0000 (22:45 +0000)]
Add getters for the MIPS TargetTransform classes

llvm-svn: 165670

11 years agoRemove unused member variable introduced in r165665.
David Blaikie [Wed, 10 Oct 2012 22:38:21 +0000 (22:38 +0000)]
Remove unused member variable introduced in r165665.

llvm-svn: 165669

11 years agoFormatting and 80-col.
Eric Christopher [Wed, 10 Oct 2012 22:37:01 +0000 (22:37 +0000)]
Formatting and 80-col.

llvm-svn: 165668

11 years agoRevert "[Options] make Option a value type."
Eric Christopher [Wed, 10 Oct 2012 22:34:46 +0000 (22:34 +0000)]
Revert "[Options] make Option a value type."

Author: Michael J. Spencer <bigcheesegs@gmail.com>
Date:   Wed Oct 10 21:48:26 2012 +0000

    [Options] make Option a value type.

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

This reverts commit 0464fd5e4ce2193e786e5adcab6b828f9366dae3.

llvm-svn: 165667

11 years agoAdd -mattr=+altivec and remove XFAIL.
Bill Schmidt [Wed, 10 Oct 2012 22:25:11 +0000 (22:25 +0000)]
Add -mattr=+altivec and remove XFAIL.

llvm-svn: 165666

11 years agoAdd a new interface to allow IR-level passes to access codegen-specific information.
Nadav Rotem [Wed, 10 Oct 2012 22:04:55 +0000 (22:04 +0000)]
Add a new interface to allow IR-level passes to access codegen-specific information.

llvm-svn: 165665

11 years agoXFAIL for all targets pending investigation
Bill Schmidt [Wed, 10 Oct 2012 21:52:10 +0000 (21:52 +0000)]
XFAIL for all targets pending investigation

llvm-svn: 165664

11 years ago[Options] make Option a value type.
Michael J. Spencer [Wed, 10 Oct 2012 21:48:26 +0000 (21:48 +0000)]
[Options] make Option a value type.

llvm-svn: 165663

11 years agoMove the scratch buffer allocation for x86 instructions from being allocated each...
Jason Molenda [Wed, 10 Oct 2012 21:37:00 +0000 (21:37 +0000)]
Move the scratch buffer allocation for x86 instructions from being allocated each instruction,
to once in the AssemblyParse_x86 ctor.
an instruction

llvm-svn: 165662

11 years agoPatch by Shuxin Yang <shuxin.llvm@gmail.com>.
Nadav Rotem [Wed, 10 Oct 2012 21:31:55 +0000 (21:31 +0000)]
Patch by Shuxin Yang <shuxin.llvm@gmail.com>.

Original message:

The attached is the fix to radar://11663049. The optimization can be outlined by following rules:

   (select (x != c), e, c) -> select (x != c), e, x),
   (select (x == c), c, e) -> select (x == c), x, e)
where the <c> is an integer constant.

 The reason for this change is that : on x86, conditional-move-from-constant needs two instructions;
however, conditional-move-from-register need only one instruction.

  While the LowerSELECT() sounds to be the most convenient place for this optimization, it turns out to be a bad place. The reason is that by replacing the constant <c> with a symbolic value, it obscure some instruction-combining opportunities which would otherwise be very easy to spot. For that reason, I have to postpone the change to last instruction-combining phase.

  The change passes the test of "make check-all -C <build-root/test" and "make -C project/test-suite/SingleSource".

llvm-svn: 165661

11 years ago[analyzer] Treat fields of unions as having symbolic offsets.
Jordan Rose [Wed, 10 Oct 2012 21:31:21 +0000 (21:31 +0000)]
[analyzer] Treat fields of unions as having symbolic offsets.

This allows only one field to be active at a time in RegionStore.
This isn't quite the correct behavior for unions, but it at least
would handle the case of "value goes in, value comes out" from the
same field.

RegionStore currently has a number of places where any access to a union
results in UnknownVal being returned. However, it is clearly missing
some cases, or the original issue wouldn't have occurred. It is probably
now safe to remove those changes, but that's a potentially destabilizing
change that should wait for more thorough testing.

Fixes PR14054.

llvm-svn: 165660

11 years agoWhen generating spill and reload code for vector registers on PowerPC,
Bill Schmidt [Wed, 10 Oct 2012 21:25:01 +0000 (21:25 +0000)]
When generating spill and reload code for vector registers on PowerPC,
the compiler makes use of GPR0.  However, there are two flavors of
GPR0 defined by the target:  the 32-bit GPR0 (R0) and the 64-bit GPR0
(X0).  The spill/reload code makes use of R0 regardless of whether we
are generating 32- or 64-bit code.

This patch corrects the problem in the obvious manner, using X0 and
ADDI8 for 64-bit and R0 and ADDI for 32-bit.

llvm-svn: 165658

11 years agoThe PowerPC VRSAVE register has been somewhat of an odd beast since
Bill Schmidt [Wed, 10 Oct 2012 20:54:15 +0000 (20:54 +0000)]
The PowerPC VRSAVE register has been somewhat of an odd beast since
the Altivec extensions were introduced.  Its use is optional, and
allows the compiler to communicate to the operating system which
vector registers should be saved and restored during a context switch.
In practice, this information is ignored by the various operating
systems using the SVR4 ABI; the kernel saves and restores the entire
register state.  Setting the VRSAVE register is no longer performed by
the AIX XL compilers, the IBM i compilers, or by GCC on Power Linux
systems.  It seems best to avoid this logic within LLVM as well.

This patch avoids generating code to update and restore VRSAVE for the
PowerPC SVR4 ABIs (32- and 64-bit).  The code remains in place for the
Darwin ABI.

llvm-svn: 165656

11 years agoAdd in support for expansion of all of the comparison operations to the absolute...
Micah Villmow [Wed, 10 Oct 2012 20:50:51 +0000 (20:50 +0000)]
Add in support for expansion of all of the comparison operations to the absolute minimum required set. This allows a backend to expand any arbitrary set of comparisons as long as a minimum set is supported.
The minimum set of required instructions is ISD::AND, ISD::OR, ISD::SETO(or ISD::SETOEQ) and ISD::SETUO(or ISD::SETUNE). Everything is expanded into one of two patterns:
Pattern 1: (LHS CC1 RHS) Opc (LHS CC2 RHS)
Pattern 2: (LHS CC1 LHS) Opc (RHS CC2 RHS)

llvm-svn: 165655

11 years agoRevert r165652: "Remove unnecessary RTTI from the build."
Sean Silva [Wed, 10 Oct 2012 20:50:36 +0000 (20:50 +0000)]
Revert r165652: "Remove unnecessary RTTI from the build."

... Apparently the RTTI is still necessary for some reason.

llvm-svn: 165654

11 years agoMake -Wshift-op-parentheses a subgroup of -Wparentheses
David Blaikie [Wed, 10 Oct 2012 20:30:36 +0000 (20:30 +0000)]
Make -Wshift-op-parentheses a subgroup of -Wparentheses

llvm-svn: 165653

11 years agoRemove unnecessary RTTI from the build.
Sean Silva [Wed, 10 Oct 2012 20:27:20 +0000 (20:27 +0000)]
Remove unnecessary RTTI from the build.

llvm-svn: 165652

11 years agotblgen: Compile TableGen without RTTI.
Sean Silva [Wed, 10 Oct 2012 20:27:18 +0000 (20:27 +0000)]
tblgen: Compile TableGen without RTTI.

TableGen no longer needs RTTI!

llvm-svn: 165651

11 years agotblgen: Build clang-tblgen without RTTI.
Sean Silva [Wed, 10 Oct 2012 20:25:45 +0000 (20:25 +0000)]
tblgen: Build clang-tblgen without RTTI.

clang-tblgen no longer needs RTTI!

llvm-svn: 165650

11 years agotblgen: Use LLVM-style RTTI in clang-tblgen
Sean Silva [Wed, 10 Oct 2012 20:25:43 +0000 (20:25 +0000)]
tblgen: Use LLVM-style RTTI in clang-tblgen

llvm-svn: 165649

11 years agotblgen: Move mini Type hierarchy to LLVM-style RTTI.
Sean Silva [Wed, 10 Oct 2012 20:24:49 +0000 (20:24 +0000)]
tblgen: Move mini Type hierarchy to LLVM-style RTTI.

llvm-svn: 165648

11 years agotblgen: Use semantically correct RTTI functions.
Sean Silva [Wed, 10 Oct 2012 20:24:47 +0000 (20:24 +0000)]
tblgen: Use semantically correct RTTI functions.

Also, some minor cleanup.

llvm-svn: 165647

11 years agotblgen: Mechanically move dynamic_cast<> to dyn_cast<>.
Sean Silva [Wed, 10 Oct 2012 20:24:43 +0000 (20:24 +0000)]
tblgen: Mechanically move dynamic_cast<> to dyn_cast<>.

Some of these dyn_cast<>'s would be better phrased as isa<> or cast<>.
That will happen in a future patch.

There are also two dyn_cast_or_null<>'s slipped in instead of
dyn_cast<>'s, since they were causing crashes with just dyn_cast<>.

llvm-svn: 165646

11 years agotblgen: Put dyn_cast<> machinery in place for Init hierarchy.
Sean Silva [Wed, 10 Oct 2012 20:24:40 +0000 (20:24 +0000)]
tblgen: Put dyn_cast<> machinery in place for Init hierarchy.

llvm-svn: 165645

11 years agoAdd the testcase from pr13254 (the old scalarreply pass handles this wrong;
Duncan Sands [Wed, 10 Oct 2012 18:41:19 +0000 (18:41 +0000)]
Add the testcase from pr13254 (the old scalarreply pass handles this wrong;
the new sroa pass handles it right).

llvm-svn: 165644

11 years ago[Doc parsing] This patch searches overridden objc/c++
Fariborz Jahanian [Wed, 10 Oct 2012 18:34:52 +0000 (18:34 +0000)]
[Doc parsing] This patch searches overridden objc/c++
methods looking for documentation on a particular base
class inherited by any method that overrides the base class.
In case of redeclaration, as when objc method is defined
in the implementation, it also looks up for documentation
in class/class extension being redeclared.

llvm-svn: 165643

11 years agoChange the Thread constructor over to take a Process& rather than a ProcessSP. We...
Jim Ingham [Wed, 10 Oct 2012 18:32:14 +0000 (18:32 +0000)]
Change the Thread constructor over to take a Process& rather than a ProcessSP.  We can't create Threads with a NULL ProcessSP, so it makes no sense to use the SP.
Then make the Thread a Broadcaster, and get it to broadcast when the selected frame is changed (but only from the Command Line) and when Thread::ReturnFromFrame
changes the stack.
Made the Driver use this notification to print the new thread status rather than doing it in the command.
Fixed a few places where people were setting their broadcaster class by hand rather than using the static broadcaster class call.

<rdar://problem/12383087>

llvm-svn: 165640

11 years agoRemove dead variable.
Bill Wendling [Wed, 10 Oct 2012 18:20:49 +0000 (18:20 +0000)]
Remove dead variable.

llvm-svn: 165639

11 years agoSpecify CPU model to avoid breaking ATOM builds
Michael Liao [Wed, 10 Oct 2012 18:04:52 +0000 (18:04 +0000)]
Specify CPU model to avoid breaking ATOM builds

llvm-svn: 165638

11 years agoRemove unused argument.
Bill Wendling [Wed, 10 Oct 2012 18:02:57 +0000 (18:02 +0000)]
Remove unused argument.

llvm-svn: 165636

11 years ago[analyzer] Don't run non-path-sensitive checks on system headers...
Jordan Rose [Wed, 10 Oct 2012 17:55:40 +0000 (17:55 +0000)]
[analyzer] Don't run non-path-sensitive checks on system headers...

...but do run them on user headers.

Previously, we were inconsistent here: non-path-sensitive checks on code
/bodies/ were only run in the main source file, but checks on
/declarations/ were run in /all/ headers. Neither of those is the
behavior we want.

Thanks to Sujit for pointing this out!

<rdar://problem/12454226>

llvm-svn: 165635

11 years ago[analyzer] Fix typo: s/HandleDeclsGallGraph/HandleDeclsCallGraph/g
Jordan Rose [Wed, 10 Oct 2012 17:55:37 +0000 (17:55 +0000)]
[analyzer] Fix typo: s/HandleDeclsGallGraph/HandleDeclsCallGraph/g

No functionality change.

llvm-svn: 165634

11 years agodocs: Propagate fix from r165632 to other docs.
Sean Silva [Wed, 10 Oct 2012 17:21:39 +0000 (17:21 +0000)]
docs: Propagate fix from r165632 to other docs.

There are only two other instances of using `.. code::` instead of
`..  code-block::`.

llvm-svn: 165633

11 years agodocs: Attempt to fix PR14053.
Sean Silva [Wed, 10 Oct 2012 17:07:23 +0000 (17:07 +0000)]
docs: Attempt to fix PR14053.

Hypothesis 1: use of `.. code::` directive instead of `.. code-block::`
is causing Sphinx to discard the block. On my machine, `.. code::`
renders fine. However, I don't think that `..  code::` is actually a
legit Sphinx directive. I believe that on my machine Sphinx is falling
back to just displaying it monospace with no syntax, whereas llvm.org's
Sphinx is just discarding it.

This is truly "remote debugging" since I can't reproduce this on my
machine. It would be helpful to be able to see the llvm.org Sphinx
build logs; if that's possible please let me know.

llvm-svn: 165632

11 years agoAdd support for FP_ROUND from v2f64 to v2f32
Michael Liao [Wed, 10 Oct 2012 16:53:28 +0000 (16:53 +0000)]
Add support for FP_ROUND from v2f64 to v2f32

- Due to the current matching vector elements constraints in
  ISD::FP_ROUND, rounding from v2f64 to v4f32 (after legalization from
  v2f32) is scalarized. Add a customized v2f32 widening to convert it
  into a target-specific X86ISD::VFPROUND to work around this
  constraints.

llvm-svn: 165631

11 years agoDon't make regexp commands as regular commands - they are "short cuts" and users...
Jim Ingham [Wed, 10 Oct 2012 16:51:31 +0000 (16:51 +0000)]
Don't make regexp commands as regular commands - they are "short cuts" and users should be able to override them with "unalias" but you can't unalias normal commands.

llvm-svn: 165630

11 years ago-Warc-repeated-use-of-weak: look through explicit casts on assigned values.
Jordan Rose [Wed, 10 Oct 2012 16:43:06 +0000 (16:43 +0000)]
-Warc-repeated-use-of-weak: look through explicit casts on assigned values.

Reading from a weak property, casting the result, and assigning to a
strong pointer should still be considered safe.

llvm-svn: 165629

11 years agoMove Sema::PropertyIfSetterOrGetter to ObjCMethodDecl::findPropertyDecl.
Jordan Rose [Wed, 10 Oct 2012 16:42:54 +0000 (16:42 +0000)]
Move Sema::PropertyIfSetterOrGetter to ObjCMethodDecl::findPropertyDecl.

Then, switch users of PropertyIfSetterOrGetter and LookupPropertyDecl
(the latter by name) over to findPropertyDecl. This actually makes
-Wreceiver-is-weak a bit stronger than it was before.

llvm-svn: 165628

11 years agoChange Sema::PropertyIfSetterOrGetter to make use of isPropertyAccessor.
Jordan Rose [Wed, 10 Oct 2012 16:42:38 +0000 (16:42 +0000)]
Change Sema::PropertyIfSetterOrGetter to make use of isPropertyAccessor.

Old algorithm:
1. See if the name looks like a getter or setter.
2. Use the name to look up a property in the current ObjCContainer
   and all its protocols.
3. If the current container is an interface, also look in all categories
   and superclasses (and superclass categories, and so on).

New algorithm:
1. See if the method is marked as a property accessor. If so, look through
   all properties in the current container and find one that has a matching
   selector.
2. Find all overrides of the method using ObjCMethodDecl's
   getOverriddenMethods. This collects methods in superclasses and protocols
   (as well as superclass categories, which isn't really necessary), and
   checks if THEY are accessors. This part is not done recursively, since
   getOverriddenMethods is already recursive.

This lets us handle getters and setters that do not match the property
names.

llvm-svn: 165627

11 years agoRename ObjCMethodDecl::isSynthesized to isPropertyAccessor.
Jordan Rose [Wed, 10 Oct 2012 16:42:25 +0000 (16:42 +0000)]
Rename ObjCMethodDecl::isSynthesized to isPropertyAccessor.

This more accurately reflects its use: this flag is set when a method
matches the getter or setter name for a property in the same class,
and does not actually specify whether or not the definition of the method
will be synthesized (either implicitly or explicitly with @synthesize).

This renames the setter and backing field as well, and changes the
(soon-to-be-obsolete?) XML dump format to use 'property_accessor'
instead of 'synthesized'.

llvm-svn: 165626

11 years agoAdd alternative support for FP_ROUND from v2f32 to v2f64
Michael Liao [Wed, 10 Oct 2012 16:32:15 +0000 (16:32 +0000)]
Add alternative support for FP_ROUND from v2f32 to v2f64

- Due to the current matching vector elements constraints in ISD::FP_EXTEND,
  rounding from v2f32 to v2f64 is scalarized. Add a customized v2f32 widening
  to convert it into a target-specific X86ISD::VFPEXT to work around this
  constraints. This patch also reverts a previous attempt to fix this issue by
  recovering the scalarized ISD::FP_EXTEND pattern and thus significantly
  reduces the overhead of supporting non-power-2 vector FP extend.

llvm-svn: 165625

11 years agoFix stack overflow when trying to create an implicit moving
Argyrios Kyrtzidis [Wed, 10 Oct 2012 16:14:06 +0000 (16:14 +0000)]
Fix stack overflow when trying to create an implicit moving
constructor with invalid code.

rdar://12240916

llvm-svn: 165623

11 years agoRemove a trailing blank line, test commit.
NAKAMURA Takumi [Wed, 10 Oct 2012 14:06:15 +0000 (14:06 +0000)]
Remove a trailing blank line, test commit.

llvm-svn: 165621

11 years ago[CMake] clang/tools/extra may be included by LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR.
NAKAMURA Takumi [Wed, 10 Oct 2012 13:46:18 +0000 (13:46 +0000)]
[CMake] clang/tools/extra may be included by LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR.

LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=/path/to/llvm-srcroot/tools/clang/tools/extra, by default.

llvm-svn: 165620

11 years ago[CMake] check-all: Don't include check-llvm into check-all without LLVM_BUILD_TOOLS.
NAKAMURA Takumi [Wed, 10 Oct 2012 13:33:00 +0000 (13:33 +0000)]
[CMake] check-all: Don't include check-llvm into check-all without LLVM_BUILD_TOOLS.

FIXME: Would you like to run llvm/unittests w/o LLVM_BUILD_TESTS regardless of LLVM_BUILD_TOOLS?
llvm-svn: 165619

11 years ago[CMake] add_lit_testsuite: EXCLUDE_FROM_ALL excludes the test ${target} out of check...
NAKAMURA Takumi [Wed, 10 Oct 2012 13:32:55 +0000 (13:32 +0000)]
[CMake] add_lit_testsuite: EXCLUDE_FROM_ALL excludes the test ${target} out of check-all.

llvm-svn: 165618

11 years agoFix for LDRB instruction:
Stepan Dyatkovskiy [Wed, 10 Oct 2012 11:43:40 +0000 (11:43 +0000)]
Fix for LDRB instruction:
SDNode for LDRB_POST_IMM is invalid: number of registers added to SDNode fewer
that described in .td.

7 ops is needed, but SDNode with only 6 is created.

In more details:
In ARMInstrInfo.td, in multiclass AI2_ldridx, in definition _POST_IMM, offset
operand is defined as am2offset_imm. am2offset_imm is complex parameter type,
and actually it consists from dummy register and imm itself. As I understood
trick with dummy reg was made for AsmParser. In ARMISelLowering.cpp, this dummy
register was not added to SDNode, and it cause crash in Peephole Optimizer pass.

The problem fixed by setting up additional dummy reg when emitting
LDRB_POST_IMM instruction.

llvm-svn: 165617

11 years agoIssue description:
Stepan Dyatkovskiy [Wed, 10 Oct 2012 11:37:36 +0000 (11:37 +0000)]
Issue description:
SchedulerDAGInstrs::buildSchedGraph ignores dependencies between FixedStack
objects and byval parameters. So loading byval parameters from stack may be
inserted *before* it will be stored, since these operations are treated as
independent.

Fix:
Currently ARMTargetLowering::LowerFormalArguments saves byval registers with
FixedStack MachinePointerInfo. To fix the problem we need to store byval
registers with MachinePointerInfo referenced to first the "byval" parameter.

Also commit adds two new fields to the InputArg structure: Function's argument
index and InputArg's part offset in bytes relative to the start position of
Function's argument. E.g.: If function's argument is 128 bit width and it was
splitted onto 32 bit regs, then we got 4 InputArg structs with same arg index,
but different offset values.

llvm-svn: 165616

11 years agoApply the same fundamental fix for PR14048 as was applied for PR11905.
Chandler Carruth [Wed, 10 Oct 2012 11:29:08 +0000 (11:29 +0000)]
Apply the same fundamental fix for PR14048 as was applied for PR11905.

The issue arises when coercing to/from types of different sizes. We need
to be certain that the allocation on either end has sufficient room for
the coerced type. When it doesn't, we need to make room, copy across,
and then proceed. PR11905 handled the case of storing function arguments
back into allocas in the function prolog, this patch handles the case of
setting up the function arguments in a call expression.

This is actually significantly simpler than the fix for PR11905. It ends
up being a trivial change to create a temporary alloca when the source
is too small and memcpy across. This should preserve the compile-time
fast-isel benefits of doing gep+load sequences and avoiding FCAs.

Reviewed by Benjamin and Evgeniy (who fixed PR11905).

llvm-svn: 165615

11 years agoCleanup. Get rid of now dead code.
Bill Wendling [Wed, 10 Oct 2012 08:03:34 +0000 (08:03 +0000)]
Cleanup. Get rid of now dead code.

llvm-svn: 165613

11 years agoRemove the final bits of Attributes being declared in the Attribute
Bill Wendling [Wed, 10 Oct 2012 07:36:56 +0000 (07:36 +0000)]
Remove the final bits of Attributes being declared in the Attribute
namespace. Use the attribute's enum value instead. No functionality change
intended.

llvm-svn: 165611