1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
Commit Graph

105 Commits

Author SHA1 Message Date
Eli Friedman
ff61032fa0 Documentation clarifications for isSafeToSpeculativelyExecute.
llvm-svn: 76168
2009-07-17 08:38:29 +00:00
Eli Friedman
b56b3ca224 Replace isTrapping with a new, similar method called
isSafeToSpeculativelyExecute. The new method is a bit closer to what 
the callers actually care about in that it rejects more things callers 
don't want.  It also adds more precise handling for integer 
division, and unifies code for analyzing the legality of a speculative 
load.

llvm-svn: 76150
2009-07-17 04:28:42 +00:00
Owen Anderson
49226b1075 This started as a small change, I swear. Unfortunately, lots of things call the [I|F]CmpInst constructors. Who knew!?
llvm-svn: 75200
2009-07-09 23:48:35 +00:00
Duncan Sands
880eaf5278 Allow readonly functions to unwind exceptions. Teach
the optimizers about this.  For example, a readonly
function with no uses cannot be removed unless it is
also marked nounwind.

llvm-svn: 71071
2009-05-06 06:49:50 +00:00
Misha Brukman
78da0fbc46 Updated the comment for isArithmeticShift() to match reality.
llvm-svn: 68016
2009-03-29 20:41:38 +00:00
Chris Lattner
9dc97aa7bf Replace the PointerLikeTypeTraits::getNumLowBitsAvailable
function with a new NumLowBitsAvailable enum, which makes the
value available as an integer constant expression.

Add PointerLikeTypeTraits specializations for Instruction* and
Use** since they are only guaranteed 4-byte aligned.

Enhance PointerIntPair to know about (and enforce) the alignment
specified by PointerLikeTypeTraits.  This should allow things 
like PointerIntPair<PointerIntPair<void*, 1,bool>, 1, bool> 
because the inner one knows that 2 low bits are free.

llvm-svn: 67979
2009-03-29 04:32:37 +00:00
Chris Lattner
70d79bbe85 add a new insertAfter method, patch by Tom Jablin!
llvm-svn: 62158
2009-01-13 07:43:51 +00:00
Chris Lattner
dd755c74d6 improve const correctness.
llvm-svn: 60168
2008-11-27 08:39:18 +00:00
Dan Gohman
0c160fbe89 Correct the name of isTrapping in comments.
llvm-svn: 57606
2008-10-15 22:56:21 +00:00
Chris Lattner
fe3155fc62 Switch the asmprinter (.ll) and all the stuff it requires over to
use raw_ostream instead of std::ostream.  Among other goodness,
this speeds up llvm-dis of kc++ with a release build from 0.85s
to 0.49s (88% faster).

Other interesting changes:
 1) This makes Value::print be non-virtual.
 2) AP[S]Int and ConstantRange can no longer print to ostream directly, 
    use raw_ostream instead.
 3) This fixes a bug in raw_os_ostream where it didn't flush itself 
    when destroyed.
 4) This adds a new SDNode::print method, instead of only allowing "dump".


A lot of APIs have both std::ostream and raw_ostream versions, it would
be useful to go through and systematically anihilate the std::ostream 
versions.

This passes dejagnu, but there may be minor fallout, plz let me know if
so and I'll fix it.

llvm-svn: 55263
2008-08-23 22:23:09 +00:00
Dan Gohman
9653b21dc2 Fold the useful features of alist and alist_node into ilist, and
a new ilist_node class, and remove them. Unlike alist_node,
ilist_node doesn't attempt to manage storage itself, so it avoids
the associated problems, including being opaque in gdb.

Adjust the Recycler class so that it doesn't depend on alist_node.
Also, change it to use explicit Size and Align parameters, allowing
it to work when the largest-sized node doesn't have the greatest
alignment requirement.

Change MachineInstr's MachineMemOperand list from a pool-backed
alist to a std::list for now.

llvm-svn: 54146
2008-07-28 21:51:04 +00:00
Owen Anderson
79605db969 Add an insertBefore method for attaching previously unattached instructions,
such as those created by clone(), to a basic block.

llvm-svn: 52424
2008-06-17 18:29:27 +00:00
Gabor Greif
49bf1a4cf6 merge of use-diet branch to trunk
llvm-svn: 50943
2008-05-10 08:32:32 +00:00
Chris Lattner
3c362081d5 add a new Instruction::mayReadFromMemory predicate, make
Instruction::mayWriteToMemory stronger for invokes.

llvm-svn: 50858
2008-05-08 17:16:51 +00:00
Chris Lattner
368e2b28bf add a handy helper method to instruction, useful for determining
whether it is used outside of some block.  This can be used to see
if there are any non-local references, for example.

llvm-svn: 50004
2008-04-20 22:11:30 +00:00
Dan Gohman
0586403622 Add const qualifiers.
llvm-svn: 49443
2008-04-09 18:31:41 +00:00
Chris Lattner
e0b1ee937a Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)

llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Chris Lattner
f6fc9924a4 split isBinaryOp into a static and member version.
llvm-svn: 44814
2007-12-10 22:18:53 +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
Gordon Henriksen
a18a78e6e5 Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!
llvm-svn: 44747
2007-12-09 22:46:10 +00:00
Chris Lattner
917d8832a1 Instruction:: Next/Prev accessors are now private
llvm-svn: 36204
2007-04-17 18:03:55 +00:00
Chris Lattner
71a21677f4 Refactor SymbolTableListTraits to only have a single pointer in it, instead
of two.  This shrinkifies Function by 8 bytes (104->96) and Module by 8
bytes (68->60).  On a testcase of mine, this reduces the memory used to
read a module header from 565680b to 561024, a little over 4K.

