Commit Graph

12298 Commits

Author SHA1 Message Date
Chris Lattner
b162290e39 introduce WinCOFFObjectWriter, patch by Michael Spencer!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 22:07:02 +00:00
Chris Lattner
eb72dcaef7 introduce WinCOFFStreamer.cpp, patch by Michael Spencer!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 22:05:00 +00:00
Jakob Stoklund Olesen
744b3a5acd Remove TargetInstrInfo::copyRegToReg entirely.
Targets must now implement TargetInstrInfo::copyPhysReg instead. There is no
longer a default implementation forwarding to copyRegToReg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108095 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 17:01:17 +00:00
Rafael Espindola
d6d7abaf4e Make getPhysicalRegisterRegClass non-virtual. Should be able to remove it soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 16:49:10 +00:00
Jakob Stoklund Olesen
b0a258be2f Remove copyRegToReg from TargetInstrInfo so it is not longer accesible.
Use a COPY instruction instead for register copies, or TII::copyPhysReg() after
COPY instructions are lowered.

Targets should implement copyPhysReg instead of copyRegToReg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108075 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 05:17:06 +00:00
Rafael Espindola
cbeeae23c3 Fix va_arg for doubles. With this patch VAARG nodes always contain the
correct alignment information, which simplifies ExpandRes_VAARG a bit.

The patch introduces a new alignment information to TargetLoweringInfo. This is
needed since the two natural candidates cannot be used:

* The 's' in target data: If this is set to the minimal alignment of any
  argument, getCallFrameTypeAlignment would return 4 for doubles on ARM for
  example.
* The getTransientStackAlignment method. It is possible for an architecture to
  have argument less aligned than what we maintain the stack pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 04:01:49 +00:00
Dan Gohman
84023e0fbe Reapply bottom-up fast-isel, with several fixes for x86-32:
- Check getBytesToPopOnReturn().
 - Eschew ST0 and ST1 for return values.
 - Fix the PIC base register initialization so that it doesn't ever
   fail to end up the top of the entry block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108039 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-10 09:00:22 +00:00
Jakob Stoklund Olesen
1f32340d95 Automatically fold COPY instructions into stack load/store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108012 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 20:43:13 +00:00
Jakob Stoklund Olesen
e05442d508 Change TII::foldMemoryOperand API to require the machine instruction to be
inserted in a MBB, and return an already inserted MI.

This target API change is necessary to allow foldMemoryOperand to call
storeToStackSlot and loadFromStackSlot when folding a COPY to a stack slot
reference in a target independent way.

