Dale Johannesen
e8fa3130f8
Implement sseregparm.
...
llvm-svn: 46764
2008-02-05 20:46:33 +00:00
Evan Cheng
69d5e0fc0f
If a vr is already marked alive in a bb, then it has PHI uses that are visited earlier, then it is not killed in the def block (i.e. not dead).
...
llvm-svn: 46763
2008-02-05 20:04:18 +00:00
Nate Begeman
9f4245c16a
Ident mnemonics appropriately
...
llvm-svn: 46746
2008-02-05 08:49:09 +00:00
Chris Lattner
96deed5d4d
Fix a bug compiling PR1978 (perhaps not the only one though) which
...
was incorrectly simplifying "x == (gep x, 1, i)" into false, even
though i could be negative. As it turns out, all the code to
handle this already existed, we just need to disable the incorrect
optimization case and let the general case handle it.
llvm-svn: 46739
2008-02-05 04:45:32 +00:00
Owen Anderson
28d90a4a6a
Fix an obscure read-after-free bug that Duncan found.
...
llvm-svn: 46738
2008-02-05 04:34:03 +00:00
Evan Cheng
352062f5f7
Typo.
...
llvm-svn: 46725
2008-02-04 23:10:38 +00:00
Evan Cheng
1c67dcaae7
Dwarf requires variable entries to be in the source order. Right now, since we are recording variable information at isel time this means parameters would appear in the reverse order. The short term fix is to issue recordVariable() at asm printing time instead.
...
llvm-svn: 46724
2008-02-04 23:06:48 +00:00
Nate Begeman
2b00217d58
This method should be virtual
...
llvm-svn: 46723
2008-02-04 23:04:24 +00:00
Nate Begeman
8285430ed7
Eliminate some redundant code.
...
llvm-svn: 46720
2008-02-04 21:44:06 +00:00
Ted Kremenek
6dab41ed32
Added "bucket_iterators" to FoldingSet. Bucket iterators allow iteration
...
over all the nodes in a particular bucket.
llvm-svn: 46716
2008-02-04 21:11:17 +00:00
Devang Patel
ab8c21f3a1
Set error message.
...
Patch by Shantonu Sen.
llvm-svn: 46715
2008-02-04 20:57:54 +00:00
Ted Kremenek
c84b3400b2
Fixed 80 col. violation.
...
llvm-svn: 46709
2008-02-04 17:14:20 +00:00
Duncan Sands
2ba7682d9e
I don't see how NodeUpdated can be called with a
...
ReadyToProcess node - add an assertion to check
this. Add an assertion to NodeDeleted that checks
that processed/ready nodes are indeed not deleted.
It is because they are never deleted that none of
the maps can have a deleted node as the source of
a mapping. It does however seem to be possible in
theory to have a deleted value as the target of a
mapping, however this has not yet been spotted in
the wild. Still mulling on what to do about this.
[The theoretical situation is this: a node A is
expanded/promoted/whatever to a newly created node
B. Thus A->B is added to a map. When the subtree
rooted at B is legalized it is conceivable that B
is deleted due to RAUW on a node somewhere above
it].
llvm-svn: 46705
2008-02-04 09:29:17 +00:00
Nate Begeman
16830a34c4
The rest of the SSE4.1 intrinsic patterns that are obvious to me. Getting
...
Evan's help with the rest.
llvm-svn: 46697
2008-02-04 06:00:24 +00:00
Nate Begeman
ee7503810f
Some more SSE 4.1 intrinsic patterns.
...
llvm-svn: 46696
2008-02-04 05:34:34 +00:00
Owen Anderson
af0449f9e0
Be more precise when eliminating pointers bue to memcpy's. This allows more
...
stores to be deleted in some cases.
llvm-svn: 46694
2008-02-04 04:53:00 +00:00
Owen Anderson
aaba6f96da
Allow GVN to hack on memcpy's, making them open to further optimization.
...
llvm-svn: 46693
2008-02-04 02:59:58 +00:00
Nick Lewycky
febd3642ce
There are some cases where icmp(add) can be folded into a new icmp. Handle them.
...
llvm-svn: 46687
2008-02-03 16:33:09 +00:00
Nick Lewycky
29cd604126
Hack on vectors too.
...
llvm-svn: 46684
2008-02-03 08:19:11 +00:00
Nick Lewycky
ce4c4698d7
Fold away one multiply in instcombine. This would normally be caught in
...
reassociate anyways, but they could be generated during instcombine's run.
llvm-svn: 46683
2008-02-03 07:42:09 +00:00
Chris Lattner
391e0937e7
Fix typo
...
llvm-svn: 46682
2008-02-03 07:30:27 +00:00
Nate Begeman
ead8dfeef2
SSE 4.1 Intrinsics and detection
...
llvm-svn: 46681
2008-02-03 07:18:54 +00:00
Chris Lattner
57478e6318
handle the case where a node can become ready to process
...
multiple times due to a RAUW.
llvm-svn: 46680
2008-02-03 07:13:32 +00:00
Chris Lattner
6c9f8f2d91
Use the new infrastructure for listening to node updates to
...
keep the LegalizeTypes node flags up to date when doing a RAUW.
This fixes a nasty bug that Duncan ran into and makes the
previous (nonbuggy case) more efficent.
llvm-svn: 46679
2008-02-03 07:08:51 +00:00
Chris Lattner
ce1bde2760
the world doesn't need my debugging code.
...
llvm-svn: 46678
2008-02-03 07:01:05 +00:00
Chris Lattner
6ea106139d
Change the 'global modification' APIs in SelectionDAG to take a new
...
DAGUpdateListener object pointer instead of just returning a vector
of deleted nodes. This makes the interfaces more efficient (no more
allocating a vector [at least a malloc], filling it in, then walking
it) and more clean. This also allows the client to be notified of
nodes that are *changed* but not deleted.
llvm-svn: 46677
2008-02-03 06:49:24 +00:00
Chris Lattner
e926ece00b
explicitly include Compiler.h instead of getting it from tblgen in the middle of a class.
...
llvm-svn: 46676
2008-02-03 05:43:57 +00:00
Chris Lattner
096fa73683
Generalize the SDOperand->SDOperand form of
...
SelectionDAG::ReplaceAllUsesWith to handle replacement of
an SDOperand with *any* sdoperand, not just one for a node with
a single result. Note that this has a horrible FIXME'd hack in it
to work around PR1975. This should be removed when PR1975 is fixed.
llvm-svn: 46674
2008-02-03 03:35:22 +00:00
Chris Lattner
df36b95e00
don't do ReplaceUses on a result that doesn't exist.
...
llvm-svn: 46673
2008-02-03 03:20:59 +00:00
Chris Lattner
b936d07617
add a -view-legalize-types-dags option, for viewing the dags going into legalize types.
...
llvm-svn: 46672
2008-02-03 02:05:04 +00:00
Evan Cheng
f61d1115af
Get rid of the annoying blank lines before labels.
...
llvm-svn: 46667
2008-02-02 08:39:46 +00:00
Nick Lewycky
78e2e2cd07
Don't use uninitialized values. Fixes vec_align.ll on X86 Linux.
...
llvm-svn: 46666
2008-02-02 08:29:58 +00:00
Evan Cheng
dd8d07749a
Unbreak ppc debug support.
...
llvm-svn: 46665
2008-02-02 05:06:29 +00:00
Evan Cheng
c57ec111f2
SDIsel processes llvm.dbg.declare by recording the variable debug information descriptor and its corresponding stack frame index in MachineModuleInfo. This only works if the local variable is "homed" in the stack frame. It does not work for byval parameter, etc.
...
Added ISD::DECLARE node type to represent llvm.dbg.declare intrinsic. Now the intrinsic calls are lowered into a SDNode and lives on through out the codegen passes.
For now, since all the debugging information recording is done at isel time, when a ISD::DECLARE node is selected, it has the side effect of also recording the variable. This is a short term solution that should be fixed in time.
llvm-svn: 46659
2008-02-02 04:07:54 +00:00
Devang Patel
cad20dbdb0
Add comment explaining what is lower level analysis pass.
...
llvm-svn: 46658
2008-02-02 01:43:30 +00:00
Gordon Henriksen
b75d9e974d
Fixing a bug creating floating point constants of type other
...
than double through the C bindings. Thanks to Tomas Lindquist
Olsen for reporting it.
llvm-svn: 46656
2008-02-02 01:07:50 +00:00
Evan Cheng
9ff6b89bd9
Frame index can be negative.
...
llvm-svn: 46655
2008-02-02 00:17:00 +00:00
Lauro Ramos Venancio
563e0a3ea3
CBackend: Implement unaligned load/store.
...
llvm-svn: 46646
2008-02-01 21:25:59 +00:00
Duncan Sands
454a8eaee9
Don't drop function/call return attributes like 'nounwind'.
...
llvm-svn: 46645
2008-02-01 20:37:16 +00:00
Evan Cheng
d6222fc11d
Remove the nasty LABEL hack with a much less evil one. Now llvm.dbg.func.start implies a stoppoint is set. SelectionDAGISel records a new source line but does not create a ISD::LABEL node for this special stoppoint. Asm printer will magically print this label. This ensures nothing is emitted before.
...
llvm-svn: 46635
2008-02-01 09:10:45 +00:00
Evan Cheng
abe3a9ad27
Rename RecordLabel to RecordSourceLine because that's what it is doing.
...
llvm-svn: 46628
2008-02-01 02:05:57 +00:00
Evan Cheng
2a533e6894
Revert 46556 and 46585. Dan please fix the PseudoSourceValue problem and re-commit.
...
llvm-svn: 46623
2008-01-31 21:00:00 +00:00
Dale Johannesen
c19b8c41c6
Chris' change to print an approximation to long doubles
...
exposed a bug in APFloat's long double->double conversion of
NaNs. Broke several things in the ieee part of gcc testsuite.
llvm-svn: 46617
2008-01-31 18:34:01 +00:00
Evan Cheng
569eb20aac
Add a comment for a nasty short term hack.
...
llvm-svn: 46610
2008-01-31 10:05:13 +00:00
Evan Cheng
705212577d
Add an extra operand to LABEL nodes which distinguishes between debug, EH, or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution.
...
llvm-svn: 46609
2008-01-31 09:59:15 +00:00
Christopher Lamb
1a102eecb0
Allow ComplexExpressions in InstrInfo.td files to be slightly more... complex! ComplexExpressions can now have attributes which affect how TableGen interprets
...
the pattern when generating matchin code.
The first (and currently, only) attribute causes the immediate parent node of the ComplexPattern operand to be passed into the matching code rather than the node at the root of the entire DAG containing the pattern.
llvm-svn: 46606
2008-01-31 07:27:46 +00:00
Christopher Lamb
c924dea069
Add more thorough error checking for NULL register classes.
...
llvm-svn: 46605
2008-01-31 07:09:08 +00:00
Evan Cheng
d1bed85965
Add x86 specific getFrameIndexOffset(). This fixes local variable debugging info.
...
llvm-svn: 46598
2008-01-31 04:06:00 +00:00
Evan Cheng
a63f6736f3
MRegisterInfo::getLocation() is a really bad idea. Its function is to calculate the offset from frame pointer to a stack slot and then storing the delta in a MachineLocation object. The name is bad (it implies a getter), and MRegisterInfo doesn't need to know about MachineLocation.
...
Replace getLocation() with getFrameIndexOffset() which returns the delta from frame pointer to stack slot. Dwarf writer can then use the information for whatever it wants.
llvm-svn: 46597
2008-01-31 03:37:28 +00:00
Evan Cheng
f9d2cf4cae
Makes the same change in ppc backend: avoid inserting prologue before debug labels.
...
llvm-svn: 46596
2008-01-31 03:33:38 +00:00
Dan Gohman
562ed58408
Avoid unnecessarily casting away const, fixing a FIXME.
...
llvm-svn: 46591
2008-01-31 01:05:10 +00:00
Dan Gohman
018ea14d87
Avoid unnecessarily casting away const.
...
llvm-svn: 46590
2008-01-31 01:01:48 +00:00
Dan Gohman
3993809a0c
Rename ISD::FLT_ROUNDS to ISD::FLT_ROUNDS_ to avoid conflicting
...
with the real FLT_ROUNDS (defined in <float.h>).
llvm-svn: 46587
2008-01-31 00:41:03 +00:00
Evan Cheng
3d7eda3f35
Also avoid adding callee save code before debug labels.
...
llvm-svn: 46586
2008-01-31 00:27:49 +00:00
Dan Gohman
4326d513ab
Create a new class, MemOperand, for describing memory references
...
in the backend. Introduce a new SDNode type, MemOperandSDNode, for
holding a MemOperand in the SelectionDAG IR, and add a MemOperand
list to MachineInstr, and code to manage them. Remove the offset
field from SrcValueSDNode; uses of SrcValueSDNode that were using
it are all all using MemOperandSDNode now.
Also, begin updating some getLoad and getStore calls to use the
PseudoSourceValue objects.
Most of this was written by Florian Brander, some
reorganization and updating to TOT by me.
llvm-svn: 46585
2008-01-31 00:25:39 +00:00
Evan Cheng
66a9ea3aa8
Fixed a bug in MergeValueInAsValue() pointed out by David Greene. Replace val# with previous liverange's.
...
llvm-svn: 46579
2008-01-30 22:44:55 +00:00
Evan Cheng
b2b94f7a81
Treat the label for the first @llvm.dbg.stoppoint the same way as the dbg_func_start label. Make sure nothing else is inserted before them.
...
Note this solution might be somewhat fragile since ISD::LABEL may be used for other
purposes. If that ends up to be an issue, we may need to introduce a different node
for debug labels.
llvm-svn: 46571
2008-01-30 20:08:35 +00:00
Dale Johannesen
dce1b3cb2f
Adjust loop per review feedback.
...
llvm-svn: 46569
2008-01-30 19:44:39 +00:00
Evan Cheng
07f3cd3242
A semi-gross fix for a debug info issue. When inserting the "function start" label (i.e. first label in the entry block) take care to insert it at the beginning of the block.
...
llvm-svn: 46568
2008-01-30 19:35:32 +00:00
Dale Johannesen
916037c01a
Accept getelementptr starting at GV with all 0 indices as a
...
legitimate way of representing global variable GV in debug info.
llvm-svn: 46565
2008-01-30 19:00:21 +00:00
Evan Cheng
918b9c9335
Even though InsertAtEndOfBasicBlock is an ugly hack it still deserves a proper name. Rename it to EmitInstrWithCustomInserter since it does not necessarily insert
...
instruction at the end.
llvm-svn: 46562
2008-01-30 18:18:23 +00:00
Dan Gohman
dd9be7d05e
Add a new PseudoSourceValue class, which will be used to help track
...
memory reference information in the backend. Most of this was written by
Florian Brander, cleanup and updating to TOT by me.
llvm-svn: 46556
2008-01-30 16:35:31 +00:00
Nick Lewycky
ccd60a90c5
Remove a couple more cases of "getNumUses() == 0". No need to walk the linked
...
list just to see if whether the list is empty.
llvm-svn: 46555
2008-01-30 08:01:28 +00:00
Nick Lewycky
e3818dcc4e
Use empty() instead of comparing size() with zero.
...
llvm-svn: 46554
2008-01-30 07:54:16 +00:00
Nick Lewycky
719599d263
Don't DCE FreeInst's. We were using those! Patch from Owen Anderson.
...
llvm-svn: 46553
2008-01-30 07:45:37 +00:00
Evan Cheng
84adda6b67
Skip over the label which marks the beginning of the function before inserting prologue code.
...
llvm-svn: 46546
2008-01-30 03:57:33 +00:00
Scott Michel
4a4f50da13
Back out mods to llvmAsmParser, incorrectly committed
...
llvm-svn: 46545
2008-01-30 03:10:00 +00:00
Scott Michel
ab3702fba9
More cleanups for CellSPU:
...
- Expand tabs... (poss 80-col violations, will get them later...)
- Consolidate logic for SelectDFormAddr and SelectDForm2Addr into a single
function, simplifying maintenance. Also reduced custom instruction
generation for SPUvecinsert/INSERT_MASK.
llvm-svn: 46544
2008-01-30 02:55:46 +00:00
Owen Anderson
ad9a347656
Make DSE much more aggressive by performing DCE earlier. Update a testcase to reflect this increased aggressiveness.
...
llvm-svn: 46542
2008-01-30 01:24:47 +00:00
Owen Anderson
7d21431939
Fix an issue where, under very specific circumstances, memdep could end up dereferencing the end
...
of one of its internal maps.
llvm-svn: 46541
2008-01-30 01:24:05 +00:00
Chris Lattner
83227e350d
Fix a bug where scalarrepl would discard offset if type would match.
...
In practice this can only happen on code with already undefined behavior,
but this is still a good thing to handle correctly.
llvm-svn: 46539
2008-01-30 00:39:15 +00:00
Dan Gohman
13d1327796
Factor the addressing mode and the load/store VT out of LoadSDNode
...
and StoreSDNode into their common base class LSBaseSDNode. Member
functions getLoadedVT and getStoredVT are replaced with the common
getMemoryVT to simplify code that will handle both loads and stores.
llvm-svn: 46538
2008-01-30 00:15:11 +00:00
Evan Cheng
618761903d
Work in progress. This patch *fixes* x86-64 calls which are modelled as StructRet but really should be return in registers, e.g. _Complex long double, some 128-bit aggregates. This is a short term solution that is necessary only because llvm, for now, cannot model i128 nor call's with multiple results.
...
Status: This only works for direct calls, and only the caller side is done. Disabled for now.
llvm-svn: 46527
2008-01-29 19:34:22 +00:00
Duncan Sands
f451b75224
When expanding an operand, it's not the result value
...
type that matters but the operand type. This fixes
2008-01-08-IllegalCMP.ll which crashed with the new
legalize infrastructure because SETCC with result
type i8 and operand type i64 was being custom expanded
by the X86 backend. With this fix, the gcc build gets
as far as the first libcall.
llvm-svn: 46525
2008-01-29 19:29:08 +00:00
Chris Lattner
e08ec140e0
Don't let globalopt hack on volatile loads or stores.
...
llvm-svn: 46523
2008-01-29 19:01:37 +00:00
Dan Gohman
aad233ea10
Use empty() instead of comparing size() with zero.
...
llvm-svn: 46514
2008-01-29 13:02:09 +00:00
Dan Gohman
630f3a713c
Fix a typo in a comment.
...
llvm-svn: 46513
2008-01-29 12:43:50 +00:00
Dan Gohman
241714222a
Fix 80-col violations.
...
llvm-svn: 46510
2008-01-29 12:09:55 +00:00
Dan Gohman
daa38f69cf
Remove top-level const qualifiers from casts, avoiding associated
...
compiler warnings.
llvm-svn: 46509
2008-01-29 12:08:20 +00:00
Dan Gohman
4463225e99
Fix a typo in a comment.
...
llvm-svn: 46508
2008-01-29 12:07:11 +00:00
Dan Gohman
522401f26e
Add explicit keywords.
...
llvm-svn: 46506
2008-01-29 11:36:12 +00:00
Chris Lattner
83f411c586
eliminate additions of 0.0 when they are obviously dead. This has to be careful to
...
avoid turning -0.0 + 0.0 -> -0.0 which is incorrect.
llvm-svn: 46499
2008-01-29 06:52:45 +00:00
Duncan Sands
390baa691d
Use getPreferredAlignmentLog or getPreferredAlignment
...
to get the alignment of global variables, rather than
using hand-made versions.
llvm-svn: 46495
2008-01-29 06:23:44 +00:00
Owen Anderson
96b9e5423a
Add support for eliminating memcpy's at the end of functions. Also fix some errors I noticed in
...
the handling of eliminating stores to byval arguments.
llvm-svn: 46494
2008-01-29 06:18:36 +00:00
Owen Anderson
fc41146d15
RegAllocBigBlock doesn't need LiveVariables either.
...
llvm-svn: 46488
2008-01-29 02:32:13 +00:00
Nate Begeman
3eeac138f9
Properly expand extract-element for non-power-of-2 codegen
...
llvm-svn: 46486
2008-01-29 02:24:00 +00:00
Dale Johannesen
f12104ce4b
Handle 'X' constraint in asm's better.
...
llvm-svn: 46485
2008-01-29 02:21:21 +00:00
Devang Patel
86ff705c22
Filter loops that subtract induction variables.
...
These loops are not yet handled.
Fix PR 1912.
llvm-svn: 46484
2008-01-29 02:20:41 +00:00
Scott Michel
dc780aeb57
Overhaul Cell SPU's addressing mode internals so that there are now
...
only two addressing mode nodes, SPUaform and SPUindirect (vice the
three previous ones, SPUaform, SPUdform and SPUxform). This improves
code somewhat because we now avoid using reg+reg addressing when
it can be avoided. It also simplifies the address selection logic,
which was the main point for doing this.
Also, for various global variables that would be loaded using SPU's
A-form addressing, prefer D-form offs[reg] addressing, keeping the
base in a register if the variable is used more than once.
llvm-svn: 46483
2008-01-29 02:16:57 +00:00
Lauro Ramos Venancio
ad2a3eb416
Simplify the code and fix a typo.
...
llvm-svn: 46458
2008-01-28 20:02:51 +00:00
Lauro Ramos Venancio
947e17ae75
Fix fpcmp infinite loop when comparing "29-266" with "29-268".
...
llvm-svn: 46455
2008-01-28 18:23:23 +00:00
Bill Wendling
5b6f587a80
If the function has no machine instructions, then emit a "nop" so that
...
the function label isn't associated with something it shouldn't be.
llvm-svn: 46449
2008-01-28 09:15:03 +00:00
Chris Lattner
dc0c4352bd
Transform calls to memcpy into llvm.memcpy calls, patch by Eli Friedman.
...
llvm-svn: 46433
2008-01-28 04:41:43 +00:00
Nick Lewycky
6b070b1b93
Handle some more combinations of extend and icmp. Fixes PR1940.
...
llvm-svn: 46431
2008-01-28 03:48:02 +00:00
Chris Lattner
359756ea4b
Fix PR1932 by disabling an xform invalid for fdiv.
...
llvm-svn: 46429
2008-01-28 00:58:18 +00:00
Chris Lattner
7250586ec9
Fix PR1938 by forcing the code that uses an undefined value to branch one
...
way or the other. Rewriting the code itself prevents subsequent analysis
passes from making contradictory conclusions about the code that could
cause an infeasible path to be made feasible.
llvm-svn: 46427
2008-01-28 00:32:30 +00:00
Chris Lattner
26ec133a4d
Fix PowerPC/./2007-10-18-PtrArithmetic.ll
...
llvm-svn: 46424
2008-01-27 23:32:17 +00:00
Chris Lattner
3d4fa8f00f
fix a crash on CodeGen/X86/vector-rem.ll
...
llvm-svn: 46422
2008-01-27 23:21:58 +00:00
Owen Anderson
1078560f26
Reg alloc doesn't really need LiveVariables.
...
llvm-svn: 46420
2008-01-27 22:00:00 +00:00
Nick Lewycky
cd28ef8950
Be more careful modifying the use_list while also iterating through it.
...
llvm-svn: 46417
2008-01-27 18:35:00 +00:00