- May 02, 2010
-
-
Benjamin Kramer authored
llvm-svn: 102863
-
David Chisnall authored
llvm-svn: 102862
-
- May 01, 2010
-
-
Douglas Gregor authored
assignment operators. Previously, Sema provided type-checking and template instantiation for copy assignment operators, then CodeGen would synthesize the actual body of the copy constructor. Unfortunately, the two were not in sync, and CodeGen might pick a copy-assignment operator that is different from what Sema chose, leading to strange failures, e.g., link-time failures when CodeGen called a copy-assignment operator that was not instantiation, run-time failures when copy-assignment operators were overloaded for const/non-const references and the wrong one was picked, and run-time failures when by-value copy-assignment operators did not have their arguments properly copy-initialized. This implementation synthesizes the implicitly-defined copy assignment operator bodies in Sema, so that the resulting ASTs encode exactly what CodeGen needs to do; there is no longer any special code in CodeGen to synthesize copy-assignment operators. The synthesis of the body is relatively simple, and we generate one of three different kinds of copy statements for each base or member: - For a class subobject, call the appropriate copy-assignment operator, after overload resolution has determined what that is. - For an array of scalar types or an array of class types that have trivial copy assignment operators, construct a call to __builtin_memcpy. - For an array of class types with non-trivial copy assignment operators, synthesize a (possibly nested!) for loop whose inner statement calls the copy constructor. - For a scalar type, use built-in assignment. This patch fixes at least a few tests cases in Boost.Spirit that were failing because CodeGen picked the wrong copy-assignment operator (leading to link-time failures), and I suspect a number of undiagnosed problems will also go away with this change. Some of the diagnostics we had previously have gotten worse with this change, since we're going through generic code for our type-checking. I will improve this in a subsequent patch. llvm-svn: 102853
-
Chris Lattner authored
llvm-svn: 102852
-
Chris Lattner authored
llvm-svn: 102851
-
Chris Lattner authored
other places, killing a valid transformation is not the right answer. llvm-svn: 102850
-
Anders Carlsson authored
llvm-svn: 102849
-
Anders Carlsson authored
llvm-svn: 102848
-
Douglas Gregor authored
llvm-svn: 102847
-
Anders Carlsson authored
llvm-svn: 102846
-
Anders Carlsson authored
llvm-svn: 102845
-
Dale Johannesen authored
preventing the emission of the NOP on Darwin for a function with no actual code. From timberwolfmc with TEST=optllcdbg. llvm-svn: 102843
-
Anders Carlsson authored
llvm-svn: 102842
-
David Chisnall authored
Added a variant of InlineCostAnalyzer::getInlineCost() that takes the called function as an explicit argument, for use when inlining function pointers. llvm-svn: 102841
-
Douglas Gregor authored
information required to implicitly define a C++ special member function. Use it rather than explicitly setting CurContext on entry and exit, which is fragile. Use this RAII object for the implicitly-defined default constructor, copy constructor, copy assignment operator, and destructor. llvm-svn: 102840
-
David Chisnall authored
llvm-svn: 102839
-
Anton Korobeynikov authored
when needed. This fixes PR7001 llvm-svn: 102838
-
David Chisnall authored
llvm-svn: 102837
-
Anton Korobeynikov authored
llvm-svn: 102836
-
Anton Korobeynikov authored
llvm-svn: 102835
-
Anton Korobeynikov authored
This should fix PR6603. llvm-svn: 102834
-
David Chisnall authored
Used this in CGObjCGNU to attach metadata about message sends to permit speculative inlining. llvm-svn: 102833
-
Benjamin Kramer authored
llvm-svn: 102832
-
Owen Anderson authored
halting analysis, it is illegal to delete a call to a read-only function. The correct solution is almost certainly to add a "must halt" attribute and only allow deletions in its presence. XFAIL the relevant testcase for now. llvm-svn: 102831
-
Chris Lattner authored
if an indirect call site was removed and a direct one was added, not just if an indirect call site was modified to be direct. llvm-svn: 102830
-
Chris Lattner authored
llvm-svn: 102829
-
Dan Gohman authored
handles argument lowering anyway, so there's no need for special casing here. llvm-svn: 102828
-
Dan Gohman authored
llvm-svn: 102827
-
Dan Gohman authored
llvm-svn: 102826
-
Chris Lattner authored
llvm-svn: 102825
-
Chris Lattner authored
reflect that it includes all inlined calls now, not just devirtualized ones. llvm-svn: 102824
-
rdar://6295824Chris Lattner authored
that can have a big effect :). The first is to enable the iterative SCC passmanager juice that kicks in when the scc passmgr detects that a function pass has devirtualized a call. In this case, it will rerun all the passes it manages on the SCC, up to the iteration count limit (4). This is useful because a function pass may devirualize a call, and we want the inliner to inline it, or pruneeh to infer stuff about it, etc. The second patch is to add *all* call sites to the DevirtualizedCalls list the inliner uses. This list is about to get renamed, but the jist of this is that the inliner now reconsiders *all* inlined call sites as candidates for further inlining. The intuition is this that in cases like this: f() { g(1); } g(int x) { h(x); } We analyze this bottom up, and may decide that it isn't profitable to inline H into G. Next step, we decide that it is profitable to inline G into F, and do so, which means that F now calls H. Even though the call from G -> H may not have been profitable to inline, the call from F -> H may be (in this case because a constant allows folding etc). In my spot checks, this doesn't have a big impact on code. For example, the LLC output for 252.eon grew from 0.02% (from 317252 to 317308) and 176.gcc actually shrunk by .3% (from 1525612 to 1520964 bytes). 252.eon never iterated in the SCC Passmgr, 176.gcc iterated at most 1 time. llvm-svn: 102823
-
Chris Lattner authored
that appear due to inlining a callee as candidates for futher inlining, but a recent patch made it do this if those call sites were indirect and became direct. Unfortunately, in bizarre cases (see testcase) doing this can cause us to infinitely inline mutually recursive functions into callers not in the cycle. Fix this by keeping track of the inline history from which callsite inline candidates got inlined from. This shouldn't affect any "real world" code, but is required for a follow on patch that is coming up next. llvm-svn: 102822
-
Dan Gohman authored
try to put a kill flag on a DBG_INFO instruction. llvm-svn: 102820
-
Dale Johannesen authored
Seen in SingleSrc/Benchmarks/Misc/flops with TEST=optllcdbg. 7929951. llvm-svn: 102819
-
John McCall authored
already knows what context it's looking in. Just pass that context in instead of (questionably) recalculating it. llvm-svn: 102818
-
Dan Gohman authored
llvm-svn: 102817
-
Dan Gohman authored
modified. llvm-svn: 102816
-
Evan Cheng authored
sub-register indices and outputs a single super register which is formed from a consecutive sequence of registers. This is used as register allocation / coalescing aid and it is useful to represent instructions that output register pairs / quads. For example, v1024, v1025 = vload <address> where v1024 and v1025 forms a register pair. This really should be modelled as v1024<3>, v1025<4> = vload <address> but it would violate SSA property before register allocation is done. Currently we use insert_subreg to form the super register: v1026 = implicit_def v1027 - insert_subreg v1026, v1024, 3 v1028 = insert_subreg v1027, v1025, 4 ... = use v1024 = use v1028 But this adds pseudo live interval overlap between v1024 and v1025. We can now modeled it as v1024, v1025 = vload <address> v1026 = REG_SEQUENCE v1024, 3, v1025, 4 ... = use v1024 = use v1026 After coalescing, it will be v1026<3>, v1025<4> = vload <address> ... = use v1026<3> = use v1026 llvm-svn: 102815
-
Dan Gohman authored
code, and to eliminate the need for the SelectionDAGBuilder state to be live during CodeGenAndEmitDAG calls. Call SDB->clear() before CodeGenAndEmitDAG calls instead of before it, and move the CurDAG->clear() out of SelectionDAGBuilder, which doesn't own the DAG, and into CodeGenAndEmitDAG. llvm-svn: 102814
-