Commit Graph

106939 Commits

Author SHA1 Message Date
Nadav Rotem 573ee374a2 Fix a bug in FindMemType. When widening vector loads, use a wider memory type
only if the number of packed elements is a power of two.
Bug found in Duncan's testcase.

llvm-svn: 132923
2011-06-13 18:13:24 +00:00
Marshall Clow 92091dbe41 Clean up the vector tests
llvm-svn: 132921
2011-06-13 17:57:10 +00:00
Douglas Gregor c9224d6714 Eliminate the -f[no]objc-infer-related-result-type flags; there's no
reason to allow the user to control these semantics through a flag.

llvm-svn: 132919
2011-06-13 16:42:53 +00:00
Fariborz Jahanian bf31c4e4ca Update Indexer test for new 'atomic' keyword.
llvm-svn: 132918
2011-06-13 16:42:02 +00:00
Douglas Gregor c0629e031c Document CheckObjCMethodOverrides
llvm-svn: 132917
2011-06-13 16:07:18 +00:00
Chris Lattner ed58a95c33 mention graph vis isn't available in Release builds.
llvm-svn: 132916
2011-06-13 15:59:35 +00:00
Benjamin Kramer c970849ea0 InstCombine: Fold A-b == C --> b == A-C if A and C are constants.
The backend already knew this trick.

llvm-svn: 132915
2011-06-13 15:24:24 +00:00
Benjamin Kramer 975c29629f Revert r132910 and r132909 on behalf of Michael. They didn't build with clang.
llvm-svn: 132914
2011-06-13 12:56:51 +00:00
Michael J. Spencer aa41981dd8 Revert the last two commits in the series. r132911, r132912.
llvm-svn: 132913
2011-06-13 11:53:31 +00:00
Michael J. Spencer 902695c488 Modify llvm-nm to use new Binary creation method.
llvm-svn: 132912
2011-06-13 11:12:42 +00:00
Michael J. Spencer a7f9c49aab Make Binary the parent of ObjectFile and update children to new interface.
llvm-svn: 132911
2011-06-13 11:12:33 +00:00
Michael J. Spencer 7dc3c3de7e Add Binary class. This is a cleaner parent than ObjectFile.
llvm-svn: 132910
2011-06-13 11:12:12 +00:00
Michael J. Spencer 0901cec03e Add Object/Error.
llvm-svn: 132909
2011-06-13 11:11:59 +00:00
Michael J. Spencer 422504fba6 Fix spelling and sort CMakeLists.txt.
llvm-svn: 132908
2011-06-13 11:11:39 +00:00
Nick Lewycky f8e046b148 It's possible that an all-zero GEP may be used as the argument to lifetime
intrinsics. In fact, we'll optimize a bitcast to that when possible. Detect it
when looking for the lifetime intrinsics.

No test case, noticed by inspection.

llvm-svn: 132906
2011-06-13 07:52:46 +00:00
David Majnemer 254a5c07e7 Give a diagnostic when using non-POD types in a va_arg
llvm-svn: 132905
2011-06-13 06:37:03 +00:00
David Majnemer 0ac67fa22f Improve the diagnostics generated for switch statements missing expressions
- Move the diagnostic to the case statement instead of at the end of the switch
- Add a fix-it hint as to how to fix the compilation error

llvm-svn: 132903
2011-06-13 05:50:12 +00:00
Chandler Carruth ff455bbc3c Fix a broken index left over from before this function was converted to
handle memcpy and memmove. Spotted by Nico.

llvm-svn: 132902
2011-06-13 05:00:35 +00:00
David Majnemer bffdbd288a Correct the spelling of instantiation
llvm-svn: 132901
2011-06-13 04:29:15 +00:00
Jakob Stoklund Olesen fb03a92c33 Be less aggressive about hinting in RAFast.
In particular, don't spill dirty registers only to satisfy a hint. It is
not worth it.

The attached test case provides an example where the fast allocator
would spill a register when other registers are available.

llvm-svn: 132900
2011-06-13 03:26:46 +00:00
Jakob Stoklund Olesen f4f66f36c7 Include callee-saved registers in debug output.
llvm-svn: 132899
2011-06-13 03:26:42 +00:00
Rafael Espindola 51d2d7aabc Fix invalid uses of Twine. Hopefully this fixes the problem that Takumi is
having.