The foldMemoryOperandImpl hook is going to change in the same way, but I'll wait
until COPY folding is actually implemented. Most targets only fold copies and
won't need to specialize this hook at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107991 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 17:29:08 +00:00
Bob Wilson
02266e29f9 --- Reverse-merging r107947 into '.':
U    utils/TableGen/FastISelEmitter.cpp
--- Reverse-merging r107943 into '.':
U    test/CodeGen/X86/fast-isel.ll
U    test/CodeGen/X86/fast-isel-loads.ll
U    include/llvm/Target/TargetLowering.h
U    include/llvm/Support/PassNameParser.h
U    include/llvm/CodeGen/FunctionLoweringInfo.h
U    include/llvm/CodeGen/CallingConvLower.h
U    include/llvm/CodeGen/FastISel.h
U    include/llvm/CodeGen/SelectionDAGISel.h
U    lib/CodeGen/LLVMTargetMachine.cpp
U    lib/CodeGen/CallingConvLower.cpp
U    lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
U    lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
U    lib/CodeGen/SelectionDAG/FastISel.cpp
U    lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
U    lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
U    lib/CodeGen/SelectionDAG/InstrEmitter.cpp
U    lib/CodeGen/SelectionDAG/TargetLowering.cpp
U    lib/Target/XCore/XCoreISelLowering.cpp
U    lib/Target/XCore/XCoreISelLowering.h
U    lib/Target/X86/X86ISelLowering.cpp
U    lib/Target/X86/X86FastISel.cpp
U    lib/Target/X86/X86ISelLowering.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107987 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 16:37:18 +00:00
Gabor Greif
7c71b81a4f fix clang selfhost issue (shadowing)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107970 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 14:46:49 +00:00
Gabor Greif
e07c3c46d0 refactor type expressions and cache operator*'s result
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107964 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 14:00:56 +00:00
Gabor Greif
8fe5ccc585 two more cases of reuse result of operator*, found by inspection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107961 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 10:42:13 +00:00
Gabor Greif
4fd6b39703 another case of reuse result of operator*, it is expensive to recompute
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107960 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 10:32:31 +00:00
Gabor Greif
f6c166078f reuse result of operator*, it is expensive to recompute
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107959 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 09:50:51 +00:00
Lang Hames
dfbc29a5a2 Added a support for inserting new MBBs into the numbering.
Unlike insertMachineInstrInMaps this does not guarantee live intervals will
remain correct. The caller will need to manually update intervals to account
for the changes made to the CFG.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107958 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 09:19:23 +00:00
Dan Gohman
bf87e24917 Re-apply bottom-up fast-isel, with fixes. Be very careful to avoid emitting
a DBG_VALUE after a terminator, or emitting any instructions before an EH_LABEL.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107943 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 00:39:23 +00:00
Stuart Hastings
99cfb69f17 Reverting r107918 and r107919. Radar 8063111.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107930 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 23:25:39 +00:00
Stuart Hastings
c0e2639a34 Fix decl/def debug info for template functions. Radar 8063111.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107919 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 22:28:59 +00:00
Kevin Enderby
1b02acb2a0 Revert some unneeded parts of the change in r107886 for the
.weak_def_can_be_hidden directive.  Chris pointed out that the MCAsmInfo.h/.cpp
chunks aren't needed for this until the compiler starts generating these.  And
when that happens it will be more convenient for it to be a bool than a const
char*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107906 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 20:30:44 +00:00
Jakob Stoklund Olesen
320bdcbfe2 Implement X86InstrInfo::copyPhysReg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107898 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 19:46:25 +00:00
Jim Grosbach
b113cf2fed After r107880, findSurvivorReg() no longer needs to be public.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107887 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 17:27:23 +00:00
Kevin Enderby
f59cac5ed3 Added the darwin .weak_def_can_be_hidden directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107886 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 17:22:42 +00:00
Gabor Greif
da995609e6 only dereference iterator once in the loop
(by caching the result we save a potentially expensive dereference)

also use typedefs to shorten type declarations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107883 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 16:56:18 +00:00
Gabor Greif
dba3e15625 remove unneeded parens
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107881 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 16:52:57 +00:00
Jakob Stoklund Olesen
0bc25f4040 Convert EXTRACT_SUBREG to COPY when emitting machine instrs.
EXTRACT_SUBREG no longer appears as a machine instruction. Use COPY instead.

Add isCopy() checks in many places using isMoveInstr() and isExtractSubreg().
The isMoveInstr hook will be removed later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107879 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 16:40:22 +00:00
Duncan Sands
2dac4c1b51 Use std::vector rather than SmallVector here because SmallVector
causes some versions of gcc to crash when building LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107869 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 13:06:08 +00:00
Duncan Sands
a0994b1a13 Do not use std::stack because it causes obscure failures when
compiled with MSVC 2010 (PR7367).  Instead use a SmallVector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 11:54:27 +00:00
Jakob Stoklund Olesen
3651d92d91 Add TargetInstrInfo::copyPhysReg hook and use it from LowerSubregs.
This target hook is intended to replace copyRegToReg entirely, but for now it
calls copyRegToReg.

Any remaining calls to copyRegToReg wil be replaced by COPY instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107854 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 05:01:41 +00:00
Dan Gohman
f595141525 Revert 107840 107839 107813 107804 107800 107797 107791.
Debug info intrinsics win for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107850 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 01:00:56 +00:00
Jim Grosbach
d9642faf7c When processing frame index virtual registers, consider all available registers
(if there are any) and use the one which remains available for the longest
rather than just using the first one. This should help enable better re-use
of the loaded frame index values. rdar://7318760



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 00:38:54 +00:00
Evan Cheng
bcc8017c73 Move getExtLoad() and (some) getLoad() DebugLoc argument after EVT argument for consistency sake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107820 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 22:15:37 +00:00
Dan Gohman
4df83ed159 Implement bottom-up fast-isel. This has the advantage of not requiring
a separate DCE pass over MachineInstrs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107804 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 19:20:32 +00:00
Dan Gohman
f423a69839 Add X86FastISel support for return statements. This entails refactoring
a bunch of stuff, to allow the target-independent calling convention
logic to be employed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 18:32:53 +00:00
Dan Gohman
eabaed26c3 Give FunctionLoweringInfo an MBB member, avoiding the need to pass it
around everywhere, and also give it an InsertPt member, to enable isel
to operate at an arbitrary position within a block, rather than just
appending to a block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 16:47:08 +00:00
Dan Gohman
a4160c3434 Simplify FastISel's constructor by giving it a FunctionLoweringInfo
instance, rather than pointers to all of FunctionLoweringInfo's
members.

