oota-llvm.git
16 years agoAdd bound checks in SmallVector
Rafael Espindola [Mon, 22 Sep 2008 10:06:26 +0000 (10:06 +0000)]
Add bound checks in SmallVector

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

16 years agoadd_partially_linked_object: Replaced nonexistent MESSAGE option in
Oscar Fuentes [Mon, 22 Sep 2008 02:33:43 +0000 (02:33 +0000)]
add_partially_linked_object: Replaced nonexistent MESSAGE option in
add_custom_command with COMMENT. It was forcing unconditional command
execution.

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

16 years agoInitial support for the CMake build system.
Oscar Fuentes [Mon, 22 Sep 2008 01:08:49 +0000 (01:08 +0000)]
Initial support for the CMake build system.

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

16 years agoAdd helper function to get a 32-bit floating point constant. No functionality change.
Bill Wendling [Mon, 22 Sep 2008 00:44:35 +0000 (00:44 +0000)]
Add helper function to get a 32-bit floating point constant. No functionality change.

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

16 years agoexplain what earlyclobber actually is.
Chris Lattner [Sun, 21 Sep 2008 23:30:17 +0000 (23:30 +0000)]
explain what earlyclobber actually is.

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

16 years agoFold immediates into X86 shifts with fast isel. This generates:
Chris Lattner [Sun, 21 Sep 2008 21:44:29 +0000 (21:44 +0000)]
Fold immediates into X86 shifts with fast isel.  This generates:

sarl    $3, %ecx

instead of:

movl    $3, %ecx
sarl    %cl, %edx

This shrinks fast isel 176.gcc by about 2000 instructions (.3%)

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

16 years agoFactor out code into HandleVirtRegDef, for consistency with
Dan Gohman [Sun, 21 Sep 2008 21:11:41 +0000 (21:11 +0000)]
Factor out code into HandleVirtRegDef, for consistency with
Handle{Virt,Phys}Reg{Def,Use}. Remove a redundant check
for register zero, and redundant checks for isPhysicalRegister.

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

16 years agoInstead of building a list and sorting it just to find a maximum element,
Dan Gohman [Sun, 21 Sep 2008 21:01:49 +0000 (21:01 +0000)]
Instead of building a list and sorting it just to find a maximum element,
compute the maximum element directly.

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

16 years agoFetch the starting index of the block when assigning intervals. This gets live-in...
Owen Anderson [Sun, 21 Sep 2008 20:43:24 +0000 (20:43 +0000)]
Fetch the starting index of the block when assigning intervals.  This gets live-in indices
correct in the presence of things like EH labels.

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

16 years agodon't print GlobalAddressSDNode's with an offset of zero as "foo0".
Chris Lattner [Sun, 21 Sep 2008 18:38:31 +0000 (18:38 +0000)]
don't print GlobalAddressSDNode's with an offset of zero as "foo0".

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

16 years agoadd a note
Chris Lattner [Sat, 20 Sep 2008 19:17:53 +0000 (19:17 +0000)]
add a note

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

16 years agoUpdate VS projects.
Cedric Venet [Sat, 20 Sep 2008 18:02:18 +0000 (18:02 +0000)]
Update VS projects.
Change some class to struct for coherency.

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

16 years agoShorten and rearrange data fields to save a word of memory.
Dale Johannesen [Sat, 20 Sep 2008 17:45:21 +0000 (17:45 +0000)]
Shorten and rearrange data fields to save a word of memory.
Per review feedback.

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

16 years agoImplement review feedback from Devang: make use
Duncan Sands [Sat, 20 Sep 2008 16:45:58 +0000 (16:45 +0000)]
Implement review feedback from Devang: make use
of mayReadFromMemory and mayWriteToMemory.

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

16 years agoTeach coalescer about earlyclobber bits.
Dale Johannesen [Sat, 20 Sep 2008 02:03:04 +0000 (02:03 +0000)]
Teach coalescer about earlyclobber bits.
Check bits for preferred register.

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

16 years agoFix PR2808. When regalloc runs out of register, it spill a physical register around...
Evan Cheng [Sat, 20 Sep 2008 01:28:05 +0000 (01:28 +0000)]
Fix PR2808. When regalloc runs out of register, it spill a physical register around the live interval being allocated. Do not continue to try to spill another register, just grab the physical register and move on.

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

16 years agoClean up the test.
Evan Cheng [Sat, 20 Sep 2008 01:26:27 +0000 (01:26 +0000)]
Clean up the test.

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

