Commit Graph

6112 Commits

Author SHA1 Message Date
Dan Gohman
14ad6fce43 Correct a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59341 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 00:24:23 +00:00
Dan Gohman
ade9f18934 Move ScheduleDAGList's LatencyPriorityQueue class out to a separate file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59340 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 00:23:40 +00:00
Dan Gohman
7e6a1bc0fa Add support for building a ScheduleDAG from MachineInstrs. This is currently
fairly conservative; it doesn't do alias-analysis queries and it doesn't
attempt to break anti-dependencies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59324 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 21:47:58 +00:00
Lang Hames
56c523c63b Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59293 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 06:51:35 +00:00
Dan Gohman
8f6c6d4c5f For post-regalloc scheduling, remove the instructions from the block
before re-inserting them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59281 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 00:33:17 +00:00
Dan Gohman
90c5201dd1 Check in the correct version of the patch in r59279.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59280 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 00:32:34 +00:00
Dan Gohman
505a551dab Debug printing for SUnits that carry MachineInstrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59279 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 00:28:56 +00:00
Dan Gohman
f449bf36ef Initial support for carrying MachineInstrs in SUnits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59278 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 00:06:09 +00:00
Dan Gohman
c3c129fd8b Change DOTGraphTraits<ScheduleDAG*>::getGraphName how to find the name of
the current function on its own, rather than relying on the SelectionDAG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59277 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 23:45:55 +00:00
Dan Gohman
d23e0f81bc Remove the FlaggedNodes member from SUnit. Instead of requiring each SUnit
to carry a SmallVector of flagged nodes, just calculate the flagged nodes
dynamically when they are needed.

The local-liveness change is due to a trivial scheduling change where
the scheduler arbitrary decision differently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59273 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 23:24:17 +00:00
Owen Anderson
711fd3db2d Don't allow the restore point to be placed after terminators. With this change,
MultiSource/Applications is clean with the prealloc splitter.  Some failures
remain in SPEC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59267 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 21:53:14 +00:00
Dan Gohman
550f5afb68 Make the Node member of SUnit private, and add accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59264 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 21:36:12 +00:00
Dan Gohman
a23b3b803e Change ScheduleDAG's DAG member from a reference to a pointer, to prepare
for the possibility of scheduling without a SelectionDAG being present.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59263 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 21:21:28 +00:00
Dan Gohman
4a829ecc54 Use find_first/find_next to iterate through all the set bits in a
BitVector, instead of manually testing each bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59246 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 16:31:27 +00:00
Bill Wendling
e9e6bdf27f Implement stack protectors as function attributes: "ssp" and "sspreq".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59202 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 01:02:14 +00:00
Dan Gohman
bc5cbb8be9 Move the code that inserts X87 FP_REG_KILL instructions from a
special-purpose hook to a new pass. Also, add check to see if any
x87 virtual registers are used, to avoid doing any work in the
common case that no x87 code is needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59190 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 22:55:05 +00:00
Dale Johannesen
7e298ed379 Fix unsigned char->ppcf128 conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59150 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 18:38:44 +00:00
Dan Gohman
2d9716f7bf Do the LiveVariables update before printing the instruction in
the debug output, so that the updated liveness flags are
reflected in the debug output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59147 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 17:15:19 +00:00
Dan Gohman
4cbb3ca67d Remove some debugging code made redundant by the change to do
coalescing as a separate pass rather than inside of
LiveIntervalAnalysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 17:09:23 +00:00
Duncan Sands
1e465a35c8 Simplify SplitVecRes_EXTRACT_SUBVECTOR. This means
that it no longer handles non-power-of-two vectors.
However it previously only handled them sometimes,
depending on obscure numerical relationships between
the index and vector type.  For example, for a vector
of length 6, it would succeed if and only if the
index was an even multiple of 6.  I consider this
more confusing than useful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59122 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 08:37:57 +00:00
Duncan Sands
245146b58a Correct some thinkos in the expansion of ADD/SUB
when the target does not support ADDC/SUBC.  This
fixes PR3044.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59120 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 08:23:26 +00:00
Dale Johannesen
cbf7cf50ec Fix the testb optimization so x86 also bootstraps.
Reenable test.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59101 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 02:00:35 +00:00
Owen Anderson
80fe8737eb Don't walk into predecessors in which the vreg is not live when doing shrinkwrapping.
This lets several failing tests get farther along, but doesn't completely fix any of them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59086 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 22:11:27 +00:00
Dan Gohman
b13af2f2ec In ScheduleDAGRRList::CopyAndMoveSuccessors, create the SUnit for the load
before creating the SUnit for the operation that it was unfolded from. This
allows each SUnit to have all of its predecessor SUnits available at the time
it is created. I don't know yet if this will be absolutely required, but it
is a little tidier to do it this way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59083 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 21:34:44 +00:00
Dan Gohman
eb9dbf117f Avoid relying on the SelectionDAG for initializing the MachineFunction and
TargetLoweringInfo variables for the scheduler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59082 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 21:31:56 +00:00
Dan Gohman
9b75b37375 Change the scheduler accessor methods to accept an explicit TargetMachine
argument instead of taking the SelectionDAG's TargetMachine. This is
needed for some upcoming scheduler changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59055 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 17:50:47 +00:00
Bill Wendling
ae89bb1443 Fix for PR3040:
The CC was changed, but wasn't checked to see if it was legal if the DAG
combiner was being run after legalization. Threw in a couple of checks just to
make sure that it's okay. As far as the PR is concerned, no back-end target
actually exhibited this problem, so there isn't an associated testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59035 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 08:25:46 +00:00
Mon P Wang
00ec49b6ba Cleaned up and fix bugs in convert_rndsat node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59025 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 05:40:06 +00:00
Bill Wendling
22511ed2fe Small simplification. Use the iterator already present as the insertion point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59008 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 23:38:59 +00:00
Bill Wendling
d0ab34bf8f Temporarily revert r58979 and related patch. It's causing a failure in X86 bootstrap:
Comparing stages 2 and 3
warning: ./cc1-checksum.o differs
warning: ./cc1obj-checksum.o differs
warning: ./cc1objplus-checksum.o differs
warning: ./cc1plus-checksum.o differs
Bootstrap comparison failure!
./alias.o differs
./alloc-pool.o differs
./attribs.o differs
./bb-reorder.o differs
./bitmap.o differs
./build/errors.o differs
./build/genattrtab.o differs
./build/genautomata.o differs
./build/genemit.o differs
./build/genextract.o differs
...