This eliminates an NDEBUG ABI sensitivity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107789 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 16:29:44 +00:00
Dan Gohman
4c3fd9f92f Move FunctionLoweringInfo.h out into include/llvm/CodeGen. This will
allow target-specific fast-isel code to make use of it directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 16:01:37 +00:00
Dan Gohman
c9403659a9 Split the SDValue out of OutputArg so that SelectionDAG-independent
code can do calling-convention queries. This obviates OutputArgReg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107786 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 15:54:55 +00:00
Chris Lattner
29269d03af add some triple for minix, patch by Kees van Reeuwijk from PR7582
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107785 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 15:52:27 +00:00
Dan Gohman
ce5172098d Move ArgFlagsTy, OutputArg, and InputArg out of SelectionDAGNodes.h and
into a new header, TargetCallingConv.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107782 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 15:28:42 +00:00
Dan Gohman
2f2b0abbac Move CallingConvLower.cpp out of the SelectionDAG directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107781 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 15:15:27 +00:00
Dan Gohman
d463a74464 Add a getFirstNonPHI utility function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 14:33:51 +00:00
Dan Gohman
9e86f4364b Remove interprocedural-basic-aa and associated code. The AliasAnalysis
interface needs implementations to be consistent, so any code which
wants to support different semantics must use a different interface.
It's not currently worthwhile to add a new interface for this new
concept.

Document that AliasAnalysis doesn't support cross-function queries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 14:27:09 +00:00
Gabor Greif
392a8867bb conditionalize on CallInst::ArgOffset
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107766 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 09:43:45 +00:00
Gabor Greif
dc4f391773 minor cosmetic changes that happened to sit in my tree
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107764 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 09:29:07 +00:00
Dan Gohman
c9af33c685 CanLowerReturn doesn't need a SelectionDAG; it just needs an LLVMContext.
SelectBasicBlock doesn't needs its BasicBlock argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107712 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 22:19:37 +00:00
Devang Patel
0d881dabc1 Propagate debug loc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107710 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 22:08:15 +00:00
Jakob Stoklund Olesen
9c2e7ca351 Be more forgiving when calculating alias interference for physreg coalescing.
It is OK for an alias live range to overlap if there is a copy to or from the
physical register. CoalescerPair can work out if the copy is coalescable
independently of the alias.

This means that we can join with the actual destination interval instead of
using the getOrigDstReg() hack. It is no longer necessary to merge clobber
ranges into subregisters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107695 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 20:31:51 +00:00
Dan Gohman
14152b480d Reapply r107655 with fixes; insert the pseudo instruction into
the block before calling the expansion hook. And don't
put EFLAGS in a mbb's live-in list twice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107691 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 20:24:04 +00:00
Matt Fleming
004c82ad7c Add X86_64 ELF relocation values and ELF64 relocation classes.
Patch from Roman Divacky.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107688 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 18:44:02 +00:00
Matt Fleming
e07cc5dab1 Add some more ELF OSABI values as found in the System V Application
Binary Interface specification.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107685 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 18:36:57 +00:00
John McCall
b271d8679d Provide IRBuilder conveniences for creating integer constants at common widths,
and give a more precise return type for some of the type-creation methods.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107683 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 18:34:49 +00:00
John McCall
5ed9eee61a Provide an abstraction to save and restore the current insertion point of
an IRBuilder.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107677 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 18:07:52 +00:00
Dan Gohman
258c58cc62 Revert r107655.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107668 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 15:49:48 +00:00
Gabor Greif
e9e1215d94 second round of low-level interface squeeze-out:
making all of CallInst's low-level operand accessors
private

If you get compile errors I strongly urge you to
update your code.


I tried to write the necessary clues into the
header where the compiler may point to, but no
guarantees. It works for my GCC.

You have several options to update your code:

- you can use the v2.8 ArgOperand accessors
- you can go via a temporary CallSite
- you can upcast to, say, User and call its
  low-level accessors if your code is definitely
  operand-order agnostic.

If you run into serious problems, please
comment in below thread (and back out this
revision only if absolutely necessary):

