Commit Graph

41720 Commits

Author SHA1 Message Date
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
Steve Naroff 5d5efca405 -Add missing visitor for ObjCIvarRefExpr.
-Wrap objc runtime calls with "extern "C"" (for now).

llvm-svn: 48284
2008-03-12 13:19:12 +00:00
Evan Cheng 136a24742c Document an implementation detail about EXTRACT_SUBREG and INSERT_SUBREG sub-register operand.
llvm-svn: 48283
2008-03-12 07:52:15 +00:00
Owen Anderson 6ff0b822b4 Improve the return slot optimization to be both more aggressive (not limited to sret parameters), and
safer (when the passed pointer might be invalid).  Thanks to Duncan and Chris for the idea behind this, 
and extra thanks to Duncan for helping me work out the trap-safety.

llvm-svn: 48280
2008-03-12 07:37:44 +00:00
Evan Cheng 99ee78ef63 Clean up my own mess.
X86 lowering normalize vector 0 to v4i32. However DAGCombine can fold (sub x, x) -> 0 after legalization. It can create a zero vector of a type that's not expected (e.g. v8i16). We don't want to disable the optimization since leaving a (sub x, x) is really bad. Add isel patterns for other types of vector 0 to ensure correctness. It's highly unlikely to happen other than in bugpoint reduced test cases.

llvm-svn: 48279
2008-03-12 07:02:50 +00:00
Owen Anderson 944b1c76ab We also need to collect the VN IDs for the PHI instructions for later updating.
llvm-svn: 48278
2008-03-12 04:22:57 +00:00
Owen Anderson 70aaab6dc5 When we're determining what registers to coallesce, track the VNInfo IDs for the definitions that
feed the PHI instructions.  We'll need these IDs in order to update LiveIntervals properly.

llvm-svn: 48277
2008-03-12 03:13:29 +00:00
Chris Lattner e7b19035ed when the bitcode reader is referencing a paramattr, make sure to bump its refcount.
llvm-svn: 48276
2008-03-12 02:25:52 +00:00
Steve Naroff 4182fd56ad Since the rewriter now outputs C++, it no longer makes sense to pipe the output to clang.
This should "fix" all but one of the test failure.

llvm-svn: 48275
2008-03-12 02:07:40 +00:00
Evan Cheng 0903aef2ff Total brain cramp.
llvm-svn: 48274
2008-03-12 02:05:05 +00:00
Ted Kremenek 48a3410e25 Fixed regression in SymbolManager introduced in r48272.
llvm-svn: 48273
2008-03-12 02:00:37 +00:00
Ted Kremenek 68d73d19f1 Prototype (pre-alpha) implementation of CFRef checker.
llvm-svn: 48272
2008-03-12 01:21:45 +00:00
Steve Naroff 251084d03e Remove more dependencies on C "flexible array member" idiom (when generating meta-data).
llvm-svn: 48271
2008-03-12 01:06:30 +00:00
Chris Lattner 1f49988a7a This is a simple fix for getting error messages from dlerror in
LoadLibraryPermanently. The current code modifies the value of a pointer
that is passed by value, so the caller never gets the message.

Patch by Julien Lerouge!

llvm-svn: 48270
2008-03-12 00:50:01 +00:00
Dale Johannesen 0d98256c05 One more bit of Altivec parameter passing.
llvm-svn: 48269
2008-03-12 00:49:20 +00:00
Anton Korobeynikov 2f22e3f690 Be backward compatible
llvm-svn: 48268
2008-03-12 00:49:19 +00:00
Devang Patel cc189b5606 Check multiple return values.
llvm-svn: 48267
2008-03-12 00:32:32 +00:00
Steve Naroff dc5b6b2e5d Make ivar rewrite C++ friendly (since C++ forces a unified namespace for typedefs/structures). The previous version of the rewriter generated both a type def and structure def for each class (which doesn't fly in C++).
llvm-svn: 48266
2008-03-12 00:25:36 +00:00
Dan Gohman 35f8f07c00 Make this test x86-specific for now; targets that don't use
the automated CallingConv code to handle return values typically
don't support multiple return values.

llvm-svn: 48265
2008-03-12 00:25:14 +00:00
Dale Johannesen b28456ef18 Implement Altivec passing to varargs functions on ppc.
llvm-svn: 48264
2008-03-12 00:22:17 +00:00
Evan Cheng 105cb3988b Set NextMII after issuing a physical register spill.
llvm-svn: 48263
2008-03-12 00:14:07 +00:00
Devang Patel fa8667a2dd Fix attribute handling.
llvm-svn: 48262
2008-03-12 00:07:03 +00:00
Evan Cheng b398635456 Minor debug output bug.
llvm-svn: 48261
2008-03-12 00:02:46 +00:00
Dan Gohman 8a361c1f92 Basic feature test for multiple return values in codegen.
llvm-svn: 48260
2008-03-11 23:53:16 +00:00
Anton Korobeynikov e6d90f5a95 Ultimately resolve aliases during linking, if possible
llvm-svn: 48259
2008-03-11 22:51:09 +00:00
Anton Korobeynikov 80b53b8f6b Testcase for PR2137
llvm-svn: 48258
2008-03-11 22:43:42 +00:00
Anton Korobeynikov e8fa50f63a Correctly propagate thread-local flag from aliasee to alias. This fixes PR2137
llvm-svn: 48257
2008-03-11 22:38:53 +00:00
Dan Gohman 24570836b2 Use PassManagerBase instead of FunctionPassManager for functions
that merely add passes. This allows them to be used with either
FunctionPassManager or PassManager, or even with a custom new
kind of pass manager.

llvm-svn: 48256
2008-03-11 22:29:46 +00:00
Anton Korobeynikov da7db7d9a1 Add helper for ultimate aliasee resoltion
llvm-svn: 48255
2008-03-11 22:28:56 +00:00
Devang Patel 7358165c99 Handle multiple ret values.
llvm-svn: 48254
2008-03-11 22:24:29 +00:00
Devang Patel f6269f0914 Initialize.
llvm-svn: 48253
2008-03-11 22:08:21 +00:00
Dan Gohman 20af5a0fe7 Check to see if a two-entry PHI block can be simplified
before trying to merge the block into its predecessors.
This allows two-entry-phi-return.ll to be simplified
into a single basic block.

llvm-svn: 48252
2008-03-11 21:53:06 +00:00