1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 06:22:56 +02:00
Commit Graph

28736 Commits

Author SHA1 Message Date
Evan Cheng
d0a66e438f Add a ARM specific pre-allocation pass that re-schedule loads / stores from
consecutive addresses togther. This makes it easier for the post-allocation pass
to form ldm / stm.

This is step 1. We are still missing a lot of ldm / stm opportunities because
of register allocation are not done in the desired order. More enhancements
coming.

llvm-svn: 73291
2009-06-13 09:12:55 +00:00
Devang Patel
bcc1187643 llvm.dbg.region.end() intrinsic is not required to be in _last_ basic block in a function. If that happens then any basic block that follows (lexically) the block with regin.end will not have scope info available. LexicalScopeStack relies on processing basic block in CFG order, but this processing order is not guaranteed. Things get complicated when the optimizer gets a chance to optimizer IR with dbg intrinsics.
Apply defensive patch to preserve at least one lexical scope till the end of function.

llvm-svn: 73282
2009-06-13 02:16:18 +00:00
Owen Anderson
a3bb398631 Improve style.
llvm-svn: 73258
2009-06-12 22:07:19 +00:00
Owen Anderson
247bdbde16 This is supposed to be a preorder numbering of the dominator tree, not the CFG.
llvm-svn: 73257
2009-06-12 21:50:22 +00:00
Owen Anderson
8c879bba61 Now with less iterator invalidation, and other forms of crashing!
llvm-svn: 73256
2009-06-12 21:41:29 +00:00
Evan Cheng
98216808fe If killed register is defined by implicit_def, do not clear it since it's live range may overlap another def of same register.
llvm-svn: 73255
2009-06-12 21:34:26 +00:00
Chris Lattner
75c88a3730 second half of fix for PR4366: don't zap store to null of
non-default addrspaces.

llvm-svn: 73253
2009-06-12 21:01:07 +00:00
Evan Cheng
2f784781aa Mark some pattern-less instructions as neverHasSideEffects.
llvm-svn: 73252
2009-06-12 20:46:18 +00:00
Devang Patel
8d9aa4249a Clear AbstractInstanceRootMap at the end of the function.
llvm-svn: 73244
2009-06-12 19:24:05 +00:00
Dan Gohman
f9b0419cd8 Don't do (x - (y - z)) --> (x + (z - y)) on floating-point types, because
it may round differently. This fixes PR4374.

llvm-svn: 73243
2009-06-12 19:23:25 +00:00
Dan Gohman
43f66023c3 Give Instruction::isSameOperationAs a corresponding comment to note
the relationship with MergeFunctions.cpp's isEquivalentOperation,
and make a trivial code reordering so that the two functions are
easier to compare.

Fix the name of Instruction::isSameOperationAs in MergeFunction.cpp's
isEquivalentOperation's comment, and fix a nearby 80-column violation.

llvm-svn: 73241
2009-06-12 19:03:05 +00:00
Nick Lewycky
32fec8ff24 Keep callers of a weak function calling it, instead of the non-weak equivalent.
llvm-svn: 73235
2009-06-12 17:16:48 +00:00
Arnold Schwaighofer
780e3addf8 Fix Bug 4278: X86-64 with -tailcallopt calling convention
out of sync with regular cc.

The only difference between the tail call cc and the normal
cc was that one parameter register - R9 - was reserved for
calling functions through a function pointer. After time the
tail call cc has gotten out of sync with the regular cc. 

We can use R11 which is also caller saved but not used as
parameter register for potential function pointers and
remove the special tail call cc on x86-64.

llvm-svn: 73233
2009-06-12 16:26:57 +00:00
Nick Lewycky
effec6b472 Don't forget to match the calling convention when producing a thunk.
llvm-svn: 73231
2009-06-12 16:04:00 +00:00
Nick Lewycky
1e36649f95 Given two identical weak functions, produce one internal function and two weak
thunks.

