oota-llvm.git
16 years agoUpdate llvm.dbg.func.start.
Evan Cheng [Fri, 1 Feb 2008 09:12:11 +0000 (09:12 +0000)]
Update llvm.dbg.func.start.

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

16 years agoRemove the nasty LABEL hack with a much less evil one. Now llvm.dbg.func.start implie...
Evan Cheng [Fri, 1 Feb 2008 09:10:45 +0000 (09:10 +0000)]
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.

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

16 years agoRename RecordLabel to RecordSourceLine because that's what it is doing.
Evan Cheng [Fri, 1 Feb 2008 02:05:57 +0000 (02:05 +0000)]
Rename RecordLabel to RecordSourceLine because that's what it is doing.

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

16 years agoAdd convenient std::string helpers to StringMap. Patch by Mikhail Glushenkov!
Anton Korobeynikov [Thu, 31 Jan 2008 23:02:33 +0000 (23:02 +0000)]
Add convenient std::string helpers to StringMap. Patch by Mikhail Glushenkov!

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

16 years agoRevert 46556 and 46585. Dan please fix the PseudoSourceValue problem and re-commit.
Evan Cheng [Thu, 31 Jan 2008 21:00:00 +0000 (21:00 +0000)]
Revert 46556 and 46585. Dan please fix the PseudoSourceValue problem and re-commit.

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

16 years agoChris' change to print an approximation to long doubles
Dale Johannesen [Thu, 31 Jan 2008 18:34:01 +0000 (18:34 +0000)]
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.

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

16 years agoReapply the patch with fix.
Anton Korobeynikov [Thu, 31 Jan 2008 17:43:25 +0000 (17:43 +0000)]
Reapply the patch with fix.

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

16 years agorevert anton's recent stringmap patch, which breaks clang.
Chris Lattner [Thu, 31 Jan 2008 17:24:51 +0000 (17:24 +0000)]
revert anton's recent stringmap patch, which breaks clang.

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

16 years agoMake StringMap to be more STL'ish. Patch by Mikhail Glushenkov!
Anton Korobeynikov [Thu, 31 Jan 2008 12:30:40 +0000 (12:30 +0000)]
Make StringMap to be more STL'ish. Patch by Mikhail Glushenkov!

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

16 years agoWhitespace cleanup
Anton Korobeynikov [Thu, 31 Jan 2008 12:10:41 +0000 (12:10 +0000)]
Whitespace cleanup

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

16 years agoAdd a comment for a nasty short term hack.
Evan Cheng [Thu, 31 Jan 2008 10:05:13 +0000 (10:05 +0000)]
Add a comment for a nasty short term hack.

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

16 years agoAdd an extra operand to LABEL nodes which distinguishes between debug, EH, or misc...
Evan Cheng [Thu, 31 Jan 2008 09:59:15 +0000 (09:59 +0000)]
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.

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

16 years agoAllow ComplexExpressions in InstrInfo.td files to be slightly more... complex! Comple...
Christopher Lamb [Thu, 31 Jan 2008 07:27:46 +0000 (07:27 +0000)]
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.

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

16 years agoAdd more thorough error checking for NULL register classes.
Christopher Lamb [Thu, 31 Jan 2008 07:09:08 +0000 (07:09 +0000)]
Add more thorough error checking for NULL register classes.

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

16 years agoAdd x86 specific getFrameIndexOffset(). This fixes local variable debugging info.
Evan Cheng [Thu, 31 Jan 2008 04:06:00 +0000 (04:06 +0000)]
Add x86 specific getFrameIndexOffset(). This fixes local variable debugging info.

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

16 years agoMRegisterInfo::getLocation() is a really bad idea. Its function is to calculate the...
Evan Cheng [Thu, 31 Jan 2008 03:37:28 +0000 (03:37 +0000)]
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.

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

16 years agoMakes the same change in ppc backend: avoid inserting prologue before debug labels.
Evan Cheng [Thu, 31 Jan 2008 03:33:38 +0000 (03:33 +0000)]
Makes the same change in ppc backend: avoid inserting prologue before debug labels.

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

16 years agoAvoid unnecessarily casting away const, fixing a FIXME.
Dan Gohman [Thu, 31 Jan 2008 01:05:10 +0000 (01:05 +0000)]
Avoid unnecessarily casting away const, fixing a FIXME.

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

