Commit Graph

41751 Commits

Author SHA1 Message Date
Evan Cheng e21a68bca7 Undo tweak. It had no obvious benefit.
llvm-svn: 48341
2008-03-13 17:42:48 +00:00
Devang Patel af305d2342 Remove unused GetAddressOfSymbol()
Thanks Daniel Dunbar!

llvm-svn: 48340
2008-03-13 16:55:34 +00:00
Ted Kremenek 1fdd0a480e The LiveVariables analysis no longer requires a FunctionDecl&; this allows it
to be run on other declarations of blocks of code (e.g., Objective-C methods.)

llvm-svn: 48339
2008-03-13 16:55:07 +00:00
Evan Cheng 442d708bfb New test case.
llvm-svn: 48338
2008-03-13 08:05:02 +00:00
Evan Cheng 57bb088542 Typo.
llvm-svn: 48337
2008-03-13 08:04:35 +00:00
Evan Cheng 8f8a8b28e9 Don't try to sink 3-address instruction if convertToThreeAddress created more than one instructions.
llvm-svn: 48336
2008-03-13 07:56:58 +00:00
Evan Cheng ecde45ecb5 A test case I forgot to check in.
llvm-svn: 48335
2008-03-13 06:42:46 +00:00
Evan Cheng 21449c76bc Remove an unused command line option.
llvm-svn: 48334
2008-03-13 06:38:28 +00:00
Evan Cheng 5c26bde55e TwoAddressInstructionPass enhancement. After it converts a two address instruction into a 3-address one, sink it past the instruction that kills the read-mod-write register if its definition is used past the kill. This reduces the number of live register by one.
llvm-svn: 48333
2008-03-13 06:37:55 +00:00
Chris Lattner fdc0748940 handle __extension__ properly at block scope.
llvm-svn: 48332
2008-03-13 06:32:11 +00:00
Chris Lattner b943aa8c6c instead of passing in null end location info, pass in the same as start.
This still isn't right, but is slightly nicer.

llvm-svn: 48331
2008-03-13 06:29:54 +00:00
Chris Lattner 2e23209df1 improve DeclStmt to be able to store SourceRange info correctly.
Set the start of DeclStmt range.  Right now the end is meaningless 
though.

llvm-svn: 48330
2008-03-13 06:29:04 +00:00
Christopher Lamb dd55d3f1b2 Get rid of a pseudo instruction and replace it with subreg based operation on real instructions, ridding the asm printers of the hack used to do this previously. In the process, update LowerSubregs to be careful about eliminating copies that have side affects.
Note: the coalescer will have to be careful about this too, when it starts coalescing insert_subreg nodes.
llvm-svn: 48329
2008-03-13 05:47:01 +00:00
Chris Lattner 02e727ff88 Fix Path::GetMainExecutable on cygwin, patch by Sam Bishop.
llvm-svn: 48328
2008-03-13 05:22:05 +00:00
Chris Lattner 4dec91222a remove extraneous namespace qualifier, PR2142
llvm-svn: 48327
2008-03-13 05:17:59 +00:00
Chris Lattner c994c0295a move a bunch of trivial methods to be inline.
llvm-svn: 48326
2008-03-13 05:00:21 +00:00
Chris Lattner 4d650c4bee Various improvements suggested by Duncan
llvm-svn: 48325
2008-03-13 04:33:03 +00:00
Anders Carlsson 8ec6a6ffe9 Add note about asm constraints.
llvm-svn: 48324
2008-03-13 03:45:48 +00:00
Chris Lattner 723f2a1646 Fix an incorrect comment, PR2147.
llvm-svn: 48323
2008-03-13 03:29:42 +00:00
Ted Kremenek b64d183803 Added bandaid support in CFG construction for ObjCForEachStmt and ObjCAtTryStmt:
we gracefully back out and return NULL for the CFG, allowing clients to skip
analyzing functions with these CFGs. We will add support later.

Modified base ASTConsumer "CFGVisitor" to detect when a CFG is not constructed
and to emit a warning.

llvm-svn: 48322
2008-03-13 03:04:22 +00:00
Evan Cheng 0ceb8eb150 Improve VarInfo::removeKill() by using std::find instead of linear search.
llvm-svn: 48321
2008-03-13 02:42:55 +00:00
Nick Lewycky 7698bfbe16 Update -mem2reg to use succ_iterator instead of iterating across TerminatorInst
successors. This makes it support nounwind.

