1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
Commit Graph

111 Commits

Author SHA1 Message Date
Erick Tryzelaar
7adf1fa7ad A couple IRBuilder functions were still using getGlobalContext().
llvm-svn: 78997
2009-08-14 06:12:30 +00:00
Owen Anderson
c78a800e7e Add helpers for fetching basic types.
llvm-svn: 78969
2009-08-14 00:30:41 +00:00
Owen Anderson
9df206d02d Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Dan Gohman
9a6b2f19e5 Remove a bunch more now-unnecessary Context arguments.
llvm-svn: 78809
2009-08-12 16:23:25 +00:00
Dan Gohman
b0c54f532c Add convenience functions for creating nsw add operators.
llvm-svn: 78707
2009-08-11 20:20:39 +00:00
Dan Gohman
aed57ee5b0 Add convenience functions for creating inbounds GEPs.
llvm-svn: 78695
2009-08-11 17:57:01 +00:00
Dan Gohman
cf73a006f0 Use isa instead of dyn_cast when the result is only converted to bool.
llvm-svn: 78685
2009-08-11 17:20:16 +00:00
Dan Gohman
82b3823bb7 Add convenience functions for creating exact sdiv operators, and
use them in CreatePtrDiff.

llvm-svn: 78682
2009-08-11 17:05:24 +00:00
Dan Gohman
0c6e8e18aa Add an explicit keyword.
llvm-svn: 78675
2009-08-11 15:57:42 +00:00
Owen Anderson
1dc40e205b Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.

llvm-svn: 77721
2009-07-31 20:28:14 +00:00
Owen Anderson
93ccaf5c60 Move more code back to 2.5 APIs.
llvm-svn: 77635
2009-07-30 23:03:37 +00:00
Owen Anderson
0ce2151b36 Move ConstantExpr to 2.5 API.
llvm-svn: 77494
2009-07-29 18:55:55 +00:00
Owen Anderson
aa8c94b051 Change ConstantArray to 2.5 API.
llvm-svn: 77347
2009-07-28 18:32:17 +00:00
Eric Christopher
df9c86fc26 Move ExtractElementInst to ::Create instead of new. Update all uses.
llvm-svn: 77044
2009-07-25 02:28:41 +00:00
Owen Anderson
cc33e89571 Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.
llvm-svn: 77011
2009-07-24 23:12:02 +00:00
Owen Anderson
cc287b28c9 Get rid of the Pass+Context magic.
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Owen Anderson
4483fbda5e Revert yesterday's change by removing the LLVMContext parameter to AllocaInst and MallocInst.
llvm-svn: 75863
2009-07-15 23:53:25 +00:00
Owen Anderson
8c85061ee6 Move EVER MORE stuff over to LLVMContext.
llvm-svn: 75703
2009-07-14 23:09:55 +00:00
Owen Anderson
1e5155161a Move more functionality over to LLVMContext.
llvm-svn: 75497
2009-07-13 20:58:05 +00:00
Owen Anderson
393d8b0a0c Begin the painful process of tearing apart the rat'ss nest that is Constants.cpp and ConstantFold.cpp.
This involves temporarily hard wiring some parts to use the global context.  This isn't ideal, but it's
the only way I could figure out to make this process vaguely incremental.

llvm-svn: 75445
2009-07-13 04:09:18 +00:00
Owen Anderson
1500792c2c Finish pushing LLVMContext through the IRBuilder/ConstantFolder interface.
llvm-svn: 75213
2009-07-10 00:49:53 +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
Jeffrey Yasskin
a34904f9f8 Work around an ICE in gcc-4.2.4.
llvm-svn: 75084
2009-07-09 00:52:44 +00:00
Owen Anderson
9331034838 Push LLVMContext _back_ through IRBuilder.
llvm-svn: 75040
2009-07-08 20:50:47 +00:00
Owen Anderson
332aae685b Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.
llvm-svn: 75025
2009-07-08 19:03:57 +00:00
Nick Lewycky
d46a7b2d22 Remove the vicmp and vfcmp instructions. Because we never had a release with
these instructions, no autoupgrade or backwards compatibility support is
provided.