<http://groups.google.com/group/llvm-dev/browse_thread/thread/64650cf343b28271>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 15:44:11 +00:00
Dan Gohman
aa8c19405a Add versions of OutputArgReg, AnalyzeReturn, and AnalyzeCallOperands
which do not depend on SelectionDAG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 15:39:54 +00:00
Dan Gohman
802e28a8d7 Add a new CCValAssign LocInfo value, and a comment explaining what it
should be used for.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107661 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 15:35:06 +00:00
Dan Gohman
c2af869d62 Make getMinimalPhysRegClass' comment mention what makes it different
from getPhysicalRegisterRegClass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107660 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 15:31:55 +00:00
Dan Gohman
b81c771c0d Fix a bunch of custom-inserter functions to handle the case where
the pseudo instruction is not at the end of the block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107655 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 15:18:19 +00:00
Eric Christopher
f7a0c7bf8b Fix up -fstack-protector on linux to use the segment
registers.  Split out testcases per architecture and os
now.

Patch from Nelson Elhage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107640 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 05:18:56 +00:00
Nick Lewycky
b9933b8f8f Add default value to setIsNoInline for parity with the other methods of its
kind.

Also fold some functions that fit on a line to a single line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107636 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 03:53:22 +00:00
Nick Lewycky
b3344f87ac Fix typo 'getter' where 'setter' was intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107635 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 03:52:37 +00:00
Gabor Greif
69439cb919 back out r107580, I have seen what I wanted
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107582 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-04 08:59:25 +00:00
Gabor Greif
4de8ba8940 [another test commit, just to tickle the selfhost buildbots; I'll back out in a few minutes]
second round of low-level interface squeeze-out:
making all of CallInst's low-level operand accessors
private

If you get compile errors I strongly urge you to
update your code.


I tried to write the necessary clues into the
header where the compiler may point to, but no
guarantees. It works for my GCC.

You have several options to update your code:

- you can use the v2.8 ArgOperand accessors
- you can go via a temporary CallSite
- you can upcast to, say, User and call its
  low-level accessors if your code is definitely
  operand-order agnostic.

If you run into serious problems, please
comment in below thread (and back out this
revision only if absolutely necessary):

<http://groups.google.com/group/llvm-dev/browse_thread/thread/64650cf343b28271>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107580 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-04 07:42:31 +00:00
Evan Cheng
ed2ae136d2 Remove isSS argument from CreateFixedObject. Fixed objects cannot be spill slots so it's always false.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107550 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-03 00:40:23 +00:00
Jakob Stoklund Olesen
273f7e4299 Detect and handle COPY in many places.
This code is transitional, it will soon be possible to eliminate
isExtractSubreg, isInsertSubreg, and isMoveInstr in most places.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107547 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-03 00:04:37 +00:00
Dan Gohman
43b8fd728b Document that BasicAA respects noalias, while InterproceduralBasicAA
does not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107546 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02 23:52:36 +00:00
Jakob Stoklund Olesen
a4e1ba53dd Add a new target independent COPY instruction and code to lower it.
The COPY instruction is intended to replace the target specific copy
instructions for virtual registers as well as the EXTRACT_SUBREG and
INSERT_SUBREG instructions in MachineFunctions. It won't we used in a selection
DAG.

COPY is lowered to native register copies by LowerSubregs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107529 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02 22:29:50 +00:00
Jakob Stoklund Olesen
65766ce7df Clean up TargetOpcodes.h a bit, and limit the number of places where the full
list of predefined instructions appear. Add some consistency checks.

Ideally, TargetOpcodes.h should be produced by TableGen from Target.td, but it
is hardly worth the effort.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107520 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02 21:44:22 +00:00
Dan Gohman
541481f34c Remove an unused enum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107507 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02 20:20:50 +00:00
Dale Johannesen
f1e309eb48 Propagate the AlignStack bit in InlineAsm's to the
PrologEpilog code, and use it to determine whether
the asm forces stack alignment or not.  gcc consistently
does not do this for GCC-style asms; Apple gcc inconsistently
sometimes does it for asm blocks.  There is no
convenient place to put a bit in either the SDNode or
the MachineInstr form, so I've added an extra operand
to each; unlovely, but it does allow for expansion for
more bits, should we need it.  PR 5125.  Some
existing testcases are affected.
The operand lists of the SDNode and MachineInstr forms
are indexed with awesome mnemonics, like "2"; I may
fix this someday, but not now.  I'm not making it any
worse.  If anyone is inspired I think you can find all
the right places from this patch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107506 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02 20:16:09 +00:00
Jakob Stoklund Olesen
ec8c3e8ccc Handle unindexed instructions in SlotIndices.
SlotIndexes::insertMachineInstrInMaps would crash when trying to insert an
instruction imediately after an unmapped debug value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107504 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02 19:54:45 +00:00
Jakob Stoklund Olesen
8de3b1eb86 Rematerialize as much as possible before inserting spills and reloads.
This allows us to recognize the common case where all uses could be
rematerialized, and no stack slot allocation is necessary.

If some values could be fully rematerialized, remove them from the live range
before allocating a stack slot for the rest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02 17:44:57 +00:00
Gabor Greif
524e92b0fd back out r107480, it was just testing the waters anyway...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107481 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02 13:27:50 +00:00
Gabor Greif
033e75f030 [test commit, just to tickle the selfhost buildbots; I'll back out in a few minutes]
second round of low-level interface squeeze-out:
making all of CallInst's low-level operand accessors
private

If you get compile errors I strongly urge you to
update your code.


I tried to write the necessary clues into the
header where the compiler may point to, but no
guarantees. It works for my GCC.

You have several options to update your code:

- you can use the v2.8 ArgOperand accessors
- you can go via a temporary CallSite
- you can upcast to, say, User and call its
  low-level accessors if your code is definitely
  operand-order agnostic.

If you run into serious problems, please
comment in below thread (and back out this
revision only if absolutely necessary):

<http://groups.google.com/group/llvm-dev/browse_thread/thread/64650cf343b28271>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107480 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02 13:21:55 +00:00
Dan Gohman
9342c176a7 Comment a non-obvious member variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107458 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02 01:20:16 +00:00
Bill Wendling
5e721d7682 Implement the "linker_private_weak" linkage type. This will be used for
Objective-C metadata types which should be marked as "weak", but which the
linker will remove upon final linkage. However, this linkage isn't specific to
Objective-C.

For example, the "objc_msgSend_fixup_alloc" symbol is defined like this:

      .globl l_objc_msgSend_fixup_alloc
      .weak_definition l_objc_msgSend_fixup_alloc
      .section __DATA, __objc_msgrefs, coalesced
      .align 3
l_objc_msgSend_fixup_alloc:
       .quad   _objc_msgSend_fixup
       .quad   L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".

Currently only supported on Darwin platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 21:55:59 +00:00
Gabor Greif
0f66d4be04 evil hack to coerce external users (projects)
to update their code to high-level interfaces

If you get compile errors in your project
please update your code according to the
comments.

This is a re-commit of r107396 which causes
compile errors for the indicated usage patterns
instead of link errors (which are less easy to
fix because of missing source location).

If you get compile errors please perform
following functionally equivalent transformations:
  - getOperand(0)  --->  getCalledValue()
  - setOperand(0, V)  --->  setCalledFunction(V)

This will make your code more future-proof
and avoid potentially hard-to-debug bugs.

please refer to this thread on llvm-dev:

<http://groups.google.com/group/llvm-dev/browse_thread/thread/64650cf343b28271>



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107432 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 21:46:41 +00:00
Daniel Dunbar
b570968424 MC: Fix some stray hunks I didn't intend to commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107428 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 20:48:51 +00:00
Daniel Dunbar
9186fa6b0c MC: Pass the target instance to the AsmParser constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107426 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 20:41:56 +00:00
Daniel Dunbar
eb89c90f0b Remove stray comma.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107425 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 20:20:05 +00:00
Daniel Dunbar
94610588af MC: Move COFF enumeration constants to llvm/Support/COFF.h, patch by Michael
Spencer!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107418 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 20:07:24 +00:00
Devang Patel
26d14294de Debugging infomration is encoded in llvm IR using metadata. This is designed
such a way that debug info for symbols preserved even if symbols are
optimized away by the optimizer. 

Add new special pass to remove debug info for such symbols.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107416 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 19:49:20 +00:00
Gabor Greif
194db3587c back out r107396 for now, it needs another minor change to function as advertised
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107399 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 15:42:00 +00:00
Gabor Greif
0ca182b823 evil hack to coerce external users (projects)
to update their code to high-level interfaces

If you get compile errors in your project
please update your code according to the
comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 15:16:35 +00:00
Gabor Greif
cf32c6e004 reformulate CallSiteBase::getCallee to adapt to CallInst::ArgOffset, and make it work even if CallInst::op_* are private
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107392 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 11:26:05 +00:00
Dan Gohman
7fbcc98f20 Teach fast-isel to avoid loading a value from memory when it's already
available in a register. This is pretty primitive, but it reduces the
number of instructions in common testcases by 4%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107380 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 03:49:38 +00:00
Mikhail Glushenkov
dd2ad8432f Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107360 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 01:00:22 +00:00
Duncan Sands
a71f0e1f2a Rename NextPowerOfTwo to RoundUpToPowerOfTwo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107297 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-30 17:24:28 +00:00
Duncan Sands
2e502577ab Clarify that the NextPowerOfTwo template is idempotent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107286 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-30 15:29:46 +00:00
Duncan Sands
2a8bf425bd Rather than giving SmallPtrSetImpl a member field SmallArray which is magically
replaced by a bigger array in SmallPtrSet (by overridding it), instead just use a
pointer to the start of the storage, and have SmallPtrSet pass in the value to use.
This has the disadvantage that SmallPtrSet becomes bigger by one pointer.  It has
the advantage that it no longer uses tricky C++ rules, and is clearly correct while
I'm not sure the previous version was.  This was inspired by g++-4.6 pointing out
that SmallPtrSetImpl was writing off the end of SmallArray, which it was.  Since
SmallArray is replaced with a bigger array in SmallPtrSet, the write was still to
valid memory.  But it was writing off the end of the declared array type - sounds
kind of dubious to me, like it sounded dubious to g++-4.6.  Maybe g++-4.6 is wrong
and this construct is perfectly valid and correctly compiled by all compilers, but
I think it is better to avoid the whole can of worms by avoiding this construct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107285 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-30 15:02:37 +00:00
Jakob Stoklund Olesen
914f2ff9e6 Begin implementation of an inline spiller.
InlineSpiller inserts loads and spills immediately instead of deferring to
VirtRegMap. This is possible now because SlotIndexes allows instructions to be
inserted and renumbered.

This is work in progress, and is mostly a copy of TrivialSpiller so far. It
works very well for functions that don't require spilling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 23:58:39 +00:00
Bill Wendling
07d3177117 Revert r107205 and r107207.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 22:34:52 +00:00
Bill Wendling
207855cff9 Introducing the "linker_weak" linkage type. This will be used for Objective-C
metadata types which should be marked as "weak", but which the linker will
remove upon final linkage. For example, the "objc_msgSend_fixup_alloc" symbol is
defined like this:

       .globl l_objc_msgSend_fixup_alloc
       .weak_definition l_objc_msgSend_fixup_alloc
       .section __DATA, __objc_msgrefs, coalesced
       .align 3
l_objc_msgSend_fixup_alloc:
        .quad   _objc_msgSend_fixup
        .quad   L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107205 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 21:24:00 +00:00
Duncan Sands
871dc240d0 Fix a buffer overflow noticed by gcc-4.6: zero is written into
SmallArray[SmallSize] in the SmallPtrSetIteratorImpl, and this is
one off the end of the array.  For those who care, right now gcc
warns about writing off the end because it is confused about the
declaration of SmallArray as having length 1 in the parent class
SmallPtrSetIteratorImpl.  However if you tweak code to unconfuse
it, then it still warns about writing off the end of the array,
because of this buffer overflow.  In short, even with this fix
gcc-4.6 will warn about writing off the end of the array, but now
that is only because it is confused.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107200 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 20:12:02 +00:00
Duncan Sands
05b0b44f8a NextPowerOfTwo was already used to ensure that SmallSizePowTwo is a power
of two, no need to do it a second time (NextPowerOfTwo is idempotent).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 20:05:34 +00:00
Chris Lattner
190a7f4a18 give PATypeHolder an explicit copy ctor which initializes the type pointer,
and make PATypeHolder work with null pointers.

The implicitly generated one didn't work on numerous levels, but was still
accepted, allowing all sorts of bugs with default constructed pa type holders.

Previously, they "sort of" worked if they were default constructed and then
destructed.  Now they really work, and you can even default construct one,
then assign to it, amazing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 19:20:38 +00:00
Gabor Greif
16575de259 minor cosmetics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107148 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 16:27:38 +00:00
Gabor Greif
f500cbdcb1 use ArgOffset constant to prepare for operand rotation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107146 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 16:21:20 +00:00
Gabor Greif
009105c393 use ArgOperand API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107144 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 16:01:30 +00:00