Commit Graph

14189 Commits

Author SHA1 Message Date
Chris Lattner a643d528bd Patch for a new instcombine xform, patch contributed by Nick Lewycky!
This implements Transforms/InstCombine/2006-05-10-InvalidIndexUndef.ll

llvm-svn: 28450
2006-05-24 17:34:30 +00:00
Chris Lattner aa2372562e Patches to make the LLVM sources more -pedantic clean. Patch provided
by Anton Korobeynikov!  This is a step towards closing PR786.

llvm-svn: 28447
2006-05-24 17:04:05 +00:00
Chris Lattner 33165c246c Fix CodeGen/Generic/vector.ll:test_div with altivec.
llvm-svn: 28445
2006-05-24 00:15:25 +00:00
Chris Lattner b56d22c2f6 Handle SETO* like we handle SET*, restoring behavior after Evan's setcc
change.  This fixes PowerPC/fnegsel.ll.

llvm-svn: 28443
2006-05-24 00:06:44 +00:00
Chris Lattner de177e016e Print struct return functions and calls as actually returning the hidden
argument struct pointer, enabling ABI compatibility for the CBE with
platforms with strange struct-return ABIs.  This fixes 252.eon and
CoyoteBench/fftbench on Darwin/X86 among other things.

llvm-svn: 28442
2006-05-23 23:39:48 +00:00
Chris Lattner a58f559848 Fix file header comment
llvm-svn: 28441
2006-05-23 23:20:42 +00:00
Evan Cheng 7068a93cae Better way to check for vararg.
llvm-svn: 28440
2006-05-23 21:08:24 +00:00
Evan Cheng 17e734f0a6 Remove PreprocessCCCArguments and PreprocessFastCCArguments now that
FORMAL_ARGUMENTS nodes include a token operand.

llvm-svn: 28439
2006-05-23 21:06:34 +00:00
Chris Lattner 8be5be817c Implement an annoying part of the Darwin/X86 abi: the callee of a struct
return argument pops the hidden struct pointer if present, not the caller.

For example, in this testcase:

struct X { int D, E, F, G; };
struct X bar() {
  struct X a;
  a.D = 0;
  a.E = 1;
  a.F = 2;
  a.G = 3;
  return a;
}
void foo(struct X *P) {
  *P = bar();
}

We used to emit:

_foo:
        subl $28, %esp
        movl 32(%esp), %eax
        movl %eax, (%esp)
        call _bar
        addl $28, %esp
        ret
_bar:
        movl 4(%esp), %eax
        movl $0, (%eax)
        movl $1, 4(%eax)
        movl $2, 8(%eax)
        movl $3, 12(%eax)
        ret

This is correct on Linux/X86 but not Darwin/X86.  With this patch, we now
emit:

_foo:
        subl $28, %esp
        movl 32(%esp), %eax
        movl %eax, (%esp)
        call _bar
***     addl $24, %esp
        ret
_bar:
        movl 4(%esp), %eax
        movl $0, (%eax)
        movl $1, 4(%eax)
        movl $2, 8(%eax)
        movl $3, 12(%eax)
***     ret $4

For the record, GCC emits (which is functionally equivalent to our new code):

_bar:
        movl    4(%esp), %eax
        movl    $3, 12(%eax)
        movl    $2, 8(%eax)
        movl    $1, 4(%eax)
        movl    $0, (%eax)
        ret     $4
_foo:
        pushl   %esi
        subl    $40, %esp
        movl    48(%esp), %esi
        leal    16(%esp), %eax
        movl    %eax, (%esp)
        call    _bar
        subl    $4, %esp
        movl    16(%esp), %eax
        movl    %eax, (%esi)
        movl    20(%esp), %eax
        movl    %eax, 4(%esi)
        movl    24(%esp), %eax
        movl    %eax, 8(%esi)
        movl    28(%esp), %eax
        movl    %eax, 12(%esi)
        addl    $40, %esp
        popl    %esi
        ret

This fixes SingleSource/Benchmarks/CoyoteBench/fftbench with LLC and the
JIT, and fixes the X86-backend portion of PR729.  The CBE still needs to
be updated.

llvm-svn: 28438
2006-05-23 18:50:38 +00:00
Evan Cheng ac4f66ff24 -enable-unsafe-fp-math implies -enable-finite-only-fp-math
llvm-svn: 28437
2006-05-23 18:18:46 +00:00
Vladimir Prus df1d439849 Fix missing include
llvm-svn: 28435
2006-05-23 13:43:15 +00:00
Evan Cheng 1c5b7d12df Incorrect SETCC CondCode used for FP comparisons.
llvm-svn: 28433
2006-05-23 06:40:47 +00:00
Evan Cheng ea1450742e Added option -enable-finite-only-fp-math. When on, the codegen can assume that
FP arithmetic arguments and results are never NaNs or +=Infs. This includes
ignoring parity flag (PF) when checking for FP equality.

llvm-svn: 28432
2006-05-23 06:39:12 +00:00
Rafael Espindola 27f8bdc7e5 implement minimal versions of
ARMAsmPrinter::runOnMachineFunction
LowerFORMAL_ARGUMENTS
ARMInstrInfo::isMoveInstr

llvm-svn: 28431
2006-05-23 02:48:20 +00:00
Evan Cheng 26ba25f910 A isel deficiency.
llvm-svn: 28427
2006-05-22 05:54:49 +00:00
Evan Cheng 85b6232b53 Back out indirect branch load folding hack. It broke some tests.
llvm-svn: 28425
2006-05-21 06:28:50 +00:00
Chris Lattner 80b0a70911 Add a note
llvm-svn: 28424
2006-05-21 03:57:07 +00:00
Owen Anderson 80b1b4d41e Make TargetData strings less redundant.
llvm-svn: 28423
2006-05-20 23:28:54 +00:00
Chris Lattner d0622b6894 Silence a bogus gcc warning
llvm-svn: 28422
2006-05-20 23:14:03 +00:00
Chris Lattner 482fb65144 Fix a parsing bug that caused 7 llvm-test regressions on PPC last night.
I'm suprised it didn't cause more!

