Commit Graph

98590 Commits

Author SHA1 Message Date
Dale Johannesen e45a2389ce Eliminate a warning compiling with llvm-gcc. (IMO the
warning is overzealous but gcc is what it is.)

llvm-svn: 122829
2011-01-04 19:31:24 +00:00
Owen Anderson e39cb57b09 Complete the NumberTable --> LeaderTable rename.
llvm-svn: 122828
2011-01-04 19:29:46 +00:00
Owen Anderson d7d06d3aaf Fix typo in a comment.
llvm-svn: 122827
2011-01-04 19:25:18 +00:00
Owen Anderson 51489b3b28 Prune #include's.
llvm-svn: 122826
2011-01-04 19:24:57 +00:00
Howard Hinnant ab061a656d Marshall Clow's fix for Bug 8421.
llvm-svn: 122825
2011-01-04 19:21:05 +00:00
Marshall Clow 0caac444fa Test commit; added blank line to TODO.txt
llvm-svn: 122824
2011-01-04 19:19:20 +00:00
Owen Anderson c7c3bc63f7 Clarify terminology, settling on referring to what was the "number table" as the "leader table", and
rename methods to make it much more clear what they're doing.

llvm-svn: 122823
2011-01-04 19:13:25 +00:00
Owen Anderson 83546f2fe0 When removing a value from GVN's leaders list, don't drop the Next pointer in a corner case.
llvm-svn: 122822
2011-01-04 19:10:54 +00:00
Dale Johannesen a71d2cc88d Improve the accuracy of the inlining heuristic looking for the
case where a static caller is itself inlined everywhere else, and
thus may go away if it doesn't get too big due to inlining other
things into it.  If there are references to the caller other than
calls, it will not be removed; account for this.
This results in same-day completion of the case in PR8853.

llvm-svn: 122821
2011-01-04 19:01:54 +00:00
Douglas Gregor be63bbfd24 Implement name mangling for sizeof...(pack), to silence the last of
the switch-enum warnings. Test is forthcoming, once I've dealt with
some template argument deduction issues.

llvm-svn: 122820
2011-01-04 18:56:13 +00:00
Owen Anderson 41a1550ef5 Branch instructions don't produce values, so there's no need to generate a value number for them. This
avoids adding them to the various value numbering tables, resulting in a minor (~3%) speedup for GVN
on 40.gcc.

llvm-svn: 122819
2011-01-04 18:54:18 +00:00
Douglas Gregor 35c7e84eb7 There is nothing interesting to analyze with a sizeof...(pack) expression
llvm-svn: 122818
2011-01-04 18:46:34 +00:00
Owen Anderson 22c53e277a Remove commented out code.
llvm-svn: 122817
2011-01-04 18:22:08 +00:00
Owen Anderson e8d7bd0323 Give MachineFunctionAnalysis a getPassName() implementation to make timing reports prettier.
llvm-svn: 122816
2011-01-04 18:21:18 +00:00
Cameron Zwarich b2a41e9388 Switch to the new style of asterisk placement.
llvm-svn: 122815
2011-01-04 18:19:19 +00:00
Chris Lattner c86e67e110 fix an off-by-one bug that caused a crash analyzing
ashr's with huge shift amounts, PR8896

llvm-svn: 122814
2011-01-04 18:19:15 +00:00
Douglas Gregor 820ba7ba43 Implement the sizeof...(pack) expression to compute the length of a
parameter pack.

Note that we're missing proper libclang support for the new
SizeOfPackExpr expression node.

llvm-svn: 122813
2011-01-04 17:33:58 +00:00
Michael J. Spencer 3b264ba91a UnitTests/Path: Produce useful diagnostics on error.
llvm-svn: 122812
2011-01-04 17:00:18 +00:00
Cameron Zwarich 5cd3d718f6 Switch to path halving from path compression for a small speedup. This also
makes getLeader() nonrecursive.

