Commit Graph

1577 Commits

Author SHA1 Message Date
Dan Gohman
1327f69d98 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46506 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 11:36:12 +00:00
Owen Anderson
24387df207 Fixes for BreakCriticalMachineCodeEdge by Fernando.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46419 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-27 19:51:03 +00:00
Chris Lattner
84cd0e7fa3 make isExactlyValue work for long double.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46410 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-27 06:19:08 +00:00
Chris Lattner
88d480b552 Reorder a field to reduce the size of StackObject. Note that this
may require a clean rebuild on leopard. :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46360 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25 17:49:41 +00:00
Chris Lattner
bc2458408a move this field back. Moving the field causes miscompilations (!) of voronoi and others.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46350 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25 07:29:34 +00:00
Chris Lattner
1612faae3c move MachineFrameInfo::CreateFixedObject out of line, give MachineFrameInfo
a reference to TargetFrameInfo.  Rearrange order of fields in StackObject to
save a word.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46348 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25 07:19:06 +00:00
Chris Lattner
4ae9e0c530 add a fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46346 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25 06:20:20 +00:00
Owen Anderson
b487e7215c Move some functionality for adding flags to MachineInstr's into methods on MachineInstr rather than LiveVariables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46295 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24 01:10:07 +00:00
Chris Lattner
c2f191cc2a Fix the failures in the PPC JIT by marking relocation entries for
external symbols (e.g. 'fmod') as needing a stub.  This regression
was introduced by Evan's jit patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20071231/056749.html

With this fixed, the two ExecutionEngine failures are passing on ppc,
and the ppc jit works on freebench and olden.

This should be pulled into the 2.2 release branch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46222 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:27:27 +00:00
Chris Lattner
39354cb743 add some helper methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46128 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 07:30:38 +00:00
Chris Lattner
0bd4893a07 * Introduce a new SelectionDAG::getIntPtrConstant method
and switch various codegen pieces and the X86 backend over
  to using it.

* Add some comments to SelectionDAGNodes.h

* Introduce a second argument to FP_ROUND, which indicates
  whether the FP_ROUND changes the value of its input. If
  not it is safe to xform things like fp_extend(fp_round(x)) -> x.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46125 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 07:00:52 +00:00
Dale Johannesen
48ae02fe62 Do not mark EH tables no-dead-strip unless the
associated function is so marked.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46088 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16 19:59:28 +00:00
Chris Lattner
572dee71af Factor the ReachesChainWithoutSideEffects out of dag combiner into
a public SDOperand::reachesChainWithoutSideEffects method.  No 
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46050 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16 05:49:24 +00:00
Owen Anderson
40a627ddf8 Move some calls to getVRegDef higher in the callgraph, so they don't get executed as frequently in performance sensitive code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46027 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 22:58:11 +00:00
Evan Cheng
426df7538d Unbreak the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46021 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 22:19:35 +00:00
Evan Cheng
e14af4fe74 Oops. Forgot to commit this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46003 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 07:49:54 +00:00
Anton Korobeynikov
66fac79b89 For PR1839: add initial support for __builtin_trap. llvm-gcc part is missed
as well as PPC codegen


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46001 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 07:02:33 +00:00
Chris Lattner
2769f6fc59 remove some incorrect classof's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45893 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 23:25:16 +00:00
Chris Lattner
5080f4d991 rename MachineInstr::setInstrDescriptor -> setDesc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45871 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 18:10:50 +00:00
Scott Michel
9de5d0dd42 More CellSPU refinement and progress:
- Cleaned up custom load/store logic, common code is now shared [see note
  below], cleaned up address modes

- More test cases: various intrinsics, structure element access (load/store
  test), updated target data strings, indirect function calls.

Note: This patch contains a refactoring of the LoadSDNode and StoreSDNode
structures: they now share a common base class, LSBaseSDNode, that
provides an interface to their common functionality. There is some hackery
to access the proper operand depending on the derived class; otherwise,
to do a proper job would require finding and rearranging the SDOperands
sent to StoreSDNode's constructor. The current refactor errs on the
side of being conservatively and backwardly compatible while providing
functionality that reduces redundant code for targets where loads and
stores are custom-lowered.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45851 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 02:53:15 +00:00
Duncan Sands
007f9847c4 Output sinl for a long double FSIN node, not sin.
Likewise fix up a bunch of other libcalls.  While
there I remove NEG_F32 and NEG_F64 since they are
not used anywhere.  This fixes 9 Ada ACATS failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45833 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 10:28:30 +00:00
Evan Cheng
1778a15901 Clearify the meaning of immutable StackObject.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45828 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 07:19:43 +00:00
Evan Cheng
0d0e1b58cb Add a isImmutable bit to StackObject. Fixed stack objects are immutable (in the function) unless specified otherwise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45812 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 02:18:37 +00:00
Chris Lattner
c637d6f452 provide def_* and use_* iterators in addition to reg_* iterators.
The first only returns definitions of a register, the second only
returns uses, the third returns both.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45803 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 01:01:27 +00:00
Nate Begeman
a95afe2b5f Update the comment on scalar to vector to be a bit more clear.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45707 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 17:52:24 +00:00
Chris Lattner
749c6f6b5e rename TargetInstrDescriptor -> TargetInstrDesc.
Make MachineInstr::getDesc return a reference instead
of a pointer, since it can never be null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45695 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 07:27:27 +00:00
Gordon Henriksen
572742e876 Setting GlobalDirective in TargetAsmInfo by default rather than
providing a misleading facility. It's used once in the MIPS backend
and hardcoded as "\t.globl\t" everywhere else.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45676 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 02:31:11 +00:00
Chris Lattner
69244300b8 Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflects
that it is cheap and efficient to get.

