Commit Graph

21957 Commits

Author SHA1 Message Date
Anton Korobeynikov
c6ee8276f3 Get rid of hash_map. Use StringMap instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47373 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 11:27:49 +00:00
Anton Korobeynikov
a27694d7aa And final pack of warnings silencing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47372 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 11:27:04 +00:00
Anton Korobeynikov
07e6e56f57 Make Transforms to be 4.3 warnings-clean
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47371 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 11:26:25 +00:00
Anton Korobeynikov
d28b57569d Fix code style
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47370 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 11:24:05 +00:00
Anton Korobeynikov
7c1c261272 Remove bunch of gcc 4.3-related warnings from Target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47369 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 11:22:39 +00:00
Anton Korobeynikov
4c71dfe356 Update gcc 4.3 warnings fix patch with recent head changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47368 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 11:10:28 +00:00
Anton Korobeynikov
ae9f3a3b7c Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47367 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 11:08:44 +00:00
Bill Wendling
6d794746b7 Added some comments and reformatted others. No functionality change.
Added two "FIXMEs" for code that looks dubious to me (but I could be
wrong).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47366 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 09:15:16 +00:00
Owen Anderson
61d30a821f When performing return slot optimization, remember to inform memdep when we're removing the memcpy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47364 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 08:23:02 +00:00
Evan Cheng
8647bcd5de Added memmove to interpreter external functions list. Patch by Daniel Dunbar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47363 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 07:55:26 +00:00
Bill Wendling
420cdebbcb More constification of things. More comments added. No functionality
changes. (Sorry for any formatting changes that creeped in.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47362 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 07:36:31 +00:00
Nick Lewycky
178f20a685 Use getConstant for ConstantInts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47361 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 06:58:55 +00:00
Nick Lewycky
3e63076980 Add 'umax' similar to 'smax' SCEV. Closes PR2003.
Parse reversed smax and umax as smin and umin and express them with negative
or binary-not SCEVs (which are really just subtract under the hood).

Parse 'xor %x, -1' as (-1 - %x).

Remove dead code (ConstantInt::get always returns a ConstantInt).

Don't use getIntegerSCEV(-1, Ty). The first value is an int, then it gets
passed into a uint64_t. Instead, create the -1 directly from
ConstantInt::getAllOnesValue().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47360 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 06:48:22 +00:00
Chris Lattner
19fc1d3742 Fix an incredibly subtle bug exposed by Ted's change to APInt profiling.
AddNodeIDNode does profiling for a ConstantSDNode, but so does 
SelectionDAG::getConstant.  This profiling should be moved to a common
static function in ConstantSDNode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47359 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 06:28:01 +00:00
Bill Wendling
90a3868fe5 No functionality change:
- Constified some MachineOperand values.
 - Added/Modified some comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47358 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 06:10:21 +00:00
Evan Cheng
79964fdbaf Disable for now. This is pessimizing code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47354 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 02:29:17 +00:00
Dale Johannesen
6167c3fcda Add Alignment field to ParameterAttributes and
treat more or less rationally in interface
functions, subject to change.  No functional change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47352 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 23:51:49 +00:00
Evan Cheng
e9c608d6cc Add hidden option -x86-fold-and-in-test to test the effect the test / and folding change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47351 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 23:36:51 +00:00
Devang Patel
5a97097e56 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47350 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 22:27:01 +00:00
Devang Patel
d6ffcf9117 Parse
%b = getresult {i32, i32} %a, i32 1


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47349 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 22:26:37 +00:00
Devang Patel
40a04216da Add GetResultInst. First step for multiple return value support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47348 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 22:15:16 +00:00
Dale Johannesen
222ebf70b7 Generated files for checkin 47342.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47344 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 21:40:51 +00:00
Dale Johannesen
ab0789c616 Forgot a file, goes with 47342.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47343 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 21:40:10 +00:00
Dale Johannesen
0d51e7ec0d Expand ParameterAttributes to 32 bits (in preparation
for adding alignment info, not there yet).  Clean up
interfaces to reference ParameterAttributes consistently.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47342 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 21:38:47 +00:00
Ted Kremenek
a795aca96a Fixed bug in APInt::Profile() where the BitWidth field was not included in the
profile of the APSInt object. This caused unexpected Profile collisions where
none should have occurred.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47338 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 20:50:41 +00:00
Andrew Lenharth
86532db5d7 fix some byval problems in the cbe. Closes PR2065
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47337 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 19:47:54 +00:00
Chris Lattner
f27dfcb210 random cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47334 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 18:49:08 +00:00
Chris Lattner
ce2bcc8839 Don't fold and's into test instructions if they have multiple uses.
This compiles test-nofold.ll into:

_test:
	movl	$15, %ecx
	andl	4(%esp), %ecx
	testl	%ecx, %ecx
	movl	$42, %eax
	cmove	%ecx, %eax
	ret

instead of:
_test:
	movl	4(%esp), %eax
	movl	%eax, %ecx
	andl	$15, %ecx
	testl	$15, %eax
	movl	$42, %eax
	cmove	%ecx, %eax
	ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47330 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 17:37:35 +00:00
Duncan Sands
ec5ec88d15 Fix a compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47328 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 09:28:48 +00:00
Chris Lattner
75542bd56b remove the LowerSelect pass. The last client was the old Sparc backend, which is long dead by now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47323 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 07:49:17 +00:00
Chris Lattner
15f166c7b6 remove the lower packed pass. It can never work and even the parts that
could work don't work fully.  This fixes PR1705.  Oh yeah, we don't have
packed types anymore either ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47322 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 07:39:17 +00:00
Owen Anderson
967552e7ec Refactor this method a bit, and correct a test that was completely wrong but happened to work out anyways. :-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47321 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 07:07:51 +00:00
Chris Lattner
e42ce73c37 isa+cast -> dyncast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47320 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 06:53:20 +00:00
Chris Lattner
0a76a621a4 simplify this code again, try 2 :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47319 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 06:52:38 +00:00
Owen Anderson
9cffa9a6ed Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47318 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 06:51:23 +00:00
Owen Anderson
851bfff50f In addition to arguments passed to it, memcpy (and all other calls) can ModRef pointers that alias their arguments as well. This fixes PR2057.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47317 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 06:47:18 +00:00
Owen Anderson
61c24e96b1 Major improvements to yesterday's return slot optimization. Remove some unneccessary constraints,
and add some others that should have been in from the first place.  Document the whole thing better.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47315 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 06:35:43 +00:00
Chris Lattner
46acf85b97 Fix some minor issues folding undef, PR2052
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47314 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 06:22:12 +00:00
Chris Lattner
50b2ca4c73 fdiv/frem of undef can produce undef, because the undef operand
can be a SNaN.  We could be more aggressive and turn this into 
unreachable, but that is less nice, and not really worth it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47313 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 06:12:18 +00:00
Chris Lattner
389056110f regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47312 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 04:36:25 +00:00
Chris Lattner
689e8b294e Fix PR2060 by rejecting invalid types for integer constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47311 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 04:36:07 +00:00
Owen Anderson
fa113f8155 Factor the profitability check for return slot optimization out into a static function.
At some point in the future, this check will become smarter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47310 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 03:27:34 +00:00
Owen Anderson
c0755a6f98 An sret parameter is required to be the first parameter, so there's no need to loop
over all the parameters of the callee looking for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47309 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 03:15:29 +00:00
Owen Anderson
7acc0af95a Cleanup some of my patches from yesterday. Refactor the check for which xform
to apply to a memcpy into processInstruction.  Also, fix a bug in the check due to
missing braces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47307 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 03:09:45 +00:00
Owen Anderson
c2580ab9b0 Fix Transforms/GVN/memcpy.ll, which Chris broke in r47275 by reordering the branches. memcpy's are a kind of CallInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47305 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 02:53:23 +00:00
Evan Cheng
31886dbe37 PR1909: Tail merging pass ran wild. It makes no sense to merge blocks in order to save a single instruction since a branch will be inserted for each BB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47301 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 02:09:37 +00:00
Evan Cheng
422cba6ed0 Me not like duplicated comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47300 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 02:05:16 +00:00
Evan Cheng
efec751a1b - When DAG combiner is folding a bit convert into a BUILD_VECTOR, it should check if it's essentially a SCALAR_TO_VECTOR. Avoid turning (v8i16) <10, u, u, u> to <10, 0, u, u, u, u, u, u>. Instead, simply convert it to a SCALAR_TO_VECTOR of the proper type.
- X86 now normalize SCALAR_TO_VECTOR to (BIT_CONVERT (v4i32 SCALAR_TO_VECTOR)). Get rid of X86ISD::S2VEC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47290 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 23:04:32 +00:00
Nick Lewycky
e0cfecf47d Correctly fold divide-by-constant, even when faced with overflow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47287 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 22:48:05 +00:00
Dan Gohman
b00ee21f21 Chris pointed out that it's not necessary to set i64 MUL to Expand
on x86-32 since i64 itself is not a Legal type. And, update some
comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47282 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 19:34:53 +00:00
Evan Cheng
a9407f5937 - Remove the previous check which broke coalescer-commute3.ll
- For now, conservatively ignore copy MI whose source is a physical register. Commuting its def MI can cause a physical register live interval to be live through a loop (since we know it's live coming into the def MI).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47281 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 18:56:31 +00:00
Chris Lattner
7c4e9a44a4 upgrade some tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47280 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 18:46:39 +00:00
Nate Begeman
e9fe65c973 Add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47279 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 18:39:23 +00:00
Chris Lattner
92b416f64e Add a note about sext from i1 plus flags use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47278 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 18:30:13 +00:00
Dan Gohman
339ffedca9 Don't mark scalar integer multiplication as Expand on x86, since x86
has plain one-result scalar integer multiplication instructions.
This avoids expanding such instructions into MUL_LOHI sequences that
must be special-cased at isel time, and avoids the problem with that
code that provented memory operands from being folded.

This fixes PR1874, addressesing the most common case. The uncommon
cases of optimizing multiply-high operations will require work
in DAGCombiner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47277 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 17:55:26 +00:00
Chris Lattner
e10c0b9d66 Transforming -A + -B --> -(A + B) isn't safe for FP, thanks
to Dale for noticing this!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47276 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 17:50:16 +00:00
Chris Lattner
913b19f6fc minor code simplification, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47275 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 17:47:29 +00:00
Duncan Sands
548448a317 Simplify caller updating using a CallSite, as
requested by Chris.  While there, do the same
for an existing function committed by someone
called "lattner" :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47273 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 17:32:13 +00:00
Chris Lattner
bb494bcb0e don't bother calling getUnderlyingObject for non-pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47272 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 17:28:21 +00:00
Owen Anderson
ef562471ce Since we're not checking for the more general AllocationInst first, we need to explicitly check
that Object is an Argument before casting it to one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47268 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 10:11:00 +00:00
Roman Levenstein
8dd25288f9 New helper function getMBBFromIndex() that given an index in any instruction of an MBB returns a pointer the MBB. Reviewed by Evan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47267 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 09:35:30 +00:00
Owen Anderson
5aa4f2a085 Add support to GVN for performing sret return slot optimization. This means that, if an sret function tail calls
another sret function, it should pass its own sret parameter to the tail callee, allowing it to fill in the correct
return value.  llvm-gcc does not emit this by default.  Instead, it allocates space in the caller for the sret of
the tail call and then uses memcpy to copy the result into the caller's sret parameter.  This optimization detects
and optimizes that case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47265 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 09:24:53 +00:00
Owen Anderson
874a892c99 I got the predicate backwards in my last patch. The comment is correct, the code was not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47264 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 09:22:21 +00:00
Owen Anderson
26d914ada3 This check is not correct for mallocs, so exclude them earlier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47263 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 09:11:02 +00:00
Evan Cheng
96cfff0906 For now, avoid commuting def MI for copy MI's whose source is not killed. That simply trade a live interval for another and because only the non-two-address operands can be folded into loads, may end up pessimising code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47262 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 08:40:53 +00:00
Chris Lattner
8244243a31 switch simplifycfg from using vectors for most things to smallvectors,
this speeds it up 2.3% on eon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47261 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 07:42:56 +00:00
Chris Lattner
bf1d8a7099 optimize away stackrestore calls that have no intervening alloca or call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47258 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 06:12:38 +00:00
Owen Anderson
9eb948b466 Duncan pointed out that we can fast fail here, because the sret parameter of
a function must be the first parameter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47254 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 04:06:26 +00:00
Owen Anderson
ae708a3d91 Fix a comment, and a bug where we weren't applying the tail call logic in cases that failed the first test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47253 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 03:52:21 +00:00
Owen Anderson
9aa7c35cee Fix bugs that Chris noticed in my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47252 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 02:31:23 +00:00
Chris Lattner
d5b8d92b9f simplify some code, BreakUpSubtract always returns nonnull now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47251 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 02:18:25 +00:00
Chris Lattner
0ab5a4ae55 bitcasts of pointers are always pointers.
If we see a memcpy of a pointer, make sure to check later
uses of the pointer as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47250 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 02:11:28 +00:00
Owen Anderson
7d54254c9c Add a predicate to Argument to check for the StructRet attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47248 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 23:22:28 +00:00
Owen Anderson
9b636cb338 Teach getModRefInfo that memcpy, memmove, and memset don't "capture" memory addresses.
Also, noalias arguments are be considered "like" stack allocated ones for this purpose, because
the only way they can be modref'ed is if they escape somewhere in the current function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47247 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 21:29:08 +00:00
Chris Lattner
dd12f96c5e Fold (-x + -y) -> -(x+y) which promotes better association, fixing
the second half of PR2047


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47244 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 21:03:36 +00:00
Chris Lattner
5329bb22e9 fix pasto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47242 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 20:54:40 +00:00
Chris Lattner
0b0803ae15 Split up subtracts into add+negate if they have a reassociable use or operand
that is also a subtract.  This implements PR2047 and Transforms/Reassociate/subtest2.ll 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47241 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 20:51:26 +00:00
Chris Lattner
9bc5ed78c8 make the logic for breaking up subtracts more explicit, no
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47239 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 20:44:51 +00:00
Chris Lattner
456012c72e move PR2053 to here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47237 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 19:43:57 +00:00
Duncan Sands
3d5378ff8e Remove any 'nest' parameter attributes if the function
is not passed as an argument to a trampoline intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47220 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16 20:56:04 +00:00
Duncan Sands
b3a94608b3 Some micro-optimizations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47219 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16 20:53:06 +00:00
Andrew Lenharth
d497d9fab6 I cannot find a libgcc function for this builtin. Therefor expanding it to a noop (which is how it use to be treated). If someone who knows the x86 backend better than me could tell me how to get a lock prefix on an instruction, that would be nice to complete x86 support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47213 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16 14:46:26 +00:00
Duncan Sands
051bb7b075 Teach LegalizeTypes how to expand the operands of
br_cc.  This fixes 5 "make check" failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47212 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16 10:29:26 +00:00
Evan Cheng
559f4224d6 Refactor some code; check if commuteInstruction is able to commute the instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47208 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16 02:32:17 +00:00
Andrew Lenharth
22c5c1b2df llvm.memory.barrier, and impl for x86 and alpha
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47204 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16 01:24:58 +00:00
Bill Wendling
527c250a90 Fix typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47200 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16 01:09:25 +00:00
Dan Gohman
42a77880a8 Rename CountMemOperands to ComputeMemOperandsEnd to reflect what
it actually does. Simplify CountOperands a little by reusing
ComputeMemOperandsEnd. And reword some comments for both.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47198 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16 00:36:48 +00:00
Dan Gohman
94ebde1d45 Revert 47177, which was incorrect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47196 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16 00:25:40 +00:00
Scott Michel
0123b7dcfa Make tblgen a little smarter about constants smaller than i32. Currently,
tblgen will complain if a sign-extended constant does not fit into a
data type smaller than i32, e.g., i16. This causes a problem when certain
hex constants are used, such as 0xff for byte masks or immediate xor
values.

tblgen will try the sign-extended value first and, if the sign extended
value would overflow, it tries to see if the unsigned value will fit.
Consequently, a software developer can now safely incant:

	(XORHIr16 R16C:$rA, 0xffff)

which is somewhat clearer and more informative than incanting:

	(XORHIr16 R16C:$rA, (i16 -1))

even if the two are bitwise equivalent.

Tblgen also outputs the 64-bit unsigned constant in the generated ISel code
when getTargetConstant() is invoked.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47188 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 23:05:48 +00:00
Evan Cheng
bd3e5aac74 The copy instruction being coalesced will be removed, it is not a kill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47179 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 21:36:51 +00:00
Ted Kremenek
e3e09574ae Fixed bug in FoldingSetIteratorImpl where we did not correctly check if
we had reached the "fake bucket" after the last bucket, allowing the iterator
in some cases to run off the end of the hashtable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47178 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 21:12:46 +00:00
Dan Gohman
53c607f562 Skip over the defs and start at the uses when looking for operands
with the TIED_TO attribute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47177 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 20:59:17 +00:00
Dan Gohman
3b66555c53 Use the TargetInstrDescr to determine the number of operands
that should be checked for the TIED_TO attribute instead of
using CountOperands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47176 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 20:50:13 +00:00
Duncan Sands
ca3a56f2fb Teach LegalizeTypes how to promote the flags
in a ret node.  These are created as i32 constants
but on some platforms i32 is not legal.  This
fixes 26 "make check" failures, for example
Alpha/2005-07-12-TwoMallocCalls.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47172 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 19:34:17 +00:00
Chris Lattner
ec321b4d64 Handle \n's in value names for more targets. The asm printers
really really really need refactoring :(



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47171 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 19:04:54 +00:00
Chris Lattner
3502d0dac3 If the llvm name contains an unprintable character, don't print it in
the global comment.  This prevents printing things like:

...  # foo
bar

when the name is "foo\nbar".



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47170 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 18:56:05 +00:00
Chris Lattner
705da96697 targets that support quotes for mangled names still need to escape newlines
when they occur in the name, just like " is escaped.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47169 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 18:54:56 +00:00
Dale Johannesen
3b407444c9 Cosmetics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47168 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 18:40:53 +00:00
Evan Cheng
c8d044e4f7 - Removing the infamous r2rMap_ and rep() method. Now the coalescer will update
register defs and uses after each successful coalescing.
- Also removed a number of hacks and fixed some subtle kill information bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47167 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 18:24:29 +00:00
Evan Cheng
f20db15954 Added CommuteChangesDestination(). This returns true if commuting the specified
machine instr will change its definition register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47166 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 18:21:33 +00:00
Evan Cheng
63e3cd4e0f Remove unnecessary #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47164 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 18:12:09 +00:00
Dan Gohman
21be3849ae Use StoreSDNode::getValue instead of calling getOperand directly
with a hard-coded operand number.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47163 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 18:11:59 +00:00
Dale Johannesen
ab1a0354ec Remove warning about 64-bit code on processor
that doesn't support it.  Per Chris.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47162 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 18:09:51 +00:00
Lauro Ramos Venancio
2e78b7879d It is not safe to call fork in PrintStackTrace. Sometimes it freezes the program.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47161 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 18:05:54 +00:00
Devang Patel
9d9b204d6a Fix PR2028
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47150 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 01:24:49 +00:00
Dale Johannesen
b4c9a687eb nocona, core2 and penryn support 64 bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47149 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 01:22:41 +00:00
Chris Lattner
b6e1dd7075 Support vector constant zeros, thanks to Zack Rusin for the testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47148 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 00:57:28 +00:00
Dale Johannesen
db01c8ba26 Rewrite tblgen handling of subtarget features so
it follows the order of the enum, not alphabetical.
The motivation is to make -mattr=+ssse3,+sse41
select SSE41 as it ought to.  Added "ignored"
enum values of 0 to PPC and SPU to avoid compiler
warnings.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 23:35:16 +00:00
Devang Patel
9b03daa2a3 If loop header is also loop exiting block then OrigPN is incoming value for B loop header.
Fixes PR 2030.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47141 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 23:18:47 +00:00
Dan Gohman
5a0e7b41c1 Fix a warning about comparison between signed and unsigned,
being consistent with the rest of the APInt implementation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47138 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 22:38:45 +00:00
Chris Lattner
8c5c22f610 Fix PR2029
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47129 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 19:18:13 +00:00
Chris Lattner
423be627e6 Fix a miscompilation from Dan's recent apintification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47128 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 18:48:56 +00:00
Nate Begeman
ccef580583 Fix single precision FP constants on SPU. They are actually legal,
which allows us to kill a target-specific node.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47127 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 18:43:04 +00:00
Duncan Sands
00fee65fd2 In TargetLowering::LowerCallTo, don't assert that
the return value is zero-extended if it isn't
sign-extended.  It may also be any-extended.
Also, if a floating point value was returned
in a larger floating point type, pass 1 as the
second operand to FP_ROUND, which tells it
that all the precision is in the original type.
I think this is right but I could be wrong.
Finally, when doing libcalls, set isZExt on
a parameter if it is "unsigned".  Currently
isSExt is set when signed, and nothing is
set otherwise.  This should be right for all
calls to standard library routines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47122 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 17:28:50 +00:00
Nate Begeman
e179584f9b Change how FP immediates are handled.
1) ConstantFP is now expand by default
2) ConstantFP is not turned into TargetConstantFP during Legalize
   if it is legal.

This allows ConstantFP to be handled like Constant, allowing for 
targets that can encode FP immediates as MachineOperands.

As a bonus, fix up Itanium FP constants, which now correctly match,
and match more constants!  Hooray.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47121 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 08:57:00 +00:00
Nate Begeman
e8b7ccf0c9 Support a new type of MachineOperand, MO_FPImmediate, used for holding
FP Immediates, crazily enough


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47117 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 07:39:30 +00:00
Chris Lattner
13daadbd25 simplify code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47116 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 07:39:01 +00:00
Nate Begeman
0fec975a18 Move some useful operands up into the all-targets .td
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47115 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 07:25:46 +00:00
Nick Lewycky
95f0ba2703 Fix PR2032. Inform the alias analysis of changes to the underlying program.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47111 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 07:11:24 +00:00
Chris Lattner
eb05f90c71 upgrade some entries, remove stuff that is done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47109 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 06:19:02 +00:00
Chris Lattner
ea1cddf546 the mid-level optimizer removes this stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47108 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 05:43:18 +00:00
Chris Lattner
48b4d96949 this one is easy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47107 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 05:41:38 +00:00
Chris Lattner
8b0cb7bcc6 This readme entry is done, testcase here: CodeGen/X86/zero-remat.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47106 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 05:39:46 +00:00
Dan Gohman
d9fe41c0c8 Allow the APInt form of ComputeMaskedBits to operate on i128 types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47101 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 23:13:32 +00:00
Dan Gohman
f4f92f5ebe Assigning an APInt to 0 with plain assignment gives it a one-bit
size. Initialize these APInts to properly-sized zero values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47099 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 23:07:24 +00:00
Dan Gohman
72d2fd57b6 Avoid setting bits that aren't demanded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47098 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 22:43:25 +00:00
Dan Gohman
977a76fbb6 Simplify some logic in ComputeMaskedBits. And change ComputeMaskedBits
to pass the mask APInt by value, not by reference. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47096 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 22:28:48 +00:00
Devang Patel
ea06906559 A loop latch phi node may have uses inside loop, not just in loop header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47093 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 22:23:07 +00:00
Dan Gohman
7649127ec1 Rename APInt's isPositive to isNonNegative, to reflect what it
actually does.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47090 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 22:09:18 +00:00
Devang Patel
23067dfeac While moving exit condition, do not drop loop latch on the floor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47089 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 22:06:36 +00:00
Dan Gohman
42dd77f207 Add countTrailingOnes member functions to APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47086 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 21:11:05 +00:00
Devang Patel
02c4836f3d Keep track of exit value operand number when operands are swapped.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47082 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 19:48:48 +00:00
Nicolas Geoffray
afe6c2b001 Enable exception handling int JIT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47079 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 18:39:37 +00:00
Duncan Sands
d462ba8539 Teach LegalizeTypes how to expand and promote CTLZ,
CTTZ and CTPOP.  The expansion code differs from
that in LegalizeDAG in that it chooses to take the
CTLZ/CTTZ count from the Hi/Lo part depending on
whether the Hi/Lo value is zero, not on whether
CTLZ/CTTZ of Hi/Lo returned 32 (or whatever the
width of the type is) for it.  I made this change
because the optimizers may well know that Hi/Lo
is zero and exploit it.  The promotion code for
CTTZ also differs from that in LegalizeDAG: it
uses an "or" to get the right result when the
original value is zero, rather than using a compare
and select.  This also means the value doesn't
need to be zero extended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47075 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 18:01:53 +00:00
Chris Lattner
a1998d1cba Fix the PPC JIT regressions by encoding zeroreg as 0 for BLR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47067 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 17:24:14 +00:00
Chris Lattner
eedcf3fc46 remove some dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47066 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 17:18:26 +00:00
Devang Patel
e45252efee Remove use of ltdl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47065 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 17:11:39 +00:00
Wojciech Matyjewicz
a65ee03bb2 Fix typo. Thanks to Duncan for noticing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47062 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 12:21:32 +00:00
Wojciech Matyjewicz
3a4cbe2a41 Add comments as per review feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47061 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 11:51:34 +00:00
Evan Cheng
cdbcfccece Some code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47060 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 09:56:03 +00:00
Evan Cheng
9cec00e7f1 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47058 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 09:13:21 +00:00
Evan Cheng
e984e504b5 Fix a potential serious problem where kills belonging to the val# defined by a two-address instruction is also on the val# that defines the input.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47057 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 09:06:18 +00:00
Evan Cheng
e35a6d1dfb * Cannot safely commute an instruction there are other defs which can reach its uses.
* Ignore copy instructions which have already been coalesced.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47056 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 08:41:08 +00:00
Chris Lattner
86ca3cacc5 In SDISel, for targets that support FORMAL_ARGUMENTS nodes, lower this
node as soon as we create it in SDISel.  Previously we would lower it in
legalize.  The problem with this is that it only exposes the argument
loads implied by FORMAL_ARGUMENTs after legalize, so that only dag combine 2
can hack on them.  This causes us to miss some optimizations because 
datatype expansion also happens here.

Exposing the loads early allows us to do optimizations on them.  For example
we now compile arg-cast.ll to:

_foo:
	movl	$2147483647, %eax
	andl	8(%esp), %eax
	ret

where we previously produced:

_foo:
	subl	$12, %esp
	movsd	16(%esp), %xmm0
	movsd	%xmm0, (%esp)
	movl	$2147483647, %eax
	andl	4(%esp), %eax
	addl	$12, %esp
	ret

It might also make sense to do this for ISD::CALL nodes, which have implicit
stores on many targets.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47054 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 07:39:09 +00:00
Chris Lattner
9f72d1a730 don't try to avoid inserting loads when lowering FORMAL_ARGUMENTS.
DAGCombine is now quite good at zapifying them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47053 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 07:35:30 +00:00
Chris Lattner
fec42eb6da teach dag combiner how to eliminate MERGE_VALUES nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47052 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 07:25:05 +00:00
Nate Begeman
b5041b3085 readme updates
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47051 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 07:06:12 +00:00
Nate Begeman
0325d90348 Support legalizing insert_vector_elt on targets where the element
type is not legal.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47048 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 06:43:04 +00:00
Evan Cheng
70071434ae Initial support for copy elimination by commuting its definition MI.
PR1877.
A3 = op A2 B0<kill>                                                                                                                                                                            
...                                                                                                                                                                                     
B1 = A3      <- this copy                                                                                                                                                                      
...                                                                                                                                                                                          
   = op A3   <- more uses                                                                                                                                                                      
                                                                                                                                                                                                 
==>                                                                                                                                                                                             
                                                                                                                                                                                            
B2 = op B0 A2<kill>                                                                                                                                                                            
...                                                                                                                                                                                          
B1 = B2      <- now an identify copy                                                                                                                                                           
...                                                                                                                                                                                          
   = op B2   <- more uses

This speeds up FreeBench/neural by 29%, Olden/bh by 12%, oopack_v1p8 by 53%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47046 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 03:01:43 +00:00
Nate Begeman
ba8d51c1d7 Make register scavenging happy by not using a reg (CR0) that isn't defined
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47045 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 02:58:33 +00:00