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

24638 Commits

Author SHA1 Message Date
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