llvm-svn: 132898
2011-06-13 03:09:13 +00:00
Benjamin Kramer 91f914ce21 InstCombine: Shrink ((zext X) & C1) == C2 to fold away the cast if the "zext" and the "and" have one use.
llvm-svn: 132897
2011-06-12 22:48:00 +00:00
Benjamin Kramer 35159c114c Simplify code. No functionality changes, name changes aside.
llvm-svn: 132896
2011-06-12 22:47:53 +00:00
Benjamin Kramer 820a947fe1 Happy new year.
Only 163 days late!

llvm-svn: 132895
2011-06-12 15:26:54 +00:00
Benjamin Kramer ec33d0cc1b My calendar says it's 2011.
llvm-svn: 132894
2011-06-12 15:26:54 +00:00
Nadav Rotem 504cf0cde2 Fix a bug in the calculation of the vectorTypeBreakdown into registers. Odd
types such as i33 were rounded to i32. Originated from Duncan's testcase.

llvm-svn: 132893
2011-06-12 14:56:55 +00:00
Nadav Rotem 083837e729 Improve the generated code by getCopyFromPartsVector for promoted integer types.
Instead of scalarizing, and doing an element-by-element truncat, use vector
truncate.
Add support for scalarization of vectors:  i8 -> <1 x i1> (from Duncan's
testcase).

llvm-svn: 132892
2011-06-12 14:49:38 +00:00
Nadav Rotem fc2b4ad4ef Bugfix: When looking for a legal vector type, stop looking when a non-simple
element type is found.
This fix addresses some of the tests in Duncan's testcase (forthcoming).

llvm-svn: 132891
2011-06-12 14:40:30 +00:00
Richard Smith 4a4beec7b0 Don't assert on initialized typedef declarations in classes:
struct {
    typedef int A = 0;
  };

According to the C++11 standard, this is not ill-formed, but does not have any ascribed meaning. We can't reasonably accept it, so treat it as ill-formed.

Also switch C++ from an incorrect 'fields can only be initialized in constructors' diagnostic for this case to C's 'illegal initializer (only variables can be initialized)'

llvm-svn: 132890
2011-06-12 11:43:46 +00:00
Richard Smith e4073e0ae1 Test for C++11 [class]p6 (trivial classes).
llvm-svn: 132889
2011-06-12 09:24:32 +00:00
Jakob Stoklund Olesen b707659519 Tweak hash function and compress hash tables.
Make the hash tables as small as possible while ensuring that all
lookups can be done in less than 8 probes.

Cut the aliases hash table in half by only storing a < b pairs - it
is a symmetric relation.

Use larger multipliers on the initial hash function to ensure that it
properly covers the whole table, and to resolve some clustering in the
very regular ARM register bank.

This reduces the size of most of these tables by 4x - 8x. For instance,
the ARM tables shrink from 48 KB to 8 KB.

llvm-svn: 132888
2011-06-12 07:04:32 +00:00
Jakob Stoklund Olesen f0528dae27 Remove now dead code.
These computations have been moved to CodeGenRegisters.cpp.

llvm-svn: 132887
2011-06-12 07:04:28 +00:00
Jakob Stoklund Olesen 9184edd230 Extract the generateHashTable function.
The constant hash tables for sub-registers and overlaps are generated
the same way, so extract a function to generate and print the hash
table.

Also use the information computed by CodeGenRegisters.cpp instead of the
locally data.

llvm-svn: 132886
2011-06-12 07:04:26 +00:00
Rafael Espindola 2f3c2fe7c5 Really fix the fall-through logic.
Add a triple to the tests.

llvm-svn: 132885
2011-06-12 05:57:01 +00:00
Rafael Espindola cb55e752ed Test for the previous commit.
llvm-svn: 132884
2011-06-12 05:35:39 +00:00
Rafael Espindola 653a07206d Fix silly bug I introduce in the previous commit. Fixes debug builds.
llvm-svn: 132883
2011-06-12 05:26:32 +00:00
Rafael Espindola defd4b0875 AnalyzeBranch doesn't change which successors a bb has, just the order
we try to branch to them.