llvm-svn: 74991
2009-07-08 03:04:38 +00:00
Owen Anderson
7a1f69e433 Push LLVMContext through GlobalVariables and IRBuilder.
llvm-svn: 74985
2009-07-08 01:26:06 +00:00
Anton Korobeynikov
fed9dcc88c Revert IRBuilder CC propagation. Fix SimplifyLibCalls instead.
llvm-svn: 73715
2009-06-18 20:05:31 +00:00
Anton Korobeynikov
82ab724191 Forgot to commit this hunk
llvm-svn: 73693
2009-06-18 08:30:57 +00:00
Anton Korobeynikov
e492bc7546 Propagate calling conv for invokes too
llvm-svn: 73692
2009-06-18 08:13:56 +00:00
Anton Korobeynikov
77a0bd41fc Honour calling convention and attributes of Callee by default.
llvm-svn: 73646
2009-06-17 22:20:46 +00:00
Chris Lattner
ee538a1431 make CreateFMul forward to CreateFMul, not CreateMul.
llvm-svn: 73603
2009-06-17 06:31:02 +00:00
Dan Gohman
cccda40191 Add a CreateFNeg function to IRBuilder.
llvm-svn: 73437
2009-06-15 22:50:40 +00:00
Dan Gohman
5f6f8101d5 Split the Add, Sub, and Mul instruction opcodes into separate
integer and floating-point opcodes, introducing
FAdd, FSub, and FMul.

For now, the AsmParser, BitcodeReader, and IRBuilder all preserve
backwards compatability, and the Core LLVM APIs preserve backwards
compatibility for IR producers. Most front-ends won't need to change
immediately.

This implements the first step of the plan outlined here:
http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt

llvm-svn: 72897
2009-06-04 22:49:04 +00:00
Dan Gohman
17d7639520 Add an accessor method to return the insertion point.
llvm-svn: 72184
2009-05-20 21:45:41 +00:00
Nick Lewycky
e5b361c13a Cleanup. Remove redundant llvm:: , we don't need them since we're inside
namespace llvm already.

llvm-svn: 68774
2009-04-10 06:54:06 +00:00
Nick Lewycky
0f4dbe06e7 Add utility function to IRBuilder that takes the difference between two
pointers, taking into account the size of the pointed-to object.
Patch by Jeffrey Yasskin!

llvm-svn: 68768
2009-04-10 05:30:48 +00:00
Chris Lattner
4fe63a51eb add method to access a template argument.
llvm-svn: 67458
2009-03-22 00:18:18 +00:00
Daniel Dunbar
4050346c70 Add IRBuilder::CreateConstGEP{1, 2}_{32, 64}.
- Names are lame, but it seems better to be explicit.

llvm-svn: 66295
2009-03-06 22:26:07 +00:00
Misha Brukman
7ee4196e74 Removed trailing whitespace.
llvm-svn: 65196
2009-02-20 22:51:36 +00:00
Dan Gohman
8271066844 Tidy up #includes, deleting a bunch of unnecessary #includes.
llvm-svn: 61715
2009-01-05 17:59:02 +00:00
Nick Lewycky
3889c7ebf0 Clean up some strange whitespace.
llvm-svn: 59373
2008-11-15 20:32:33 +00:00
Daniel Dunbar
553c69eecd Rename IRBuilder::IsNonNull -> IsNotNull in response to feedback.
llvm-svn: 56953
2008-10-02 17:05:03 +00:00
Daniel Dunbar
fe82c1180a Add IRBuilder::{CreateIsNull, CreateIsNonNull} helper methods.
- I'm open to the idea that these could have better names. I think
   these read better than CreateEQNull and CreateNENull.

llvm-svn: 56757
2008-09-27 23:22:55 +00:00
Duncan Sands
0f1ba9dee5 Add a NullFolder class that doesn't fold constants.
This may be used as the second IRBuilder template
parameter, the idea being that people learning LLVM
may find it helpful (several people asked on IRC
if it was possible to turn off constant folding
because it made it hard for them to see what was
going on).  Compiles, but otherwise completely
untested.

