Commit Graph

69531 Commits

Author SHA1 Message Date
Nick Lewycky 6f7d8347c1 Add new "memory use marker" intrinsics. These indicate lifetimes and invariant
sections of memory objects.

llvm-svn: 83953
2009-10-13 07:03:23 +00:00
Chris Lattner 2bb5cb490c reimplement codegen for indirect goto with the following advantages:
1. CGF now has fewer bytes of state (one pointer instead of a vector).
2. The generated code is determinstic, instead of getting labels in
   'map order' based on pointer addresses.
3. Clang now emits one 'indirect goto switch' for each function, instead
   of one for each indirect goto.  This fixes an M*N = N^2 IR size issue
   when there are lots of address-taken labels and lots of indirect gotos.
4. This also makes the default cause do something useful, reducing the
   size of the jump table needed (by one).

llvm-svn: 83952
2009-10-13 06:55:33 +00:00
Chris Lattner 9842a4dcb1 merge an indirect goto test into statements, add another
hairier (but nonsensical) example.

llvm-svn: 83951
2009-10-13 06:52:43 +00:00
Daniel Dunbar cdf01b5d82 Fix a -Asserts warning.
llvm-svn: 83950
2009-10-13 06:47:08 +00:00
Zhongxing Xu e02b89566a Return the original state by default.
llvm-svn: 83949
2009-10-13 06:07:58 +00:00
Chris Lattner 92ae16b0ae number address-taken labels from 1. This allows 0 to be used as a sentinel
for a null pointer.  In other words, "&&foo != NULL" will always work out to
true.

llvm-svn: 83948
2009-10-13 06:04:29 +00:00
Chris Lattner dd7eaad7d4 Use the new Type::getInt8PtrTy method. This should probably be used in a lot
more places in clang codegen now.

llvm-svn: 83947
2009-10-13 06:02:42 +00:00
John Thompson 9f2a365fe2 test commit
llvm-svn: 83945
2009-10-13 05:45:19 +00:00
Chris Lattner 799dd8538e remove dead header.
llvm-svn: 83943
2009-10-13 05:33:26 +00:00
Chris Lattner a611b45806 add rdar # I accidentally lost.
llvm-svn: 83942
2009-10-13 04:57:27 +00:00
Chris Lattner af066d818c merge two tests.
llvm-svn: 83941
2009-10-13 04:56:49 +00:00
Chris Lattner 1a6babf1f4 make the diagnostic in the 'unused result' warning more precise
about the reason, rdar://7186119.

llvm-svn: 83940
2009-10-13 04:53:48 +00:00
Chris Lattner f315471e24 fix PR4938 by recognizing % as a modifier on outputs,
previously we only recognized it on inputs.

llvm-svn: 83939
2009-10-13 04:32:07 +00:00
Chris Lattner 278c12e1af remove notcast, it is now dead!
llvm-svn: 83938
2009-10-13 04:27:02 +00:00
Chris Lattner a24b2b8c88 remove two old and nearly useless tests.
llvm-svn: 83937
2009-10-13 04:25:24 +00:00
Zhongxing Xu 88dd1ff0d7 Now we can call into another function with the CallInliner transfer function.
llvm-svn: 83936
2009-10-13 02:36:42 +00:00
Zhongxing Xu 2d88c0b989 Add two utility methods.
llvm-svn: 83935
2009-10-13 02:29:58 +00:00
Zhongxing Xu daa4176926 Add an initial implementation of EnterStackFrame() to the StoreManager.
llvm-svn: 83934
2009-10-13 02:24:55 +00:00
Devang Patel bd9c3a074d XFAIL these tests for now.
llvm-svn: 83933
2009-10-13 01:51:29 +00:00
Dan Gohman c4e367b854 Add a ceilLogBase2 function to APInt.
llvm-svn: 83932
2009-10-13 01:49:02 +00:00
Victor Hernandez 70e8505eb1 Memory dependence analysis was incorrectly stopping to scan for stores to a pointer at bitcast uses of a malloc call.
It should continue scanning until the malloc call, and this patch fixes that.

llvm-svn: 83931
2009-10-13 01:42:53 +00:00
Edward O'Callaghan a5314b83d1 Regenerate configure for rev. 83823 putback.
llvm-svn: 83930
2009-10-13 01:01:38 +00:00
Devang Patel 232f278fc1 Disable tests that check debug info intrinsic. This does not work if debug info intrinsics are not used to encode debug info.
llvm-svn: 83929
2009-10-12 23:46:58 +00:00
Devang Patel 5b294f4330 Enable "debug info attached to an instruction" mode.
llvm-svn: 83928
2009-10-12 23:31:25 +00:00
Devang Patel 9da3cc2b2d Enable "debug info attached to an instruction" mode.
llvm-svn: 83925
2009-10-12 23:22:09 +00:00
Douglas Gregor e3afaeb7e4 Minor CSS fix
llvm-svn: 83924
2009-10-12 23:15:14 +00:00
Douglas Gregor ef06ccf8d0 When declaring a class template whose name is qualified, make sure
that the scope in which it is being declared is complete. Also, when
instantiating a member class template's ClassTemplateDecl, be sure to
delay type creation so that the resulting type is dependent. Ick.

llvm-svn: 83923
2009-10-12 23:11:44 +00:00
Devang Patel 0f58bec599 Find enclosing subprogram info.
llvm-svn: 83922
2009-10-12 23:11:24 +00:00
Devang Patel 0af2a420cd Set default location for a function if it is not set.
llvm-svn: 83921
2009-10-12 23:10:55 +00:00
Douglas Gregor 0347f40eba Minor margin fix
llvm-svn: 83918
2009-10-12 22:52:00 +00:00
Kevin Enderby 11b32384f2 Fix two warnings about unused variables that are only used in assert() calls.
llvm-svn: 83917
2009-10-12 22:51:49 +00:00
Bob Wilson 5b07a903d4 Delete a comment that makes no sense to me. The statement that moving a CPE
before its reference is only supported on ARM has not been true for a while.
In fact, until recently, that was only supported for Thumb.  Besides that,
CPEs are always a multiple of 4 bytes in size, so inserting a CPE should have
no effect on Thumb alignment.