-bw


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59003 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 21:22:06 +00:00
Bill Wendling
7205677a46 - Make sure that we don't over-increment the iterator when going through the
basic blocks.
- Minor code clean-up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59002 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 21:13:10 +00:00
Mon P Wang
77cdf30742 Added CONVERT_RNDSAT (conversion with rounding and saturation) SDNode to
support targets that support these conversions. Users should avoid using
this node as the current targets don't generating code for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59001 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 20:54:11 +00:00
Duncan Sands
f509224510 Fix PR2667: add soft float support for sint_to_fp/uint_to_fp
where the argument is an apint, or smaller than the minimum
size for which there is a libcall (i32). 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58994 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 17:36:26 +00:00
Duncan Sands
cff50d9e20 Tweak some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58993 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 17:31:56 +00:00
Duncan Sands
6959b2bb65 Small cleanups. No functionality change intended!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58992 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 17:29:56 +00:00
Duncan Sands
a29c13086a When promoting the result of fp_to_uint/fp_to_sint,
inform the optimizers that the result must be zero/
sign extended from the smaller type.  For example,
if a fp to unsigned i16 is promoted to fp to i32,
then we are allowed to assume that the extra 16 bits
are zero (because the result of fp to i16 is undefined
if the result does not fit in an i16).  This is
quite aggressive, but should help the optimizers
produce better code.  This requires correcting a
test which thought that fp_to_uint is some kind
of truncation, which it is not: in the testcase
(which does fp to i1), either the fp value converts
to 0 or 1 or the result is undefined, which is
quite different to truncation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58991 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 17:28:30 +00:00
Dale Johannesen
baf26b2d3e Really fix testb optimization on big-endian.
Fixes ppc32 bootstrap.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58979 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 07:16:42 +00:00
Mon P Wang
aeb06d2462 Added support for the following definition of shufflevector
<result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask> 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58964 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 04:46:22 +00:00
Chris Lattner
a64f463fb9 eliminate a couple more uses of utohexstr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58963 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 04:35:24 +00:00
Chris Lattner
c6a1346d7c Use utohex_buffer instead of utohexstr to avoid creating a temporary
string in the .ll and .s printers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58962 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 04:30:26 +00:00
Chris Lattner
4d557e4872 Fix an over aggressive assumption that struct decls will have a pointer to
an array that is empty.  Instead of requiring this array, allow a null pointer.
This shrinks all forward references of structs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58959 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 03:48:55 +00:00
Dale Johannesen
ced4900578 Temporarily revert 58825, which breaks PPC bootstrap.
xs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58930 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-09 06:48:10 +00:00
Anton Korobeynikov
0b45c9957f Temporary revert my last commit: it seems it's triggering some subtle bug in backend
and breaks llvm-gcc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58926 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 23:05:05 +00:00
Duncan Sands
059b2dbd90 Try to produce better code when scalarizing VSETCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58920 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 18:26:48 +00:00
Anton Korobeynikov
0f56953567 Factor out offset printing code into generic AsmPrinter.
FIXME: it seems, that most of targets don't support
offsets wrt CPI/GlobalAddress', was it intentional?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58917 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 17:21:38 +00:00
Evan Cheng
ce4a70bd76 Rename startFunctionStub to startGVStub since it's also used for GV non-lazy ptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58897 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 08:02:53 +00:00
Dale Johannesen
b514ac9e3c Make testb optimization work on big-endian targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58874 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 00:01:16 +00:00
Dale Johannesen
53e4e4478c Make FP tests requiring two compares work on PPC (PR 642).
This is Chris' patch from the PR, modified to realize that
SETUGT/SETULT occur legitimately with integers, plus
two fixes in LegalizeDAG to pass a valid result type into
LegalizeSetCC.  The argument of TLI.getSetCCResultType is
ignored on PPC, but I think I'm following usage elsewhere.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58871 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 22:54:33 +00:00
Duncan Sands
47b3417cf0 Sign-extend rather than zero-extend when promoting
the condition for a BRCOND, according to what is
returned by getSetCCResultContents.  Since all
targets return the same thing (ZeroOrOneSetCCResult),
this should be harmless!  The point is that all over
the place the result of SETCC is fed directly into
BRCOND.  On machines for which getSetCCResultContents
returns ZeroOrNegativeOneSetCCResult, this is a
sign-extended boolean.  So it seems dangerous to
also feed BRCOND zero-extended booleans in some
circumstances - for example, when promoting the
condition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58861 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 20:13:04 +00:00
Dale Johannesen
bc3c4296c0 Fix unsigned->ppcf128 conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58856 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 19:11:43 +00:00
Bill Wendling
cab3e68136 Refactor code that adjusts the offsets of stack objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58829 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 01:48:58 +00:00
Dale Johannesen
89217a6f18 When we're doing a compare of load-AND-constant to 0
(e.g. a bitfield test) narrow the load as much as possible.
The has the potential to avoid unnecessary partial-word
load-after-store conflicts, which cause stalls on several targets.
Also a size win on x86 (testb vs testl).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58825 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 01:28:02 +00:00
Bill Wendling
b7c6ebcb47 - Modify the stack protector algorithm so that the stack slot is allocated in
LLVM IR code and not in the selection DAG ISel. This is a cleaner solution.

