oota-llvm.git
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

16 years agoTypo.
Evan Cheng [Sat, 13 Sep 2008 01:44:01 +0000 (01:44 +0000)]
Typo.

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

16 years agoRely on instruction format to determine so_reg operand for now.
Evan Cheng [Sat, 13 Sep 2008 01:38:29 +0000 (01:38 +0000)]
Rely on instruction format to determine so_reg operand for now.

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

16 years agoRevert 56176. All those instruction formats are still needed.
Evan Cheng [Sat, 13 Sep 2008 01:35:33 +0000 (01:35 +0000)]
Revert 56176. All those instruction formats are still needed.

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

16 years agoAccidentially flipped the condition.
Evan Cheng [Sat, 13 Sep 2008 01:29:57 +0000 (01:29 +0000)]
Accidentially flipped the condition.

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

16 years agoAdd debug dumps.
Evan Cheng [Sat, 13 Sep 2008 01:15:21 +0000 (01:15 +0000)]
Add debug dumps.

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

16 years agoEliminate unnecessary instruction formats.
Evan Cheng [Fri, 12 Sep 2008 23:15:39 +0000 (23:15 +0000)]
Eliminate unnecessary instruction formats.

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

16 years agoAddrmode 1 S bit can be dynamically set. Look for CPSR def.
Evan Cheng [Fri, 12 Sep 2008 22:45:55 +0000 (22:45 +0000)]
Addrmode 1 S bit can be dynamically set. Look for CPSR def.

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

16 years agoRewrite address mode 1 code emission routines.
Evan Cheng [Fri, 12 Sep 2008 22:01:15 +0000 (22:01 +0000)]
Rewrite address mode 1 code emission routines.

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

16 years agoThe "alias" keyword comes first.
Duncan Sands [Fri, 12 Sep 2008 20:48:21 +0000 (20:48 +0000)]
The "alias" keyword comes first.

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

16 years agoOn some targets, non-move instructions can become move instructions because of coales...
Evan Cheng [Fri, 12 Sep 2008 18:13:14 +0000 (18:13 +0000)]
On some targets, non-move instructions can become move instructions because of coalescing. e.g.
vr2 = OR vr0, vr1
=>
vr2 = OR vr1, vr1   // after coalescing vr0 with vr1

Update the value# of the destination register with the copy instruction if that happens.

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

16 years agoChange ConstantSDNode and ConstantFPSDNode to use ConstantInt* and
Dan Gohman [Fri, 12 Sep 2008 18:08:03 +0000 (18:08 +0000)]
Change ConstantSDNode and ConstantFPSDNode to use ConstantInt* and
ConstantFP* instead of APInt and APFloat directly.

This reduces the amount of time to create ConstantSDNode
and ConstantFPSDNode nodes when ConstantInt* and ConstantFP*
respectively are already available, as is the case in
SelectionDAGBuild.cpp. Also, it reduces the amount of time
to legalize constants into constant pools, and the amount of
time to add ConstantFP operands to MachineInstrs, due to
eliminating ConstantInt::get and ConstantFP::get calls.

It increases the amount of work needed to create new constants
in cases where the client doesn't already have a ConstantInt*
or ConstantFP*, such as legalize expanding 64-bit integer constants
to 32-bit constants. And it adds a layer of indirection for the
accessor methods. But these appear to be outweight by the benefits
in most cases.

It will also make it easier to make ConstantSDNode and
ConstantFPNode more consistent with ConstantInt and ConstantFP.

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

16 years agoPass "earlyclobber" bit through to machine
Dale Johannesen [Fri, 12 Sep 2008 17:49:03 +0000 (17:49 +0000)]
Pass "earlyclobber" bit through to machine
representation; coalescer and RA need to know
about it.  No functional change.

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

16 years agoRename ConstantSDNode::getValue to getZExtValue, for consistency
Dan Gohman [Fri, 12 Sep 2008 16:56:44 +0000 (16:56 +0000)]
Rename ConstantSDNode::getValue to getZExtValue, for consistency
with ConstantInt. This led to fixing a bug in TargetLowering.cpp
using getValue instead of getAPIntValue.

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

16 years agoGive GlobalsModRef a whirl in the nightly testers.
Duncan Sands [Fri, 12 Sep 2008 08:23:37 +0000 (08:23 +0000)]
Give GlobalsModRef a whirl in the nightly testers.
I placed it just before GVN because that it is the
pass most likely to benefit from it.  Some quick
and dirty testing confirms that this is a decent
place for it.

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

16 years agoRather than marking all internal globals "Ref"
Duncan Sands [Fri, 12 Sep 2008 07:29:58 +0000 (07:29 +0000)]
Rather than marking all internal globals "Ref"
when a readonly declaration is called, set a
flag.  This is faster and uses less memory.
In theory it is less accurate, because before
only those internal globals that were read
by someone were being marked "Ref", but now
all are.  But in practice, thanks to other
passes, all internal globals of the kind
considered here will be both read and stored
to: those only read will have been turned
into constants, and those only stored to will
have been deleted.

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

16 years agoThe sequence for ppcf128 compares was not IEEE
Dale Johannesen [Fri, 12 Sep 2008 00:30:56 +0000 (00:30 +0000)]
The sequence for ppcf128 compares was not IEEE
safe in the presence of NaNs.

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

16 years agoOn 64-bit targets, change 32-bit getelementptr indices to be 64-bit
Dan Gohman [Thu, 11 Sep 2008 23:06:38 +0000 (23:06 +0000)]
On 64-bit targets, change 32-bit getelementptr indices to be 64-bit
getelementptr indices, inserting an explicit cast if necessary.
This helps expose the sign-extension operation to other optimizations.

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