llvm-svn: 73230
2009-06-12 15:56:56 +00:00
Nicolas Geoffray
72523163ad After obtaining the lock, look if the function has been codegen'd by
another thread.

llvm-svn: 73227
2009-06-12 14:11:08 +00:00
Nick Lewycky
5b80791480 Add an "are types equivalent" operation that ignores the types that a pointer
points to while analyzing all other fields.

Use FoldingSetNodeID to produce a good hash. This dramatically decreases run
times.

Emit thunks. This means that it can look at all functions regardless of what
the linkage is or if the address is taken, but unfortunately some small
functions can be even shorter than the thunk because our backend doesn't yet
realize it can just turn these into jumps. This means that this pass will
pessimize code on average.

llvm-svn: 73222
2009-06-12 08:04:51 +00:00
Nick Lewycky
bbce41f698 Don't remove aggregate-typed module level constants before encoding functions
since functions may contain aggregate constants too.

llvm-svn: 73220
2009-06-12 05:20:12 +00:00
Eli Friedman
74e9f6c070 Misc x86 README updates: remove a couple of already-fixed issues,
add a few suggestions from looking at some assembly code.

llvm-svn: 73210
2009-06-11 23:07:04 +00:00
Bruno Cardoso Lopes
2b429fb48f Use forward declarations and move TargetELFWriterInfo impl to a new file.
llvm-svn: 73209
2009-06-11 22:13:00 +00:00
Bruno Cardoso Lopes
9b68e8653f Support for ELF Visibility
Emission for globals, using the correct data sections
Function alignment can be computed for each target using TargetELFWriterInfo
Some small fixes

llvm-svn: 73201
2009-06-11 19:16:03 +00:00
Chris Lattner
e0360f8ae8 Fix 4366: store to null in non-default addr space should not be
turned into unreachable.

llvm-svn: 73195
2009-06-11 17:54:56 +00:00
Sanjiv Gupta
4d678059ba Generate libcalls for floating point arithmetic and casting operations.
llvm-svn: 73194
2009-06-11 16:50:48 +00:00
Duncan Sands
9b5e3effef Cosmetic changes to parameter attribute verification.
llvm-svn: 73188
2009-06-11 08:11:03 +00:00
Duncan Sands
c12241a948 Avoid leaking memory in an error path. Noticed
by cppcheck.

llvm-svn: 73187
2009-06-11 08:09:49 +00:00
Sanjiv Gupta
1f8f8ce400 More formatting.
llvm-svn: 73185
2009-06-11 06:55:48 +00:00
Sanjiv Gupta
04cb690c99 Fixed source comments. No functionality change.
llvm-svn: 73184
2009-06-11 06:49:55 +00:00
Oscar Fuentes
c2d42ced17 CMake: Updated list of files on lib/CodeGen/CMakeLists.txt.
llvm-svn: 73174
2009-06-10 22:53:59 +00:00
Jay Foad
5affd7b2c9 Implement and use new method Function::hasAddressTaken().
llvm-svn: 73164
2009-06-10 08:41:11 +00:00
Sanjiv Gupta
02c9163ae2 Remove warnings: no newline at end of file.
llvm-svn: 73156
2009-06-10 03:42:13 +00:00
Anton Korobeynikov
1447d902e3 Silence a warning
llvm-svn: 73152
2009-06-09 23:00:39 +00:00
Jay Foad
209162fd09 Remove an unused function SafeToDestroyConstant(). Rename an almost
identical function ConstantIsDead() to SafeToDestroyConstant(), to
emphasise the connection with Constant::destroyConstant().

llvm-svn: 73149
2009-06-09 21:37:11 +00:00
Bill Wendling
23d6f0b5c7 Simplified logic of this if-then statement to reduce nesting. No functionality
change.

llvm-svn: 73143
2009-06-09 20:08:51 +00:00
Owen Anderson
996a7f7f37 Add the beginnings of an implementatation of lazy liveness analysis, based on "Fast Liveness Checking for SSA-form Programs" by Boissinot, et al.
This is still very early, hasn't been tested, and is not yet well documented.  More to come soon.

