1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

24923 Commits

Author SHA1 Message Date
Anton Korobeynikov
59a67c60db Replace explicit pointer-size constants to TargetData query.
No functionality change.

llvm-svn: 55996
2008-09-09 18:22:57 +00:00
Dan Gohman
28c911b79b Make SimplifyDemandedVectorElts simplify vectors with multiple
users, and teach it about shufflevector instructions.

Also, fix a subtle bug in SimplifyDemandedVectorElts'
insertelement code.

This is a patch that was originally written by Eli Friedman,
with some fixes and cleanup by me.

llvm-svn: 55995
2008-09-09 18:11:14 +00:00
Devang Patel
ccd2dfd23a Simplify.
Fix outdated comment.

llvm-svn: 55993
2008-09-09 17:56:50 +00:00
Duncan Sands
85c4a89959 Optimization suggested by Matthijs Kooijman.
llvm-svn: 55988
2008-09-09 13:44:24 +00:00
Duncan Sands
d8ab4c3485 Correct callgraph construction. It has two problems:
(1) code left over from the days of ConstantPointerRef:
if a use of a function is a GlobalValue then that is
not considered a reason to add an edge from the external
node, even though the use may be as an initializer for
an externally visible global!  There might be some point
to this behaviour when the use is by an alias (though the
code predated aliases by some centuries), but I think
PR2782 is a better way of handling that.  (2) If function
F calls function G, and also G is a parameter to the
call, then an F->G edge is not added to the callgraph.
While this doesn't seem to matter much, adding such an
edge makes the callgraph more regular.
In addition, the new code should be faster as well as
simpler.

llvm-svn: 55987
2008-09-09 12:40:47 +00:00
Owen Anderson
22debc8bec Check for type legality before materializing integer constants in fast isel. With this change,
all of MultiSource/Applications passes on Darwin/X86 under FastISel.

llvm-svn: 55982
2008-09-09 06:32:02 +00:00
Dan Gohman
4b334f02b1 Remove the code that protected FastISel from aborting in
the case of loads, stores, and conditional branches. It can
handle those now, so any that aren't handled should trigger
the abort.

llvm-svn: 55977
2008-09-09 02:40:04 +00:00
Dan Gohman
12e88b5421 Temporarily disable vector select in the bitcode reader. The
way it handles the type of the condition is breaking plain
scalar select in the case that the value is a
forward-reference.

llvm-svn: 55976
2008-09-09 02:08:49 +00:00
Evan Cheng
dc011a1b10 Fix a constant lowering bug. Now we can do load and store instructions with funky getelementptr embedded in the address operand.
llvm-svn: 55975
2008-09-09 01:26:59 +00:00
Dale Johannesen
1ed08a58d1 Fix logic for not emitting no-dead-strip for some
objects in llvm.used (thanks Anton).  Makes visible
the magic 'l' prefix for symbols on Darwin which are
to be passed through the assembler, then removed at
linktime (previously all references to this had been
hidden in the ObjC FE code, oh well).

llvm-svn: 55973
2008-09-09 01:21:22 +00:00
Dan Gohman
90358a2f67 Update generated files.
llvm-svn: 55972
2008-09-09 01:13:24 +00:00
Devang Patel
b6380f607d Fix simplifycfg crash in handing block merge.
llvm-svn: 55971
2008-09-09 01:06:56 +00:00
Dan Gohman
3e79d697f3 Extend the vcmp/fcmp LLVM IR instructions to take vectors as arguments
and, if so, to return a vector of boolean as a result;

Extend the select LLVM IR instruction to allow you to specify a result
type which is a vector of boolean, in which case the result will be an
element-wise selection instead of choosing one vector or the other; and

Update LangRef.html to describe these changes.

This patch was contributed by Preston Gurd!

llvm-svn: 55969
2008-09-09 01:02:47 +00:00
Bill Wendling
701da64da7 Add support for floating-point calculations of log2 with limited precisions of 6
and 18.

llvm-svn: 55968
2008-09-09 00:28:24 +00:00
Devang Patel
7df7366784 s/RemoveUnreachableBlocks/RemoveUnreachableBlocksFromFn/g
llvm-svn: 55965
2008-09-08 22:14:17 +00:00
Dale Johannesen
372133f1c8 Don't suppress no-dead-strip for used static functions.
llvm-svn: 55962
2008-09-08 21:21:49 +00:00
Anton Korobeynikov
d82cd01929 Reapply 55904: Unbreak and fix indentation
llvm-svn: 55958
2008-09-08 21:13:56 +00:00
Anton Korobeynikov
1d726f1597 Reapply 55901: Drop unused variable
llvm-svn: 55957
2008-09-08 21:13:33 +00:00
Anton Korobeynikov
9d896f5566 Reapply 55900: We do support EH on x86-64!
llvm-svn: 55956
2008-09-08 21:13:08 +00:00
Anton Korobeynikov
33c69aaf24 Reapply 55899: First draft of EH support on x86/64-linux
Now with fix, which prevents subtle codegen bug to trigger on darwin.
No fix for bug though, it's still there.

llvm-svn: 55955
2008-09-08 21:12:47 +00:00
Anton Korobeynikov
8e8f8bf5a6 Reapply blindly reverted 55898: Implement FRAME_TO_ARGS_OFFSET for x86-64
llvm-svn: 55954
2008-09-08 21:12:11 +00:00
Dan Gohman
121cc3c111 Fix a few I's that were meant to be renamed to BI's.
llvm-svn: 55942
2008-09-08 20:37:59 +00:00
Bill Wendling
51ddfce77e Reverting r55898 as well. This wasn't reverted in the original revert...
llvm-svn: 55938
2008-09-08 19:42:32 +00:00
Bill Wendling
c5e40e77f3 Accidental commit of partial 'stack canaries' code
llvm-svn: 55937
2008-09-08 18:12:00 +00:00
Dale Johannesen
78617b727e Redo the 3 existing low-precision expansions to
use float constants.  An oversight by the numerics
people who supplied this.

