Commit Graph

33084 Commits

Author SHA1 Message Date
Sanjiv Gupta 9e8d42f295 Revert back 85006 for now as it breaks PIC16 tests.
llvm-svn: 85008
2009-10-24 18:19:41 +00:00
Sanjiv Gupta 055c3305a1 Adding support for placing global objects in shared data memory.
llvm-svn: 85006
2009-10-24 18:02:44 +00:00
Chris Lattner 3db7bd27c2 various cleanups suggested by Duncan
llvm-svn: 84993
2009-10-24 05:27:19 +00:00
Chris Lattner 9e2d5b3b8e fix PR5287, a serious regression from my previous patches. Thanks to
Duncan for the nice tiny testcase.

llvm-svn: 84992
2009-10-24 05:22:15 +00:00
Victor Hernandez e297149e26 Auto-upgrade free instructions to calls to the builtin free function.
Update all analysis passes and transforms to treat free calls just like FreeInst.
Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised.

llvm-svn: 84987
2009-10-24 04:23:03 +00:00
Evan Cheng 46ed1f8341 80 col violation.
llvm-svn: 84986
2009-10-24 02:07:42 +00:00
Anton Korobeynikov b4a1347be2 Add some asserts to catch copyRegToReg() fails early
llvm-svn: 84983
2009-10-24 00:27:00 +00:00
Jim Grosbach e2871d69db Restrict Thumb1 register allocation to low registers, even for instructions that
can access the hi regs. Our prologue and epilogue code doesn't know how to
properly handle save/restore of the hi regs, so things go badly when we alloc
them.

llvm-svn: 84982
2009-10-24 00:19:24 +00:00
Evan Cheng d638bc310a Identity copies should not contribute to spill weight.
llvm-svn: 84978
2009-10-23 23:09:19 +00:00
Jim Grosbach 22b2c011f9 FIXME no longer applies. R12 and R3 are available for allocation
llvm-svn: 84977
2009-10-23 23:07:42 +00:00
Jeffrey Yasskin d0fc8f809a Fix http://llvm.org/PR4822: allow module deletion after a function has been
compiled.

When functions are compiled, they accumulate references in the JITResolver's
stub maps. This patch removes those references when the functions are
destroyed.  It's illegal to destroy a Function when any thread may still try to
call its machine code.

This patch also updates r83987 to use ValueMap instead of explicit CallbackVHs
and fixes a couple "do stuff inside assert()" bugs from r84522.

llvm-svn: 84975
2009-10-23 22:37:43 +00:00
Victor Hernandez 8acf2956b8 Remove AllocationInst. Since MallocInst went away, AllocaInst is the only subclass of AllocationInst, so it no longer is necessary.
llvm-svn: 84969
2009-10-23 21:09:37 +00:00
Dan Gohman 4ef112be62 APInt-ify the gep scaling code, so that it correctly handles the case where
the scale overflows pointer-sized arithmetic. This fixes PR5281.

llvm-svn: 84954
2009-10-23 17:57:43 +00:00
Dan Gohman 41d00ac45b Make LoopDeletion check the maximum backedge taken count, rather than the
exact backedge taken count, when checking for infinite loops. This allows
it to delete loops with multiple exit conditions.

llvm-svn: 84952
2009-10-23 17:10:01 +00:00
Chris Lattner 851193b873 some stuff is done, we still have constantexpr simplification to do.
llvm-svn: 84943
2009-10-23 07:00:55 +00:00
Chris Lattner ccf1e84779 teach libanalysis to simplify vector loads with bitcast sources. This
implements something out of Target/README.txt producing:

_foo:                                                       ## @foo
	movl	4(%esp), %eax
	movapd	LCPI1_0, %xmm0
	movapd	%xmm0, (%eax)
	ret	$4

instead of:

_foo:                                                       ## @foo
	movl	4(%esp), %eax
	movapd	_b, %xmm0
	mulpd	LCPI1_0, %xmm0
	addpd	_a, %xmm0
	movapd	%xmm0, (%eax)
	ret	$4

llvm-svn: 84942
2009-10-23 06:57:37 +00:00
Chris Lattner 59f94c01dd enhance FoldReinterpretLoadFromConstPtr to handle loads of up to 32
bytes (i256).

llvm-svn: 84941
2009-10-23 06:50:36 +00:00
Chris Lattner ed00b80bf8 teach libanalysis to fold int and fp loads from almost arbitrary
non-type-safe constant initializers.  This sort of thing happens
quite a bit for 4-byte loads out of string constants, unions, 
bitfields, and an interesting endianness check from sqlite, which
is something like this:

const int sqlite3one = 1;
# define SQLITE_BIGENDIAN    (*(char *)(&sqlite3one)==0)
# define SQLITE_LITTLEENDIAN (*(char *)(&sqlite3one)==1)
# define SQLITE_UTF16NATIVE (SQLITE_BIGENDIAN?SQLITE_UTF16BE:SQLITE_UTF16LE)

all of these macros now constant fold away.

This implements PR3152 and is based on a patch started by Eli, but heavily
modified and extended.

llvm-svn: 84936
2009-10-23 06:23:49 +00:00
Evan Cheng 8b86efefec X86 needs critical path anti-dependency breaking.
llvm-svn: 84931
2009-10-23 05:57:35 +00:00
Dale Johannesen 0d670b5b92 Commit fixes for half precision I noted in review, so
they don't get lost; I don't think the originator has
write access.

llvm-svn: 84928
2009-10-23 04:02:51 +00:00
Victor Hernandez 2981d1b93d Minor code cleanup.
llvm-svn: 84919
2009-10-23 00:59:10 +00:00
Bill Wendling 6aea1a2a5a Neuter stack protectors by only checking character arrays. This is what GCC
does.

