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

101 Commits

Author SHA1 Message Date
Duncan Sands
f7fb4d197c Make stripPointerCasts and getUnderlyingObject
non-recursive.

llvm-svn: 61479
2008-12-29 21:06:19 +00:00
Chris Lattner
0be74c4208 These messages should always be emitted when NDEBUG is unset, not when
NDEBUG is unset and -debug is passed.

llvm-svn: 60986
2008-12-13 18:37:58 +00:00
Chris Lattner
2f766df51f Comment typeo fix, thanks Duncan!
llvm-svn: 60429
2008-12-02 18:33:11 +00:00
Chris Lattner
90d1a3c343 add a little helper function that does PHI translation.
llvm-svn: 60405
2008-12-02 07:16:45 +00:00
Duncan Sands
88d8323743 Factorize code: remove variants of "strip off
pointer bitcasts and GEP's", and centralize the
logic in Value::getUnderlyingObject.  The
difference with stripPointerCasts is that
stripPointerCasts only strips GEPs if all
indices are zero, while getUnderlyingObject
strips GEPs no matter what the indices are.

llvm-svn: 56922
2008-10-01 15:25:41 +00:00
Bill Wendling
8b4fecfb09 Make pointer parameter const for isUsedInBasicBlock.
llvm-svn: 56625
2008-09-25 22:42:01 +00:00
Gabor Greif
984ba5a313 backing out my last commit, it was not intended to go on the trunk
llvm-svn: 56349
2008-09-19 15:13:20 +00:00
Gabor Greif
67fa076542 first shot at removing Use::Val
untested, Use::swap() is definitely not done yet

llvm-svn: 56348
2008-09-19 15:03:57 +00:00
Evan Cheng
e91c8c4508 Rename instance variables, parameter argument names to eliminate a bunch of compilation warnings with -Wshadow.
llvm-svn: 53970
2008-07-24 00:08:56 +00:00
Chris Lattner
96b3955e9b fix some warnings when assertions are disabled.
llvm-svn: 52587
2008-06-21 19:47:03 +00:00
Evan Cheng
5897328890 Do not speculatively execute an instruction by hoisting it to its predecessor BB if any of its operands are defined but not used in BB. The transformation will prevent the operand from being sunk into the use block.
llvm-svn: 52244
2008-06-12 21:15:59 +00:00
Nate Begeman
253fc69ff3 Move the operator new and operator delete out of line. This fixes an issue with
operator new() referring to the static initTags function, which has to be in the 
same linkage unit as any file including User.h.

llvm-svn: 51136
2008-05-15 01:23:11 +00:00
Anton Korobeynikov
ddb93e7a02 Turn StripPointerCast() into a method
llvm-svn: 50836
2008-05-07 22:54:15 +00:00
Anton Korobeynikov
90ee6d6616 Make StripPointerCast a common function (should we mak it method of Value instead?)
llvm-svn: 50775
2008-05-06 22:52:30 +00:00
Chris Lattner
757d7d318a fix a bug in my previous patch, a classic =/== bug.
llvm-svn: 50483
2008-04-30 15:27:09 +00:00
Chris Lattner
710d05695f add a method for comparing to see if a value has a specified name.
llvm-svn: 50465
2008-04-30 03:55:40 +00:00
Nick Lewycky
c0b361a17c Print the name, not a pointer.
llvm-svn: 47796
2008-03-01 17:20:55 +00:00
Devang Patel
e60ebc7744 Let invoke return aggregate value.
llvm-svn: 47425
2008-02-21 02:14:01 +00:00
Devang Patel
702c4a60a6 Let function call return aggregate.
Now, we have very first multiple return value testcase!

llvm-svn: 47424
2008-02-21 01:54:02 +00:00
Anton Korobeynikov
0c5e186924 Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings.
llvm-svn: 47367
2008-02-20 11:08:44 +00:00
Chris Lattner
ad9a6ccb83 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Gordon Henriksen
8430f1ff9a Reverting dtor devirtualization patch.
_sabre_: it has a major problem: by the time ~Value is run, all of the "parts" of the derived classes have been destroyed
_sabre_: the vtable lives to fight another day

llvm-svn: 44760
2007-12-10 02:14:30 +00:00
Chris Lattner
11bc69b3c8 fix some warnings.
llvm-svn: 44756
2007-12-10 01:51:22 +00:00
Chris Lattner
3d939a50a5 Fix a big problem in the recent dtor refactoring work, now it passes 2007-11-19-InlineAsm.ll
llvm-svn: 44755
2007-12-10 01:48:29 +00:00
Gordon Henriksen
a18a78e6e5 Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!
llvm-svn: 44747
2007-12-09 22:46:10 +00:00
Dan Gohman
30ba45b569 Use empty() member functions when that's what's being tested for instead
of comparing begin() and end().