llvm-svn: 83916
2009-10-12 22:49:05 +00:00
Kevin Enderby 3f0b9b3db4 Fix a problem in the code where ARMAsmParser::ParseShift() second argument
should have been a pointer to a reference.

llvm-svn: 83915
2009-10-12 22:39:54 +00:00
Douglas Gregor 775b837976 Test explicit specialization involving multiple template<> headers
llvm-svn: 83914
2009-10-12 22:33:31 +00:00
Devang Patel dac79decf3 There is no need to attach debug location info with alloca instruction.
llvm-svn: 83913
2009-10-12 22:29:02 +00:00
Devang Patel 551e112e99 Encode long double.
llvm-svn: 83912
2009-10-12 22:28:31 +00:00
Douglas Gregor ca027af608 Permit explicit specialization of member functions of class templates
that are declarations (rather than definitions). Also, be sure to set
the access specifiers properly when instantiating the declarations of
member function templates.

llvm-svn: 83911
2009-10-12 22:27:17 +00:00
John McCall e724ae92a8 More appropriate API usage.
llvm-svn: 83910
2009-10-12 22:25:59 +00:00
Evan Cheng f815861591 Make licm debug message readable.
llvm-svn: 83908
2009-10-12 22:25:23 +00:00
John McCall d5707abdfd Implement -Wparentheses: warn about using assignments in contexts that require
conditions.  Add a fixit to insert the parentheses.  Also fix a very minor
possible memory leak in 'for' conditions.

Fixes PR 4876 and rdar://problem/7289172

llvm-svn: 83907
2009-10-12 21:59:07 +00:00
Bob Wilson 3250e7769f Change CreateNewWater method to return NewMBB by reference.
llvm-svn: 83905
2009-10-12 21:39:43 +00:00
Douglas Gregor 2210c9cd6e Test explicit specializations of static data members that are declarations, not definitions
llvm-svn: 83904
2009-10-12 21:37:59 +00:00
Bob Wilson cc121aa750 Last week, ARMConstantIslandPass was failing to converge for the
MultiSource/Benchmarks/MiBench/automotive-susan test.  The failure has
since been masked by an unrelated change (just randomly), so I don't have
a testcase for this now.  Radar 7291928.

The situation where this happened is that a constant pool entry (CPE) was
placed at a lower address than the load that referenced it.  There were in
fact 2 CPEs placed at adjacent addresses and referenced by 2 loads that were
close together in the code.  The distance from the loads to the CPEs was
right at the limit of what they could handle, so that only one of the CPEs
could be placed within range.  On every iteration, the first CPE was found
to be out of range, causing a new CPE to be inserted.  The second CPE had
been in range but the newly inserted entry pushed it too far away.  Thus the
second CPE was also replaced by a new entry, which in turn pushed the first
CPE out of range.  Etc.

Judging from some comments in the code, the initial implementation of this
pass did not support CPEs placed _before_ their references.  In the case
where the CPE is placed at a higher address, the key to making the algorithm
terminate is that new CPEs are only inserted at the end of a group of adjacent
CPEs.  This is implemented by removing a basic block from the "WaterList"
once it has been used, and then adding the newly inserted CPE block to the
list so that the next insertion will come after it.  This avoids the ping-pong
effect where CPEs are repeatedly moved to the beginning of a group of
adjacent CPEs.  This does not work when going backwards, however, because the
entries at the end of an adjacent group of CPEs are closer than the CPEs
earlier in the group.

To make this pass terminate, we need to maintain a property that changes can
only happen in some sort of monotonic fashion.  The fix used here is to require
that the CPE for a particular constant pool load can only move to lower
addresses.  This is a very simple change to the code and should not cause
any significant degradation in the results.

llvm-svn: 83902
2009-10-12 21:23:15 +00:00
Douglas Gregor a2fe1fe208 Yet another test for explicit specialization, this one involving linkage
llvm-svn: 83901
2009-10-12 21:21:22 +00:00
Anders Carlsson 1d116976b4 Store the key function of a record decl inside CGRecordLayout.
llvm-svn: 83900
2009-10-12 21:16:22 +00:00
Ted Kremenek 289ae4f454 Use a BumpPtrAllocator to allocate all aspects of CFG, including CFGBlocks, successor and predecessor vectors, etc.
Speedup: when doing 'clang-cc -analyze -dump-cfg' (without actual printing, just
CFG building) on the amalgamated SQLite source (all of SQLite in one source
file), runtime reduced by 9%.

This fixes: <rdar://problem/7250745>

llvm-svn: 83899
2009-10-12 20:55:07 +00:00
Mike Stump b9a9a7c0ad Fixup windows include paths. Patch by John Thompson.
llvm-svn: 83898
2009-10-12 20:50:45 +00:00
Bob Wilson e4adae267e Another minor clean-up.
llvm-svn: 83897
2009-10-12 20:45:53 +00:00
Douglas Gregor 1fc79dda69 More tests for explicit template specialization
llvm-svn: 83896
2009-10-12 20:45:50 +00:00
Chris Lattner bf43817408 allow this testcase to pass with recent changes. The test hasn't been
producing any stores at all for a long time, but ".store." was in some
IR instruction names until recently.  This removal caused the test to
start failing.  Just make it reject any stores.

llvm-svn: 83895
2009-10-12 20:42:35 +00:00