llvm-svn: 54698
2008-08-12 20:39:27 +00:00
Duncan Sands
cac74d2a10 Make it possible to use different constant
folding policies with IRBuilder.  The default,
provided by ConstantFolder, is to do minimal
folding like now: what ConstantExpr provides.
An alternative is to use TargetFolder, which
uses target information to fold constants more.

llvm-svn: 54640
2008-08-11 15:29:30 +00:00
Duncan Sands
310343bae7 Unbreak the llvm-gcc build: recent changes to
IRBuilder are not expecting null names.

llvm-svn: 54581
2008-08-09 15:14:59 +00:00
Chris Lattner
270ee0cb58 Make 'Insert' set the name for Loads, instead of passing the name into the
LoadInst ctor, which causes std::string thrashing.

llvm-svn: 54577
2008-08-09 06:26:23 +00:00
Eric Christopher
dcd4752642 Have IRBuilder take a template argument on whether or not to preserve
names. This can save a lot of allocations if you aren't going to be
looking at the output.

llvm-svn: 54546
2008-08-08 19:39:37 +00:00
Dan Gohman
c28f2265a4 Rename the version of CreateRet that's a convenience method for creating
multiple-valued return values, so that the name CreateRet is just for
creating plain ret statements.

llvm-svn: 54053
2008-07-25 20:36:15 +00:00
Chris Lattner
e92598ef91 Make CreateBinOp/CreateNeg/CreateNot do constant folding.
llvm-svn: 53950
2008-07-23 06:58:10 +00:00
Dan Gohman
6564581be0 Enable first-class aggregates support.
Remove the GetResultInst instruction. It is still accepted in LLVM assembly
and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove
support for return instructions with multiple values. These are auto-upgraded
to use InsertValueInst instructions.

The IRBuilder still accepts multiple-value returns, and auto-upgrades them
to InsertValueInst instructions.

llvm-svn: 53941
2008-07-23 00:34:11 +00:00
Dan Gohman
b7d67aaa88 Add insertvalue and extractvalue folding support in IRBuilder.
llvm-svn: 53931
2008-07-22 20:19:25 +00:00
Dan Gohman
12c36eae69 IRBuilder support for insertvalue and extractvalue.
llvm-svn: 53926
2008-07-22 18:25:25 +00:00
Eric Christopher
4c3e39e220 Add a couple more helper functions to deal with
creating global constant strings and pointers
to global constant strings.

llvm-svn: 53051
2008-07-02 22:57:59 +00:00
Chris Lattner
f55505b7be Tweak IRBuilder to explicitly call the setName(const char*) method on Value
instead of passing the name into the instruction ctors.  Since most 
instruction ctors take their name as an std::string, this avoids copying the
string to the heap and a malloc and free.

Patch by Pratik Solanki!

llvm-svn: 52832
2008-06-27 18:49:21 +00:00
Gabor Greif
d61f20217a API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. Legacy interfaces will be in place for some time. (Merge from use-diet branch.)
llvm-svn: 51200
2008-05-16 19:29:10 +00:00
Nate Begeman
472144535b Add support to IR builder for new vicmp, vfcmp routines
llvm-svn: 51127
2008-05-14 20:29:46 +00:00
Chris Lattner
3835284f4c Add CreateCall3/CreateCall4 at Eric's request.
llvm-svn: 50515
2008-05-01 05:23:45 +00:00
Chris Lattner
09cf777a96 Add a spiffy little "CreateCall2" method, which can be used to make
a function call that takes two Value*'s as arguments.

llvm-svn: 50514
2008-05-01 05:11:00 +00:00
Duncan Sands
c5f548f784 Merge LLVMBuilder and FoldingBuilder, calling
the result IRBuilder.  Patch by Dominic Hamon.

llvm-svn: 49604
2008-04-13 06:22:09 +00:00