- Fix the heuristic for determining if protectors are necessary. The previous
  one wasn't checking the proper type size.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58824 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 01:23:58 +00:00
Bill Wendling
848693c254 Remove unneeded header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58823 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 23:56:59 +00:00
Bill Wendling
1fb615f820 Don't build a vector of returns. Just modify the Function in the loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58822 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 23:55:49 +00:00
Mon P Wang
e0b436ac41 Fixed scalarizing an extract subvector and prevent an infinite loop
when simplify a vector. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58820 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 22:52:21 +00:00
Bill Wendling
703ccfe053 The size limit is for individual arrays. So if any array has more than 8 bytes
in it, then emit stack protectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58819 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 22:18:44 +00:00
Bill Wendling
44cf38c01f Don't recalculate the stack position of the stack protector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58815 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 21:37:09 +00:00
Devang Patel
e75808cf3d Emit label for llvm.dbg.func.start of the inlined function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58814 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 21:28:20 +00:00
Duncan Sands
b951aec3ad Formating/comment changes - no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58801 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 08:51:32 +00:00
Bill Wendling
4c3a1d8d2b - Rename stackprotector_{prologue,epilogue} to stackprotector_{create,check}.
- Get rid of "HasStackProtector" in MachineFrameInfo.
- Modify intrinsics to tell which are doing what with memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58799 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 07:23:03 +00:00
Mon P Wang
f007a8b931 Widening cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58796 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 05:31:54 +00:00
Bill Wendling
89c5cc6c79 Adjust the stack protector heuristic to care about only arrays or calls to
"alloca".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58792 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 02:38:58 +00:00
Bill Wendling
b2a4298ce4 Implement the stack protector stack accesses via intrinsics:
- stackprotector_prologue creates a stack object and stores the guard there.