llvm-svn: 55930
2008-09-08 18:00:26 +00:00
Bill Wendling
4cc4caab72 Reverting r55898 to r55909. One of these patches was causing an ICE during the full bootstrap on Darwin:
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./gcc/xgcc
-B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./gcc/
-B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.4.0/bin/
-B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.4.0/lib/
-isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.4.0/include
-isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.4.0/sys-include
-O2  -O2 -g -O2  -DIN_GCC    -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include  -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../llvm-gcc.src/gcc
-I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include
-I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include
-I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber
-I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include
-I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include
-DSHARED -m64 -DL_negdi2 -c ../../llvm-gcc.src/gcc/libgcc2.c -o
libgcc/x86_64/_negdi2_s.o
Assertion failed: (TargetRegisterInfo::isVirtualRegister(regA) &&
TargetRegisterInfo::isVirtualRegister(regB) && "cannot update physical
register live information"), function runOnMachineFunction, file
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/lib/CodeGen/TwoAddressInstructionPass.cpp,
line 311.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./gcc/xgcc
-B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./gcc/
-B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.4.0/bin/
-B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.4.0/lib/
-isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.4.0/include
-isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.4.0/sys-include
-O2  -O2 -g -O2  -DIN_GCC    -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include  -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../llvm-gcc.src/gcc
-I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include
-I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include
-I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber
-I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include
-I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include
-DSHARED -m64 -DL_lshrdi3 -c ../../llvm-gcc.src/gcc/libgcc2.c -o
libgcc/x86_64/_lshrdi3_s.o
../../llvm-gcc.src/gcc/unwind-dw2.c:1527: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
{standard input}:unknown:Undefined local symbol LBB21_11
{standard input}:unknown:Undefined local symbol LBB21_12
{standard input}:unknown:Undefined local symbol LBB21_13
{standard input}:unknown:Undefined local symbol LBB21_8

llvm-svn: 55928
2008-09-08 17:59:12 +00:00
Evan Cheng
fc78ac5bbe Handle calls which produce i1 results: promote to i8 but and it with 1 to get the low bit.
llvm-svn: 55925
2008-09-08 17:15:42 +00:00
Devang Patel
f341d87755 Remove unused counter.
llvm-svn: 55924
2008-09-08 17:14:54 +00:00
Dan Gohman
c9fdcfb189 In visitUREM, arrange for the temporary UDIV node to be
revisited, consistent with the code in visitSREM.

llvm-svn: 55923
2008-09-08 16:59:01 +00:00
Daniel Dunbar
ddd9b2aeb0 Add VISIBILITY_HIDDEN on SDISelAsmOperandInfo
llvm-svn: 55922
2008-09-08 16:56:08 +00:00
Dan Gohman
3d1ee171e8 Bitcasting two or from aggregate types is not permitted. Update
LangRef.html, and teach the verifier to check bitcast instructions.

llvm-svn: 55921
2008-09-08 16:45:59 +00:00
Dan Gohman
2498f902ff i128 and f80 are implemented for x86-64 now.
llvm-svn: 55920
2008-09-08 16:42:56 +00:00
Dan Gohman
f2a912c2a7 Add AsmPrinter support for i128 and larger static initializer data.
llvm-svn: 55919
2008-09-08 16:40:13 +00:00
Dan Gohman
331ed48bc7 Fix copy+pastos in comments.
llvm-svn: 55918
2008-09-08 16:31:35 +00:00
Dan Gohman
afe7e3f3b1 Fix the string for ISD::UDIVREM.
llvm-svn: 55917
2008-09-08 16:30:29 +00:00
Dan Gohman
fedd10cd95 Delete an unused variable.
llvm-svn: 55915
2008-09-08 16:28:17 +00:00
Devang Patel
071f99e1df Remove OptimizeIVType()
llvm-svn: 55913
2008-09-08 16:13:27 +00:00
Duncan Sands
590470e1f2 Didn't mean to commit this change to how the
callgraph is printed.

llvm-svn: 55912
2008-09-08 16:04:03 +00:00
Evan Cheng
432600a47a Avoid redefinition and nnbreak windows build.
llvm-svn: 55911
2008-09-08 16:01:27 +00:00
Anton Korobeynikov
5ea45bb9eb Unbreak and fix indentation
llvm-svn: 55904
2008-09-08 14:23:34 +00:00
Anton Korobeynikov
cd3e839337 Drop unused variable
llvm-svn: 55901
2008-09-08 14:22:38 +00:00
Anton Korobeynikov
abd2198853 We do support EH on x86-64!
llvm-svn: 55900
2008-09-08 14:22:16 +00:00
Anton Korobeynikov
8528e4dc99 First draft of EH support on x86/64-linux
llvm-svn: 55899
2008-09-08 14:21:53 +00:00
Anton Korobeynikov
38cc49e19d Implement FRAME_TO_ARGS_OFFSET for x86-64
llvm-svn: 55898
2008-09-08 14:21:10 +00:00
Duncan Sands
0fcef7437c Update the callgraph correctly.
llvm-svn: 55896
2008-09-08 11:08:09 +00:00
Duncan Sands
62431a29a5 Update the callgraph correctly in ArgumentPromotion.
llvm-svn: 55895
2008-09-08 11:07:35 +00:00
Duncan Sands
58d434d3e8 Reapply 55859. This doesn't change anything as
long as the callgraph is correct.  It checks
for wrong callgraphs more strictly.

llvm-svn: 55894
2008-09-08 11:05:51 +00:00
Evan Cheng
8cb490d2f3 Add fast isel physical register definition support.
llvm-svn: 55892
2008-09-08 08:38:20 +00:00
Evan Cheng
66ef6517ad Add support to extend call operands when needed. Enable x86 fastisel call support.
llvm-svn: 55891
2008-09-08 06:35:17 +00:00
Bill Wendling
2239de4290 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).

llvm-svn: 55889
2008-09-08 01:56:32 +00:00
Bill Wendling
91e9abe370 Convert
// fold (sub c1, c2) -> c1-c2

from a no-op into an actual transformation.

llvm-svn: 55886
2008-09-07 11:34:47 +00:00
Duncan Sands
ae32389a41 Correct a comment and strip trailing whitespace.
llvm-svn: 55883
2008-09-07 09:54:09 +00:00
Evan Cheng
f016785579 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.

llvm-svn: 55882
2008-09-07 09:09:33 +00:00
Evan Cheng
ad262ec3a7 Some code clean up.
llvm-svn: 55881
2008-09-07 09:07:23 +00:00
Evan Cheng
396c744dfa Indentation.
llvm-svn: 55880
2008-09-07 09:04:52 +00:00
Evan Cheng
285350703c - Doh. Pass vector by value is bad.
- Add a AnalyzeCallResult specialized for calls which produce a single value. This is used by fastisel.

llvm-svn: 55879
2008-09-07 09:02:18 +00:00
Evan Cheng
6690ccd573 Handle x86 truncate to i8 with target hook for now.
llvm-svn: 55877
2008-09-07 08:47:42 +00:00
Nuno Lopes
a03bc9ce10 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

llvm-svn: 55873
2008-09-06 17:44:06 +00:00
Duncan Sands
c4ec7871bf 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.