16 years agoAvoid unnecessarily casting away const.
Dan Gohman [Thu, 31 Jan 2008 01:01:48 +0000 (01:01 +0000)]
Avoid unnecessarily casting away const.

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

16 years agoFix a typo in a comment.
Dan Gohman [Thu, 31 Jan 2008 00:44:33 +0000 (00:44 +0000)]
Fix a typo in a comment.

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

16 years agoRename ISD::FLT_ROUNDS to ISD::FLT_ROUNDS_ to avoid conflicting
Dan Gohman [Thu, 31 Jan 2008 00:41:03 +0000 (00:41 +0000)]
Rename ISD::FLT_ROUNDS to ISD::FLT_ROUNDS_ to avoid conflicting
with the real FLT_ROUNDS (defined in <float.h>).

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

16 years agoAlso avoid adding callee save code before debug labels.
Evan Cheng [Thu, 31 Jan 2008 00:27:49 +0000 (00:27 +0000)]
Also avoid adding callee save code before debug labels.

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

16 years agoCreate a new class, MemOperand, for describing memory references
Dan Gohman [Thu, 31 Jan 2008 00:25:39 +0000 (00:25 +0000)]
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.

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

16 years agoFixed a bug in MergeValueInAsValue() pointed out by David Greene. Replace val# with...
Evan Cheng [Wed, 30 Jan 2008 22:44:55 +0000 (22:44 +0000)]
Fixed a bug in MergeValueInAsValue() pointed out by David Greene. Replace val# with previous liverange's.

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

16 years agoTreat the label for the first @llvm.dbg.stoppoint the same way as the dbg_func_start...
Evan Cheng [Wed, 30 Jan 2008 20:08:35 +0000 (20:08 +0000)]
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.

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

16 years agoAdjust loop per review feedback.
Dale Johannesen [Wed, 30 Jan 2008 19:44:39 +0000 (19:44 +0000)]
Adjust loop per review feedback.

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

16 years agoA semi-gross fix for a debug info issue. When inserting the "function start" label...
Evan Cheng [Wed, 30 Jan 2008 19:35:32 +0000 (19:35 +0000)]
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.

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

16 years agoSupply appropriate arch info to darwin assembler.
Devang Patel [Wed, 30 Jan 2008 19:19:31 +0000 (19:19 +0000)]
Supply appropriate arch info to darwin assembler.

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

16 years agoAccept getelementptr starting at GV with all 0 indices as a
Dale Johannesen [Wed, 30 Jan 2008 19:00:21 +0000 (19:00 +0000)]
Accept getelementptr starting at GV with all 0 indices as a
legitimate way of representing global variable GV in debug info.

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

16 years ago Always put version numbers at the end because they are optional.
Devang Patel [Wed, 30 Jan 2008 18:30:11 +0000 (18:30 +0000)]
 Always put version numbers at the end because they are optional.

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

16 years agoEven though InsertAtEndOfBasicBlock is an ugly hack it still deserves a proper name...
Evan Cheng [Wed, 30 Jan 2008 18:18:23 +0000 (18:18 +0000)]
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.

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

16 years agoEnable exception handling if it is supported.
Devang Patel [Wed, 30 Jan 2008 17:43:03 +0000 (17:43 +0000)]
Enable exception handling if it is supported.

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

16 years agoAdd a new PseudoSourceValue class, which will be used to help track
Dan Gohman [Wed, 30 Jan 2008 16:35:31 +0000 (16:35 +0000)]
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.

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

16 years agoRemove a couple more cases of "getNumUses() == 0". No need to walk the linked
Nick Lewycky [Wed, 30 Jan 2008 08:01:28 +0000 (08:01 +0000)]
Remove a couple more cases of "getNumUses() == 0". No need to walk the linked
list just to see if whether the list is empty.

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

16 years agoUse empty() instead of comparing size() with zero.
Nick Lewycky [Wed, 30 Jan 2008 07:54:16 +0000 (07:54 +0000)]
Use empty() instead of comparing size() with zero.

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

16 years agoDon't DCE FreeInst's. We were using those! Patch from Owen Anderson.
Nick Lewycky [Wed, 30 Jan 2008 07:45:37 +0000 (07:45 +0000)]
Don't DCE FreeInst's. We were using those! Patch from Owen Anderson.

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