- stackprotector_epilogue reads the stack guard from the stack position created
  by stackprotector_prologue.

- The PrologEpilogInserter was changed to make sure that the stack guard is
  first on the stack frame.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58791 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 02:29:10 +00:00
Devang Patel
20dd0460a1 Emit label for llvm.dbg.func.start of the inlined function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58786 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 00:30:09 +00:00
Duncan Sands
c45cb9f739 Fix thinko in ppcf128 expansion of truncating store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58753 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 07:17:27 +00:00
Evan Cheng
3eb57d5439 Type of shuffle mask has changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58751 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 06:04:18 +00:00
Bill Wendling
1508606ee8 Remove dead variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58741 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 00:56:35 +00:00
Bill Wendling
fa75dc647c Simplify the allocated size calculation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58740 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 00:54:27 +00:00
Bill Wendling
f0eaa9a233 Fix comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58739 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 00:46:15 +00:00
Owen Anderson
b214c6971b Use the new predicate to control when we do prealloc splitting. Fix a small bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58738 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 00:32:13 +00:00
Bill Wendling
613f77439e Some code simplification. It now doesn't generate a prologue if the epilogue
isn't going to be generated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58734 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 00:00:21 +00:00
Bill Wendling
4a3a851182 Small simplification of the stack guard type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58728 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 22:54:43 +00:00
Bill Wendling
b7c2c1246f - Add a "getOrInsertGlobal" method to the Module class. This acts similarly to
"getOrInsertFunction" in that it either adds a new declaration of the global
  and returns it, or returns the current one -- optionally casting it to the
  correct type.
- Use the new getOrInsertGlobal in the stack protector code.
- Use "splitBasicBlock" in the stack protector code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58727 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 22:51:24 +00:00
Owen Anderson
f1f75b1bd1 First pass at checking for the creation of a new join point when doing pre-alloc splitting. This is not turned on yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58726 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 22:22:41 +00:00
Bill Wendling
80a320d974 Update in response to feedback from Chris:
- Use enums instead of magic numbers.

- Rework algorithm to use the bytes size from the target to determine when to
  emit stack protectors.

- Get rid of "propolice" in any comments.

- Renamed an option to its expanded form.

- Other miscellanenous changes.

More changes will come after this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58723 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 21:53:09 +00:00
Dale Johannesen
53997b0745 80 columns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58717 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 20:52:49 +00:00
Duncan Sands
20d629cb90 Fix typo. Patch by nlewycky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58709 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 18:05:30 +00:00
Duncan Sands
e59416efb8 Fix PR3011: LegalizeTypes support for scalarizing
SELECT_CC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58706 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 17:31:08 +00:00
Nuno Lopes
7ecbfd1157 fix leakage of IfcvtTokens
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58690 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 13:02:59 +00:00
Oscar Fuentes
5c42fd8af1 CMake: Updated list of source files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58676 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 03:24:04 +00:00
Bill Wendling
2b58ce5ab4 Initial checkin for stack protectors. Here's what it does:
* The prologue is modified to read the __stack_chk_guard global and insert it
  onto the stack.