llvm-svn: 28421
2006-05-20 21:16:59 +00:00
Evan Cheng 401049ce33 - Use of load's chain result should be redirected to load's chain operand.
If it reads the chain result of the call, then the use, callseq_start,
  and call would form a cycle!
- Don't forget handle node replacement!
- There could also be a TokenFactor between the load and the callseq_start.

llvm-svn: 28420
2006-05-20 09:21:39 +00:00
Evan Cheng 0643f902be A new entry
llvm-svn: 28419
2006-05-20 07:44:53 +00:00
Evan Cheng a26c451fa2 Missing break statements.
llvm-svn: 28418
2006-05-20 07:44:28 +00:00
Evan Cheng b9ac06bb33 Remove unused patterns.
llvm-svn: 28417
2006-05-20 01:40:16 +00:00
Evan Cheng f838cfcfbe Handle indirect call which folds a load manually. This never matches by
the TableGen generated code since the load's chain result is read by
the callseq_start node.

llvm-svn: 28416
2006-05-20 01:36:52 +00:00
Owen Anderson f7db631b7d Sparc is big-endian.
llvm-svn: 28415
2006-05-20 00:49:30 +00:00
Owen Anderson 88812b5c0a Make all of the TargetMachine subclasses use the new string TargetData methods.
This is part of the on-going work on PR 761.

llvm-svn: 28414
2006-05-20 00:24:56 +00:00
Chris Lattner 29d2085716 Print csretcc calls like this:
call csretcc void %structret( { sbyte }* %P )

instead of this:

        callcsretcc  void %structret( { sbyte }* %P )

llvm-svn: 28412
2006-05-19 21:58:52 +00:00
Chris Lattner 620895a47a Fix misencoding of calling conventions
llvm-svn: 28411
2006-05-19 21:57:37 +00:00
Chris Lattner 3ea816fa48 pretty print csretcc for calls
llvm-svn: 28410
2006-05-19 21:54:03 +00:00
Chris Lattner 01dd6df5f3 CSRet allows varargs
llvm-svn: 28409
2006-05-19 21:34:04 +00:00
Chris Lattner 5bdc7127af Asmprint csret nicely
llvm-svn: 28408
2006-05-19 21:29:57 +00:00
Chris Lattner 09c0e99dfb Regenerate
llvm-svn: 28407
2006-05-19 21:28:53 +00:00
Chris Lattner 21cffffbb0 Add support for parsing csret
llvm-svn: 28406
2006-05-19 21:28:34 +00:00
Chris Lattner ef13ee3281 csret functions can be varargs (as can target cc's). Verify restrictions on
csret functions.

llvm-svn: 28405
2006-05-19 21:25:17 +00:00
Chris Lattner 29d7bded45 Add a note
llvm-svn: 28402
2006-05-19 21:01:38 +00:00
Chris Lattner b22eb6304f Add a note
llvm-svn: 28401
2006-05-19 20:55:31 +00:00
Chris Lattner 17f1f1a56c Split the SSE readme items out into their own README.
llvm-svn: 28400
2006-05-19 20:51:43 +00:00
Chris Lattner 427ea6f0a7 Split FP-stack notes out of the main readme. Next up: splitting out SSE.
llvm-svn: 28399
2006-05-19 20:45:52 +00:00
Chris Lattner 240f846495 Move a target-independent note out of the X86 readme.
llvm-svn: 28398
2006-05-19 20:45:08 +00:00
Chris Lattner d6a25a08d1 Particularly ugly code.
llvm-svn: 28397
2006-05-19 19:41:33 +00:00
Reid Spencer 2452c94df4 Fix a doxygen problem and break lines at 80 columns
llvm-svn: 28395
2006-05-19 19:09:46 +00:00
Evan Cheng feca91a516 These can be transformed into lea as well. Not that we use this feature
currently...

llvm-svn: 28393
2006-05-19 18:43:41 +00:00
Evan Cheng 7b8feb27c8 - Use exact-width integer types, e.g. int32_t, to avoid confusion.
- Fix a couple of minor bugs in i16immSExt8 and i16immZExt8.
- Added loadiPTR fragment used for indirect jumps and calls.

llvm-svn: 28392
2006-05-19 18:40:54 +00:00
Evan Cheng 1c8ef9832f Explicitly specify MOV32mi can only be used store 32-bit GV, etc.
llvm-svn: 28390
2006-05-19 07:30:36 +00:00
Rafael Espindola b15597b59a implement movri
add a stub LowerFORMAL_ARGUMENTS

llvm-svn: 28388
2006-05-18 21:45:49 +00:00
Evan Cheng f3cbd7ef31 Added a Flags field to TargetOperandInfo. Currently the only flag is
M_LOOK_UP_PTR_REG_CLASS which allows the register class of the operand to be
resolved via a callback at runtime.

llvm-svn: 28387
2006-05-18 20:44:26 +00:00
Evan Cheng d8e2f6ebc1 lib/Target/Target.td
llvm-svn: 28386
2006-05-18 20:42:07 +00:00
Chris Lattner 4cda95b32f add a note
llvm-svn: 28384
2006-05-18 18:26:13 +00:00
Chris Lattner f66e89721d add a note
llvm-svn: 28383
2006-05-18 17:38:16 +00:00