16 years agoNo need to print function stubs for Mac OS X 10.5 and up. Linker will handle it.
Evan Cheng [Sat, 20 Sep 2008 00:13:45 +0000 (00:13 +0000)]
No need to print function stubs for Mac OS X 10.5 and up. Linker will handle it.

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

16 years ago80 column violation.
Evan Cheng [Sat, 20 Sep 2008 00:13:08 +0000 (00:13 +0000)]
80 column violation.

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

16 years agoFix a FastISel GlobalVariable CSE bug.
Dan Gohman [Fri, 19 Sep 2008 23:42:04 +0000 (23:42 +0000)]
Fix a FastISel GlobalVariable CSE bug.

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

16 years agoContinue after removing the current MI.
Evan Cheng [Fri, 19 Sep 2008 22:49:39 +0000 (22:49 +0000)]
Continue after removing the current MI.

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

16 years agoRefactor X86SelectConstAddr, folding it into X86SelectAddress. This
Dan Gohman [Fri, 19 Sep 2008 22:16:54 +0000 (22:16 +0000)]
Refactor X86SelectConstAddr, folding it into X86SelectAddress. This
results in better code for globals. Also, unbreak the local CSE for
GlobalValue stub loads.

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

16 years agoMake earlyclobber stuff work when virtual regs
Dale Johannesen [Fri, 19 Sep 2008 18:52:31 +0000 (18:52 +0000)]
Make earlyclobber stuff work when virtual regs
have previously been assigned conflicting physreg.

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

16 years agoPrevent warning about conversion from 64-bit to 32-bit by (yuck) casting...
Bill Wendling [Fri, 19 Sep 2008 18:34:40 +0000 (18:34 +0000)]
Prevent warning about conversion from 64-bit to 32-bit by (yuck) casting...

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

16 years agoNow that ConstantSDNode doesn't hold an APInt,
Dan Gohman [Fri, 19 Sep 2008 18:09:19 +0000 (18:09 +0000)]
Now that ConstantSDNode doesn't hold an APInt,
use ARG_FLAGSSDNode as the most aligned node type,
as it contains an int64_t, which is 8-byte
aligned on mingw.

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

16 years agoAdded static methods to APSInt: getMinValue and getMaxValue.
Ted Kremenek [Fri, 19 Sep 2008 18:01:14 +0000 (18:01 +0000)]
Added static methods to APSInt: getMinValue and getMaxValue.

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

16 years agoRe-materalized definition instructions may be dead. Whack them.
Evan Cheng [Fri, 19 Sep 2008 17:38:47 +0000 (17:38 +0000)]
Re-materalized definition instructions may be dead. Whack them.

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

16 years agobacking out my last commit, it was not intended to go on the trunk
Gabor Greif [Fri, 19 Sep 2008 15:13:20 +0000 (15:13 +0000)]
backing out my last commit, it was not intended to go on the trunk

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

16 years agofirst shot at removing Use::Val
Gabor Greif [Fri, 19 Sep 2008 15:03:57 +0000 (15:03 +0000)]
first shot at removing Use::Val
untested, Use::swap() is definitely not done yet

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

16 years agoTurn on the AddReadAttrs pass.
Duncan Sands [Fri, 19 Sep 2008 14:34:36 +0000 (14:34 +0000)]
Turn on the AddReadAttrs pass.

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

16 years agoAdd test for improvement of readonly to readnone,
Duncan Sands [Fri, 19 Sep 2008 09:20:05 +0000 (09:20 +0000)]
Add test for improvement of readonly to readnone,
and non-demotion of readnone to readonly.

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

16 years agoTurn on these tests!
Duncan Sands [Fri, 19 Sep 2008 09:16:32 +0000 (09:16 +0000)]
Turn on these tests!

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

16 years agoRemove the MarkModRef pass (use AddReadAttrs instead).
Duncan Sands [Fri, 19 Sep 2008 08:23:44 +0000 (08:23 +0000)]
Remove the MarkModRef pass (use AddReadAttrs instead).
Unfortunately this means removing one regression test
of GlobalsModRef because I couldn't work out how to
perform it without MarkModRef.

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