* The epilogue is modified to read the stored guard from the stack and compare
  it to the original __stack_chk_guard value. If they differ, then the
  __stack_chk_fail() function is called.

* The stack protector needs to be first on the stack (after the parameters) to
  catch any stack-smashing activities.

Front-end support will follow after a round of beta testing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58673 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 02:10:20 +00:00
Dale Johannesen
283c6965d0 Fix some ppcf128 regressions: make ExpandFloatRes_LOAD
work correctly, and bring over a late change to ppcf128
SetCC handling.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58642 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 20:47:45 +00:00
Duncan Sands
d821726a91 Make VAARG promotion work correctly with large funky
sized integers like i129, and also reduce the number
of assumptions made about how vaarg is implemented.
This still doesn't work correctly for small integers
like (eg) i1 on x86, since x86 passes each of them
(essentially an i8) in a 4 byte stack slot, so the
pointer needs to be advanced by 4 bytes not by 1 byte
as now.  But this is no longer a LegalizeTypes problem
(it was also wrong in LT before): it is a bug in the
operation expansion in LegalizeDAG: now LegalizeTypes
turns an i1 vaarg into an i8 vaarg which would work
fine if only the i8 vaarg was turned into correct code
later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58635 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 20:22:12 +00:00
Duncan Sands
5c58a3168f Make VAARG work with x86 long double (which is
10 bytes long, but is passed in 12/16 bytes).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58608 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 11:51:11 +00:00
Matthijs Kooijman
06140888b1 Make MachineFrameInfo::print not crash when no TargetFrameInfo is available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58606 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 11:16:43 +00:00
Owen Anderson
ae61ca0206 Revert my last patch until I consult with Evan about it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58591 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 02:33:28 +00:00
Owen Anderson
6423c6c0e8 Don't do pre-splitting if doing so would create a value join that did not
exist before.  Updating the live intervals in that care is tricky in the general
case.

Evan, if you see a tighter guard condition for this, let me know.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58560 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-02 08:08:18 +00:00
Mon P Wang
3efcd4a65c Added interface to allow clients to create a MemIntrinsicNode for
target intrinsics that touches memory


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58548 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-01 20:24:53 +00:00
Anton Korobeynikov
ed532cac7c Invalidate debug/eh/gc labels when unreachable MBB is deleted.
Based on patch by Martin Nowack!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58536 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 20:08:30 +00:00
Dan Gohman
87e82f00ad Remove some unused virtual function bodies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58524 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 19:06:33 +00:00
Bill Wendling
f7c094000f Revert r58489. It isn't correct for all cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58523 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 18:30:19 +00:00
Evan Cheng
36f3adfe7f Add a fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58514 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 16:41:59 +00:00
Duncan Sands
06f0aff69e Add a bunch of libcalls for ppcf128 that were somehow
completely forgotten about when writing LegalizeTypes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58508 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 14:06:52 +00:00
Bill Wendling
f6a9988cea Don't skip over all "terminator" instructions when determining where to put the
callee-saved restore code. It could skip over conditional jumps
accidentally. Instead, just skip the "return" instructions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58489 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 04:00:23 +00:00
Duncan Sands
3d0f5afefb Fix PR2986: do not use a potentially illegal
type for the shift amount type.  Add a check
that shifts and rotates use the type returned
by getShiftAmountTy for the amount.  This
exposed some problems in CellSPU and PPC,
which have already been fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58455 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-30 20:26:50 +00:00
Mon P Wang
2eb13c347f Add missing vsetcc expansion for widening
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58443 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-30 18:21:52 +00:00
Mon P Wang
0c39719bfc Add initial support for vector widening. Logic is set to widen for X86.
One will only see an effect if legalizetype is not active.  Will move
support to LegalizeType soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58426 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-30 08:01:45 +00:00
Duncan Sands
b99e740d71 Uniformize capitalization of NodeId.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58386 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-29 17:52:12 +00:00
Duncan Sands
21c2972f7d Fix PR2977: LegalizeTypes support for expanding
VAARG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58379 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-29 14:25:28 +00:00