16 years agoPointers change size depending upon the target. Remove them to make the test more...
Tanya Lattner [Wed, 30 Jan 2008 05:15:15 +0000 (05:15 +0000)]
Pointers change size depending upon the target. Remove them to make the test more stable.

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

16 years agoSkip over the label which marks the beginning of the function before inserting prolog...
Evan Cheng [Wed, 30 Jan 2008 03:57:33 +0000 (03:57 +0000)]
Skip over the label which marks the beginning of the function before inserting prologue code.

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

16 years agoBack out mods to llvmAsmParser, incorrectly committed
Scott Michel [Wed, 30 Jan 2008 03:10:00 +0000 (03:10 +0000)]
Back out mods to llvmAsmParser, incorrectly committed

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

16 years agoMore cleanups for CellSPU:
Scott Michel [Wed, 30 Jan 2008 02:55:46 +0000 (02:55 +0000)]
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.

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

16 years agoMake DSE much more aggressive by performing DCE earlier. Update a testcase to reflec...
Owen Anderson [Wed, 30 Jan 2008 01:24:47 +0000 (01:24 +0000)]
Make DSE much more aggressive by performing DCE earlier.  Update a testcase to reflect this increased aggressiveness.

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

16 years agoFix an issue where, under very specific circumstances, memdep could end up dereferenc...
Owen Anderson [Wed, 30 Jan 2008 01:24:05 +0000 (01:24 +0000)]
Fix an issue where, under very specific circumstances, memdep could end up dereferencing the end
of one of its internal maps.

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

16 years agoFix a bug where scalarrepl would discard offset if type would match.
Chris Lattner [Wed, 30 Jan 2008 00:39:15 +0000 (00:39 +0000)]
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.

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

16 years agoFactor the addressing mode and the load/store VT out of LoadSDNode
Dan Gohman [Wed, 30 Jan 2008 00:15:11 +0000 (00:15 +0000)]
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.

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

16 years agoWork in progress. This patch *fixes* x86-64 calls which are modelled as StructRet...
Evan Cheng [Tue, 29 Jan 2008 19:34:22 +0000 (19:34 +0000)]
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.

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

16 years agoUpdate this test case.
Evan Cheng [Tue, 29 Jan 2008 19:30:05 +0000 (19:30 +0000)]
Update this test case.

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

16 years agoWhen expanding an operand, it's not the result value
Duncan Sands [Tue, 29 Jan 2008 19:29:08 +0000 (19:29 +0000)]
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.

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

16 years agoDon't let globalopt hack on volatile loads or stores.
Chris Lattner [Tue, 29 Jan 2008 19:01:37 +0000 (19:01 +0000)]
Don't let globalopt hack on volatile loads or stores.

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

16 years agoAltered ctor for APSInt to accept an optional "isUnsigned" flag. Default
Ted Kremenek [Tue, 29 Jan 2008 18:55:14 +0000 (18:55 +0000)]
Altered ctor for APSInt to accept an optional "isUnsigned" flag.  Default
behavior is unchanged.

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

16 years agoUse empty() instead of comparing size() with zero.
Dan Gohman [Tue, 29 Jan 2008 13:02:09 +0000 (13:02 +0000)]
Use empty() instead of comparing size() with zero.

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

16 years agoFix a typo in a comment.
Dan Gohman [Tue, 29 Jan 2008 12:43:50 +0000 (12:43 +0000)]
Fix a typo in a comment.

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

16 years agoUpdate this file for 2.0 syntax.
Dan Gohman [Tue, 29 Jan 2008 12:35:50 +0000 (12:35 +0000)]
Update this file for 2.0 syntax.

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

16 years agoAdd comments describing what the loop depth values mean. Also, make a
Dan Gohman [Tue, 29 Jan 2008 12:12:40 +0000 (12:12 +0000)]
Add comments describing what the loop depth values mean. Also, make a
minor simplification to the loop depth calculation code.

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

16 years agoFix 80-col violations.
Dan Gohman [Tue, 29 Jan 2008 12:09:55 +0000 (12:09 +0000)]
Fix 80-col violations.

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

16 years agoRemove top-level const qualifiers from casts, avoiding associated
Dan Gohman [Tue, 29 Jan 2008 12:08:20 +0000 (12:08 +0000)]
Remove top-level const qualifiers from casts, avoiding associated
compiler warnings.

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

16 years agoFix a typo in a comment.
Dan Gohman [Tue, 29 Jan 2008 12:07:11 +0000 (12:07 +0000)]
Fix a typo in a comment.

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