Move a variety of predicates from TargetInstrInfo into 
TargetInstrDescriptor, which makes it much easier to query a predicate
when you don't have TII around.  Now you can use MI->getDesc()->isBranch()
instead of going through TII, and this is much more efficient anyway. Not
all of the predicates have been moved over yet.

Update old code that used MI->getInstrDescriptor()->Flags to use the
new predicates in many places.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45674 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 01:56:04 +00:00
Gordon Henriksen
8fa8929177 With this patch, the LowerGC transformation becomes the
ShadowStackCollector, which additionally has reduced overhead with
no sacrifice in portability.

Considering a function @fun with 8 loop-local roots,
ShadowStackCollector introduces the following overhead
(x86):

; shadowstack prologue
        movl    L_llvm_gc_root_chain$non_lazy_ptr, %eax
        movl    (%eax), %ecx
        movl    $___gc_fun, 20(%esp)
        movl    $0, 24(%esp)
        movl    $0, 28(%esp)
        movl    $0, 32(%esp)
        movl    $0, 36(%esp)
        movl    $0, 40(%esp)
        movl    $0, 44(%esp)
        movl    $0, 48(%esp)
        movl    $0, 52(%esp)
        movl    %ecx, 16(%esp)
        leal    16(%esp), %ecx
        movl    %ecx, (%eax)

; shadowstack loop overhead
        (none)

; shadowstack epilogue
        movl    48(%esp), %edx
        movl    %edx, (%ecx)

; shadowstack metadata
        .align  3
___gc_fun:                              # __gc_fun
        .long   8
        .space  4

In comparison to LowerGC:

; lowergc prologue
        movl    L_llvm_gc_root_chain$non_lazy_ptr, %eax
        movl    (%eax), %ecx
        movl    %ecx, 48(%esp)
        movl    $8, 52(%esp)
        movl    $0, 60(%esp)
        movl    $0, 56(%esp)
        movl    $0, 68(%esp)
        movl    $0, 64(%esp)
        movl    $0, 76(%esp)
        movl    $0, 72(%esp)
        movl    $0, 84(%esp)
        movl    $0, 80(%esp)
        movl    $0, 92(%esp)
        movl    $0, 88(%esp)
        movl    $0, 100(%esp)
        movl    $0, 96(%esp)
        movl    $0, 108(%esp)
        movl    $0, 104(%esp)
        movl    $0, 116(%esp)
        movl    $0, 112(%esp)

; lowergc loop overhead
        leal    44(%esp), %eax
        movl    %eax, 56(%esp)
        leal    40(%esp), %eax
        movl    %eax, 64(%esp)
        leal    36(%esp), %eax
        movl    %eax, 72(%esp)
        leal    32(%esp), %eax
        movl    %eax, 80(%esp)
        leal    28(%esp), %eax
        movl    %eax, 88(%esp)
        leal    24(%esp), %eax
        movl    %eax, 96(%esp)
        leal    20(%esp), %eax
        movl    %eax, 104(%esp)
        leal    16(%esp), %eax
        movl    %eax, 112(%esp)

; lowergc epilogue
        movl    48(%esp), %edx
        movl    %edx, (%ecx)

; lowergc metadata
        (none)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45670 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 01:30:53 +00:00
Gordon Henriksen
ce2247755e Enabling the target-independent garbage collection infrastructure by hooking it
up to the various compiler pipelines.

This doesn't actually add support for any GC algorithms, which means it 
temporarily breaks a few tests. To be fixed shortly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45669 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 01:30:38 +00:00
Evan Cheng
2a3e08b596 X86 JIT PIC jumptable support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45616 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-05 02:26:58 +00:00
Bill Wendling
67d65bb69d Don't recalculate the loop info and loop dominators analyses if they're
preserved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45596 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-04 20:54:55 +00:00
Evan Cheng
be8c03fc66 X86 PIC JIT support fixes: encoding bugs, add lazy pointer stubs support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45575 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-04 10:46:51 +00:00
Chris Lattner
c4ce73f666 Add a really quick hack at a machine code sinking pass, enabled with --enable-sinking.
It is missing validity checks, so it is known broken.  However, it is powerful enough
to compile this contrived code:

void test1(int C, double A, double B, double *P) {
  double Tmp = A*A+B*B;
  *P = C ? Tmp : A;
}

into:

_test1:
	movsd	8(%esp), %xmm0
	cmpl	$0, 4(%esp)
	je	LBB1_2	# entry