16 years agoFix a vectorshuffle instcombine bug introduced by r55995.
Dan Gohman [Thu, 11 Sep 2008 22:47:57 +0000 (22:47 +0000)]
Fix a vectorshuffle instcombine bug introduced by r55995.
Patch by Nicolas Capens!

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

16 years agoAdd indirect tail call (function pointer) examples.
Arnold Schwaighofer [Thu, 11 Sep 2008 22:24:28 +0000 (22:24 +0000)]
Add indirect tail call (function pointer) examples.

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

16 years agoudpate header comment: s/VP/VFP/
Jim Grosbach [Thu, 11 Sep 2008 21:41:29 +0000 (21:41 +0000)]
udpate header comment: s/VP/VFP/

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

16 years agoWhen tailcallopt is enabled all fastcc calls must have an aligned argument stack...
Arnold Schwaighofer [Thu, 11 Sep 2008 20:28:43 +0000 (20:28 +0000)]
When tailcallopt is enabled all fastcc calls must have an aligned argument stack size. Add a test case.

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

16 years agoFix PR2748. Avoid coalescing physical register with virtual register which would...
Evan Cheng [Thu, 11 Sep 2008 20:07:10 +0000 (20:07 +0000)]
Fix PR2748. Avoid coalescing physical register with virtual register which would create illegal extract_subreg. e.g.
vr1024 = extract_subreg vr1025, 1
...
vr1024 = mov8rr AH
If vr1024 is coalesced with AH, the extract_subreg is now illegal since AH does not have a super-reg whose sub-register 1 is AH.

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

16 years agoFix a bug in ANY_EXTEND handling that was breaking 403.gcc on X86-64 in fast isel.
Owen Anderson [Thu, 11 Sep 2008 19:44:55 +0000 (19:44 +0000)]
Fix a bug in ANY_EXTEND handling that was breaking 403.gcc on X86-64 in fast isel.

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

16 years agoFix comment typo.
Duncan Sands [Thu, 11 Sep 2008 19:41:10 +0000 (19:41 +0000)]
Fix comment typo.

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

16 years agoIntrinsics don't touch internal global variables
Duncan Sands [Thu, 11 Sep 2008 19:35:55 +0000 (19:35 +0000)]
Intrinsics don't touch internal global variables
(unless passed one via a parameter), even if they
are IntrWriteMem.

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

16 years agoFix a copy+paste bug that Duncan spotted. For several
Dan Gohman [Thu, 11 Sep 2008 18:53:02 +0000 (18:53 +0000)]
Fix a copy+paste bug that Duncan spotted. For several
cases it was still getting lucky and detecting overflow
but it was clearly incorrect.

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

16 years agoFix PR2783 - coalescer bug. Missing a TargetRegisterInfo::isVirtualRegister check.
Evan Cheng [Thu, 11 Sep 2008 18:40:32 +0000 (18:40 +0000)]
Fix PR2783 - coalescer bug. Missing a TargetRegisterInfo::isVirtualRegister check.

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

16 years agoEliminate some unused methods.
Evan Cheng [Thu, 11 Sep 2008 17:31:47 +0000 (17:31 +0000)]
Eliminate some unused methods.

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

16 years agoIndentation.
Evan Cheng [Thu, 11 Sep 2008 17:31:12 +0000 (17:31 +0000)]
Indentation.

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

16 years agolib/Target/SubtargetFeature.cpp asserts that the FeatureKV[] table be sorted
Jim Grosbach [Thu, 11 Sep 2008 17:05:32 +0000 (17:05 +0000)]
lib/Target/SubtargetFeature.cpp asserts that the FeatureKV[] table be sorted
by its first field, but TableGen doesn't actually enforce creating it that
way. TableGen sorts the records that will be used to create it by the names
of the records, not the Name field of those records.

This patch corrects the sort to use the "Name" field of the record as the
sort key.

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

16 years agoIntrinsics don't read these kinds of global
Duncan Sands [Thu, 11 Sep 2008 15:43:12 +0000 (15:43 +0000)]
Intrinsics don't read these kinds of global
variables.

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

16 years agoChange getSubReg semantics. It now returns zero if the specified register doesn't...
Evan Cheng [Thu, 11 Sep 2008 06:25:25 +0000 (06:25 +0000)]
Change getSubReg semantics. It now returns zero if the specified register doesn't have a subreg of the specified index.

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

16 years agoFix a 80 column violation.
Evan Cheng [Thu, 11 Sep 2008 05:58:06 +0000 (05:58 +0000)]
Fix a 80 column violation.

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

16 years agoThe version of AtomicSDNode::AtomicSDNode used (only) for
Dale Johannesen [Thu, 11 Sep 2008 03:12:59 +0000 (03:12 +0000)]
The version of AtomicSDNode::AtomicSDNode used (only) for
cmp-and-swap reversed the Cmp and Swap arguments; comments
make it clear this is unintentional.  Unfortunately, the
x86 BE had a compensating reversal, which is removed here.
PPC is OK.

From inspection of the Alpha code I think it is OK, but
if somebody has that platform please check it out.  I
cannot test on that platform.

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

16 years agoIf ISD::ANY_EXTEND fails, try ISD::ZERO_EXTEND and ISD::SIGN_EXTEND before giving...
Owen Anderson [Thu, 11 Sep 2008 02:41:37 +0000 (02:41 +0000)]
If ISD::ANY_EXTEND fails, try ISD::ZERO_EXTEND and ISD::SIGN_EXTEND before giving up.  This fixes 445.gobmk on
X86-64 in fast isel.

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