16 years agoFix a typo in a comment.
Dan Gohman [Tue, 29 Jan 2008 12:06:33 +0000 (12:06 +0000)]
Fix a typo in a comment.

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

16 years agoAdd explicit keywords.
Dan Gohman [Tue, 29 Jan 2008 11:36:12 +0000 (11:36 +0000)]
Add explicit keywords.

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

16 years agollvm.sqrt(-0.0) is defined.
Chris Lattner [Tue, 29 Jan 2008 07:00:44 +0000 (07:00 +0000)]
llvm.sqrt(-0.0) is defined.

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

16 years agoeliminate additions of 0.0 when they are obviously dead. This has to be careful to
Chris Lattner [Tue, 29 Jan 2008 06:52:45 +0000 (06:52 +0000)]
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.

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

16 years agoAdd a testcase for eliminating memcpy's at the end of functions. Forgot to commit...
Owen Anderson [Tue, 29 Jan 2008 06:40:32 +0000 (06:40 +0000)]
Add a testcase for eliminating memcpy's at the end of functions.  Forgot to commit this with my last commit.

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

16 years agoAdd target triples to these so they don't fail on linux.
Chris Lattner [Tue, 29 Jan 2008 06:26:07 +0000 (06:26 +0000)]
Add target triples to these so they don't fail on linux.

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

16 years agoUse getPreferredAlignmentLog or getPreferredAlignment
Duncan Sands [Tue, 29 Jan 2008 06:23:44 +0000 (06:23 +0000)]
Use getPreferredAlignmentLog or getPreferredAlignment
to get the alignment of global variables, rather than
using hand-made versions.

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

16 years agoAdd support for eliminating memcpy's at the end of functions. Also fix some errors...
Owen Anderson [Tue, 29 Jan 2008 06:18:36 +0000 (06:18 +0000)]
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.

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

16 years agoThis would be better done as an executable test.
Duncan Sands [Tue, 29 Jan 2008 06:04:54 +0000 (06:04 +0000)]
This would be better done as an executable test.

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

16 years agoAfter recent changes we fail to optimize this test
Duncan Sands [Tue, 29 Jan 2008 05:57:23 +0000 (05:57 +0000)]
After recent changes we fail to optimize this test
sufficiently to have it pass.  I'm removing it from
the testsuite and adding it to PR452 instead.

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

16 years agoRegAllocBigBlock doesn't need LiveVariables either.
Owen Anderson [Tue, 29 Jan 2008 02:32:13 +0000 (02:32 +0000)]
RegAllocBigBlock doesn't need LiveVariables either.

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

16 years agoFix to bug 1951: tblgen gratuitously renames variables when no temporary was
Scott Michel [Tue, 29 Jan 2008 02:29:31 +0000 (02:29 +0000)]
Fix to bug 1951: tblgen gratuitously renames variables when no temporary was
generated. This feature would only show up in fairly complex patterns, such
as this one in CellSPU:

  def : Pat<(add (SPUhi tconstpool:$in, 0), (SPUlo tconstpool:$in, 0)),
    (IOHLlo (ILHUhi tconstpool:$in), tconstpool:$in)>;

which generated the following emit code:

SDNode *Emit_0(const SDOperand &N, unsigned Opc0, unsigned Opc1, MVT::ValueType VT0, MVT::ValueType VT1) DISABLE_INLINE {
  SDOperand N0 = N.getOperand(0);
  SDOperand N00 = N0.getOperand(0);
  SDOperand N01 = N0.getOperand(1);
  SDOperand N1 = N.getOperand(1);
  SDOperand N10 = N1.getOperand(0);
  SDOperand N11 = N1.getOperand(1);
  SDOperand Tmp3(CurDAG->getTargetNode(Opc0, VT0, N00), 0);
  return CurDAG->SelectNodeTo(N.Val, Opc1, VT1, Tmp3, Tmp2); /* Tmp2 s/b N00 */
}

Tested against the test suites without incident.

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

16 years agoProperly expand extract-element for non-power-of-2 codegen
Nate Begeman [Tue, 29 Jan 2008 02:24:00 +0000 (02:24 +0000)]
Properly expand extract-element for non-power-of-2 codegen

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

16 years agoHandle 'X' constraint in asm's better.
Dale Johannesen [Tue, 29 Jan 2008 02:21:21 +0000 (02:21 +0000)]
Handle 'X' constraint in asm's better.

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