llvm-svn: 48320
2008-03-13 02:42:41 +00:00
Evan Cheng 4f610c0de1 Remove unused options.
llvm-svn: 48319
2008-03-13 02:41:34 +00:00
Dan Gohman 565df95a36 Eliminate a few unnecessary uses of dynamic_cast.
llvm-svn: 48318
2008-03-13 02:08:36 +00:00
Dan Gohman 1e9860a2ed Fix a typo.
llvm-svn: 48317
2008-03-13 01:58:48 +00:00
Dan Gohman 1412f515c3 Don't redundantly clear std::vector members in destructors.
llvm-svn: 48316
2008-03-13 01:57:34 +00:00
Dan Gohman 73caf5ff10 Change PMTopLevelManager's PassManagers vector element type from
Pass* to PMDataManager*. PMDataManager is more specific than Pass,
so this more accurately describes the objects that are being stored.

This eliminates the need for several dynamic_casts to PMDataManager*.
It does introduce one dynamic_cast though, in dumpPasses(). Give
this one a comment describing why a dynamic_cast is being used.

llvm-svn: 48315
2008-03-13 01:48:32 +00:00
Dan Gohman 11eecd635c Change PMStack::push to accept a PMDataManager* instead of
a Pass*. PMDataManager* is what it actually holds, so this
makes it clearer.

llvm-svn: 48314
2008-03-13 01:21:31 +00:00
Dan Gohman abf8892706 Fix a typo in a comment.
llvm-svn: 48313
2008-03-13 01:08:50 +00:00
Dan Gohman 37f10d4aeb No need for typedefs with enums in C++.
llvm-svn: 48312
2008-03-13 01:07:53 +00:00
Evan Cheng 399e1101ba Refactor some code out of MachineSink into a MachineInstr query.
llvm-svn: 48311
2008-03-13 00:44:09 +00:00
Dale Johannesen 6424bd0b11 Do not promote float params to double in varargs
calls here.  This was done earlier for params in
the varargs part of the params; any float params
that survive to here are in the non-varargs part,
and must not be promoted.

llvm-svn: 48310
2008-03-12 23:40:01 +00:00
Steve Naroff 35cb7960e3 Two fixes to RewriteTest::RewriteObjCIvarRefExpr():
- For explicit ivar refers, make sure the cast is propagated to the AST.
- Don't free the base (since it is still in use).
This fixes the recent regression to test/Rewriter/objc-ivar-receiver-1.m.

llvm-svn: 48309
2008-03-12 23:15:19 +00:00
Evan Cheng 65e9d5f1a8 Experimental scheduler change to schedule / coalesce the copies added for function livein's. Take 2008-03-10-RegAllocInfLoop.ll, the schedule looks like this after these copies are inserted:
entry: 0x12049d0, LLVM BB @0x1201fd0, ID#0:
Live Ins: %EAX %EDX %ECX
        %reg1031<def> = MOVPC32r 0
        %reg1032<def> = ADD32ri %reg1031, <es:_GLOBAL_OFFSET_TABLE_>, %EFLAGS<imp-def>
        %reg1028<def> = MOV32rr %EAX
        %reg1029<def> = MOV32rr %EDX
        %reg1030<def> = MOV32rr %ECX
        %reg1027<def> = MOV8rm %reg0, 1, %reg0, 0, Mem:LD(1,1) [0x1201910 + 0]
        %reg1025<def> = MOV32rr %reg1029
        %reg1026<def> = MOV32rr %reg1030
        %reg1024<def> = MOV32rr %reg1028

The copies unnecessarily increase register pressure and it will end up requiring a physical register to be spilled.

With -schedule-livein-copies:
entry: 0x12049d0, LLVM BB @0x1201fa0, ID#0:
Live Ins: %EAX %EDX %ECX
        %reg1031<def> = MOVPC32r 0
        %reg1032<def> = ADD32ri %reg1031, <es:_GLOBAL_OFFSET_TABLE_>, %EFLAGS<imp-def>
        %reg1024<def> = MOV32rr %EAX
        %reg1025<def> = MOV32rr %EDX
        %reg1026<def> = MOV32rr %ECX
        %reg1027<def> = MOV8rm %reg0, 1, %reg0, 0, Mem:LD(1,1) [0x12018e0 + 0]

Much better!

llvm-svn: 48307
2008-03-12 22:19:41 +00:00
Ted Kremenek e2f6d6cdb8 Changed CallRetValSymbol to SymbolConjured to allow "conjured" symbols to be created for any expression, not just CallExprs.
Added experimental support for conjuring symbols during assingments where the RHS is "unknown".  This allows more value tracking for path-sensitivity.
Fixed bug in "assumption" logic when processing symbolic constraints; we would improperly mark constraints we didn't support as infeasible.