Before we were creating successor lists with duplicated entries. Fixing that
found a bug in isBlockOnlyReachableByFallthrough that would causes it to
return the wrong answer for

-----------
...
jne foo
jmp bar

foo:
----------

llvm-svn: 132882
2011-06-12 03:20:32 +00:00
Jakob Stoklund Olesen d2b4713e53 Compute lists of sub-regs, super-regs, and overlapping regs.
Besides moving structural computations to CodeGenRegisters.cpp, this
also well-defines the order of these lists:

- Sub-register lists come from a pre-order traversal of the graph
  defined by the SubRegs lists in the .td files.

- Super-register lists are topologically ordered so no register comes
  before any of its sub-registers. When the sub-register graph is not a
  tree, independent super-registers appear in numerical order.

- Lists of overlapping registers are ordered according to register
  number.

This reverses the order of the super-regs lists, but nobody was
depending on that. The previous order of the overlaps lists was odd, and
it may have depended on the precise behavior of std::stable_sort.

The old computations are still there, but will be removed shortly.

llvm-svn: 132881
2011-06-12 03:05:52 +00:00
Charles Davis 7ed40cbded Put FrameSetup flag on x86 instructions that set up the call frame. No
functionality change.

Later on, we'll use the flag to emit SEH pseudo-ops that describe how the
call frame was built.

llvm-svn: 132880
2011-06-12 01:45:54 +00:00
Fariborz Jahanian 8086dfc7d4 Added 'atomic' for objc properties.
llvm-svn: 132879
2011-06-11 17:37:19 +00:00
Richard Smith 938f40b5aa Implement support for C++11 in-class initialization of non-static data members.
llvm-svn: 132878
2011-06-11 17:19:42 +00:00
Fariborz Jahanian 1c2d29e3c3 Add code completetion code for the new 'atomic' attribute
keyword in objc property decl.

llvm-svn: 132877
2011-06-11 17:14:27 +00:00
Bill Wendling 0de0fd61b7 Reformatting. Moving class definitions to more natural places. No functionalogical changes.
llvm-svn: 132876
2011-06-11 11:37:49 +00:00
Douglas Gregor 53cad081e3 Extra test for related result type inference
llvm-svn: 132874
2011-06-11 04:42:58 +00:00
Douglas Gregor 2720dc656b Fix order of operands for the warning about incompatible Objective-C
pointer assignment in C++. This was a longstanding problem spotted by
Jordy Rose.

llvm-svn: 132873
2011-06-11 04:42:12 +00:00
Chad Rosier 79044dbebf Revert r132871.
llvm-svn: 132872
2011-06-11 02:27:46 +00:00
Chad Rosier 5793b53027 Typo.
llvm-svn: 132871
2011-06-11 02:16:36 +00:00
Eli Friedman 1735b29196 Make sure to pass OpFlags into MachineInstrBuilder::addExternalSymbol; the
memcpy/memset symbol doesn't get marked up correctly in PIC modes otherwise.
Should fix llvm-x86_64-linux-checks buildbot.  Followup to r132864.

llvm-svn: 132869
2011-06-11 01:55:07 +00:00
Douglas Gregor 33823727c8 Implement Objective-C Related Result Type semantics.
Related result types apply Cocoa conventions to the type of message
sends and property accesses to Objective-C methods that are known to
always return objects whose type is the same as the type of the
receiving class (or a subclass thereof), such as +alloc and
-init. This tightens up static type safety for Objective-C, so that we
now diagnose mistakes like this:

t.m:4:10: warning: incompatible pointer types initializing 'NSSet *'
with an
      expression of type 'NSArray *' [-Wincompatible-pointer-types]
  NSSet *array = [[NSArray alloc] init];
         ^       ~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1:
note: 
      instance method 'init' is assumed to return an instance of its
      receiver
      type ('NSArray *')
- (id)init;
^

It also means that we get decent type inference when writing code in
Objective-C++0x:

  auto array = [[NSMutableArray alloc] initWithObjects:@"one",  @"two",nil];
  //    ^ now infers NSMutableArray* rather than id

llvm-svn: 132868
2011-06-11 01:09:30 +00:00