llvm-svn: 42585
2007-10-03 19:26:29 +00:00
Chris Lattner
14442c9a4d Make Value::getNameLen not crash on an empty name, fixing PR1712.
llvm-svn: 42444
2007-09-28 20:09:40 +00:00
Chris Lattner
07ac73b539 simplify code, improve a comment.
llvm-svn: 41205
2007-08-21 00:21:07 +00:00
Chris Lattner
de900e3b6c add Value::getNameStart/getNameLen() accessors.
llvm-svn: 40989
2007-08-10 15:34:35 +00:00
Chris Lattner
6dbed4d4ca Fix a nasty memory leak, caused by my revamp of the value symbol table.
llvm-svn: 35195
2007-03-20 00:18:10 +00:00
Jeff Cohen
98c99a3a02 Unbreak VC++ build.
llvm-svn: 34917
2007-03-05 00:00:42 +00:00
Chris Lattner
9084bb5471 rewrite Value::takeName to take advantage of the new symtab stuff. This
causes it to require no allocations and no symtab lookups in the common
case.  This speeds up instcombine 9.2% on 447.dealII.

llvm-svn: 34324
2007-02-15 20:01:43 +00:00
Chris Lattner
fbd6928545 Add a new Value::getNameStr method, which is preferred over getName.
llvm-svn: 34310
2007-02-15 18:53:54 +00:00
Chris Lattner
cc543b031e add a setName variant that takes a null-terminated string. This can be
used to avoid std::string allocations in common cases.

llvm-svn: 34232
2007-02-13 07:53:34 +00:00
Chris Lattner
a48bf1bdbf Add new setName accessor which doesn't require creating a string.
llvm-svn: 34197
2007-02-12 18:52:59 +00:00
Chris Lattner
5a58a65c10 Switch ValueSymbolTable to use StringMap<Value*> instead of std::map<std::string, Value*>
as its main datastructure.  There are many improvements yet to be made, but
this speeds up opt --std-compile-opts on 447.dealII by 7.3%.

llvm-svn: 34193
2007-02-12 05:18:08 +00:00
Chris Lattner
676ffe699d fix uninitialized variable
llvm-svn: 34182
2007-02-11 19:12:18 +00:00
Chris Lattner
50ea7bc913 add an optimization for the case where the src has no name
llvm-svn: 34174
2007-02-11 01:04:09 +00:00
Chris Lattner
e8dd3c90f1 add a helper method: Value::takeName
llvm-svn: 34171
2007-02-11 00:37:27 +00:00
Chris Lattner
a1455127ae eliminate ValueSymbolTable::rename, it has no advantage over using remove+insert.
Make insert/remove assert if used incorrectly instead of returning a bool.

llvm-svn: 33988
2007-02-07 06:13:49 +00:00
Reid Spencer
6af21b3029 For PR411:
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.

llvm-svn: 33918
2007-02-05 20:47:22 +00:00
Reid Spencer
cdaf88ff9d For PR411:
Take an incremental step towards type plane elimination. This change
separates types from values in the symbol tables by finally making use
of the TypeSymbolTable class. This yields more natural interfaces for
dealing with types and unclutters the SymbolTable class.

llvm-svn: 32956
2007-01-06 07:24:44 +00:00
Bill Wendling
1838be30c7 Removed iostream #includes. Replaced std::cerr with DOUT.
llvm-svn: 31814
2006-11-17 08:03:48 +00:00
Chris Lattner
e2a54ddd33 Change the signature of replaceUsesOfWithOnConstant. The bool was always
true dynamically.  Finally, pass the Use* that replaceAllUsesWith has into
the method for future use.

llvm-svn: 23626
2005-10-04 18:13:04 +00:00
Misha Brukman
53e199440e Remove trailing whitespace
llvm-svn: 21427
2005-04-21 23:48:37 +00:00
Chris Lattner
ffa96dc848 This fixes PR531, a crash when running the CBE on a bytecode file.
The problem is that Function::renameLocalSymbols is iterating through
the symbol table planes, occasionally calling setName to rename a value
(which used to do a symbol table remove/insert pair).

The problem is that if there is only a single value in a particular type
plane that the remove will nuke the symbol table plane, and the insert
will create and insert a new one.  This hoses Function::renameLocalSymbols
because it has an iterator to the old plane, under the (very reasonable)
assumption that simply renaming a value won't cause the type plane to
disappear.

This patch fixes the bug by making the rename operation a single atomic
operation, which has a side effect of making the whole thing faster too. :)

llvm-svn: 20469
2005-03-06 02:14:28 +00:00
Chris Lattner
b177010d51 remove all of the various setName implementations, consolidating them into
Value::setName, which is no longer virtual.

llvm-svn: 20464
2005-03-05 19:51:50 +00:00
Chris Lattner
a91c25c69b new method
llvm-svn: 20288
2005-02-23 16:51:11 +00:00
Chris Lattner
d73939a8ed Initialize new field.
llvm-svn: 20044
2005-02-05 01:37:58 +00:00
Chris Lattner
839b0ef616 Updates for new use list changes.
llvm-svn: 19961
2005-02-01 01:24:21 +00:00