llvm-svn: 55872
2008-09-06 17:19:29 +00:00
Owen Anderson
ef6d356c39 Fix constant pool loads, and remove broken versions of addConstantPoolReference.
llvm-svn: 55868
2008-09-06 01:11:01 +00:00
Owen Anderson
4d5723c58f Fix the X86 addConstantPoolReference, which had the operands in the wrong order.
llvm-svn: 55867
2008-09-06 00:50:00 +00:00
Dale Johannesen
3be45974bb Next limited float precision expansion (log2 12 bits)
llvm-svn: 55866
2008-09-05 23:49:37 +00:00
Owen Anderson
453bcfcf8d Revert r55859. This is breaking the build in the abscence of its companion commit.
llvm-svn: 55865
2008-09-05 23:36:01 +00:00
Eli Friedman
fecea4b498 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.

llvm-svn: 55864
2008-09-05 23:07:03 +00:00
Dan Gohman
85d35b92df 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.

llvm-svn: 55863
2008-09-05 22:59:21 +00:00
Devang Patel
4148488e49 Remove unused map.
llvm-svn: 55861
2008-09-05 21:55:33 +00:00
Duncan Sands
fdfa2d24fe 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.

llvm-svn: 55859
2008-09-05 21:43:04 +00:00
Dan Gohman
930d0be24c Fix X86FastISel's shift and select code to reject illegal types.
llvm-svn: 55857
2008-09-05 21:27:34 +00:00
Dale Johannesen
6b48790d88 Add the next limited-precision expansion.
llvm-svn: 55856
2008-09-05 21:27:19 +00:00
Dan Gohman
28e33e92e4 Fix the opcodes used by X86FastISel for shifts and conditional moves.
llvm-svn: 55855
2008-09-05 21:13:04 +00:00
Evan Cheng
5fd19547f4 Factor out code that emits load and store instructions.
llvm-svn: 55854
2008-09-05 21:00:03 +00:00
Owen Anderson
7866b1c4c3 Rename method.
llvm-svn: 55853
2008-09-05 20:49:33 +00:00
Dan Gohman
b22e9b050f FastISel support for AND and OR with type i1.
llvm-svn: 55846
2008-09-05 18:44:22 +00:00
Dale Johannesen
116163ab21 Add hooks for other intrinsics to get low-precision expansions.
llvm-svn: 55845
2008-09-05 18:38:42 +00:00
Dan Gohman
0be4bca4b6 X86FastISel support for shifts and conditional moves.
llvm-svn: 55844
2008-09-05 18:30:08 +00:00
Dan Gohman
525caf83e5 FastISel support for ConstantExprs.
llvm-svn: 55843
2008-09-05 18:18:20 +00:00
Dan Gohman
13d7484b4a Revert r55817. It broke PIC. FastISel will need to find a different
approach here.

llvm-svn: 55842
2008-09-05 18:13:01 +00:00
Evan Cheng
10a350fa89 If SSE2 is available, x86 should pass first 3 f32/f64 arguments in XMM registers for fastcc calls.
llvm-svn: 55840
2008-09-05 17:24:07 +00:00
Evan Cheng
339a06f29e Add a variant of AnalyzeCallOperands that can be used by fast isel.
llvm-svn: 55838
2008-09-05 16:59:26 +00:00
Duncan Sands
b63fde1edb Use removeAllCalledFunctions rather than removing
edges one by one by hand.

llvm-svn: 55836
2008-09-05 14:56:53 +00:00
Duncan Sands
c568792f0a Remove trailing whitespace.
llvm-svn: 55835
2008-09-05 12:37:12 +00:00
Duncan Sands
8de0cd8f10 Make this pass return that it made a change if
it modifies a functions attributes.

llvm-svn: 55831
2008-09-05 09:08:37 +00:00
Duncan Sands
566e0f1053 "Fix" PR2762. The testcase now crashes codegen
elsewhere due to a missing pattern for
v2f64 = sint_to_fp v2i32.  That is PR2687.

llvm-svn: 55828
2008-09-05 08:13:35 +00:00
Dan Gohman
a3987ed4e2 Fix a search+replace-o.
llvm-svn: 55824
2008-09-05 01:58:21 +00:00
Dale Johannesen
ce63ed5b47 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.

llvm-svn: 55823
2008-09-05 01:48:15 +00:00
Dan Gohman
29cba19a2a Check a comparion's operand type for legality before
expanding its operands.

llvm-svn: 55820
2008-09-05 01:33:56 +00:00
Dan Gohman
121baa1723 Fix X86FastISel code for comparisons and conditional branches
to check the result of getRegForValue before using it, and
to check for illegal operand types.

llvm-svn: 55819
2008-09-05 01:15:35 +00:00
Dan Gohman
e64326ff34 FastISel support for unreachable.
llvm-svn: 55818
2008-09-05 01:08:41 +00:00
Dan Gohman
fcd2cbd985 In FastISel mode, the scheduler may be invoked multiple times
in the same block. Fix the entry-block handling to only run at
at the beginning of the entry block, and not any other times.

llvm-svn: 55817
2008-09-05 01:07:48 +00:00
Dan Gohman
783f38e056 X86FastISel support for conditional branches.
llvm-svn: 55816
2008-09-05 01:06:14 +00:00
Owen Anderson
6d5b72d45a Add initial support for selecting constant materializations that require constant
pool loads on X86 in fast isel.  This isn't actually used yet.

llvm-svn: 55814
2008-09-05 00:06:23 +00:00
Dan Gohman
88c3de638e X86FastISel support for ICmpInst and FCmpInst.
llvm-svn: 55811
2008-09-04 23:26:51 +00:00
Evan Cheng
bd15e330d0 For whatever the reason, x86 CallingConv::Fast (i.e. fastcc) was not passing scalar arguments in registers. This patch defines a new fastcc CC which is slightly different from the FastCall CC. In addition to passing integer arguments in ECX and EDX, it also specify doubles are passed in 8-byte slots which are 8-byte aligned (instead of 4-byte aligned). This avoids a potential performance hazard where doubles span cacheline boundaries.
llvm-svn: 55807
2008-09-04 22:59:58 +00:00
Devang Patel
3d42ac68df A loop may be unswitched multiple times. Reconstruct dom info. at the end.
llvm-svn: 55806
2008-09-04 22:43:59 +00:00
Devang Patel
f3770334a9 If function notes say optimize for size, then adjust alignment.
llvm-svn: 55794
2008-09-04 21:03:41 +00:00
Dan Gohman
1ffb4ad3a8 Add an include of SmallSet.h.
llvm-svn: 55793
2008-09-04 20:49:27 +00:00
Devang Patel
25b88b66e8 Initialize loop data first.
llvm-svn: 55792
2008-09-04 20:36:36 +00:00
Duncan Sands
bbfa97b8b0 Neaten this up a bit. No functionality change.
llvm-svn: 55789
2008-09-04 19:16:20 +00:00
Devang Patel
c96f319a3c Do not unswitch if the function notes say we're optimizing this function for size.
llvm-svn: 55786
2008-09-04 18:55:13 +00:00
Andrew Lenharth
4523deb38b try to seperate the mechanism into something others can use
llvm-svn: 55785
2008-09-04 18:51:26 +00:00
Dale Johannesen
bbd799c544 Add intrinsic forms of pow and exp2. The non-intrinsic
forms remain to handle older IR files, but will go away soon.