LBB1_1:	# entry
	movsd	16(%esp), %xmm1
	mulsd	%xmm1, %xmm1
	mulsd	%xmm0, %xmm0
	addsd	%xmm1, %xmm0
LBB1_2:	# entry
	movl	24(%esp), %eax
	movsd	%xmm0, (%eax)
	ret

instead of:

_test1:
	movsd	16(%esp), %xmm0
	mulsd	%xmm0, %xmm0
	movsd	8(%esp), %xmm1
	movapd	%xmm1, %xmm2
	mulsd	%xmm2, %xmm2
	addsd	%xmm0, %xmm2
	cmpl	$0, 4(%esp)
	je	LBB1_2	# entry
LBB1_1:	# entry
	movapd	%xmm2, %xmm1
LBB1_2:	# entry
	movl	24(%esp), %eax
	movsd	%xmm1, (%eax)
	ret

woo.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45570 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-04 07:36:53 +00:00
Evan Cheng
02aabbf96b Change MachineRelocation::DoesntNeedFnStub to NeedStub. This fields will be used
for non-function GV relocations that require function address stubs (e.g. Mac OS X in non-static mode).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45527 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-03 02:56:28 +00:00
Chris Lattner
9848ced5d0 don't access element zero of an array of size zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45526 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-03 01:25:31 +00:00
Chris Lattner
e138b3dd1f switch the register iterator to act more like hte LLVM value iterator: dereferencing
it now returns the machineinstr of the use.  To get the operand, use I.getOperand().

Add a new MachineRegisterInfo::replaceRegWith, which is basically like
Value::replaceAllUsesWith.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45482 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-01 20:36:19 +00:00
Chris Lattner
a91a7d594f Add a trivial but handy function to efficiently return the machine
instruction that defines the specified vreg.  Crazy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45480 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-01 03:07:29 +00:00
Chris Lattner
6c5757e4e8 add efficient iteration support for register use/def's
within a machine function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45479 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-01 02:55:32 +00:00
Chris Lattner
62ed6b9ade Implement automatically updated def/use lists for all MachineInstr register
operands.  The lists are currently kept in MachineRegisterInfo, but it does
not yet provide an iterator interface to them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45477 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-01 01:12:31 +00:00
Chris Lattner
f20c1a497f properly encapsulate the parent field of MBB and MI with get/set accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45469 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-31 04:56:33 +00:00
Chris Lattner
84bc5427d6 Rename SSARegMap -> MachineRegisterInfo in keeping with the idea
that "machine" classes are used to represent the current state of
the code being compiled.  Given this expanded name, we can start 
moving other stuff into it.  For now, move the UsedPhysRegs and
LiveIn/LoveOuts vectors from MachineFunction into it.

Update all the clients to match.

This also reduces some needless #includes, such as MachineModuleInfo
from MachineFunction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45467 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-31 04:13:23 +00:00
Chris Lattner
1c0780985d slightly simplify and document SSARegMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45465 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-30 23:40:31 +00:00
Chris Lattner
8aa797aa51 Add new shorter predicates for testing machine operands for various types:
e.g. MO.isMBB() instead of MO.isMachineBasicBlock().  I don't plan on 
switching everything over, so new clients should just start using the 
shorter names.

Remove old long accessors, switching everything over to use the short
accessor: getMachineBasicBlock() -> getMBB(), 
getConstantPoolIndex() -> getIndex(), setMachineBasicBlock -> setMBB(), etc.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45464 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-30 23:10:15 +00:00
Chris Lattner
a29b8aac90 - rename opType -> OpKind and contents -> Contents.
- eliminate the auxInfo union, merging it into the contents union.  This shaves 
  4 bytes off MachineOperand on a 32-bit machine.

- Use accessors in ctor methods.

- Add comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45462 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-30 22:24:06 +00:00
Chris Lattner
f73823000e More cleanups for MachineOperand:
- Eliminate the static "print" method for operands, moving it
    into MachineOperand::print.
  - Change various set* methods for register flags to take a bool
    for the value to set it to.  Remove unset* methods.
  - Group methods more logically by operand flavor in MachineOperand.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45461 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-30 21:56:09 +00:00
Chris Lattner
e3087890ac MachineOperand:
- Add getParent() accessors.
  - Move SubReg out of the AuxInfo union, to make way for future changes.
  - Remove the getImmedValue/setImmedValue methods.
  - in some MachineOperand::Create* methods, stop initializing fields that are dead.

MachineInstr:
  - Delete one copy of the MachineInstr printing code, now there is only one dump
    format and one copy of the code.
  - Make MachineOperand use the parent field to get info about preg register names if
    no target info is otherwise available.
  - Move def/use/kill/dead flag printing to the machineoperand printer, so they are
    always printed for an operand.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45460 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-30 21:31:53 +00:00
Chris Lattner
e12d6abfdf make machine operands fatter: give each one an up-pointer to the
machineinstr that owns it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45449 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-30 06:11:04 +00:00
Chris Lattner
103a64318b split machineoperand out into its own header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45445 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-30 04:40:25 +00:00
Chris Lattner
ece6737f15 remove unneeded #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45439 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-30 01:11:43 +00:00