oota-llvm.git
16 years agoFix PR2596: out of bound reference.
Evan Cheng [Tue, 5 Aug 2008 21:51:46 +0000 (21:51 +0000)]
Fix PR2596: out of bound reference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54375 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCorrectly handle replacement and removal of PHIs with one incoming register.
Owen Anderson [Tue, 5 Aug 2008 21:40:45 +0000 (21:40 +0000)]
Correctly handle replacement and removal of PHIs with one incoming register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54374 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRevert r53282. This was causing a miscompile on Linux. Also, the transformation
Bill Wendling [Tue, 5 Aug 2008 21:23:45 +0000 (21:23 +0000)]
Revert r53282. This was causing a miscompile on Linux. Also, the transformation
looks bogus. Please see PR2629 for details on why this is breaking things.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54372 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoOops, we were already checking for dead phis. Handle this the proper way, then.
Owen Anderson [Tue, 5 Aug 2008 21:18:51 +0000 (21:18 +0000)]
Oops, we were already checking for dead phis.  Handle this the proper way, then.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54371 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoWe don't need to update live intervals for dead PHIs.
Owen Anderson [Tue, 5 Aug 2008 20:51:26 +0000 (20:51 +0000)]
We don't need to update live intervals for dead PHIs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54369 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoExpand acronyms, suggested by Walter Pawley
Chris Lattner [Tue, 5 Aug 2008 18:29:16 +0000 (18:29 +0000)]
Expand acronyms, suggested by Walter Pawley

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54362 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove the -disable-correct-folding option, which was ugly and is no longer needed.
Owen Anderson [Tue, 5 Aug 2008 18:27:54 +0000 (18:27 +0000)]
Remove the -disable-correct-folding option, which was ugly and is no longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54361 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCapitalize LLVM, suggested by Walt Pawley
Chris Lattner [Tue, 5 Aug 2008 18:21:08 +0000 (18:21 +0000)]
Capitalize LLVM, suggested by Walt Pawley

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54360 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdate the remaining tests not to use -disable-correct-folding, and remove two
Owen Anderson [Tue, 5 Aug 2008 18:19:14 +0000 (18:19 +0000)]
Update the remaining tests not to use -disable-correct-folding, and remove two
that couldn't be updated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54359 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoOne more -disable-correct-folding case removed.
Owen Anderson [Tue, 5 Aug 2008 18:08:56 +0000 (18:08 +0000)]
One more -disable-correct-folding case removed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54358 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove another -disable-correct-folding use.
Owen Anderson [Tue, 5 Aug 2008 18:05:58 +0000 (18:05 +0000)]
Remove another -disable-correct-folding use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54357 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoEliminate another use of -disable-correct-folding.
Owen Anderson [Tue, 5 Aug 2008 18:03:01 +0000 (18:03 +0000)]
Eliminate another use of -disable-correct-folding.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54356 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoThis check is unnecessary, and getting rid of it removes a use of -disable-correct...
Owen Anderson [Tue, 5 Aug 2008 17:52:54 +0000 (17:52 +0000)]
This check is unnecessary, and getting rid of it removes a use of -disable-correct-folding.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54355 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove the need for -disable-correct-folding from this test.
Owen Anderson [Tue, 5 Aug 2008 17:49:52 +0000 (17:49 +0000)]
Remove the need for -disable-correct-folding from this test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54354 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix the AsmWriter to not print extra spaces after parameter attributes.
Dan Gohman [Tue, 5 Aug 2008 15:51:44 +0000 (15:51 +0000)]
Fix the AsmWriter to not print extra spaces after parameter attributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54351 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTrim #includes.
Dan Gohman [Tue, 5 Aug 2008 15:32:23 +0000 (15:32 +0000)]
Trim #includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54350 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix several const-correctness issues, resolving some -Wcast-qual warnings.
Dan Gohman [Tue, 5 Aug 2008 14:45:15 +0000 (14:45 +0000)]
Fix several const-correctness issues, resolving some -Wcast-qual warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54349 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCorrect an assertion string.
Dan Gohman [Tue, 5 Aug 2008 14:42:28 +0000 (14:42 +0000)]
Correct an assertion string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54348 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove #if 0.
Evan Cheng [Tue, 5 Aug 2008 07:20:57 +0000 (07:20 +0000)]
Remove #if 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54347 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix PR2568: Fix bug that cause redudant kill marker after its live interval has been...
Evan Cheng [Tue, 5 Aug 2008 07:10:38 +0000 (07:10 +0000)]
Fix PR2568: Fix bug that cause redudant kill marker after its live interval has been extended due to coalescing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54346 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove unneeded iteration. Thanks to Dan for the feedback.
Owen Anderson [Tue, 5 Aug 2008 00:30:10 +0000 (00:30 +0000)]
Remove unneeded iteration.  Thanks to Dan for the feedback.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54337 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoThis option doesn't need to be a target option. It can be in SDISel instead.
Owen Anderson [Tue, 5 Aug 2008 00:27:28 +0000 (00:27 +0000)]
This option doesn't need to be a target option.  It can be in SDISel instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54336 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdate these tests to work by disabling the new correct CFG generation. This flag...
Owen Anderson [Mon, 4 Aug 2008 23:55:29 +0000 (23:55 +0000)]
Update these tests to work by disabling the new correct CFG generation.  This flag should ONLY be used to for tests like these.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54334 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago- Fix SelectionDAG to generate correct CFGs.
Owen Anderson [Mon, 4 Aug 2008 23:54:43 +0000 (23:54 +0000)]
- Fix SelectionDAG to generate correct CFGs.
- Add a basic machine-level dead block eliminator.