llvm-svn: 55781
2008-09-04 18:30:46 +00:00
Dan Gohman
e1f9be27bc Tidy up several unbeseeming casts from pointer to intptr_t.
llvm-svn: 55779
2008-09-04 17:05:41 +00:00
Owen Anderson
cd3ee9198d Fix the ordering of operands to the store (inverted relative to LLVM IR), and fix the testcase.
llvm-svn: 55777
2008-09-04 16:48:33 +00:00
Dan Gohman
7ee14837e6 Clean up uses of TargetLowering::getTargetMachine.
llvm-svn: 55769
2008-09-04 15:39:15 +00:00
Andrew Lenharth
9e27a7b4b0 cleanup as per Duncan's review
llvm-svn: 55766
2008-09-04 14:34:22 +00:00
Owen Anderson
35485dbae3 Add a first attempt at implementing stores for X86 fast isel using target hooks.
Dan or Evan, please review.

llvm-svn: 55764
2008-09-04 07:08:58 +00:00
Evan Cheng
9c728a557d Load from GV stub should be locally CSE'd.
llvm-svn: 55763
2008-09-04 06:18:33 +00:00
Evan Cheng
dcce925eb1 Fix an overly strict assertion. Source register of a copy may not be killed, it may be killed by an implicit super-register use.
llvm-svn: 55762
2008-09-04 05:43:55 +00:00
Evan Cheng
53ce5fa5ce Remove code that pad number of bytes to pop for X86_FastCall CC. The code doesn't do the "aligning" for Cygwin, Mingw, and Windows. But aligning it on Darwin and Linux breaks gcc compatibility. That ruled out all the platforms we support!
llvm-svn: 55756
2008-09-04 01:04:15 +00:00
Dale Johannesen
9e4d101fab Add intrinsics for log, log2, log10, exp, exp2.
No functional change (and no FE change to generate them).

llvm-svn: 55753
2008-09-04 00:47:13 +00:00
Dan Gohman
18f659d804 Do trivial local CSE for constants and other non-Instruction values
in FastISel.

llvm-svn: 55748
2008-09-03 23:32:19 +00:00
Dan Gohman
f86538dd3c Put RegsForValue in the llvm namespace to avoid warnings about
classes in the llvm namespace having members with types from
anonymous namespaces.

llvm-svn: 55747
2008-09-03 23:18:39 +00:00
Dan Gohman
18cc2a26df Create HandlePHINodesInSuccessorBlocksFast, a version of
HandlePHINodesInSuccessorBlocks that works FastISel-style. This
allows PHI nodes to be updated correctly while using FastISel.

This also involves some code reorganization; ValueMap and
MBBMap are now members of the FastISel class, so they needn't
be passed around explicitly anymore. Also, SelectInstructions
is changed to SelectInstruction, and only does one instruction
at a time.