llvm-svn: 48306
2008-03-12 21:45:47 +00:00
Duncan Sands 723849a17f Initial soft-float support for LegalizeTypes. I rewrote
the fcopysign expansion from LegalizeDAG to get rid of
what seems to be a bug: the use of sign extension means
that when copying the sign bit from an f32 to an f64,
the upper 32 bits of the f64 (now an i64) are set, not
just the top bit...  I also generalized it to work for
any sized floating point types, and removed the bogosity:
  SDOperand Mask1 = (SrcVT == MVT::f64)
    ? DAG.getConstantFP(BitsToDouble(1ULL << 63), SrcVT)
    : DAG.getConstantFP(BitsToFloat(1U << 31), SrcVT);
  Mask1 = DAG.getNode(ISD::BIT_CONVERT, SrcNVT, Mask1);
(here SrcNVT is an integer with the same size as SrcVT).
As far as I can see this takes a 1 << 63, converts to
a double, converts that to a floating point constant
then converts that to an integer constant, ending up
with... 1 << 63 as an integer constant!  So I just
generate this integer constant directly.

llvm-svn: 48305
2008-03-12 21:27:04 +00:00
Steve Naroff ffb5f9ad93 Minor aesthetic improvement (after I reviewed my last commit).
llvm-svn: 48304
2008-03-12 21:22:52 +00:00
Steve Naroff 9f33bd2c34 Avoid using the "unnamed struct field" extension (enabled with -fms-extensions). This feature/extension silently does the wrong thing in g++. As far as I can tell, g++ simply throws the field away entirely (note that it works fine with gcc). Since I am now always casting the object (for other reasons), accessing protected/public fields simply requires the cast refer to the defining class. This solution is simpler all around (thanks to Chris for suggesting it).
llvm-svn: 48302
2008-03-12 21:09:20 +00:00
Ted Kremenek 626bd2d33e Added generation of symbolic values for the return values of functions that have
no summaries (useful for false-path pruning).

llvm-svn: 48301
2008-03-12 21:06:49 +00:00
Ted Kremenek 86f1d0cd80 In GRSimpleVals, added the generation of symbolic values for the return values
of function calls. This is useful in pruning paths.

llvm-svn: 48299
2008-03-12 21:04:07 +00:00
Dan Gohman 34ae72c435 Change VirtRegMap's dump to dump to cerr, not DOUT, so that it
can be called from within a debuger without having -debug specified
on the command-line.

llvm-svn: 48298
2008-03-12 20:52:10 +00:00
Dan Gohman bf68f9fd8d Fix typos in comments.
llvm-svn: 48297
2008-03-12 20:50:04 +00:00
Dan Gohman f7492cf0ec Fix this test on hosts that don't have sse2.
llvm-svn: 48296
2008-03-12 20:40:51 +00:00
Duncan Sands c54fe97f08 Fix typo.
llvm-svn: 48295
2008-03-12 20:35:19 +00:00
Duncan Sands 87de65fc29 Don't try to extract an i32 from an f64. This
getCopyToParts problem was noticed by the new
LegalizeTypes infrastructure.  In order to avoid
this kind of thing in the future I've added a
check that EXTRACT_ELEMENT is only used with
integers.  Once LegalizeTypes is up and running
most likely BUILD_PAIR and EXTRACT_ELEMENT can
be removed, in favour of using apints instead.

llvm-svn: 48294
2008-03-12 20:30:08 +00:00
Chris Lattner 28842b7c0d Update to reflect changes in parameter attribute api.
llvm-svn: 48290
2008-03-12 17:46:07 +00:00
Chris Lattner 8a923e7c28 Reimplement the parameter attributes support, phase #1. hilights:
1. There is now a "PAListPtr" class, which is a smart pointer around
   the underlying uniqued parameter attribute list object, and manages
   its refcount.  It is now impossible to mess up the refcount.
2. PAListPtr is now the main interface to the underlying object, and
   the underlying object is now completely opaque.
3. Implementation details like SmallVector and FoldingSet are now no
   longer part of the interface.
4. You can create a PAListPtr with an arbitrary sequence of
   ParamAttrsWithIndex's, no need to make a SmallVector of a specific 
   size (you can just use an array or scalar or vector if you wish).
5. All the client code that had to check for a null pointer before
   dereferencing the pointer is simplified to just access the 
   PAListPtr directly.
6. The interfaces for adding attrs to a list and removing them is a
   bit simpler.

Phase #2 will rename some stuff (e.g. PAListPtr) and do other less 
invasive changes.

llvm-svn: 48289
2008-03-12 17:45:29 +00:00
Steve Naroff b327e49047 Use the "used" attribute. Without it, g++ removes all the meta-data:-( This doesn't happen when compiling straight C code.
llvm-svn: 48287
2008-03-12 17:18:30 +00:00
Ted Kremenek 576b76a794 Improved ExplodedGraph::Trim to only show nodes reachable from a reverse BFS
from the sources, and to try and generate only a single path from sources
to roots.

llvm-svn: 48286
2008-03-12 17:18:20 +00:00
Chris Lattner ee8d960ed1 no need to keep around this output.
llvm-svn: 48285
2008-03-12 17:14:06 +00:00