16 years agoAdd a new pass AddReadAttrs which works out which functions
Duncan Sands [Fri, 19 Sep 2008 08:17:05 +0000 (08:17 +0000)]
Add a new pass AddReadAttrs which works out which functions
can get the readnone/readonly attributes, and gives them it.
The plan is to remove markmodref (which did the same thing
by querying GlobalsModRef) and delete the analogous
functionality from GlobalsModRef.

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

16 years agoTest the callgraph directly for the missing edge.
Duncan Sands [Fri, 19 Sep 2008 08:01:57 +0000 (08:01 +0000)]
Test the callgraph directly for the missing edge.

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

16 years agoTeach -callgraph to always print the callgraph (as the
Duncan Sands [Fri, 19 Sep 2008 07:57:09 +0000 (07:57 +0000)]
Teach -callgraph to always print the callgraph (as the
description says it does), not just when -analyze is
used as well.  This means printing to stderr, so adjust
some tests.

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

16 years agoRemove AsmThatEarlyClobber etc. from LiveIntervalAnalysis
Dale Johannesen [Fri, 19 Sep 2008 01:02:35 +0000 (01:02 +0000)]
Remove AsmThatEarlyClobber etc. from LiveIntervalAnalysis
and redo as linked list walk.  Logic moved into RA.
Per review feedback.

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

16 years agosplitLoop does not handle split condition EQ.
Devang Patel [Thu, 18 Sep 2008 23:45:14 +0000 (23:45 +0000)]
splitLoop does not handle split condition EQ.
Fixes PR 2805

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

16 years agoAddress-mode folding for X86FastISel. It's pretty basic, but it
Dan Gohman [Thu, 18 Sep 2008 23:23:44 +0000 (23:23 +0000)]
Address-mode folding for X86FastISel. It's pretty basic, but it
catches a fair number of common cases. Note that this currently
causes Fast-ISel to leave behind lots of dead instructions.
Those will be dealt with in subsequent commits.

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

16 years agoDecrementing the iterator here could be wrong if the worklist is empty after the...
Bill Wendling [Thu, 18 Sep 2008 23:04:18 +0000 (23:04 +0000)]
Decrementing the iterator here could be wrong if the worklist is empty after the "erase".
Thanks to Ji Young Park for the patch!

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

16 years agoTry to place hoisted instructions befoe icmp instruction.
Devang Patel [Thu, 18 Sep 2008 22:50:42 +0000 (22:50 +0000)]
Try to place hoisted instructions befoe icmp instruction.

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

16 years agoSomehow RegAllocLinearScan is keeping two pointers to MachineRegisterInfo.
Evan Cheng [Thu, 18 Sep 2008 22:38:47 +0000 (22:38 +0000)]
Somehow RegAllocLinearScan is keeping two pointers to MachineRegisterInfo.

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

16 years agoSimplify this code. The FastISel class has its own TD member.
Dan Gohman [Thu, 18 Sep 2008 18:26:43 +0000 (18:26 +0000)]
Simplify this code. The FastISel class has its own TD member.

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

16 years agoDon't consider instructions with implicit physical register
Dan Gohman [Thu, 18 Sep 2008 18:22:32 +0000 (18:22 +0000)]
Don't consider instructions with implicit physical register
defs to be necessarily live.

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

16 years agoUpgrade doxygen.
Tanya Lattner [Thu, 18 Sep 2008 16:32:28 +0000 (16:32 +0000)]
Upgrade doxygen.

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

16 years agoAdd a new "fast" scheduler. This is currently basically just a
Dan Gohman [Thu, 18 Sep 2008 16:26:26 +0000 (16:26 +0000)]
Add a new "fast" scheduler. This is currently basically just a
copy of the BURRList scheduler, but with several parts ripped
out, such as backtracking, online topological sort maintenance
(needed by backtracking), the priority queue, and Sethi-Ullman
number computation and maintenance (needed by the priority
queue). As a result of all this, it generates somewhat lower
quality code, but that's its tradeoff for running about 30%
faster than list-burr in -fast mode in many cases.

This is somewhat experimental. Moving forward, major pieces of
this can be refactored with pieces in common with
ScheduleDAGRRList.cpp.

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

16 years agoPreliminary support for systems which require changing JIT memory regions privilege...
Evan Cheng [Thu, 18 Sep 2008 07:54:21 +0000 (07:54 +0000)]
Preliminary support for systems which require changing JIT memory regions privilege from read / write to read / executable.

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

16 years agoDuh. Default to ARMCC::AL (always).
Evan Cheng [Thu, 18 Sep 2008 07:28:19 +0000 (07:28 +0000)]
Duh. Default to ARMCC::AL (always).

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

16 years agoClean up.
Evan Cheng [Thu, 18 Sep 2008 07:27:23 +0000 (07:27 +0000)]
Clean up.

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

16 years agoCosmetic.
Evan Cheng [Thu, 18 Sep 2008 07:24:33 +0000 (07:24 +0000)]
Cosmetic.

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

16 years agoFastISel: For calls, prefer using the callee's address as a constant
Dan Gohman [Wed, 17 Sep 2008 21:18:49 +0000 (21:18 +0000)]
FastISel: For calls, prefer using the callee's address as a constant
over having it in a register. And wait until after checking type
legality before requesting that the callee address be placed in a
register. Also, fix support for calls with void return type.

This speeds up fast-isel isel time by about 15% and reduces
instruction counts by about 3% overall on certain testcases. It also
changes many indirect calls to direct calls.

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

16 years agoAdd a bit to mark operands of asm's that conflict
Dale Johannesen [Wed, 17 Sep 2008 21:13:11 +0000 (21:13 +0000)]
Add a bit to mark operands of asm's that conflict
with an earlyclobber operand elsewhere.  Propagate
this bit and the earlyclobber bit through SDISel.
Change linear-scan RA not to allocate regs in a way
that conflicts with an earlyclobber.  See also comments.

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

16 years agoUnallocatable registers do not have live intervals.
Evan Cheng [Wed, 17 Sep 2008 18:36:25 +0000 (18:36 +0000)]
Unallocatable registers do not have live intervals.

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

16 years agoDo not hoist instruction above branch condition. The instruction may use branch condi...
Devang Patel [Wed, 17 Sep 2008 18:21:49 +0000 (18:21 +0000)]
Do not hoist instruction above branch condition. The instruction may use branch condition.

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

16 years agoDo not ignore iv uses outside the loop.
Devang Patel [Wed, 17 Sep 2008 17:53:47 +0000 (17:53 +0000)]
Do not ignore iv uses outside the loop.
This one slipped through cracks very well.

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

16 years agoFix comments, help messages.
Devang Patel [Wed, 17 Sep 2008 16:01:39 +0000 (16:01 +0000)]
Fix comments, help messages.

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

16 years agoDon't worry about clobbering physical register defs that aren't used.
Dan Gohman [Wed, 17 Sep 2008 15:25:49 +0000 (15:25 +0000)]
Don't worry about clobbering physical register defs that aren't used.

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

16 years agoFix addrmode1 instruction encodings; fix bx_ret encoding.
Evan Cheng [Wed, 17 Sep 2008 07:53:38 +0000 (07:53 +0000)]
Fix addrmode1 instruction encodings; fix bx_ret encoding.

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

16 years agoSpecify instruction encoding using range list to avoid endianess issues.
Evan Cheng [Wed, 17 Sep 2008 07:16:21 +0000 (07:16 +0000)]
Specify instruction encoding using range list to avoid endianess issues.

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

16 years agoAdd instruction names as comments to InstBits entries.
Evan Cheng [Wed, 17 Sep 2008 06:29:52 +0000 (06:29 +0000)]
Add instruction names as comments to InstBits entries.

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

16 years agoSimplify and generalize X86DAGToDAGISel::CanBeFoldedBy, and draw
Dan Gohman [Wed, 17 Sep 2008 01:39:10 +0000 (01:39 +0000)]
Simplify and generalize X86DAGToDAGISel::CanBeFoldedBy, and draw
up some new ascii art to illustrate what it does. This change
currently has no effect on generated code.

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

16 years agoAdd a new MachineInstr-level DCE pass. It is very simple, and is intended to
Dan Gohman [Wed, 17 Sep 2008 00:43:24 +0000 (00:43 +0000)]
Add a new MachineInstr-level DCE pass. It is very simple, and is intended to
be used with fast-isel.

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

16 years agoAdd trampoline support to PPC. GCC simply calls the "__trampoline_setup"
Bill Wendling [Wed, 17 Sep 2008 00:30:57 +0000 (00:30 +0000)]
Add trampoline support to PPC. GCC simply calls the "__trampoline_setup"
function with appropriate parameters. This allows us to support blocks on PPC.

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

16 years agoFix cut-n-pasto.
Devang Patel [Wed, 17 Sep 2008 00:01:04 +0000 (00:01 +0000)]
Fix cut-n-pasto.

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

16 years agoWhen converting a CopyFromReg to a copy instruction, use the register class of its...
Evan Cheng [Tue, 16 Sep 2008 23:12:11 +0000 (23:12 +0000)]
When converting a CopyFromReg to a copy instruction, use the register class of its uses to determine the right destination register class of the copy. This is important for targets where a physical register may belong to multiple register classes.

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

16 years agoRemove.
Devang Patel [Tue, 16 Sep 2008 22:26:44 +0000 (22:26 +0000)]
Remove.

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

16 years agoAdd -O1, -O2 and -O3 that matches llvm-gcc's -O1, -O2 and -O3 respectively.
Devang Patel [Tue, 16 Sep 2008 22:25:14 +0000 (22:25 +0000)]
Add -O1, -O2 and -O3 that matches llvm-gcc's -O1, -O2 and -O3 respectively.

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

16 years agoChange SelectionDAG::getConstantPool to always set the alignment of the
Dan Gohman [Tue, 16 Sep 2008 22:05:41 +0000 (22:05 +0000)]
Change SelectionDAG::getConstantPool to always set the alignment of the
ConstantPoolSDNode, using the target's preferred alignment for the
constant type.

In LegalizeDAG, when performing loads from the constant pool, the
ConstantPoolSDNode's alignment is used in the calls to getLoad and
getExtLoad.

This change prevents SelectionDAG::getLoad/getExtLoad from incorrectly
choosing the ABI alignment for constant pool loads when Alignment == 0.
The incorrect alignment is only a performance issue when ABI alignment
does not equal preferred alignment (i.e., on x86 it was generating
MOVUPS instead of MOVAPS for v4f32 constant loads when the default ABI
alignment for 128bit vectors is forced to 1 byte.)

Patch by Paul Redmond!

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

16 years agoReverting r56249. On further investigation, this functionality isn't needed.
Bill Wendling [Tue, 16 Sep 2008 21:48:12 +0000 (21:48 +0000)]
Reverting r56249. On further investigation, this functionality isn't needed.

Apologies for the thrashing.

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

16 years agoInclude the alignment value when displaying ConstantPoolSDNodes.
Dan Gohman [Tue, 16 Sep 2008 21:18:22 +0000 (21:18 +0000)]
Include the alignment value when displaying ConstantPoolSDNodes.

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

16 years ago- Change "ExternalSymbolSDNode" to "SymbolSDNode".
Bill Wendling [Tue, 16 Sep 2008 21:12:30 +0000 (21:12 +0000)]
- Change "ExternalSymbolSDNode" to "SymbolSDNode".
- Add linkage to SymbolSDNode (default to external).
- Change ISD::ExternalSymbol to ISD::Symbol.
- Change ISD::TargetExternalSymbol to ISD::TargetSymbol

These changes pave the way to allowing SymbolSDNodes with non-external linkage.

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

16 years agoFix these comments to reflect current reality. Surprisingly,
Dan Gohman [Tue, 16 Sep 2008 20:45:53 +0000 (20:45 +0000)]
Fix these comments to reflect current reality. Surprisingly,
MachineConstantPool::getConstantPoolIndex actually expects
a log2-encoded alignment.

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

16 years agoFinally re-apply r46959. This is made feasible by the combination
Dan Gohman [Tue, 16 Sep 2008 18:52:57 +0000 (18:52 +0000)]
Finally re-apply r46959. This is made feasible by the combination
of r56230, r56232, and r56246.

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

16 years agoImprove instcombine's handling of integer min and max in two ways:
Dan Gohman [Tue, 16 Sep 2008 18:46:06 +0000 (18:46 +0000)]
Improve instcombine's handling of integer min and max in two ways:
 - Recognize expressions like "x > -1 ? x : 0" as min/max and turn them
   into expressions like "x < 0 ? 0 : x", which is easily recognizable
   as a min/max operation.
 - Refrain from folding expression like "y/2 < 1" to "y < 2" when the
   comparison is being used as part of a min or max idiom, like
   "y/2 < 1 ? 1 : y/2". In that case, the division has another use, so
   folding doesn't eliminate it, and obfuscates the min/max, making it
   harder to recognize as a min/max operation.

These benefit ScalarEvolution, CodeGen, and anything else that wants to
recognize integer min and max.

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

16 years agoAllocateRWXMemory -> AllocateRWX.
Evan Cheng [Tue, 16 Sep 2008 17:28:18 +0000 (17:28 +0000)]
AllocateRWXMemory -> AllocateRWX.

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

16 years agoFCmpInst predicates UNO, ORD, FALSE, and TRUE are commutative.
Dan Gohman [Tue, 16 Sep 2008 16:44:00 +0000 (16:44 +0000)]
FCmpInst predicates UNO, ORD, FALSE, and TRUE are commutative.

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

16 years agoFix test to account for no more whitespace and that one of the matches is the
Bill Wendling [Tue, 16 Sep 2008 06:40:04 +0000 (06:40 +0000)]
Fix test to account for no more whitespace and that one of the matches is the
"declare" statement.

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

16 years agoRemove space that was forgotten.`
Bill Wendling [Tue, 16 Sep 2008 06:30:47 +0000 (06:30 +0000)]
Remove space that was forgotten.`

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

16 years agoDon't take the time to CheckDAGForTailCallsAndFixThem when tail calls
Dan Gohman [Tue, 16 Sep 2008 01:42:28 +0000 (01:42 +0000)]
Don't take the time to CheckDAGForTailCallsAndFixThem when tail calls
are not enabled. Instead just omit the tail call flag when calls are
created.

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

16 years agoFix spacing in the grep line for this test, following the recent
Dan Gohman [Tue, 16 Sep 2008 01:37:08 +0000 (01:37 +0000)]
Fix spacing in the grep line for this test, following the recent
SCEV-whitespace changes.

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

16 years agoRe-enables the new vector select in the bitcode reader, by modifying the
Dan Gohman [Tue, 16 Sep 2008 01:01:33 +0000 (01:01 +0000)]
Re-enables the new vector select in the bitcode reader, by modifying the
bitcode reader/writer as follows:

- add and use new bitcode FUNC_CODE_INST_VSELECT to handle the llvm
select opcode using either i1 or [N x i1] as the selector.
- retain old BITCODE FUNC_CODE_INST_SELECT in the bitcode reader to
handle select on i1 for backwards compatibility with existing bitcode
files.
- re-enable the vector-select.ll test program.

Also, rename the recently added bitcode opcode FUNC_CODE_INST_VCMP to
FUNC_CODE_INST_CMP2 and make the bitcode writer use it to handle
fcmp/icmp on scalars or vectors. In the bitcode writer, use
FUNC_CODE_INST_CMP for vfcmp/vicmp only. In the bitcode reader, have
FUNC_CODE_INST_CMP handle icmp/fcmp returning bool, for backwards
compatibility with existing bitcode files.

Patch by Preston Gurd!

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

16 years agoTeach ScalarEvolution to consider loop preheaders in the search for
Dan Gohman [Mon, 15 Sep 2008 22:18:04 +0000 (22:18 +0000)]
Teach ScalarEvolution to consider loop preheaders in the search for
an if statement that guards a loop, to allow indvars to avoid smax
operations in more situations.

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

16 years agoLive intervals for live-in registers should begin at the beginning of a basic block...
Owen Anderson [Mon, 15 Sep 2008 22:00:38 +0000 (22:00 +0000)]
Live intervals for live-in registers should begin at the beginning of a basic block, not at the first
instruction.  Also, their valno's should have an unknown def.  This has no effect currently, but was
causing issues when StrongPHIElimination was enabled.

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

16 years agoTeach LSR to optimize away SMAX operations for tripcounts in common
Dan Gohman [Mon, 15 Sep 2008 21:22:06 +0000 (21:22 +0000)]
Teach LSR to optimize away SMAX operations for tripcounts in common
cases.  See the comment above OptimizeSMax for the full story, and
the testcase for an example. This cancels out a pessimization
commonly attributed to indvars, and will allow us to lift some of
the artificial throttles in indvars, rather than add new ones.

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

16 years agoExtract optimization pass selection code from llvm-gcc into a separate routine.
Devang Patel [Mon, 15 Sep 2008 21:13:42 +0000 (21:13 +0000)]
Extract optimization pass selection code from llvm-gcc into a separate routine.
This can be used by other stand alone tools, such as 'opt'.

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

16 years agoFixed Bug 2751
Bruno Cardoso Lopes [Mon, 15 Sep 2008 21:06:55 +0000 (21:06 +0000)]
Fixed Bug 2751
http://llvm.org/bugs/show_bug.cgi?id=2751

Abicall was enabled even when static code model was provided
in the command line.
The correct behavior is to disable abicall when static is
specified.

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

16 years agoRe-enable SelectionDAG CSE for calls. It matters in the case of
Dan Gohman [Mon, 15 Sep 2008 19:46:03 +0000 (19:46 +0000)]
Re-enable SelectionDAG CSE for calls. It matters in the case of
libcalls, as in this testcase on ARM.

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

16 years agoAdded testcase for bswap allegrexel intrinsic
Bruno Cardoso Lopes [Mon, 15 Sep 2008 19:38:11 +0000 (19:38 +0000)]
Added testcase for bswap allegrexel intrinsic

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

16 years agoEnd of the GlobalsModRef experiment.
Duncan Sands [Mon, 15 Sep 2008 18:42:38 +0000 (18:42 +0000)]
End of the GlobalsModRef experiment.

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

16 years agoUpdate the LLVM polygen grammar for recent language changes:
Dan Gohman [Mon, 15 Sep 2008 16:10:51 +0000 (16:10 +0000)]
Update the LLVM polygen grammar for recent language changes:
x86_ssecallcc, function notes, and some whitespace adjustments.

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

16 years agoFix documentation for these functions; they do not only modify users within the
Nick Lewycky [Mon, 15 Sep 2008 06:31:52 +0000 (06:31 +0000)]
Fix documentation for these functions; they do not only modify users within the
block specified by the InstList. Patch by Stefanus Du Toit.

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

16 years agoCorrectly update kill infos after extending a live range and merge 2 val#'s; fix...
Evan Cheng [Mon, 15 Sep 2008 06:28:41 +0000 (06:28 +0000)]
Correctly update kill infos after extending a live range and merge 2 val#'s; fix 56165 - do not mark val# copy field if the copy does not define the val#.

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

16 years agoAdd "sample" documentation to sample project.
Nick Lewycky [Mon, 15 Sep 2008 05:31:29 +0000 (05:31 +0000)]
Add "sample" documentation to sample project.

This fixes part of PR2793.

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

16 years agoFix WriteAsOperand to not emit a leading space character. Adjust
Dan Gohman [Sun, 14 Sep 2008 17:21:12 +0000 (17:21 +0000)]
Fix WriteAsOperand to not emit a leading space character. Adjust
its callers to emit a space character before calling it when a
space is needed.

This fixes several spurious whitespace issues in
ScalarEvolution's debug dumps. See the test changes for
examples.

This also fixes odd space-after-tab indentation in the output
for switch statements, and changes calls from being printed like
this:
  call void @foo( i32 %x )
to this:
  call void @foo(i32 %x)

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

16 years agoadjust last patch per review feedback
Dale Johannesen [Sun, 14 Sep 2008 01:44:36 +0000 (01:44 +0000)]
adjust last patch per review feedback

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

16 years agominor correction
Gabor Greif [Sat, 13 Sep 2008 18:51:27 +0000 (18:51 +0000)]
minor correction

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

16 years agoRemove isImm(), isReg(), and friends, in favor of
Dan Gohman [Sat, 13 Sep 2008 17:58:21 +0000 (17:58 +0000)]
Remove isImm(), isReg(), and friends, in favor of
isImmediate(), isRegister(), and friends, to avoid confusion
about having two different names with the same meaning. I'm
not attached to the longer names, and would be ok with
changing to the shorter names if others prefer it.

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

16 years agoFix PR2792: treat volatile loads as writing memory somewhere.
Duncan Sands [Sat, 13 Sep 2008 12:45:50 +0000 (12:45 +0000)]
Fix PR2792: treat volatile loads as writing memory somewhere.
Treat stores as reading memory, just to play safe.

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

16 years agoFix random abort.
Evan Cheng [Sat, 13 Sep 2008 01:55:59 +0000 (01:55 +0000)]
Fix random abort.

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

16 years agoDefine CallSDNode, an SDNode subclass for use with ISD::CALL.
Dan Gohman [Sat, 13 Sep 2008 01:54:27 +0000 (01:54 +0000)]
Define CallSDNode, an SDNode subclass for use with ISD::CALL.
Currently it just holds the calling convention and flags
for isVarArgs and isTailCall.

And it has several utility methods, which eliminate magic
5+2*i and similar index computations in several places.

CallSDNodes are not CSE'd. Teach UpdateNodeOperands to handle
nodes that are not CSE'd gracefully.

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