llvm-svn: 55746
2008-09-03 23:12:08 +00:00
Devang Patel
49483d797e Update inline threshold for current function if the notes say, optimize for size.
llvm-svn: 55745
2008-09-03 23:06:09 +00:00
Owen Anderson
94bd638e81 Fix a bug that prevented PRE from applying in some cases.
llvm-svn: 55744
2008-09-03 23:06:07 +00:00
Devang Patel
c0d6a60b65 Avoid extra comma.
llvm-svn: 55742
2008-09-03 22:55:40 +00:00
Devang Patel
f8c7bd2a05 Parse and print opt_size note.
llvm-svn: 55740
2008-09-03 22:10:21 +00:00
Andrew Lenharth
4a69775c64 Initial version of a Partial Specialization IPO pass. It triggers a couple hundred times on 176.gcc. I don't know the performance impact yet, the heuristic is quite simple still.
llvm-svn: 55734
2008-09-03 21:00:28 +00:00
Dale Johannesen
ca782fcba1 Do not emit a UsedDirective for things in the llvm.used
list that have internal linkage; the linker doesn't need
or want this.  (These objects must still be preserved
at compile time, so just removing them from the llvm.used
list doesn't work.)  Should affect only Darwin.

llvm-svn: 55722
2008-09-03 20:34:58 +00:00
Devang Patel
41331065dd Fix typo in a comment.
llvm-svn: 55720
2008-09-03 20:25:40 +00:00
Devang Patel
b25dcdea78 Add parentheses to make code more readable.
llvm-svn: 55717
2008-09-03 19:57:15 +00:00
Devang Patel
24618c5a6a Fix comments.
llvm-svn: 55716
2008-09-03 19:52:17 +00:00
Duncan Sands
e745635d61 If a SCC has a node without a function, then the SCC
analysis would bail out without removing function
records for other members of the SCC (which may exist
if those functions read or wrote global variables).
Since these are initialized to "readnone", this
resulted in incorrect alias analysis results.

llvm-svn: 55714
2008-09-03 19:37:16 +00:00
Devang Patel
c70392bfcd Add custom inliner that handles only functions that are marked as always_inline.
llvm-svn: 55713
2008-09-03 18:50:53 +00:00
Devang Patel
42fe8ff6e8 Handle "always inline" note during inline cost analysis.
llvm-svn: 55712
2008-09-03 18:47:45 +00:00
Devang Patel
dae7f0b9d7 Check noinline note and ignore other notes.
llvm-svn: 55711
2008-09-03 18:46:35 +00:00
Devang Patel
653bcea20d Handle "noinline" note inside the simple inliner.
llvm-svn: 55708
2008-09-03 18:10:21 +00:00
Owen Anderson
d08396955c Oops, I accidentally broke the fallback case with my last commit.
llvm-svn: 55704
2008-09-03 17:51:57 +00:00
Owen Anderson
906c590bb8 Fix an issue where we were reusing materializations of constants in blocks not dominated by the materialization. This is
the simple fix, materializing the constant before every use.  It might be better to either track domination of uses or
to materialize all constants and the beginning of the function and let remat sort when to do materialization at uses.

llvm-svn: 55703
2008-09-03 17:37:03 +00:00
Dan Gohman
3ee4edfe9c Split the SelectionDAG-building code, including the FunctionLoweringInfo
and SelectionDAGLowering classes, out of SelectionDAGISel.cpp and put
it in a separate file, SelectionDAGBuild.cpp.

llvm-svn: 55701
2008-09-03 16:12:24 +00:00
Duncan Sands
e639585987 Fix maxo bado thinko.
llvm-svn: 55700
2008-09-03 16:10:55 +00:00
Dan Gohman
c58897359b Separate MachineInstr-emitting routines from actual scheduling
routines and move them into a separate file, ScheduleDAGEmit.cpp.

llvm-svn: 55699
2008-09-03 16:01:59 +00:00
Dan Gohman
ec225915fa Fix addRegisterDead and addRegisterKilled to be more thorough
when searching for redundant subregister dead/kill bits.

Previously it was common to see instructions marked like this:
  "RET %EAX<imp-use,kill>, %AX<imp-use,kill>"

With this change, addRegisterKilled continues scanning after
finding the %EAX operand, so it proceeds to discover the
redundant %AX kill and eliminates it, producing this:
  "RET %EAX<imp-use,kill>"

This currently has no effect on the generated code.

llvm-svn: 55698
2008-09-03 15:56:16 +00:00
Duncan Sands
06bd9f3885 Since onlyReadsMemory returns true if in fact
doesNotAccessMemory, check doesNotAccessMemory
first, since otherwise functions may be
marked readonly rather than readnone.

llvm-svn: 55697
2008-09-03 15:31:24 +00:00
Duncan Sands
0283a6c991 Cleanup GlobalsModRef a bit. When analysing the
callgraph, when one member of a SCC calls another
then the analysis would drop to mod-ref because
there is (usually) no function info for the callee
yet; fix this.  Teach the analysis about function
attributes, in particular the readonly attribute
(which requires being careful about globals).

llvm-svn: 55696
2008-09-03 12:55:42 +00:00
Nick Lewycky
8b8886c6b0 Try to fold each element of a vector. This is needed to maintain structural
equivalence.

llvm-svn: 55694
2008-09-03 06:48:55 +00:00
Evan Cheng
942d55dd92 Add X86 target hook to implement load (even from GlobalAddress).
llvm-svn: 55693
2008-09-03 06:44:39 +00:00
Evan Cheng
f993be4cc8 If TargetSelectInstruction returns true, move to next instruction.
llvm-svn: 55692
2008-09-03 06:43:41 +00:00
Nick Lewycky
3b35dcc455 Don't apply this transform to vectors. Fixes PR2756.
llvm-svn: 55690
2008-09-03 06:24:21 +00:00
Nick Lewycky
57cebeaeba Don't crash when trying to constant fold a vector with some elements that can't
be folded. Instead, fail to fold the entire vector.

We could also return a vector with some elements folded and some not. If anyone
thinks that's a better approach, please speak up!

llvm-svn: 55689
2008-09-03 05:54:33 +00:00
Ted Kremenek
b7236d215b Fix capitalization in #include of FastISel.h. This unbreaks the build on case-sensitive filesystems.
llvm-svn: 55687
2008-09-03 02:54:11 +00:00
Evan Cheng
4cef3f6ce1 Unbreak fast isel.
llvm-svn: 55685
2008-09-03 01:04:47 +00:00
Devang Patel
5fa8cc79ed Add additional check to ensure that iv is canonicalized.
llvm-svn: 55682
2008-09-03 00:29:13 +00:00
Devang Patel
4dfecae8fe Check iteration count.
llvm-svn: 55680
2008-09-03 00:10:56 +00:00
Evan Cheng
43c7084625 Let tblgen only generate fastisel routines, not the class definition. This makes it easier for targets to define its own fastisel class.
llvm-svn: 55679
2008-09-03 00:03:49 +00:00
Devang Patel
df5dce4aa8 While removing PHI, use basicblock to identify incoming value.
llvm-svn: 55678
2008-09-03 00:02:42 +00:00
Devang Patel
5659d2508e s/FP_AlwaysInline/FN_NOTE_AlwaysInline/g
llvm-svn: 55676
2008-09-02 22:43:57 +00:00
Devang Patel
a1e2066b1d If all IV uses are extending integer IV then change the type of IV itself, if possible.
llvm-svn: 55674
2008-09-02 22:18:08 +00:00
Devang Patel
cda9086d29 respect inline=never and inline=always notes.
llvm-svn: 55673
2008-09-02 22:16:13 +00:00
Evan Cheng
5e0e6dfc7f 80 col violations.
llvm-svn: 55668
2008-09-02 21:59:13 +00:00
Devang Patel
631122c84b Read and write function notes.
llvm-svn: 55657
2008-09-02 21:47:13 +00:00
Devang Patel
d131eb6bfb Use bitwise AND.
llvm-svn: 55656
2008-09-02 21:46:44 +00:00
Devang Patel
4b52a398c3 Print function notes.
llvm-svn: 55647
2008-09-02 20:56:33 +00:00
Devang Patel
f06ad159e9 Parse function notes.
llvm-svn: 55646
2008-09-02 20:52:40 +00:00
Devang Patel
863655cd40 Initialize function notes.
llvm-svn: 55645
2008-09-02 20:51:15 +00:00
Dale Johannesen
46f19abcec Fix some bugs in the code sequences for atomics.
llvm-svn: 55643
2008-09-02 20:30:23 +00:00
Dan Gohman
9969b223c7 Ensure that HandlePHINodesInSuccessorBlocks is run for all blocks,
even in FastISel mode in the case where FastISel successfully 
selects all the instructions. 

llvm-svn: 55641
2008-09-02 20:17:56 +00:00
Nuno Lopes
5c40eb8e05 plug a little memleak in verifyFunction()
# first commit to llvm, so whatch out :)

llvm-svn: 55631
2008-09-02 11:30:10 +00:00
Evan Cheng
15fd1af657 MMI may be null.
llvm-svn: 55626
2008-09-02 08:14:01 +00:00
Evan Cheng
126bd60288 Add Mac OS X compatible JIT callback routine.
llvm-svn: 55625
2008-09-02 07:49:03 +00:00
Evan Cheng
e97c48a34a Revamp ARM JIT.
llvm-svn: 55624
2008-09-02 06:52:38 +00:00
Evan Cheng
9817be2f96 Change getBinaryCodeForInstr prototype. First operand MachineInstr& should be const. Make corresponding changes.
llvm-svn: 55623
2008-09-02 06:51:36 +00:00
Gabor Greif
632fa3a318 Provide two overloads of AnalyzeNewNode.
The first can update the SDNode in an SDValue
while the second is called with SDNode* and
returns a possibly updated SDNode*.

This patch has no intended functional impact,
but helps eliminating ugly temporary SDValues.

llvm-svn: 55608
2008-09-01 15:10:19 +00:00
Duncan Sands
efc82024e0 Even though no caller actually uses the new value
(what matters is that it is added to the worklist),
it seems more logical to return it.

llvm-svn: 55606
2008-09-01 13:11:13 +00:00
Duncan Sands
0338e9f60d Add a small pass that sets the readnone/readonly
attributes on functions, based on the result of
alias analysis.  It's not hardwired to use
GlobalsModRef even though this is the only (AFAIK)
alias analysis that results in this pass actually
doing something.  Enable as follows:
  opt ... -globalsmodref-aa -markmodref ...
Advantages of this pass: (1) records the result
of globalsmodref in the bitcode, meaning it is
available for use by later passes (currently
the pass manager isn't smart enough to magically
make an advanced alias analysis available to all
later passes), which may expose more optimization
opportunities; (2) hopefully speeds up compilation
when code is optimized twice, for example when a
file is compiled to bitcode, then later LTO is done
on it: marking functions readonly/readnone when
producing the initial bitcode should speed up alias
analysis during LTO; (3) good for discovering that
globalsmodref doesn't work very well :)
Not currently turned on by default.

llvm-svn: 55604
2008-09-01 11:40:11 +00:00
Evan Cheng
738426a2a1 Control flow instruction encodings.
llvm-svn: 55601
2008-09-01 08:25:56 +00:00
Evan Cheng
36170e63a3 ldm / stm instruction encodings.
llvm-svn: 55599
2008-09-01 07:48:18 +00:00
Evan Cheng
01019d7909 AXI2 and AXI3 instruction encodings.
llvm-svn: 55598
2008-09-01 07:34:13 +00:00
Evan Cheng
fdae49e627 Reorganize instruction formats again; AXI1 encoding.
llvm-svn: 55597
2008-09-01 07:19:00 +00:00
Evan Cheng
26305b192f addrmode3 instruction encodings.
llvm-svn: 55596
2008-09-01 07:00:14 +00:00
Evan Cheng
eb40cb3e42 Reorganize some instruction format definitions. No functionality change.
llvm-svn: 55594
2008-09-01 01:51:14 +00:00
Evan Cheng
fa095aec1e Rest of addrmode2 instruction encodings.
llvm-svn: 55593
2008-09-01 01:27:33 +00:00
Evan Cheng
4c8338c0d3 Addr2 word / byte load encodings.
llvm-svn: 55591
2008-08-31 19:02:21 +00:00
Evan Cheng
94f3d276c6 Addr1 instructions opcodes are encoded in bits 21-24; encode S bit.
llvm-svn: 55590
2008-08-31 18:32:16 +00:00
Gabor Greif
7db742d8c2 fix a bunch of 80-col violations
llvm-svn: 55588
2008-08-31 15:37:04 +00:00
Bill Wendling
297eb080b6 Revert the "XFAIL" for the rotate_ops.ll testcase. Instead, mark ISD::ROTR
instructions in CellSPU as "Expand" so that they won't be generated. I added a
"FIXME" so that this hack can be addressed and reverted once ISD::ROTR is
supported in the .td files.

llvm-svn: 55582
2008-08-31 02:59:23 +00:00
Bill Wendling
8faa2f3ec4 Expand for ROTR with MVT::i64.
Dale, Could you please review this?

llvm-svn: 55581
2008-08-31 02:53:19 +00:00
Bill Wendling
4a9ded80e2 Cosmetic changes to Machine LICM. No functionality change.
llvm-svn: 55578
2008-08-31 02:30:23 +00:00
Bill Wendling
3f918b3603 Another situation where ROTR is cheaper than ROTL.
llvm-svn: 55577
2008-08-31 01:13:31 +00:00
Bill Wendling
ef64d4333e For this pattern, ROTR is the cheaper option.
llvm-svn: 55576
2008-08-31 01:04:56 +00:00
Bill Wendling
08690f06b2 - Fix comment so that it describes how the code really works:
// fold (or (shl x, (*ext y)), (srl x, (*ext (sub 32, y)))) ->
   //   (rotl x, y)
   // fold (or (shl x, (*ext y)), (srl x, (*ext (sub 32, y)))) ->
   //   (rotr x, (sub 32, y))

Example: (x == 0xDEADBEEF and y == 4)

    (x << 4) | (x >> 28)
 => 0xEADBEEF0 | 0x0000000D
 => 0xEADBEEFD

    (rotl x, 4)
 => 0xEADBEEFD

    (rotr x, 28)
 => 0xEADBEEFD

- Fix comment and code for second version. It wasn't using the rot* propertly.

   // fold (or (shl x, (*ext (sub 32, y))), (srl x, (*ext r))) -> 
   //   (rotr x, y)
   // fold (or (shl x, (*ext (sub 32, y))), (srl x, (*ext r))) ->
   //   (rotl x, (sub 32, y))

    (x << 28) | (x >> 4)
 => 0xD0000000 | 0x0DEADBEE
 => 0xDDEADBEE

    (rotl x, 4)
 => 0xEADBEEFD

    (rotr x, 28)
 => (0xEADBEEFD)

llvm-svn: 55575
2008-08-31 00:37:27 +00:00
Gabor Greif
fa6e220233 typo
llvm-svn: 55574
2008-08-30 22:16:05 +00:00
Gabor Greif
2aef1d5e4c fix some 80-col violations
llvm-svn: 55571
2008-08-30 19:29:20 +00:00
Gordon Henriksen
3324b5c3ca PR2731: C and Ocaml bindings for setTailCall and isTailCall.
Based on patch by Giorgos Korfiatis.

llvm-svn: 55570
2008-08-30 16:34:54 +00:00
Gordon Henriksen
3a9a0e274b Fix ConstantExpr::getInsertElement.
Breakage was exposed in the Ocaml bindings tests after Chris
uncommented an assertion in r55084.

llvm-svn: 55566
2008-08-30 15:41:51 +00:00
Gabor Greif
8fa04b6eb0 fix some 80-col violations
llvm-svn: 55565
2008-08-30 10:09:02 +00:00
Evan Cheng
b40b710766 Re-apply 55467 with fix. If copy is being replaced by remat'ed def, transfer the implicit defs onto the remat'ed instruction.
llvm-svn: 55564
2008-08-30 09:09:33 +00:00
Evan Cheng
4cfcf9ca51 Fold isRematerializable checks into isSafeToReMat.
llvm-svn: 55563
2008-08-30 09:07:18 +00:00
Evan Cheng
c3c439a624 For now, can't mark XOR64rr isAsCheapAsAMove. It's technically correct. But various passes cannot handle remating these.
llvm-svn: 55562
2008-08-30 08:54:22 +00:00
Evan Cheng
4bc8c9652e Transform (x << (y&31)) -> (x << y). This takes advantage of the fact x86 shift instructions 2nd operand (shift count) is limited to 0 to 31 (or 63 in the x86-64 case).
llvm-svn: 55558
2008-08-30 02:03:58 +00:00
Owen Anderson
6c8f04643e Fix an issue where a use might be selected before a def, and then we didn't respect the pre-chosen vreg
assignment when selecting the def.  This is the naive solution to the problem: insert a copy to the pre-chosen
vreg.  Other solutions might be preferable, such as:
  1) Passing the dest reg into FastEmit_.  However, this would require the higher level code to know about reg classes, which they don't currently.
  2) Selecting blocks in reverse postorder.  This has some compile time cost for computing the order, and we'd need to measure its impact.