16 years agoFilter loops that subtract induction variables.
Devang Patel [Tue, 29 Jan 2008 02:20:41 +0000 (02:20 +0000)]
Filter loops that subtract induction variables.
These loops are not yet handled.

Fix PR 1912.

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

16 years agoOverhaul Cell SPU's addressing mode internals so that there are now
Scott Michel [Tue, 29 Jan 2008 02:16:57 +0000 (02:16 +0000)]
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.

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

16 years agoNew test.
Devang Patel [Tue, 29 Jan 2008 01:10:04 +0000 (01:10 +0000)]
New test.

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

16 years agoAdd test to make sure that #pragma mark/error doesn't error if there are
Bill Wendling [Tue, 29 Jan 2008 00:41:29 +0000 (00:41 +0000)]
Add test to make sure that #pragma mark/error doesn't error if there are
unbalanced quotes.

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

16 years agoAdded destructor for template class FoldingSetNodeWrapper.
Ted Kremenek [Mon, 28 Jan 2008 22:05:23 +0000 (22:05 +0000)]
Added destructor for template class FoldingSetNodeWrapper.
Added getValue() to FoldingSetNodeWrapper.

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

16 years agoSimplify the code and fix a typo.
Lauro Ramos Venancio [Mon, 28 Jan 2008 20:02:51 +0000 (20:02 +0000)]
Simplify the code and fix a typo.

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

16 years agoPure/const functions with ByVal parameters cannot
Duncan Sands [Mon, 28 Jan 2008 19:25:47 +0000 (19:25 +0000)]
Pure/const functions with ByVal parameters cannot
be marked readonly either.

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

16 years agoFix fpcmp infinite loop when comparing "29-266" with "29-268".
Lauro Ramos Venancio [Mon, 28 Jan 2008 18:23:23 +0000 (18:23 +0000)]
Fix fpcmp infinite loop when comparing "29-266" with "29-268".

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

16 years agothis test is now compiled into the right thing.
Chris Lattner [Mon, 28 Jan 2008 17:38:46 +0000 (17:38 +0000)]
this test is now compiled into the right thing.

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

16 years agoUnbreak builds with differing object and source
Duncan Sands [Mon, 28 Jan 2008 17:38:30 +0000 (17:38 +0000)]
Unbreak builds with differing object and source
directories.  Patch by Sam Bishop.

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

16 years agoMake this more likely to be passed byval.
Duncan Sands [Mon, 28 Jan 2008 10:35:11 +0000 (10:35 +0000)]
Make this more likely to be passed byval.

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

16 years agoIf the function has no machine instructions, then emit a "nop" so that
Bill Wendling [Mon, 28 Jan 2008 09:15:03 +0000 (09:15 +0000)]
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.

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

16 years agoTransform calls to memcpy into llvm.memcpy calls, patch by Eli Friedman.
Chris Lattner [Mon, 28 Jan 2008 04:41:43 +0000 (04:41 +0000)]
Transform calls to memcpy into llvm.memcpy calls, patch by Eli Friedman.

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

16 years agoreduce duplicate -I flags passed to the compiler, cleaning up the VERBOSE
Chris Lattner [Mon, 28 Jan 2008 04:18:41 +0000 (04:18 +0000)]
reduce duplicate -I flags passed to the compiler, cleaning up the VERBOSE
output.  Patch contributed by Sam Bishop!

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

16 years agoHandle some more combinations of extend and icmp. Fixes PR1940.
Nick Lewycky [Mon, 28 Jan 2008 03:48:02 +0000 (03:48 +0000)]
Handle some more combinations of extend and icmp. Fixes PR1940.

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

16 years agoFix PR1932 by disabling an xform invalid for fdiv.
Chris Lattner [Mon, 28 Jan 2008 00:58:18 +0000 (00:58 +0000)]
Fix PR1932 by disabling an xform invalid for fdiv.

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

16 years agomake handling of overflow and undefined results much more clear.
Chris Lattner [Mon, 28 Jan 2008 00:36:27 +0000 (00:36 +0000)]
make handling of overflow and undefined results much more clear.
Patch by Eli Friedman, thanks!

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

16 years agoFix PR1938 by forcing the code that uses an undefined value to branch one
Chris Lattner [Mon, 28 Jan 2008 00:32:30 +0000 (00:32 +0000)]
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.

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