These two have to go together, since many other parts of the code generator are unable to handle the unreachable blocks otherwise created.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54333 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPR2621: Improvements to the SCEV AddRec binomial expansion. This
Eli Friedman [Mon, 4 Aug 2008 23:49:06 +0000 (23:49 +0000)]
PR2621: Improvements to the SCEV AddRec binomial expansion.  This
version uses a new algorithm for evaluating the binomial coefficients
which is significantly more efficient for AddRecs of more than 2 terms
(see the comments in the code for details on how the algorithm works).
It also fixes some bugs: it removes the arbitrary length restriction for
AddRecs, it fixes the silent generation of incorrect code for AddRecs
which require a wide calculation width, and it fixes an issue where we
were incorrectly truncating the iteration count too far when evaluating
an AddRec expression narrower than the induction variable.

There are still a few related issues I know of: I think there's
still an issue with the SCEVExpander expansion of AddRec in terms of
the width of the induction variable used.  The hack to avoid generating
too-wide integers shouldn't be necessary; instead, the callers should be
considering the cost of the expansion before expanding it (in addition
to not expanding too-wide integers, we might not want to expand
expressions that are really expensive, especially when optimizing for
size; calculating an length-17 32-bit AddRec currently generates about 250
instructions of straight-line code on X86).  Also, for long 32-bit
AddRecs on X86, CodeGen really sucks at scheduling the code.  I'm planning on
filing follow-up PRs for these issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54332 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix SDISel lowering of PHI nodes to use ComputeValueVTs.
Dan Gohman [Mon, 4 Aug 2008 23:42:46 +0000 (23:42 +0000)]
Fix SDISel lowering of PHI nodes to use ComputeValueVTs.
This allows it to work correctly on aggregate values.
This fixes PR2623.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54331 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix SDISel lowering of zeroinitializer and undef to use ComputeValueVTs.
Dan Gohman [Mon, 4 Aug 2008 23:30:41 +0000 (23:30 +0000)]
Fix SDISel lowering of zeroinitializer and undef to use ComputeValueVTs.
This allows it to work correctly on nested aggregate values.
This fixes PR2625.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54330 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd an assert to catch invalid VECTOR_SHUFFLE mask indices.
Dan Gohman [Mon, 4 Aug 2008 23:09:15 +0000 (23:09 +0000)]
Add an assert to catch invalid VECTOR_SHUFFLE mask indices.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54329 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMips ISelLowering cleanup : Removed old LowerCALL and FORMAL_ARGS helpers, they
Bruno Cardoso Lopes [Mon, 4 Aug 2008 07:12:52 +0000 (07:12 +0000)]
Mips ISelLowering cleanup : Removed old LowerCALL and FORMAL_ARGS helpers, they
aren't used anyway, they also used to broke compiling when fastcc was specified for a
function, but not anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54316 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoHandle i32->f32 bitconvert results.
Bruno Cardoso Lopes [Mon, 4 Aug 2008 06:44:31 +0000 (06:44 +0000)]
Handle i32->f32 bitconvert results.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54315 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd atomic sub for other sizes
Andrew Lenharth [Sun, 3 Aug 2008 20:17:34 +0000 (20:17 +0000)]
Add atomic sub for other sizes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54314 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoEmit saveri with the correct operand order, patch by Richard Pennington!
Chris Lattner [Sun, 3 Aug 2008 18:16:14 +0000 (18:16 +0000)]
Emit saveri with the correct operand order, patch by Richard Pennington!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54313 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix PR2615
Bruno Cardoso Lopes [Sun, 3 Aug 2008 15:37:43 +0000 (15:37 +0000)]
Fix PR2615

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54312 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImproved asm inline for hi,lo results
Bruno Cardoso Lopes [Sat, 2 Aug 2008 19:42:36 +0000 (19:42 +0000)]
Improved asm inline for hi,lo results
Added hi,lo registers to be used,def implicitly. This provides better handle of
instructions which use hi/lo.
Fixes a small BranchAnalysis bug

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54274 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoApply the same pattern used in 'and' lowering for 'or'
Bruno Cardoso Lopes [Sat, 2 Aug 2008 19:37:33 +0000 (19:37 +0000)]
Apply the same pattern used in 'and' lowering for 'or'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54273 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix comment typos.
Duncan Sands [Fri, 1 Aug 2008 12:23:49 +0000 (12:23 +0000)]
Fix comment typos.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54266 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemoved unused parameters.
Bill Wendling [Fri, 1 Aug 2008 05:50:13 +0000 (05:50 +0000)]
Removed unused parameters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54262 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake sse2 explicit, for non-x86 hosts.
Dale Johannesen [Thu, 31 Jul 2008 20:16:33 +0000 (20:16 +0000)]
Make sse2 explicit, for non-x86 hosts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54251 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoExpand fcopysign
Bruno Cardoso Lopes [Thu, 31 Jul 2008 18:50:54 +0000 (18:50 +0000)]
Expand fcopysign

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54250 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoHandle more SELECT corner cases considering legalize types, probabily wont work with
Bruno Cardoso Lopes [Thu, 31 Jul 2008 18:31:28 +0000 (18:31 +0000)]
Handle more SELECT corner cases considering legalize types, probabily wont work with
the default legalizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54249 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a flag to disable jump table generation (all
Dale Johannesen [Thu, 31 Jul 2008 18:13:12 +0000 (18:13 +0000)]
Add a flag to disable jump table generation (all
switches use the binary search algorithm) for
environments that don't support it.  PPC64 JIT
is such an environment; turn the flag on for that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54248 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImprove dagcombining for sext-loads and sext-in-reg nodes.
Dan Gohman [Thu, 31 Jul 2008 00:50:31 +0000 (00:50 +0000)]
Improve dagcombining for sext-loads and sext-in-reg nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54239 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded pattern for floating point zero immediate (avoiding a constant pool
Bruno Cardoso Lopes [Wed, 30 Jul 2008 19:00:31 +0000 (19:00 +0000)]
Added pattern for floating point zero immediate (avoiding a constant pool
access).
Added pattern to match bitconvert node.
Fixed MTC1 asm string bug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54229 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMove SelectionDAG::viewGraph() out of line; as an inline function
Dan Gohman [Wed, 30 Jul 2008 18:48:53 +0000 (18:48 +0000)]
Move SelectionDAG::viewGraph() out of line; as an inline function
it isn't always visible to gdb.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54228 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't look for leaf values to store when lowering stores of
Dan Gohman [Wed, 30 Jul 2008 18:36:51 +0000 (18:36 +0000)]
Don't look for leaf values to store when lowering stores of
empty structs. This fixes PR2612.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54226 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse existing LiveInterval methods to simplify live interval merging. Thanks to Evan...
Owen Anderson [Wed, 30 Jul 2008 18:27:35 +0000 (18:27 +0000)]
Use existing LiveInterval methods to simplify live interval merging.  Thanks to Evan for pointing these out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54225 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoI missed this file in r54223. movzbl is now used instead
Dan Gohman [Wed, 30 Jul 2008 18:23:34 +0000 (18:23 +0000)]
I missed this file in r54223. movzbl is now used instead
of movzbw here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54224 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReapply r54147 with a constraint to only use the 8-bit
Dan Gohman [Wed, 30 Jul 2008 18:09:17 +0000 (18:09 +0000)]
Reapply r54147 with a constraint to only use the 8-bit
subreg form on x86-64, to avoid the problem with x86-32
having GPRs that don't have 8-bit subregs.

Also, change several 16-bit instructions to use
equivalent 32-bit instructions. These have a smaller
encoding and avoid partial-register updates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54223 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoValue numbers whose def index is a special sentinel value should not be remapped.
Owen Anderson [Wed, 30 Jul 2008 17:42:47 +0000 (17:42 +0000)]
Value numbers whose def index is a special sentinel value should not be remapped.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54218 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFixed bug in global address lowering for functions and in Brcond lowering
Bruno Cardoso Lopes [Wed, 30 Jul 2008 17:06:13 +0000 (17:06 +0000)]
Fixed bug in global address lowering for functions and in Brcond lowering

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54215 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemoved small section flag for mips, the assembler doesnt support this flag
Bruno Cardoso Lopes [Wed, 30 Jul 2008 17:04:04 +0000 (17:04 +0000)]
Removed small section flag for mips, the assembler doesnt support this flag

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54214 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded new features to represent specific instructions groups
Bruno Cardoso Lopes [Wed, 30 Jul 2008 17:01:06 +0000 (17:01 +0000)]
Added new features to represent specific instructions groups

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54213 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoInstruction definition cleanup
Bruno Cardoso Lopes [Wed, 30 Jul 2008 16:58:59 +0000 (16:58 +0000)]
Instruction definition cleanup

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54212 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDocument BasicBlock::Create.
Matthijs Kooijman [Wed, 30 Jul 2008 12:53:14 +0000 (12:53 +0000)]
Document BasicBlock::Create.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54210 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoNot that using stream headers other than iostream is allowed.
Matthijs Kooijman [Wed, 30 Jul 2008 12:14:10 +0000 (12:14 +0000)]
Not that using stream headers other than iostream is allowed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54209 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded support for overloading intrinsics (atomics) based on pointers
Mon P Wang [Wed, 30 Jul 2008 04:36:53 +0000 (04:36 +0000)]
Added support for overloading intrinsics (atomics) based on pointers
to different address spaces.  This alters the naming scheme for those
intrinsics, e.g., atomic.load.add.i32 => atomic.load.add.i32.p0i32

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54195 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAnother SCEV issue from PR2607; essentially the same issue, but this
Eli Friedman [Wed, 30 Jul 2008 04:36:32 +0000 (04:36 +0000)]
Another SCEV issue from PR2607; essentially the same issue, but this
time applying to the implicit comparison in smin expressions. The
correct way to transform an inequality into the opposite
inequality, either signed or unsigned, is with a not expression.

I looked through the SCEV code, and I don't think there are any more
occurrences of this issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54194 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMore fixes for corner cases when remapping live range indices.
Owen Anderson [Wed, 30 Jul 2008 00:22:56 +0000 (00:22 +0000)]
More fixes for corner cases when remapping live range indices.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54186 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoWhen merging live intervals, we also need to merge in any live ranges that are inputs...
Owen Anderson [Wed, 30 Jul 2008 00:21:16 +0000 (00:21 +0000)]
When merging live intervals, we also need to merge in any live ranges that are inputs to two-address instructions
that themselves define a range we already care about.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54185 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix for PR2607: SCEV miscomputing the loop count for loops with an
Eli Friedman [Wed, 30 Jul 2008 00:04:08 +0000 (00:04 +0000)]
Fix for PR2607: SCEV miscomputing the loop count for loops with an
SGT exit condition.  Essentially, the correct way to flip an inequality
in 2's complement is the not operator, not the negation operator.
That said, the difference only affects cases involving INT_MIN.

Also, enhance the pre-test search logic to be a bit smarter about
inequalities flipped with a not operator, so it can eliminate the smax
from the iteration count for simple loops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54184 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoWhen merging a PHI operand's live interval into the PHI's live interval, we need...
Owen Anderson [Tue, 29 Jul 2008 21:17:08 +0000 (21:17 +0000)]
When merging a PHI operand's live interval into the PHI's live interval, we need to merge over all liveranges in
the operand's interval that share the relevant value number, not just the range that immediately precedes the PHI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54174 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't decrement the BB remap when we don't need to.
Owen Anderson [Tue, 29 Jul 2008 21:15:44 +0000 (21:15 +0000)]
Don't decrement the BB remap when we don't need to.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54173 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix PR2609. If a label is deleted, then it needs
Duncan Sands [Tue, 29 Jul 2008 20:56:02 +0000 (20:56 +0000)]
Fix PR2609.  If a label is deleted, then it needs
to be marked invalid regardless of whether it is
a debug, an exception handling or (hopefully) a
GC label.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54172 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoChanged some methods order.
Bruno Cardoso Lopes [Tue, 29 Jul 2008 19:29:50 +0000 (19:29 +0000)]
Changed some methods order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54169 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix broken CellSPU lowering, re-instate braces in Legalize
Nate Begeman [Tue, 29 Jul 2008 19:07:27 +0000 (19:07 +0000)]
Fix broken CellSPU lowering, re-instate braces in Legalize

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54168 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded floating point lowering for select.
Bruno Cardoso Lopes [Tue, 29 Jul 2008 19:05:28 +0000 (19:05 +0000)]
Added floating point lowering for select.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54167 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSet the executable bit - means it can actually
Duncan Sands [Tue, 29 Jul 2008 18:31:42 +0000 (18:31 +0000)]
Set the executable bit - means it can actually
be run when installing on sparc sun.  Set the
mime type to text/x-sh while there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54165 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDisable a fix in the previous patch, since it breaks CellSPU.
Nate Begeman [Tue, 29 Jul 2008 18:28:31 +0000 (18:28 +0000)]
Disable a fix in the previous patch, since it breaks CellSPU.
The CellSPU codegen is broken, but needs to be fixed before we can
put this back in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54164 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd vector shifts to the IR, patch by Eli Friedman.
Nate Begeman [Tue, 29 Jul 2008 15:49:41 +0000 (15:49 +0000)]
Add vector shifts to the IR, patch by Eli Friedman.
CodeGen & Clang work coming next.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54161 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd -unroll-allow-partial command line option that enabled the loop unroller to
Matthijs Kooijman [Tue, 29 Jul 2008 13:21:23 +0000 (13:21 +0000)]
Add -unroll-allow-partial command line option that enabled the loop unroller to
partially unroll a loop when fully unrolling would not fit under the threshold.

Patch by Mikael Lepistö.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54160 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRestructure ArgumentPromotion a bit. Instead of just having a single boolean
Matthijs Kooijman [Tue, 29 Jul 2008 10:00:13 +0000 (10:00 +0000)]
Restructure ArgumentPromotion a bit. Instead of just having a single boolean
that says "unconditional loads from this argument are safe", we now keep track
of the safety per set of indices from which loads happen. This prevents
ArgPromotion from promoting loads that aren't really valid. As an added effect,
this will now disregard the the type of the indices passed to a GEP, so
"load GEP %A, i32 1" and "load GEP %A, i64 1" will result in a single argument,
not two.

This fixes PR2598, for which a testcase has been added as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54159 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImprove bugpoint output a bit by outputting the actual instructions instead of
Matthijs Kooijman [Tue, 29 Jul 2008 08:55:30 +0000 (08:55 +0000)]
Improve bugpoint output a bit by outputting the actual instructions instead of
just it's name, which is often empty. Also remove a newline from the output
that wasn't really needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54158 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a GetElementPtrInst::getIndexedType that accepts uint64_t's instead of just Value*'s.
Matthijs Kooijman [Tue, 29 Jul 2008 08:46:11 +0000 (08:46 +0000)]
Add a GetElementPtrInst::getIndexedType that accepts uint64_t's instead of just Value*'s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54157 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix for PR2578. Do not split off a block whose size is less than FreeRangeHeader...
Evan Cheng [Tue, 29 Jul 2008 07:38:32 +0000 (07:38 +0000)]
Fix for PR2578. Do not split off a block whose size is less than FreeRangeHeader::getMinBlockSize(). Patch by Damien.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54152 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRevert 54147.
Dan Gohman [Tue, 29 Jul 2008 01:02:18 +0000 (01:02 +0000)]
Revert 54147.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54148 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd x86 isel patterns to match what would be a ZERO_EXTEND_INREG operation,
Dan Gohman [Mon, 28 Jul 2008 22:18:25 +0000 (22:18 +0000)]
Add x86 isel patterns to match what would be a ZERO_EXTEND_INREG operation,
which is represented in codegen as an 'and' operation. This matches them
with movz instructions, instead of leaving them to be matched by and
instructions with an immediate field.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54147 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFold the useful features of alist and alist_node into ilist, and
Dan Gohman [Mon, 28 Jul 2008 21:51:04 +0000 (21:51 +0000)]
Fold the useful features of alist and alist_node into ilist, and
a new ilist_node class, and remove them. Unlike alist_node,
ilist_node doesn't attempt to manage storage itself, so it avoids
the associated problems, including being opaque in gdb.

Adjust the Recycler class so that it doesn't depend on alist_node.
Also, change it to use explicit Size and Align parameters, allowing
it to work when the largest-sized node doesn't have the greatest
alignment requirement.

Change MachineInstr's MachineMemOperand list from a pool-backed
alist to a std::list for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54146 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't remove volatile loads. Thanks to Duncan for noticing this one.
Owen Anderson [Mon, 28 Jul 2008 20:52:42 +0000 (20:52 +0000)]
Don't remove volatile loads.  Thanks to Duncan for noticing this one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54144 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove extra lines
Bill Wendling [Mon, 28 Jul 2008 20:50:25 +0000 (20:50 +0000)]
Remove extra lines

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54143 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDisable gp_rel relocation for constant pools access for now.
Bruno Cardoso Lopes [Mon, 28 Jul 2008 19:26:25 +0000 (19:26 +0000)]
Disable gp_rel relocation for constant pools access for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54142 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSince build_vector is a variadic node, the number
Duncan Sands [Mon, 28 Jul 2008 19:17:21 +0000 (19:17 +0000)]
Since build_vector is a variadic node, the number
of operands should be -1 not 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54141 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoThis is not a binary file.
Duncan Sands [Mon, 28 Jul 2008 19:16:31 +0000 (19:16 +0000)]
This is not a binary file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54140 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded floating point lowering for setcc and brcond.
Bruno Cardoso Lopes [Mon, 28 Jul 2008 19:11:24 +0000 (19:11 +0000)]
Added floating point lowering for setcc and brcond.
Fixed COMM asm directive usage.
ConstantPool using custom FourByteConstantSection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54139 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTest this differently: I saw this test fail
Duncan Sands [Mon, 28 Jul 2008 19:09:01 +0000 (19:09 +0000)]
Test this differently: I saw this test fail
because opt exited while llvm-as was still
writing to the pipe, causing it to get a
SIGPIPE.  It seems best to change things to
avoid the race altogether.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54138 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't build with 4.0.
Bill Wendling [Mon, 28 Jul 2008 18:45:36 +0000 (18:45 +0000)]
Don't build with 4.0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54137 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a typo in a comment.
Dan Gohman [Mon, 28 Jul 2008 18:43:51 +0000 (18:43 +0000)]
Fix a typo in a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54136 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReword a comment to be less ambiguous.
Dan Gohman [Mon, 28 Jul 2008 18:42:57 +0000 (18:42 +0000)]
Reword a comment to be less ambiguous.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54135 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a bashism in TestRunner.sh.
Dan Gohman [Mon, 28 Jul 2008 18:41:03 +0000 (18:41 +0000)]
Fix a bashism in TestRunner.sh.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54134 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd support for eliminating stores that store the same value that was just loaded.
Owen Anderson [Mon, 28 Jul 2008 16:14:26 +0000 (16:14 +0000)]
Add support for eliminating stores that store the same value that was just loaded.
This fixes PR2599.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54133 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a subtle bug when removing instructions from memdep. In very specific
Owen Anderson [Mon, 28 Jul 2008 16:00:58 +0000 (16:00 +0000)]
Fix a subtle bug when removing instructions from memdep.  In very specific
circumstances we could end up remapping a dependee to the same instruction
that we're trying to remove.  Handle this properly by just falling back to
a conservative solution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54132 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove <iostream> include.
Bill Wendling [Sun, 27 Jul 2008 23:18:30 +0000 (23:18 +0000)]
Remove <iostream> include.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54131 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't use reinterpret_cast when it isn't needed.
Dan Gohman [Sun, 27 Jul 2008 23:12:19 +0000 (23:12 +0000)]
Don't use reinterpret_cast when it isn't needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54130 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake the ScheduleDAG's GraphRoot edge be blue and dashed too, like
Dan Gohman [Sun, 27 Jul 2008 22:46:49 +0000 (22:46 +0000)]
Make the ScheduleDAG's GraphRoot edge be blue and dashed too, like
the SelectionDAG's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54129 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRename SDOperand to SDValue.
Dan Gohman [Sun, 27 Jul 2008 21:46:04 +0000 (21:46 +0000)]
Rename SDOperand to SDValue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54128 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTidy SDNode::use_iterator, and complete the transition to have it
Dan Gohman [Sun, 27 Jul 2008 20:43:25 +0000 (20:43 +0000)]
Tidy SDNode::use_iterator, and complete the transition to have it
parallel its analogue, Value::value_use_iterator. The operator* method
now returns the user, rather than the use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54127 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix embedded CRLF characters.
Dan Gohman [Sun, 27 Jul 2008 18:37:58 +0000 (18:37 +0000)]
Fix embedded CRLF characters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54125 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRename isOnlyUseOf to isOnlyUserOf.
Dan Gohman [Sun, 27 Jul 2008 18:06:42 +0000 (18:06 +0000)]
Rename isOnlyUseOf to isOnlyUserOf.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54124 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImprove comments for SDNode use-count methods. No functionality change.
Dan Gohman [Sun, 27 Jul 2008 17:44:52 +0000 (17:44 +0000)]
Improve comments for SDNode use-count methods. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54123 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSome binary operations were being treated as
Duncan Sands [Sun, 27 Jul 2008 12:28:43 +0000 (12:28 +0000)]
Some binary operations were being treated as
unary operations!  Add support for softening
some additional unary operations like fp_to_sint.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54122 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix the issues originally addressed in r54070. After thinking about it some more...
Owen Anderson [Fri, 25 Jul 2008 23:38:08 +0000 (23:38 +0000)]
Fix the issues originally addressed in r54070.  After thinking about it some more, I realized that the right thing to do
is to have StrongPHIElimination use its knowledge of the PHIs before they're erased to update the intervals appropriate.  This is
both simpler and more accurate than the alternative, which was having LIA figure it out when it renumbered things, plus it's just
the right thing to do!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54077 91177308-0d34-0410-b5e6-96231b3b80d8