llvm-svn: 55555
2008-08-30 00:38:46 +00:00
Dale Johannesen
1cfbb25e75 Add ppc partial-word ATOMIC_CMP_SWAP.
llvm-svn: 55554
2008-08-30 00:08:53 +00:00
Evan Cheng
c1c53221c5 Swap fp comparison operands and change predicate to allow load folding (safely this time).
llvm-svn: 55553
2008-08-29 23:22:12 +00:00
Evan Cheng
a884330e08 Use static_cast instead of C style cast.
llvm-svn: 55552
2008-08-29 23:21:31 +00:00
Evan Cheng
9ee227f1df Fix 80 col. violations.
llvm-svn: 55551
2008-08-29 23:20:46 +00:00
Evan Cheng
2a3e05b519 Back out 55498. It broken Apple style bootstrapping.
llvm-svn: 55549
2008-08-29 22:21:44 +00:00
Evan Cheng
17382f9ffb Backing out 55521. Not safe.
llvm-svn: 55548
2008-08-29 22:13:21 +00:00
Dale Johannesen
bc977ce106 Add partial word version of ATOMIC_SWAP.
llvm-svn: 55546
2008-08-29 18:29:46 +00:00
Owen Anderson
3aa3841da2 Add initial support for fast isel of instructions that have inputs pinned to physical registers.
llvm-svn: 55545
2008-08-29 17:45:56 +00:00
Chris Lattner
a90998343b regenerate
llvm-svn: 55542
2008-08-29 17:20:18 +00:00
Chris Lattner
efbbbb0cde Asmprint nameless instructions as:
%4 = add ...