llvm-svn: 122811
2011-01-04 16:24:51 +00:00
Tobias Grosser 4ccb923820 Include llvm-gcc dir before llvm_tools_dir
This ensures that always the recently compiled tools are picked for testing.

llvm-svn: 122810
2011-01-04 16:01:17 +00:00
Duncan Sands 95c4eccbe9 These methods should be "const"; make them so.
llvm-svn: 122809
2011-01-04 12:52:29 +00:00
Francois Pichet 984b3c3c2f Disable r122754 on Windows: was causing all lit tests to fail.
llvm-svn: 122808
2011-01-04 10:23:42 +00:00
Abramo Bagnara ba85497ae4 Prefer getAs<ComplexType> rather than cast<ComplexType> on canonical type. Suggestion by Douglas Gregor!
llvm-svn: 122807
2011-01-04 09:50:03 +00:00
Chris Lattner 8643810ede Teach loop-idiom to turn a loop containing a memset into a larger memset
when safe.

The testcase is basically this nested loop:
void foo(char *X) {
  for (int i = 0; i != 100; ++i) 
    for (int j = 0; j != 100; ++j)
      X[j+i*100] = 0;
}

which gets turned into a single memset now.  clang -O3 doesn't optimize
this yet though due to a phase ordering issue I haven't analyzed yet.

llvm-svn: 122806
2011-01-04 07:46:33 +00:00
Chris Lattner a62b01dc37 restructure this a bit. Initialize the WeakVH with "I", the
instruction *after* the store.  The store will always be deleted
if the transformation kicks in, so we'd do an N^2 scan of every
loop block.  Whoops.

llvm-svn: 122805
2011-01-04 07:27:30 +00:00
Chandler Carruth e0cee6a8b0 Implement -Wself-assign, which warns on code such as:
int x = 42;
  x = x;  // Warns here.

The warning avoids macro expansions, templates, user-defined assignment
operators, and volatile types, so false positives are expected to be low.

The common (mis-)use of this code pattern is to silence unused variable
warnings, but a more idiomatic way of doing that is '(void)x;'.
A follow-up to this will add a note and fix-it hint suggesting this
replacement in cases where the StmtExpr consists precisely of the self
assignment.

llvm-svn: 122804
2011-01-04 06:52:15 +00:00
Cameron Zwarich 82e8332a22 Eliminate repeated allocation of a per-BB DenseMap for a 4.6% reduction of time
spent in StrongPHIElimination on 403.gcc.

llvm-svn: 122803
2011-01-04 06:42:27 +00:00
Chandler Carruth a92409c3ec Enhance the diagnostic for negative array sizes to include the
declaration name of the array when present. This ensures that
a poor-man's C++03 static_assert will include the user error message
often embedded in the name.

Update all the tests to reflect the new wording, and add a test for the
name behavior.

llvm-svn: 122802
2011-01-04 04:44:35 +00:00
Cameron Zwarich f4e13699e7 Avoid finding loop back edges when we are not splitting critical edges in
CodeGenPrepare (which is the default behavior).

llvm-svn: 122801
2011-01-04 04:43:31 +00:00
Sean Callanan e4f98722be Fixed a problem where constant results of expressions
were not being created in the proper way, meaning
results were getting lost.

llvm-svn: 122800
2011-01-04 02:41:41 +00:00
Douglas Gregor 857591143e When creating the injected-class-name for a class template involving a
non-type template parameter pack, make sure to create a pack expansion
for the corresponding template argument.

llvm-svn: 122799
2011-01-04 02:33:52 +00:00
Greg Clayton bc114c6b20 Fixed the file ordering (alphabetic) in the Commands folder.
llvm-svn: 122797
2011-01-04 01:17:46 +00:00
David Greene 4b71405b71 Don't pattern match "/clang" so we don't mangle directory names. Some
tests use absolute paths to clang.