llvm-svn: 84916
2009-10-23 00:01:05 +00:00
David Goodwin 02ad4cb32e Allow the target to select the level of anti-dependence breaking that should be performed by the post-RA scheduler. The default is none.
llvm-svn: 84911
2009-10-22 23:19:17 +00:00
Ted Kremenek b5cd6233b1 Use 'waitpid' instead of 'wait'. Basing Program::Wait() on 'wait()' prevents it being correct within a multithreaded context.
This address: PR 5277 (Program::Wait is unsafe to call from multiple threads).

Note: If waitpid() turns out to be non-portable, we can add more autoconf magic, or look into
another solution.

llvm-svn: 84903
2009-10-22 22:16:17 +00:00
Benjamin Kramer ab304c9237 Random include cleanup.
llvm-svn: 84898
2009-10-22 21:49:41 +00:00
Jeffrey Yasskin 86dfc11cdf Fix OProfileJITEventListener after r84054 renamed CompileUnit to Scope.
llvm-svn: 84895
2009-10-22 20:57:35 +00:00
Bill Wendling 4f0b8d7861 Tidying up some code and comments. No functionality change.
llvm-svn: 84894
2009-10-22 20:48:59 +00:00
Devang Patel 1155fdf6dc Hide MetadataContext implementation details.
llvm-svn: 84886
2009-10-22 19:36:54 +00:00
Devang Patel 6da5dbf3c2 Fix getMDs() interface such that it does not expose implementation details.
llvm-svn: 84885
2009-10-22 18:55:16 +00:00
Devang Patel 084679e70a Using TrackingVH instead of WeakVH or WeakMetadataVH.
llvm-svn: 84884
2009-10-22 18:25:28 +00:00
Devang Patel 09c319e269 Sort handler names to ensure deterministic behavior.
llvm-svn: 84878
2009-10-22 17:40:37 +00:00
Bob Wilson 9d763cc3f8 Revert 84843. Evan, this was breaking some of the if-conversion tests.
llvm-svn: 84868
2009-10-22 16:52:21 +00:00
Nicolas Geoffray 7e8017cce7 Verify that the function and exception table have been allocated
before freeing them.

llvm-svn: 84859
2009-10-22 14:35:57 +00:00
Benjamin Kramer c77f8634e5 Shift art to the right to keep GCC from complaining about multi-line comments.
llvm-svn: 84849
2009-10-22 09:28:49 +00:00
Evan Cheng 3615b9bef3 Move if-conversion before post-regalloc scheduling so the predicated instruction get scheduled properly.
llvm-svn: 84843
2009-10-22 06:48:32 +00:00
Evan Cheng 943f4f41f2 Load / store multiple was missing opportunites when the load / store bundles are at the end of the bb. Test case is already in, the bug is exposed by subsequent commit.
llvm-svn: 84842
2009-10-22 06:47:35 +00:00
Chris Lattner cf7e8947e9 move another load optimization from instcombine -> libanalysis.
llvm-svn: 84841
2009-10-22 06:44:07 +00:00
Chris Lattner 51d2f70e32 move 'loading i32 from string' optimization from instcombine
to libanalysis.  Instcombine shrinking... does this even 
make sense???

llvm-svn: 84840
2009-10-22 06:38:35 +00:00
Chris Lattner 1664a4fd86 Move some constant folding logic for loads out of instcombine into
Analysis/ConstantFolding.cpp.  This doesn't change the behavior of
instcombine but makes other clients of ConstantFoldInstruction
able to handle loads.  This was partially extracted from Eli's patch
in PR3152.

llvm-svn: 84836
2009-10-22 06:25:11 +00:00
Evan Cheng 5457a96b63 Trim more includes.
llvm-svn: 84832
2009-10-22 05:11:00 +00:00
Evan Cheng 344fcd9d61 Trim include.
llvm-svn: 84831
2009-10-22 05:08:49 +00:00
Chris Lattner 1448799377 fix warning.
llvm-svn: 84826
2009-10-22 03:42:27 +00:00
Devang Patel 0fffb49d56 Fix getHandlerNames() interface. Now it populate clinet supplied small vector with handler names.
llvm-svn: 84820
2009-10-22 01:01:24 +00:00
Evan Cheng 0f55e9ce2e Don't generate sbfx / ubfx with negative lsb field. Patch by David Conrad.
llvm-svn: 84813
2009-10-22 00:40:00 +00:00
Devang Patel 6746d43a3f Use StringRef to construct MDString.
llvm-svn: 84811
2009-10-22 00:22:05 +00:00
Chris Lattner c7a962d3b3 fix PR5262.
llvm-svn: 84810
2009-10-22 00:17:26 +00:00
Anton Korobeynikov f1ad2c618a Use special DAG-to-DAG preprocessing to allow mem-mem instructions to be selected.
Yay for ASCII graphics!

llvm-svn: 84808
2009-10-22 00:16:00 +00:00
Anton Korobeynikov 8626367e38 Fix null pointer dereference.
llvm-svn: 84806
2009-10-22 00:15:17 +00:00
Devang Patel dcb99d310a Remove meaningless const.
Pass StringRef by value.

llvm-svn: 84804
2009-10-22 00:10:15 +00:00
Dan Gohman ff97acd8f1 Revert the main portion of r31856. It was causing BranchFolding
to break up CFG diamonds by banishing one of the blocks to the end of
the function, which is bad for code density and branch size.

This does pessimize MultiSource/Benchmarks/Ptrdist/yacr2, the
benchmark cited as the reason for the change, however I've examined
the code and it looks more like a case of gaming a particular
branch than of being generally applicable.

llvm-svn: 84803
2009-10-22 00:03:58 +00:00