llvm-svn: 73141
2009-06-09 19:30:45 +00:00
Dan Gohman
389d27ecdd Use expandCodeFor instead of expand when the result will be
immediately casted. At present, this is just a minor code
simplification. In the future, the expansion code may be able
to make better choices if it knows what the desired result
type will be.

llvm-svn: 73137
2009-06-09 17:18:38 +00:00
Sanjiv Gupta
2121a84223 PIC16 emits auto variables as globals. When optimizer removes a function entierly by estimating its side effects on globals, those globals(autos) without a function were not being printed by the Asm printer.
llvm-svn: 73135
2009-06-09 15:31:19 +00:00
Anton Korobeynikov
6dbf7b689c Typo
llvm-svn: 73098
2009-06-08 22:59:50 +00:00
Anton Korobeynikov
0677cee20d Revert hunk commited by accident
llvm-svn: 73097
2009-06-08 22:57:18 +00:00
Anton Korobeynikov
d08df21f36 The attached patches implement most of the ARM AAPCS-VFP hard float
ABI. The missing piece is support for putting "homogeneous aggregates"
into registers.

Patch by Sandeep Patel!

llvm-svn: 73095
2009-06-08 22:53:56 +00:00
Anton Korobeynikov
52b2898854 Separate V6 from V6T2 since the latter has some extra nice instructions
llvm-svn: 73085
2009-06-08 21:20:36 +00:00
Anton Korobeynikov
7e9e1b3e1f Add helper for checking of Thumb1 mode
llvm-svn: 73080
2009-06-08 20:31:02 +00:00
Bill Wendling
b0c6fe320d Revert r72898. It does not solve the problem I want it to solve.
llvm-svn: 73075
2009-06-08 18:18:28 +00:00
Bruno Cardoso Lopes
472eb7c299 Delete comment and fix typo
llvm-svn: 73040
2009-06-07 21:49:11 +00:00
Bruno Cardoso Lopes
f7d71605a6 Fix wrong elf class and byte order initializations.
llvm-svn: 73039
2009-06-07 21:33:20 +00:00
Bruno Cardoso Lopes
cfa07266cf Simple ELF32/64 binary files can now be emitted for x86 and x86_64 without
relocation sections.

llvm-svn: 73038
2009-06-07 21:22:38 +00:00
Eli Friedman
2964aa5a38 Tweak the expansion code for BIT_CONVERT to generate better code
converting from an MMX vector to an i64.

llvm-svn: 73024
2009-06-07 09:41:57 +00:00
Eli Friedman
1609a6524f Get rid of some unnecessary code.
llvm-svn: 73017
2009-06-07 07:28:45 +00:00
Nick Lewycky
71dc3c5d85 Create FunctionType::isValidArgumentType to go along with isValidReturnType.
Also create isValidElementType for ArrayType, PointerType, StructType and
VectorType.

Make LLParser use them. This closes up some holes like an assertion failure on:

  %x = type {label}

but largely doesn't change any semantics. The only thing we accept now which
we didn't before is vectors of opaque type such as "<4 x opaque>". The opaque
can be resolved to an int or float when linking.

llvm-svn: 73016
2009-06-07 07:26:46 +00:00
Eli Friedman
d4b463b0dc Slightly generalize the code that handles shuffles of consecutive loads
on x86 to handle more cases.  Fix a bug in said code that would cause it 
to read past the end of an object.  Rewrite the code in 
SelectionDAGLegalize::ExpandBUILD_VECTOR to be a bit more general. 
Remove PerformBuildVectorCombine, which is no longer necessary with 
these changes.  In addition to simplifying the code, with this change, 
we can now catch a few more cases of consecutive loads.

llvm-svn: 73012
2009-06-07 06:52:44 +00:00
Nick Lewycky
a96000f2bf Remove cyclic MDNode detection. Any attempt to create a cyclic MDNode will
crash LLVM first.

llvm-svn: 73011
2009-06-07 04:03:01 +00:00