llvm-svn: 36188
2007-04-17 03:26:42 +00:00
Dan Gohman
2d4b1767ab Rename Value::getValueType to getValueID, to avoid confusion with
other things named getValueType.

llvm-svn: 35964
2007-04-13 18:12:09 +00:00
Chris Lattner
0eb72353e4 Refactor the setName stuff, moving it down the inheritance hierarchy, to
solve a crash in -instcombine -debug that was hit while investigating PR1217

llvm-svn: 34544
2007-02-24 00:55:48 +00:00
Chris Lattner
134ae17654 make mayWriteToMemory a non-virtual function
llvm-svn: 34334
2007-02-15 23:15:00 +00:00
Chris Lattner
4534d3fc6e Switch UnaryOperators to default to passing names up by const char* when possible.
This speeds up bcreading by 1.5%.

llvm-svn: 34233
2007-02-13 07:54:42 +00:00
Reid Spencer
591bfa1e0b Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types.  This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
   shl i32 %X, 1
instead of
   shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.

llvm-svn: 33776
2007-02-02 02:16:23 +00:00
Chris Lattner
29a821859e Now that setcondinst has been eliminated, we can mark Value::SubclassID
const and remove the ugly mutator methods.

llvm-svn: 32860
2007-01-04 02:15:37 +00:00
Reid Spencer
4428c3483b For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.

llvm-svn: 32751
2006-12-23 06:05:41 +00:00
Bill Wendling
7f6a73eb5c Added an automatic cast to "std::ostream*" etc. from OStream. We then can
rework the hacks that had us passing OStream in. We pass in std::ostream*
instead, check for null, and then dispatch to the correct print() method.

llvm-svn: 32636
2006-12-17 05:15:13 +00:00
Reid Spencer
992d9788b3 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.

llvm-svn: 31931
2006-11-27 01:05:10 +00:00
Chris Lattner
1ab553b24d Override use_back in instruction/basicblock to provide more type information.
llvm-svn: 30678
2006-09-30 22:20:34 +00:00
Chris Lattner
8aa718b0ed Add new SetCondInst::isRelational/isEquality methods. Rename
Instruction::isRelational to Instruction::isComparison.

llvm-svn: 30444
2006-09-17 19:14:47 +00:00
Chris Lattner
a396e6d9ba Add some out-of-line virtual dtors so that the class has a "home", preventing
vtables for (e.g.) Instruction from being emitted into every .o file.

llvm-svn: 28898
2006-06-21 16:53:47 +00:00
Chris Lattner
adef4bbf27 This method doesn't need to be virtual, thanks to Reid for pointing this out.
llvm-svn: 28206
2006-05-09 17:29:17 +00:00
Jeff Cohen
19d804b6d6 Fix VC++ level 4 warnings. Because a base class has declared these private, VC++ complains it cannot automatically generate this methods.
llvm-svn: 24751
2005-12-17 00:19:22 +00:00
Chris Lattner
6d5166d861 Remove some dead argument names which irritates GCC at certain warning levels.
llvm-svn: 23979
2005-10-25 17:59:28 +00:00
Chris Lattner
cb28e2f105 add a new helper method
llvm-svn: 22697
2005-08-08 05:21:33 +00:00
Misha Brukman
3f0aa3dbf8 Remove trailing whitespace
llvm-svn: 21408
2005-04-21 20:19:05 +00:00
Chris Lattner
1b4201e69f Fix problems compiling with G++ 4.x.x with -pedantic. Thanks to
Vladimir Merzliakov for the patch!

llvm-svn: 20513
2005-03-07 20:35:45 +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
93642ede7d Remove the second argument to Value::setName, it is never needed.
llvm-svn: 20457
2005-03-05 18:59:36 +00:00
Chris Lattner
d8266ae3dd Adjust to changes in the User class.
llvm-svn: 19888
2005-01-29 00:33:00 +00:00
Chris Lattner
e561ef0261 Add method
llvm-svn: 18368
2004-11-30 02:51:53 +00:00
Chris Lattner
70197d8f29 Add long overdue methods
llvm-svn: 16921
2004-10-11 22:21:13 +00:00
Chris Lattner
78e3b3650e Now that the SparcV9 specific MachineCodeForInstruction class uses it's own
map on the side, Instruction no longer has to be Annotable.  This reduces
the size of the Instruction class by another 4 bytes (on a 32-bit system).

llvm-svn: 14439
2004-06-27 18:57:34 +00:00
Chris Lattner
dd7c37af2e Eliminate the Instruction::iType field, folding it into the Value::VTy field.
This reduces the size of the instruction class by 4 bytes, and means that
isa<CallInst>(V) (for example) only needs to do one load from memory instead
of two.

llvm-svn: 14434
2004-06-27 18:38:24 +00:00
Chris Lattner
b6833e4a48 Consider anything with a ValueType that is >= Instruction to be an instruction
llvm-svn: 14429
2004-06-26 20:51:50 +00:00
Reid Spencer
7172b26a18 Revert an unneeded interface change to Instruction.h
llvm-svn: 14137
2004-06-11 03:06:43 +00:00
Reid Spencer
aa6ccbcdee Added an isPhiNode(unsigned) static method to determine if an opcode is
a PhiNode or not. Needed by Bytecode Analyzer.

llvm-svn: 14124
2004-06-10 22:27:10 +00:00