llvm-svn: 122796
2011-01-04 01:05:30 +00:00
Owen Anderson 2e28697c60 Clean up a funky pass registration that got passed over when I got rid of static constructors.
llvm-svn: 122795
2011-01-04 00:55:21 +00:00
Andrew Trick 163a24420a Fix the ARM IIC_iCMPsi itinerary and add an important assert.
llvm-svn: 122794
2011-01-04 00:32:57 +00:00
Douglas Gregor 44e7df67d9 Implement pack expansion of base initializers, so that we can
initialize those lovely mixins that come from pack expansions of base
specifiers.

llvm-svn: 122793
2011-01-04 00:32:56 +00:00
Argyrios Kyrtzidis bd9dfb2e29 Rename MaybeSkipFunctionBodyForCodeCompletion -> trySkippingFunctionBodyForCodeCompletion and check isCodeCompletionEnabled() before doing the call.
Suggestions by Chris.

llvm-svn: 122792
2011-01-04 00:27:27 +00:00
Cameron Zwarich e924969380 Address most of Duncan's review comments. Also, make LoopInstSimplify a simple
FunctionPass. It probably doesn't have a reason to be a LoopPass, as it will
probably drop the simple fixed point and either use RPO iteration or Duncan's
approach in instsimplify of only revisiting instructions that have changed.

The next step is to preserve LoopSimplify. This looks like it won't be too hard,
although the pass manager doesn't actually seem to respect when non-loop passes
claim to preserve LCSSA or LoopSimplify. This will have to be fixed.

llvm-svn: 122791
2011-01-04 00:12:46 +00:00
Chris Lattner 0ba473c218 use the very-handy getTruncateOrZeroExtend helper function, and
stop setting NSW: signed overflow is possible.  Thanks to Dan
for pointing these out.

llvm-svn: 122790
2011-01-04 00:06:55 +00:00
Bill Wendling 4466e981f9 Formatting changes. No functionality change.
llvm-svn: 122789
2011-01-03 23:59:05 +00:00
Owen Anderson 0839d3930a Fix comment.
llvm-svn: 122788
2011-01-03 23:51:56 +00:00
Owen Anderson d62d37225a Use the new addEscapingValue callback to update GlobalsModRef when GVN adds PHIs of GEPs. For the moment,
have GlobalsModRef handle this conservatively by simply removing the value from its maps.

llvm-svn: 122787
2011-01-03 23:51:43 +00:00
Evan Cheng f02ca16ba7 Convert MC tests to .s so codegen changes won't break them.
llvm-svn: 122786
2011-01-03 23:47:14 +00:00
Chris Lattner bde6ec1db6 Duncan deftly points out that readnone functions aren't
invalidated by stores, so they can be handled as 'simple'
operations.

llvm-svn: 122785
2011-01-03 23:38:13 +00:00
Argyrios Kyrtzidis cd12b63b47 Fix 80 column violation.
llvm-svn: 122784
2011-01-03 23:15:14 +00:00
Evan Cheng 65089fc6c7 Use pushq / popq instead of subq $8, %rsp / addq $8, %rsp to adjust stack in
prologue and epilogue if the adjustment is 8. Similarly, use pushl / popl if
the adjustment is 4 in 32-bit mode.

In the epilogue, takes care to pop to a caller-saved register that's not live
at the exit (either return or tailcall instruction).
rdar://8771137

llvm-svn: 122783
2011-01-03 22:53:22 +00:00
Douglas Gregor 752a595655 Implement pack expansions whose pattern is a base-specifier.
llvm-svn: 122782
2011-01-03 22:36:02 +00:00
Argyrios Kyrtzidis d5756a609d When in code-completion, skip obj-c method bodies for speed up.
llvm-svn: 122781
2011-01-03 22:33:06 +00:00
Douglas Gregor 7ec835f35b Add a test that is currently failing
llvm-svn: 122780
2011-01-03 21:56:22 +00:00
David Greene 544a3e932f Don't pattern match "clang-" as it may be part of a tool name with a
triple suffix.

llvm-svn: 122779
2011-01-03 21:55:08 +00:00