Commit Graph

41209 Commits

Author SHA1 Message Date
Evan Cheng
5960e4eb68 Add fast isel physical register definition support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55892 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-08 08:38:20 +00:00
Evan Cheng
24e3a90904 Add support to extend call operands when needed. Enable x86 fastisel call support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-08 06:35:17 +00:00
Bill Wendling
9a0d1ba051 Revert my previous change -- the subtraction of two constants was a no-op
before. This is taken care of in the selection DAG pass. In my opinion, this
should be in one place or the other. I.e., it should probably be removed from
the DAG combiner (along with the other arithmetic transformations on constants
that are essentially no-ops).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55889 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-08 01:56:32 +00:00
Bill Wendling
ca460d5a39 Convert
// fold (sub c1, c2) -> c1-c2

from a no-op into an actual transformation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55886 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-07 11:34:47 +00:00
Bill Wendling
c7e4c4dd3a Clean up CSS validator errors: 'Property align doesn't exist : center'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55885 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-07 10:29:20 +00:00
Bill Wendling
e36dccc9b5 Formatting changes. to make the information cleaner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55884 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-07 10:26:33 +00:00
Duncan Sands
4cddaf77c4 Correct a comment and strip trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55883 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-07 09:54:09 +00:00
Evan Cheng
f3d4efe30c Initial fastisel call support for C, Fast, and X86_FastCall calling conventions. It's meant to handle "simple" calls, i.e. no byval, structret, etc. It doesn't support multi-result returns either.
Not yet turned on, it needs to support sext / zext of arguments and result.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55882 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-07 09:09:33 +00:00
Evan Cheng
e9ac9e6b7d Some code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55881 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-07 09:07:23 +00:00
Evan Cheng
f09917847b Indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55880 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-07 09:04:52 +00:00
Evan Cheng
c7fcfa07d9 - Doh. Pass vector by value is bad.
- Add a AnalyzeCallResult specialized for calls which produce a single value. This is used by fastisel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55879 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-07 09:02:18 +00:00
Evan Cheng
e3e3626338 Eliminate a compile time warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55878 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-07 09:00:57 +00:00
Evan Cheng
10a8d9c737 Handle x86 truncate to i8 with target hook for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55877 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-07 08:47:42 +00:00
Evan Cheng
d07b46e908 Fix indentation of generated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55876 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-07 08:23:06 +00:00
Evan Cheng
34fc6ceb73 Ignore multi-instruction patterns. e.g.
def : Pat<(i8 (trunc GR32:$src)),
          (i8 (EXTRACT_SUBREG (MOV32to32_ GR32:$src), x86_subreg_8bit))>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55875 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-07 08:19:51 +00:00
Nuno Lopes
b9baf31679 fix crash when the malloc/free function is defined or is a declaration with 0 parameters.
this pass doesnt seem to be used, but still it's now a little more correct

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55873 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-06 17:44:06 +00:00
Duncan Sands
fec2c2bf5e When PruneEH turned an invoke into an ordinary
call (thus changing the call site) it didn't
inform the callgraph about this.  But the
call site does matter - as shown by the testcase,
the callgraph become invalid after the inliner
ran (with an edge between two functions simply
missing), resulting in wrong deductions by
GlobalsModRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55872 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-06 17:19:29 +00:00
Owen Anderson
3b217c6f5c Fix constant pool loads, and remove broken versions of addConstantPoolReference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55868 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-06 01:11:01 +00:00
Owen Anderson
99d6dca2f8 Fix the X86 addConstantPoolReference, which had the operands in the wrong order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55867 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-06 00:50:00 +00:00
Dale Johannesen
853244f8a6 Next limited float precision expansion (log2 12 bits)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55866 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 23:49:37 +00:00
Owen Anderson
6e6074508c Revert r55859. This is breaking the build in the abscence of its companion commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55865 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 23:36:01 +00:00
Eli Friedman
d0c0fae63b Fix for PR2687: Add patterns to match sint_to_fp and fp_to_sint for <2 x
i32>.  This is a little messy, but it works.