instead of:

add ...    ; 4

This makes opt -print-cfg output actually usable and makes .ll files
generally easier to read.  This fixes PR2480

llvm-svn: 55541
2008-08-29 17:19:30 +00:00
Chris Lattner
b23f7dae39 Add support for parsing .ll files that have numbers in front of
nameless values, such as:

%3 = add i32 4, 2

This fixes the first half of PR2480

llvm-svn: 55539
2008-08-29 17:12:13 +00:00
Evan Cheng
3fb02ae0b6 TableGen'ing instruction encodings.
llvm-svn: 55533
2008-08-29 07:42:03 +00:00
Evan Cheng
b38decd917 addrmode1 (data processing) instruction encoding: bits 5-6 are 0, bits 7-10 encode the opcode.
llvm-svn: 55531
2008-08-29 07:40:52 +00:00
Evan Cheng
5150e3da45 MVN is addrmode1.
llvm-svn: 55530
2008-08-29 07:36:24 +00:00
Evan Cheng
f90bc9a050 More refactoring.
llvm-svn: 55528
2008-08-29 06:41:12 +00:00
Evan Cheng
cdd06ba3f4 Swap fp comparison operands and change predicate to allow load folding.
llvm-svn: 55521
2008-08-28 23:48:31 +00:00
Evan Cheng
c50df85672 Refactor ARM instruction format definitions into a separate file. No functionality changes.
llvm-svn: 55518
2008-08-28 23:39:26 +00:00
Dan Gohman
c7b8401b77 Add a target callback for FastISel.
llvm-svn: 55512
2008-08-28 23:21:34 +00:00
Gabor Greif
5ec5f19852 remove tabs, fix > 80 cols
llvm-svn: 55511
2008-08-28 23:19:51 +00:00
Chris Lattner
673f4ce5f7 rename destroy -> releaseMemory to properly hook into passmgr.
llvm-svn: 55508
2008-08-28 22:56:53 +00:00
Nicolas Geoffray
05014c43fa Add support for JIT exceptions on Darwin. Since we're dealing with libgcc,
whose darwin code was written after the ability to dynamically register frames,
we need to do special hacks to make things work.

llvm-svn: 55507
2008-08-28 22:34:49 +00:00
Gabor Greif
86c795a8ca erect abstraction boundaries for accessing SDValue members, rename Val -> Node to reflect semantics
llvm-svn: 55504
2008-08-28 21:40:38 +00:00
Dan Gohman
481731693d Implement null and undef values for FastISel.
llvm-svn: 55500
2008-08-28 21:19:07 +00:00
Mon P Wang
7566974359 In lowering SELECT_CC, removed cases where we can't flip the true and false when the compare value has a NaN
llvm-svn: 55499
2008-08-28 21:04:05 +00:00
Dan Gohman
35a69c106a Optimize DAGCombiner's worklist processing. Previously it started
its work by putting all nodes in the worklist, requiring a big
dynamic allocation. Now, DAGCombiner just iterates over the AllNodes
list and maintains a worklist for nodes that are newly created or
need to be revisited. This allows the worklist to stay small in most
cases, so it can be a SmallVector.

This has the side effect of making DAGCombine not miss a folding
opportunity in alloca-align-rounding.ll.

llvm-svn: 55498
2008-08-28 21:01:56 +00:00
Dan Gohman
9a6f5b0bdd Move CaseBlock, JumpTable, and BitTestBlock to be members of
SelectionDAGLowering instead of being in an anonymous namespace.
This fixes warnings about SelectionDAGLowering having fields
using anonymous namespaces.

llvm-svn: 55497
2008-08-28 20:38:18 +00:00
Dan Gohman
f8e43fa400 Fix a FastISel bug where the instructions from lowering the arguments
were being emitted after the first instructions of the entry block.

llvm-svn: 55496
2008-08-28 20:28:56 +00:00
Rafael Espindola
1cd4fc3111 Use resize instead of reserve. Reserve doesn't change size().
llvm-svn: 55486
2008-08-28 18:32:53 +00:00
Rafael Espindola
31c516aabe Reduce the size of the Parts vector.
llvm-svn: 55483
2008-08-28 18:29:58 +00:00
Owen Anderson
675ace60a1 Hook up support for fast-isel of trunc instructions, using the newly working support for EXTRACT_SUBREG.
llvm-svn: 55482
2008-08-28 18:26:01 +00:00
Dale Johannesen
e9a1266213 Implement partial-word binary atomics on ppc.
llvm-svn: 55478
2008-08-28 17:53:09 +00:00
Owen Anderson
8c991b6f8a FastEmitInst_extractsubreg doesn't need to be passed the register class. It can get it from MachineRegisterInfo instead.
llvm-svn: 55476
2008-08-28 17:47:37 +00:00
Dan Gohman
8f4d612996 Revert r55467; it causes regressions in UnitTests/Vector/divides,
Benchmarks/sim/sim, and others on x86-64.

