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

38091 Commits

Author SHA1 Message Date
Anton Korobeynikov
f688e4a53e Honour ByVal parameter attribute in llvm2cpp
llvm-svn: 48941
2008-03-29 11:15:01 +00:00
Chris Lattner
10e3ff7e5f change iterator invalidation avoidance to just move the iterator backward
when something changes, instead of moving forward.  This allows us to 
simplify memset lowering, inserting the memset at the end of the range of 
stuff we're touching instead of at the start.

This, in turn, allows us to make use of the addressing instructions already
used in the function instead of inserting our own.  For example, we now
codegen:

	%tmp41 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 0		; <i8*> [#uses=2]
	call void @llvm.memset.i64( i8* %tmp41, i8 -1, i64 8, i32 1 )

instead of:

	%tmp20 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 7		; <i8*> [#uses=1]
	%ptroffset = getelementptr i8* %tmp20, i64 -7		; <i8*> [#uses=1]
	call void @llvm.memset.i64( i8* %ptroffset, i8 -1, i64 8, i32 1 )

llvm-svn: 48940
2008-03-29 05:15:47 +00:00
Chris Lattner
48b3859ee9 make the common case of a single store (which clearly shouldn't be turned
into a memset!) faster by avoiding an allocation of an std::list node.

llvm-svn: 48939
2008-03-29 04:52:12 +00:00
Chris Lattner
12cecbbb25 add a testcase for forming memset from noncontiguous stores.
llvm-svn: 48938
2008-03-29 04:51:35 +00:00
Chris Lattner
722c9a539f give form-memset a significantly more sane heuristic, enable it by default.
llvm-svn: 48937
2008-03-29 04:36:18 +00:00
Owen Anderson
7d815aea28 Remove some unneeded code for LiveInterval joining, and fix a bug in the Phi elimination algorithm where we were accidentally reasoning about
the source rather than the destination.

llvm-svn: 48936
2008-03-29 01:58:47 +00:00
Evan Cheng
4d86275d23 Cosmetic change.
llvm-svn: 48935
2008-03-29 01:04:05 +00:00
Dan Gohman
227e702cae Fix a tokenfactor node to use the load chain rather than the
load value. This fixes PR2177.

llvm-svn: 48932
2008-03-28 23:45:16 +00:00
Evan Cheng
10d0aba260 Backing out 48911 for now. It's breaking stuff.
llvm-svn: 48922
2008-03-28 17:49:06 +00:00
Chris Lattner
90bd039074 ifdef out a dead function. Should this be removed?
llvm-svn: 48916
2008-03-28 15:36:27 +00:00
Duncan Sands
80f14df923 Rename getAnyLoad to getLoad is suggested by Evan.
llvm-svn: 48914
2008-03-28 09:45:24 +00:00
Evan Cheng
3b54c5fa08 New entry.
llvm-svn: 48912
2008-03-28 07:07:06 +00:00
Evan Cheng
d66e48366f Load from stub is already re-materializable.
llvm-svn: 48911
2008-03-28 06:49:25 +00:00
Nick Lewycky
96038a0528 Update example to new syntax.
llvm-svn: 48910
2008-03-28 06:46:51 +00:00
Chris Lattner
0a18724a00 make memset inference significantly more powerful: it can now handle
memsets that initialize "structs of arrays" and other store sequences
that are not sequential.  This is still only enabled if you pass 
-form-memset-from-stores.  The flag is not heavily tested and I haven't
analyzed the perf regressions when -form-memset-from-stores is passed
either, but this causes no make check regressions.

llvm-svn: 48909
2008-03-28 06:45:13 +00:00
Evan Cheng
69a8741b60 New entry.
llvm-svn: 48908
2008-03-28 06:34:23 +00:00
Bill Wendling
6d6d654acf Simplify the conversion from "0x" numbers to a single digit number.
llvm-svn: 48907
2008-03-28 06:22:23 +00:00
Duncan Sands
3d613421f1 Implement LegalizeTypes support for softfloat LOAD.
In order to handle indexed nodes I had to introduce
a new constructor, and since I was there I factorized
the code in the various load constructors.

llvm-svn: 48894
2008-03-27 20:23:40 +00:00
Dan Gohman
199ab29337 Avoid creating chain dependencies from CopyToReg nodes to load and store
nodes. This doesn't currently have much impact the generated code, but it
does produce simpler-looking SelectionDAGs, and consequently
simpler-looking ScheduleDAGs, because there are fewer spurious
dependencies.

In particular, CopyValueToVirtualRegister now uses the entry node as the
input chain dependency for new CopyToReg nodes instead of calling getRoot
and depending on the most recent memory reference.

Also, rename UnorderedChains to PendingExports and pull it up from being
a local variable in SelectionDAGISel::BuildSelectionDAG to being a
member variable of SelectionDAGISel, so that it doesn't have to be
passed around to all the places that need it.

llvm-svn: 48893
2008-03-27 19:56:19 +00:00
Devang Patel
85770c83ba PHI->removeIncomingValue may remove PHInode.
Increment iterator in advance.

llvm-svn: 48890
2008-03-27 17:32:46 +00:00
Devang Patel
0951d2a8d3 add another testcase
llvm-svn: 48881
2008-03-27 17:13:55 +00:00
Mikhail Glushenkov
f3c45cf9d1 Fix build breakage on Windows with GCC 4.3. References bug #2176.
llvm-svn: 48874
2008-03-27 09:53:47 +00:00
Roman Levenstein
00030f1b38 Fix spelling. Thanks, Duncan! :-)
llvm-svn: 48873
2008-03-27 09:44:37 +00:00
Roman Levenstein
34552e20b3 Speed-up the SumOfUnscheduledPredsOfSuccs by introducing a new function
called LimitedSumOfUnscheduledPredsOfSuccs. It terminates the computation
after a given treshold is reached. This new function is always faster, but
brings real wins only on bigger test-cases.

The old function SumOfUnscheduledPredsOfSuccs is left in-place for now and therefore a warning about an unused static function is produced.

llvm-svn: 48872
2008-03-27 09:14:57 +00:00
Erick Tryzelaar
5fcf593c21 Adding the first two chapters of the ocaml/kaleidoscope tutorial.
llvm-svn: 48871
2008-03-27 08:18:07 +00:00
Chris Lattner
7f9e824685 when a node is removed from an ilist, set its next/prev pointers to
null.  This means that uses of invalidated iterators will explode violently
with:
ilist:143: failed assertion `NodePtr && "++'d off the end of an ilist!"'

instead of happening to work "most of the time".

llvm-svn: 48859
2008-03-27 02:43:03 +00:00
Devang Patel
a04c63181f New test case.
llvm-svn: 48858
2008-03-27 01:51:31 +00:00
Evan Cheng
e66720fd57 Code clean up.
llvm-svn: 48856
2008-03-27 01:45:11 +00:00
Evan Cheng
aca67f0b29 Allow certain lea instructions to be rematerialized.
llvm-svn: 48855
2008-03-27 01:41:09 +00:00
Evan Cheng
1afaf3092f Remove an unused command line option.
llvm-svn: 48854
2008-03-27 01:30:24 +00:00
Evan Cheng
6cbce6b602 Fix a memory bug: increment an iterator of a deleted machine instr.
llvm-svn: 48853
2008-03-27 01:27:25 +00:00
Erick Tryzelaar
0efea4df76 Expose ExecutionEngine::getTargetData() to c and ocaml bindings.
llvm-svn: 48851
2008-03-27 00:27:14 +00:00
Chuck Rose III
76d6e4baff Updating win32 VStudio project files with new file references and removing dead references.
llvm-svn: 48849
2008-03-27 00:02:53 +00:00
Dale Johannesen
4524d3a1d1 Fix a bug in Darwin EH: FDE->CIE pointer must
be relocatable.  Describe why .set is needed better.

llvm-svn: 48848
2008-03-26 23:31:39 +00:00
Mikhail Glushenkov
ee0874a62e Another test commit (with git-svn)
llvm-svn: 48843
2008-03-26 21:37:43 +00:00
Mikhail Glushenkov
f7e7761c32 Test commit
llvm-svn: 48840
2008-03-26 21:18:58 +00:00
Evan Cheng
6fc37c8f25 One more coalescer fix wrt deadness propagation.
llvm-svn: 48837
2008-03-26 20:15:49 +00:00
Evan Cheng
8d222d6221 Avoid commuting a def MI in order to coalesce a copy instruction away if any use of the same val# is a copy instruction that has already been coalesced.
llvm-svn: 48833
2008-03-26 19:03:01 +00:00
Roman Levenstein
55b8822511 Use a linked data structure for the uses lists of an SDNode, just like
LLVM Value/Use does and MachineRegisterInfo/MachineOperand does.
This allows constant time for all uses list maintenance operations.

The idea was suggested by Chris. Reviewed by Evan and Dan.
Patch is tested and approved by Dan.

On normal use-cases compilation speed is not affected. On very big basic
blocks there are compilation speedups in the range of 15-20% or even better. 

llvm-svn: 48822
2008-03-26 12:39:26 +00:00
Roman Levenstein
dc2d45564d Fixed some spelling errors. Thanks, Duncan!
llvm-svn: 48819
2008-03-26 11:23:38 +00:00
Roman Levenstein
febd10df58 Some improvements related to the computation of isReachable.
This fixes Bugzilla #1835 (http://llvm.org/bugs/show_bug.cgi?id=1835).
This patched is reviewed by Tanya and Dan. Dan tested and approved it.

The reason for the bad performance of the old algorithm is that it is very naive and scans every
time all nodes of the DAG in the worst case.

This patch introduces  a new algorithm based on the paper "Online algorithms
for maintaining the topological order of a directed acyclic graph" by
David J.Pearce and Paul H.J.Kelly. This is the MNR algorithm. It has a
linear time worst-case and performs much better in most situations.

The paper can be found here:
http://fano.ics.uci.edu/cites/Document/Online-algorithms-for-maintaining-the-topological-order-of-a-directed-acyclic-graph.html

The main idea of the new algorithm is to compute the topological ordering of the SNodes in the
DAG and to maintain it even after DAG modifications. The topological ordering allows for very fast 
node reachability checks. 

Tests on very big  input files with tens of thousands of instructions in a BB indicate huge 
speed-ups (up to 10x compilation time improvement) compared to the old version.

llvm-svn: 48817
2008-03-26 09:18:09 +00:00
Evan Cheng
6323ea8467 Fix some SSE4.1 instruction encoding bugs.
llvm-svn: 48815
2008-03-26 08:11:49 +00:00
Owen Anderson
0fa6dd147f Dead PHI instructions need to be handled specially.
llvm-svn: 48811
2008-03-26 03:03:23 +00:00
Erick Tryzelaar
0b9ba7c168 Test commit (removed trailing whitespace)
llvm-svn: 48809
2008-03-26 00:38:56 +00:00
Dale Johannesen
8c1e95810f Use ## for comment delimiter on darwin x86-32, so
llvm's output .s files will go through gcc -std=c99
without triggering preprocesser errors.  Approach
suggested by Daveed Vandevoorde.

llvm-svn: 48808
2008-03-25 23:29:30 +00:00
Evan Cheng
6226a78cb1 Smaller function alignment when optimizing for size.
llvm-svn: 48805
2008-03-25 22:29:46 +00:00
Evan Cheng
6ee0633a42 Rename option -optimizefor-size to -optimize-size.
llvm-svn: 48804
2008-03-25 22:28:39 +00:00
Owen Anderson
bf0ddb6156 Remove some debugging code.
llvm-svn: 48803
2008-03-25 22:26:43 +00:00
Owen Anderson
8edda0e5c0 StrongPHIElimination doesn't support swapping live intervals like the coalescer does.
llvm-svn: 48802
2008-03-25 22:25:27 +00:00
Dan Gohman
2b96ce84aa Add explicit keywords.
llvm-svn: 48801
2008-03-25 22:06:05 +00:00