16 years agoAlways for PACKAGEVERSION to 'mainline' for teh llvm web page.
Chris Lattner [Sun, 27 Jan 2008 23:43:26 +0000 (23:43 +0000)]
Always for PACKAGEVERSION to 'mainline' for teh llvm web page.

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

16 years agoFix PowerPC/./2007-10-18-PtrArithmetic.ll
Chris Lattner [Sun, 27 Jan 2008 23:32:17 +0000 (23:32 +0000)]
Fix PowerPC/./2007-10-18-PtrArithmetic.ll

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

16 years agoUpdate this test. Due to dag combiner improvements, we now compile
Chris Lattner [Sun, 27 Jan 2008 23:26:37 +0000 (23:26 +0000)]
Update this test.  Due to dag combiner improvements, we now compile
f7/f11 to:

_f7:
eor r0, r0, #2, 2 @ -2147483648
bx lr
_f11:
bic r0, r0, #2, 2 @ -2147483648
bx lr

instead of:

_f7:
fmsr s0, r0
fnegs s0, s0
fmrs r0, s0
bx lr

_f11:
fmsr s0, r0
fabss s0, s0
fmrs r0, s0
bx lr

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

16 years agofix a crash on CodeGen/X86/vector-rem.ll
Chris Lattner [Sun, 27 Jan 2008 23:21:58 +0000 (23:21 +0000)]
fix a crash on CodeGen/X86/vector-rem.ll

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

16 years agoAdd support for frameworks. Patch by Shantonu Sen!
Chris Lattner [Sun, 27 Jan 2008 22:58:59 +0000 (22:58 +0000)]
Add support for frameworks.  Patch by Shantonu Sen!

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

16 years agoReg alloc doesn't really need LiveVariables.
Owen Anderson [Sun, 27 Jan 2008 22:00:00 +0000 (22:00 +0000)]
Reg alloc doesn't really need LiveVariables.

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

16 years agoFixes for BreakCriticalMachineCodeEdge by Fernando.
Owen Anderson [Sun, 27 Jan 2008 19:51:03 +0000 (19:51 +0000)]
Fixes for BreakCriticalMachineCodeEdge by Fernando.

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

16 years agoBe more careful modifying the use_list while also iterating through it.
Nick Lewycky [Sun, 27 Jan 2008 18:35:00 +0000 (18:35 +0000)]
Be more careful modifying the use_list while also iterating through it.

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

16 years agoRevert r46393: readonly/readnone functions are no
Duncan Sands [Sun, 27 Jan 2008 18:12:58 +0000 (18:12 +0000)]
Revert r46393: readonly/readnone functions are no
longer allowed to write through byval arguments.

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

16 years agoImplement some dag combines that allow doing fneg/fabs/fcopysign in integer
Chris Lattner [Sun, 27 Jan 2008 17:42:27 +0000 (17:42 +0000)]
Implement some dag combines that allow doing fneg/fabs/fcopysign in integer
registers if used by a bitconvert or using a bitconvert.  This allows us to
avoid constant pool loads and use cheaper integer instructions when the
values come from or end up in integer regs anyway.  For example, we now
compile CodeGen/X86/fp-in-intregs.ll to:

_test1:
movl $2147483648, %eax
xorl 4(%esp), %eax
ret
_test2:
movl $1065353216, %eax
orl 4(%esp), %eax
andl $3212836864, %eax
ret

Instead of:
_test1:
movss 4(%esp), %xmm0
xorps LCPI2_0, %xmm0
movd %xmm0, %eax
ret
_test2:
movss 4(%esp), %xmm0
andps LCPI3_0, %xmm0
movss LCPI3_1, %xmm1
andps LCPI3_2, %xmm1
orps %xmm0, %xmm1
movd %xmm1, %eax
ret

bitconverts can happen due to various calling conventions that require
fp values to passed in integer regs in some cases, e.g. when returning
a complex.

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

16 years agoadd a note
Chris Lattner [Sun, 27 Jan 2008 07:31:41 +0000 (07:31 +0000)]
add a note

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

16 years agoUse fldz and fld1 for long double constants instead of a constant pool load.
Chris Lattner [Sun, 27 Jan 2008 06:19:31 +0000 (06:19 +0000)]
Use fldz and fld1 for long double constants instead of a constant pool load.

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