We should really get rid of the intrinsics, though, since they map
perfectly well to standard LLVM instructions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55864 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 23:07:03 +00:00
Dan Gohman
8a11053f3c Move the code that inserts copies for function livein registers
out of ScheduleDAGEmit.cpp and into SelectionDAGISel.cpp. This
allows it to be run exactly once per function, even if multiple
SelectionDAG iterations happen in the entry block, as may happen
with FastISel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55863 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 22:59:21 +00:00
Devang Patel
bcc11d2a71 Remove unused map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55861 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 21:55:33 +00:00
Dale Johannesen
54d9f98a56 Mark math lib intrinsics readonly, on the grounds
that they read the rounding mode.  This is conservatively
correct, which they weren't before.  We can do more
optimization on these if we actually model the rounding
mode.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55860 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 21:49:30 +00:00
Duncan Sands
c94fe21a56 Delete the removeCallEdgeTo callgraph method,
because it does not maintain a correct list
of callsites.  I discovered (see following
commit) that the inliner will create a wrong
callgraph if it is fed a callgraph with
correct edges but incorrect callsites.  These
were created by Prune-EH, and while it wasn't
done via removeCallEdgeTo, it could have been
done via removeCallEdgeTo, which is an accident
waiting to happen.  Use removeCallEdgeFor
instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55859 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 21:43:04 +00:00
Duncan Sands
f8e3541990 Prevent our own passes from promoting this to
readonly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55858 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 21:34:32 +00:00
Dan Gohman
f58cb6d224 Fix X86FastISel's shift and select code to reject illegal types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55857 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 21:27:34 +00:00
Dale Johannesen
852680a8fa Add the next limited-precision expansion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55856 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 21:27:19 +00:00
Dan Gohman
31d26912cc Fix the opcodes used by X86FastISel for shifts and conditional moves.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55855 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 21:13:04 +00:00
Evan Cheng
0de588fd89 Factor out code that emits load and store instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55854 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 21:00:03 +00:00
Owen Anderson
9c7216f984 Rename method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55853 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 20:49:33 +00:00
Evan Cheng
7f132122c8 Fix test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55849 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 20:04:37 +00:00
Dan Gohman
638c6830c6 FastISel support for AND and OR with type i1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55846 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 18:44:22 +00:00
Dale Johannesen
59e577f73c Add hooks for other intrinsics to get low-precision expansions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55845 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 18:38:42 +00:00
Dan Gohman
c39f4dba1c X86FastISel support for shifts and conditional moves.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55844 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 18:30:08 +00:00
Dan Gohman
40b189e4e2 FastISel support for ConstantExprs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55843 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 18:18:20 +00:00
Dan Gohman
be0034e3c2 Revert r55817. It broke PIC. FastISel will need to find a different
approach here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55842 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 18:13:01 +00:00
Evan Cheng
e2471a9169 If SSE2 is available, x86 should pass first 3 f32/f64 arguments in XMM registers for fastcc calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55840 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 17:24:07 +00:00
Evan Cheng
c89d2feb35 Add a variant of AnalyzeCallOperands that can be used by fast isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55838 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 16:59:26 +00:00
Duncan Sands
6f0a7687ab Use removeAllCalledFunctions rather than removing
edges one by one by hand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55836 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 14:56:53 +00:00
Duncan Sands
a7212e5826 Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55835 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 12:37:12 +00:00
Duncan Sands
e4a48c7581 Strip trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55834 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 12:31:56 +00:00
Duncan Sands
cae62e3498 Make this pass return that it made a change if
it modifies a functions attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55831 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 09:08:37 +00:00
Duncan Sands
1c11debc94 "Fix" PR2762. The testcase now crashes codegen
elsewhere due to a missing pattern for
v2f64 = sint_to_fp v2i32.  That is PR2687.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55828 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 08:13:35 +00:00
Dan Gohman
3dd168d445 Fix a search+replace-o.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55824 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 01:58:21 +00:00
Dale Johannesen
601d3c0145 Add -flimit-float-precision to enable some faster,
but less accurate (non-IEEE) code sequences for
certain math library functions.  Add the first of
several such expansions.  Don't worry, if you don't
turn it on it won't affect you.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55823 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 01:48:15 +00:00
Dan Gohman
4f22bb0676 Check a comparion's operand type for legality before
expanding its operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55820 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 01:33:56 +00:00
Dan Gohman
f52550b50e Fix X86FastISel code for comparisons and conditional branches
to check the result of getRegForValue before using it, and
to check for illegal operand types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55819 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 01:15:35 +00:00
Dan Gohman
087c8507e5 FastISel support for unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55818 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 01:08:41 +00:00