llvm-svn: 55475
2008-08-28 17:22:54 +00:00
Rafael Espindola
17b967216a Correctly resize the Parts array.
llvm-svn: 55471
2008-08-28 14:24:45 +00:00
Evan Cheng
28b0b18082 If a copy isn't coalesced, but its src is defined by trivial computation. Re-materialize the src to replace the copy.
llvm-svn: 55467
2008-08-28 07:53:51 +00:00
Evan Cheng
419506a149 FsFLD0S{S|D} and V_SETALLONES are as cheap as moves.
llvm-svn: 55466
2008-08-28 07:52:25 +00:00
Chris Lattner
bd43eec286 Make the verifier reject instructions which have null pointers
for operands: rdar://6179606.  no testcase, because I can't write
a .ll file that is this broken ;-)

llvm-svn: 55460
2008-08-28 04:02:44 +00:00
Chris Lattner
460b89cb3a Clear the intervals list in "destroy", patch by
Prakash Prabhu!

llvm-svn: 55458
2008-08-28 03:33:03 +00:00
Dale Johannesen
490c016734 Split the ATOMIC NodeType's to include the size, e.g.
ATOMIC_LOAD_ADD_{8,16,32,64} instead of ATOMIC_LOAD_ADD.
Increased the Hardcoded Constant OpActionsCapacity to match.
Large but boring; no functional change.

This is to support partial-word atomics on ppc; i8 is
not a valid type there, so by the time we get to lowering, the
ATOMIC_LOAD nodes looks the same whether the type was i8 or i32.
The information can be added to the AtomicSDNode, but that is the
largest SDNode; I don't fully understand the SDNode allocation,
but it is sensitive to the largest node size, so increasing
that must be bad.  This is the alternative.

llvm-svn: 55457
2008-08-28 02:44:49 +00:00
Dan Gohman
3a89011a01 Reorganize the lifetimes of the major objects SelectionDAGISel
works with.

SelectionDAG, FunctionLoweringInfo, and SelectionDAGLowering
objects now get created once per SelectionDAGISel instance, and
can be reused across blocks and across functions. Previously,
they were created and destroyed each time they were needed.

This reorganization simplifies the handling of PHI nodes, and
also SwitchCases, JumpTables, and BitTestBlocks. This
simplification has the side effect of fixing a bug in FastISel
where successor PHI nodes weren't being updated correctly.

This is also a step towards making the transition from FastISel
into and out of SelectionDAG faster, and also making
plain SelectionDAG faster on code with lots of little blocks.

llvm-svn: 55450
2008-08-27 23:52:12 +00:00
Owen Anderson
bb32ae5803 Add a helper method that will be used to support EXTRACT_SUBREG for selecting trunc's in fast-isel.
llvm-svn: 55439
2008-08-27 22:30:02 +00:00
Bill Wendling
0b5b31a0be Make "movdq2q" and "movq2dq" dependent upon having SSE2 because they use the
SSE2 registers as well as the MMX registers.

llvm-svn: 55436
2008-08-27 21:32:04 +00:00
Bill Wendling
84547c2a09 Put file scoped constants in an anonymous namespace. Use the "using namespace
llvm" for consistency.

llvm-svn: 55435
2008-08-27 21:10:13 +00:00
Evan Cheng
cf2cb4da82 Move the check whether it's worth remating to caller.
llvm-svn: 55434
2008-08-27 20:58:54 +00:00
Devang Patel
7abe1944ae Do not apply the transformation if the target does not support DestTy natively.
llvm-svn: 55433
2008-08-27 20:55:23 +00:00
Dan Gohman
9e928e0b1f Fix FastISel's bitcast code for the case where getRegForValue fails.
llvm-svn: 55431
2008-08-27 20:41:38 +00:00
Evan Cheng
dc202f4bba Refactor isSafeToReMat out of 2addr pass.
llvm-svn: 55430
2008-08-27 20:33:50 +00:00
Owen Anderson
0b1a8af290 Use TargetLowering to get the types in fast isel, which handles pointer types correctly for our purposes.
llvm-svn: 55428
2008-08-27 18:58:30 +00:00
Dan Gohman
b76e1ca974 Don't check TLI.getOperationAction. The FastISel way is to
just try to do the action and let the tablegen-generated code
determine if there is target-support for an operation.

llvm-svn: 55427
2008-08-27 18:15:05 +00:00
Dan Gohman
d5e34d9dce Add a new FastISel method, getRegForValue, which takes care of
the details of materializing constants and other values into
registers, and make use of it in several places.

llvm-svn: 55426
2008-08-27 18:10:19 +00:00
Dan Gohman
6174651396 Add a comment about the current floating-point constant code in FastISel.
llvm-svn: 55425
2008-08-27 18:01:42 +00:00
Devang Patel
23569e6a1f Fix typos and whitespaces. Other cosmetic changes based on feedback.
llvm-svn: 55424
2008-08-27 17:50:18 +00:00
Chris Lattner
551cf02a2d Minor cleanup.
llvm-svn: 55423
2008-08-27 17:36:58 +00:00
Dan Gohman
3976cccecd Reinstate the x86-64 portion of r55190. When doing extloads into
64-bit registers from 16-bit and smaller memory locations, prefer
instructions that define the entire 64-bit register, to avoid
partial-register updates.

llvm-svn: 55422
2008-08-27 17:33:15 +00:00
Dan Gohman
d9e0302919 Optimize ScheduleDAGRRList's topological sort to use one pass instead
of two, and to not need a scratch std::vector. Also, compute the ordering
immediately in the result array, instead of in another scratch std::vector
that is copied to the result array.

llvm-svn: 55421
2008-08-27 16:29:48 +00:00
Dan Gohman
db4286e6f7 Optimize ScheduleDAG's ComputeDepths and ComputeHeights to not need
a scratch std::vector.

llvm-svn: 55420
2008-08-27 16:27:25 +00:00
Dan Gohman
5189ab26fb Remove the std::ostream form of PseudoSourceValue's print,
which isn't needed anymore.

llvm-svn: 55419
2008-08-27 16:19:44 +00:00
Dan Gohman
be3a88eac3 Diagnose uses of unsized types with the byval attribute in the
verifier. See PR2711 for details.

llvm-svn: 55414
2008-08-27 14:48:06 +00:00
Dan Gohman
6d6043d2fc Update wording, as aggregates are now first-class.
llvm-svn: 55413
2008-08-27 14:44:57 +00:00