1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

407 Commits

Author SHA1 Message Date
Victor Hernandez
a25a2890fa Remove MallocInst from LLVM Instructions.
llvm-svn: 84299
2009-10-17 01:18:07 +00:00
Victor Hernandez
4d7283f82c Autoupgrade malloc insts to malloc calls.
Update testcases that rely on malloc insts being present.

Also prematurely remove MallocInst handling from IndMemRemoval and RaiseAllocations to help pass tests in this incremental step.

llvm-svn: 84292
2009-10-17 00:00:19 +00:00
Duncan Sands
2400ad7236 Introduce and use convenience methods for getting pointer types
where the element is of a basic builtin type.  For example, to get
an i8* use getInt8PtrTy.

llvm-svn: 83379
2009-10-06 15:40:36 +00:00
Nick Lewycky
81504d2150 Round out the API for the new optimization flags.
llvm-svn: 82930
2009-09-27 21:33:04 +00:00
Nick Lewycky
d21c325f09 Instruction::clone does not need to take an LLVMContext&. Remove that and
update all the callers.

llvm-svn: 82889
2009-09-27 07:38:41 +00:00
Victor Hernandez
f772c0b8b2 Revert 82694 "Auto-upgrade malloc instructions to malloc calls." because it causes regressions in the nightly tests.
llvm-svn: 82784
2009-09-25 18:11:52 +00:00
Victor Hernandez
ff8027ced6 Auto-upgrade malloc instructions to malloc calls.
Reviewed by Devang Patel.

llvm-svn: 82694
2009-09-24 17:47:49 +00:00
Devang Patel
18dae0848f Do not leave behind metadata while cloning an instruction.
llvm-svn: 82638
2009-09-23 18:32:25 +00:00
Chris Lattner
78d19af97a tidy up
llvm-svn: 82489
2009-09-21 22:27:34 +00:00
Victor Hernandez
065bc44d01 Update malloc call creation code (AllocType is now the element type of the malloc, not the resulting type).
In getMallocArraySize(), fix bug in the case that array size is the product of 2 constants.

Extend isArrayMalloc() and getMallocArraySize() to handle case where malloc is used as char array.

Ensure that ArraySize in LowerAllocations::runOnBasicBlock() is correct type.

Extend Instruction::isSafeToSpeculativelyExecute() to handle malloc calls.

Add verification for malloc calls.

Reviewed by Dan Gohman.

llvm-svn: 82257
2009-09-18 19:20:02 +00:00
Daniel Dunbar
fc94e2d90d Fix -Asserts warning.
llvm-svn: 81580
2009-09-11 22:07:31 +00:00
Dan Gohman
9040a3526e Fix indentation.
llvm-svn: 81484
2009-09-11 00:05:10 +00:00
Benjamin Kramer
200a6693fb Add some braces to make newer GCCs happy and update CMakeLists.
llvm-svn: 81443
2009-09-10 11:31:39 +00:00
Evan Cheng
78182244f1 Add malloc call utility functions. Patch by Victor Hernandez.
llvm-svn: 81426
2009-09-10 04:36:43 +00:00
Dan Gohman
1147a7ba87 Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.
llvm-svn: 81172
2009-09-07 23:54:19 +00:00
Daniel Dunbar
452643b58c Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", this
breaks MiniSAT on x86_64.

llvm-svn: 81098
2009-09-06 00:11:24 +00:00
Dan Gohman
8b386a0b63 Include optional subclass flags, such as inbounds, nsw, etc., in the
Constant uniquing tables. This allows distinct ConstantExpr objects
with the same operation and different flags.

Even though a ConstantExpr "a + b" is either always overflowing or
never overflowing (due to being a ConstantExpr), it's still necessary
to be able to represent it both with and without overflow flags at
the same time within the IR, because the safety of the flag may
depend on the context of the use. If the constant really does overflow,
it wouldn't ever be safe to use with the flag set, however the use
may be in code that is never actually executed.

This also makes it possible to merge all the flags tests into a single test.

llvm-svn: 80998
2009-09-04 12:08:11 +00:00
Dan Gohman
66c853f17f Change PHINode::hasConstantValue to have a DominatorTree argument
instead of a bool argument, and to do the dominator check itself.
This makes it eaiser to use when DominatorTree information is
available.

llvm-svn: 80920
2009-09-03 15:34:35 +00:00
Gabor Greif
4604e0739b back out my recent commit (r80858), it seems to break self-hosting buildbot's stage 2 configure
llvm-svn: 80871
2009-09-03 02:02:59 +00:00
Gabor Greif
68c4f27e59 re-commit r66920 (which has been backed out in r66953) I may have more luck this time. I'll back out if needed...
llvm-svn: 80858
2009-09-03 00:18:58 +00:00
Sandeep Patel
9c4e094e2a Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.
llvm-svn: 80773
2009-09-02 08:44:58 +00:00
Dan Gohman
1497a679f2 Fix the InsertAtEnd form of ShuffleVectorInst constructor to use
the correct type.

llvm-svn: 80050
2009-08-25 23:27:45 +00:00
Dan Gohman
4d20610e6e Eliminate the unused Context argument on one of the ICmpInst and FCmpInst
constructors.

llvm-svn: 80049
2009-08-25 23:17:54 +00:00
Dan Gohman
6f3742a16a Use covariant return types for Instruction::clone, and eliminate
the forms of ExtractElementInst and InsertElementInst that are
equivalent to clone.

llvm-svn: 80041
2009-08-25 22:29:08 +00:00
Dan Gohman
cce6c79d6d Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined,
and introduce a new Instruction::isIdenticalTo which tests for full
identity, including the SubclassOptionalData flags. Also, fix the
Instruction::clone implementations to preserve the SubclassOptionalData
flags. Finally, teach several optimizations how to handle
SubclassOptionalData correctly, given these changes.

This fixes the counterintuitive behavior of isIdenticalTo not comparing
the full value, and clone not returning an identical clone, as well as
some subtle bugs that could be caused by these.

Thanks to Nick Lewycky for reporting this, and for an initial patch!

llvm-svn: 80038
2009-08-25 22:11:20 +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
Daniel Dunbar
952aa01cb9 Revert 78680 until I figure out why it completely broke things.
llvm-svn: 78697
2009-08-11 18:11:15 +00:00
Daniel Dunbar
92bda7b2e0 Remove some unnecessary LoadInst constructors, missed during Twinification.
llvm-svn: 78689
2009-08-11 17:38:47 +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
881d928f9b Move types back to the 2.5 API.
llvm-svn: 77516
2009-07-29 22:17:13 +00:00
Owen Anderson
390e9778d4 Return ConstantVector to 2.5 API.
llvm-svn: 77366
2009-07-28 21:19:26 +00:00
Owen Anderson
256c2c250e Move ConstantFP construction back to the 2.5-ish API.
llvm-svn: 77247
2009-07-27 20:59:43 +00:00
Daniel Dunbar
251177c96e Initial update to VMCore to use Twines for string arguments.
- The only meat here is in Value.{h,cpp} the rest is essential 'const
   std::string &' -> 'const Twine &'.

llvm-svn: 77048
2009-07-25 04:41:11 +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
Dan Gohman
9a7deba67e Convert a few more things to use raw_ostream.
llvm-svn: 77039
2009-07-25 01:43:01 +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
Dan Gohman
8577dd4cca Permit the IntPtrTy argument to isEliminableCastPair to be null,
to help support use when TargetData is not available.

llvm-svn: 76675
2009-07-21 23:19:40 +00:00
Dan Gohman
00b05492f1 Revert the addition of hasNoPointerOverflow to GEPOperator.
Getelementptrs that are defined to wrap are virtually useless to
optimization, and getelementptrs that are undefined on any kind
of overflow are too restrictive -- it's difficult to ensure that
all intermediate addresses are within bounds. I'm going to take
a different approach.

Remove a few optimizations that depended on this flag.

llvm-svn: 76437
2009-07-20 17:43:30 +00:00
Dan Gohman
c639ee66f0 Add a GEPOperator class, and move the hasNoPointerOverflow
accessors into it.

llvm-svn: 76245
2009-07-17 21:33:58 +00:00
Dan Gohman
2ca0f65c30 Fix a typo that Duncan spotted.
llvm-svn: 76233
2009-07-17 20:51:47 +00:00
Dan Gohman
56e00a404f GetElementPtr instructions default to having no overflow.
llvm-svn: 76222
2009-07-17 19:23:21 +00:00
Owen Anderson
8b6ad7143c Now that we have contexts on types, convert some more internals to use contexts.
llvm-svn: 75866
2009-07-16 00:03:07 +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
13080d27c5 Move a few more convenience factory functions from Constant to LLVMContext.
llvm-svn: 75840
2009-07-15 21:51:10 +00:00
Owen Anderson
8c85061ee6 Move EVER MORE stuff over to LLVMContext.
llvm-svn: 75703
2009-07-14 23:09:55 +00:00
Torok Edwin
f955a6ef49 llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").

llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Owen Anderson
3501454313 These don't really need contexts either.
llvm-svn: 75528
2009-07-13 22:18:28 +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
Torok Edwin
ae8a3ff177 assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.

llvm-svn: 75379
2009-07-11 20:10:48 +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
Torok Edwin
358888da3a Implement changes from Chris's feedback.
Finish converting lib/Target.

llvm-svn: 75043
2009-07-08 20:53:28 +00:00
Torok Edwin
ad3be984b7 Start converting to new error handling API.
cerr+abort -> llvm_report_error
assert(0)+abort -> LLVM_UNREACHABLE (assert(0)+llvm_unreachable-> abort() included)

llvm-svn: 75018
2009-07-08 18:01:40 +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
Dan Gohman
0b9e2dc359 Use Type::isIntOrIntVector and Type::isFPOrFPVector.
llvm-svn: 73433
2009-06-15 22:25:12 +00:00
Dan Gohman
2e737ac21f Support vector casts in more places, fixing a variety of assertion
failures.

To support this, add some utility functions to Type to help support
vector/scalar-independent code. Change ConstantInt::get and
ConstantFP::get to support vector types, and add an overload to
ConstantInt::get that uses a static IntegerType type, for
convenience.

Introduce a new getConstant method for ScalarEvolution, to simplify
common use cases.

llvm-svn: 73431
2009-06-15 22:12:54 +00:00
Dan Gohman
111f127d23 Fix old-style type names in comments.
llvm-svn: 73362
2009-06-14 23:30:43 +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
a21c85512e Revert r72025. It is possible for clients to convert between signed types
and pointer types safely if they only do so when the sizes are the same.
llvm-gcc is such a client.

llvm-svn: 72029
2009-05-18 18:55:39 +00:00
Dan Gohman
20650de700 Add assertions to CastInst::getCastOpcode to catch attempted conversions
between integers and pointers when the source type is marked signed,
since inttoptr and ptrtoint always use zero-extension when the destination
is larger than the source.

llvm-svn: 72025
2009-05-18 18:18:57 +00:00
Bill Wendling
96e37540a0 Revert r66920. It was causing failures in the self-hosting buildbot (in release
mode).

Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/dg.exp ...
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll
Failed with signal(SIGBUS) at line 1
while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes > /dev/null
0   bugpoint          0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
1   bugpoint          0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
2   libSystem.B.dylib 0x92f112bb _sigtramp + 43
3   libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
4   bugpoint          0x00021d1c main + 92
5   bugpoint          0x00002106 start + 54
6   bugpoint          0x00000004 start + 18446744073709543220
Stack dump:
0.    Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes 

FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll
Failed with signal(SIGBUS) at line 1
while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes
0   bugpoint          0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
1   bugpoint          0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
2   libSystem.B.dylib 0x92f112bb _sigtramp + 43
3   libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
4   bugpoint          0x00021d1c main + 92
5   bugpoint          0x00002106 start + 54
6   bugpoint          0x00000006 start + 18446744073709543222
Stack dump:
0.    Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes 

FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll
Failed with signal(SIGBUS) at line 1
while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll  -bugpoint-crashcalls -silence-passes
0   bugpoint          0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
1   bugpoint          0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
2   libSystem.B.dylib 0x92f112bb _sigtramp + 43
3   libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
4   bugpoint          0x00021d1c main + 92
5   bugpoint          0x00002106 start + 54
Stack dump:
0.    Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes 

--- Reverse-merging (from foreign repository) r66920 into '.':
U    include/llvm/Support/CallSite.h
U    include/llvm/Instructions.h
U    lib/Analysis/IPA/GlobalsModRef.cpp
U    lib/Analysis/IPA/Andersens.cpp
U    lib/Bitcode/Writer/BitcodeWriter.cpp
U    lib/VMCore/Instructions.cpp
U    lib/VMCore/Verifier.cpp
U    lib/VMCore/AsmWriter.cpp
U    lib/Transforms/Utils/LowerInvoke.cpp
U    lib/Transforms/Scalar/SimplifyCFGPass.cpp
U    lib/Transforms/IPO/PruneEH.cpp
U    lib/Transforms/IPO/DeadArgumentElimination.cpp

llvm-svn: 66953
2009-03-13 21:15:59 +00:00
Gabor Greif
6a76677e1b Second installment of "BasicBlock operands to the back"
changes.

For InvokeInst now all arguments begin at op_begin().
The Callee, Cont and Fail are now faster to get by
access relative to op_end().

This patch introduces some temporary uglyness in CallSite.
Next I'll bring CallInst up to a similar scheme and then
the uglyness will magically vanish.

This patch also exposes all the reliance of the libraries
on InvokeInst's operand ordering. I am thinking of taking
care of that too.

llvm-svn: 66920
2009-03-13 18:27:29 +00:00
Gabor Greif
037f4dc1a4 Rearrange operands of the BranchInst, to be able to
access each with a fixed negative index from op_end().

This has two important implications:
- getUser() will work faster, because there are less iterations
  for the waymarking algorithm to perform. This is important
  when running various analyses that want to determine callers
  of basic blocks.
- getSuccessor() now runs faster, because the indirection via OperandList
  is not necessary: Uses corresponding to the successors are at fixed
  offset to "this".

The price we pay is the slightly more complicated logic in the operator
User::delete, as it has to pick up the information whether it has to free
the memory of an original unconditional BranchInst or a BranchInst that
was originally conditional, but has been shortened to unconditional.
I was not able to come up with a nicer solution to this problem. (And
rest assured, I tried *a lot*).

Similar reorderings will follow for InvokeInst and CallInst. After that
some optimizations to pred_iterator and CallSite will fall out naturally.

llvm-svn: 66815
2009-03-12 18:34:49 +00:00
Chris Lattner
7253459805 fix Analysis/BasicAA/2004-12-08-BasicAACrash.ll by allowing opaque types.
llvm-svn: 66395
2009-03-09 04:56:22 +00:00
Chris Lattner
8c4f4e1852 Fix PR3746 - Crash in isel with GEP of function pointer
by checking that the top-level type of a gep is sized. This
causes us to reject the example with:

llvm-as: t2.ll:2:16: invalid getelementptr indices
getelementptr i32()* null, i32 1
              ^

llvm-svn: 66393
2009-03-09 04:46:40 +00:00
Gabor Greif
20c5fd503d simplify CallSite helper class to not consult the Instruction's
opcode on each delegation.
Instead the information is cached on construction and the cached flag used thereafter.
Introduced two predicates: isCall and isInvoke.

llvm-svn: 62055
2009-01-11 22:33:22 +00:00
Chris Lattner
031a666948 move select validation logic into a shared place where the select ctor,
verifier, asm parser, etc can share it.

llvm-svn: 61461
2008-12-29 00:12:50 +00:00
Chris Lattner
c9d864b689 add a long-overdue AllocaInst::isStaticAlloca method.
llvm-svn: 60080
2008-11-26 02:54:17 +00:00
Devang Patel
a2ccbea45a Silence unused variable warnings.
llvm-svn: 59841
2008-11-21 20:00:59 +00:00
Mon P Wang
911ee5bf8b Added support for the following definition of shufflevector
<result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask> 

llvm-svn: 58964
2008-11-10 04:46:22 +00:00
Devang Patel
b55a78e553 Silence unused variable warnings.
llvm-svn: 58743
2008-11-05 01:37:40 +00:00
Devang Patel
64dd7a2e89 Large mechanical patch.
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g

This sets the stage 
- to implement function notes as function attributes and 
- to distinguish between function attributes and return value attributes.

This requires corresponding changes in llvm-gcc and clang.

llvm-svn: 56622
2008-09-25 21:00:45 +00:00
Devang Patel
a3e9bf1bca s/ParameterAttributes/Attributes/g
llvm-svn: 56513
2008-09-23 23:03:40 +00:00
Dan Gohman
b0f5e18201 Improve support for vector casts in LLVM IR and CodeGen.
llvm-svn: 54784
2008-08-14 20:04:46 +00:00
Nate Begeman
9a71580e21 Add vector shifts to the IR, patch by Eli Friedman.
CodeGen & Clang work coming next.

llvm-svn: 54161
2008-07-29 15:49:41 +00:00
Matthijs Kooijman
6ef5a25c7f Add a GetElementPtrInst::getIndexedType that accepts uint64_t's instead of just Value*'s.
llvm-svn: 54157
2008-07-29 08:46:11 +00:00
Nate Begeman
d340dc3fab Tab removal
llvm-svn: 54025
2008-07-25 17:24:13 +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
Duncan Sands
b854603cb5 Add some convenience methods for manipulating
call attributes.

llvm-svn: 53223
2008-07-08 08:38:44 +00:00
Dan Gohman
b52f318a0c Remove two convenience constructors because they're now private, and the
private implementation doesn't really need the convenience.

llvm-svn: 52629
2008-06-23 16:48:17 +00:00
Dan Gohman
12a793b025 Use std::copy instead of a loop.
llvm-svn: 52628
2008-06-23 16:45:24 +00:00
Dan Gohman
bcddb92f4e Simplify this code. Thanks Chris!
llvm-svn: 52514
2008-06-20 00:47:44 +00:00
Dan Gohman
d9d529d7ed In InsertValueInst's copy ctor, actually copy the operands.
llvm-svn: 52434
2008-06-17 23:25:49 +00:00
Dan Gohman
24d9c8400f Implement the ExtractValueInst::getIndexedType that accepts one
index value.

llvm-svn: 52432
2008-06-17 21:07:55 +00:00
Chris Lattner
09554fd076 fix pr2460
llvm-svn: 52294
2008-06-16 04:02:40 +00:00
Gabor Greif
7c2e365dbc get rid of ExtractValueInst::init's Value argument, it is already passed to the UnaryInstruction ctor
llvm-svn: 52064
2008-06-06 21:06:32 +00:00
Gabor Greif
8ac103e71d make ExtractValueInst derived from UnaryInstruction
llvm-svn: 52061
2008-06-06 20:28:12 +00:00
Matthijs Kooijman
6216df14cb * Make CallSite::hasArgument const and let it take a const parameter.
llvm-svn: 51989
2008-06-05 08:04:58 +00:00
Matthijs Kooijman
de47a7518d Add CallSite::hasArgument to allow for seeing if a call passes a certain value as an argument quickly.
llvm-svn: 51946
2008-06-04 16:31:12 +00:00
Matthijs Kooijman
318e1df0e4 Add a Name parameter to two of the init methods of GetElementPointer to make the name setting more consistent.
llvm-svn: 51945
2008-06-04 16:14:12 +00:00
Matthijs Kooijman
2f6b694afc Implement the two constructors in InsertValueInst and ExtractValueInst.
Add a Name argment to two init methods in these classes as well to make things
a bit more consistent.

llvm-svn: 51937
2008-06-04 14:40:55 +00:00
Dan Gohman
1ab21af8e0 Factor several methods, including getInversePredicate and
getSwappedPredicate, from ICmpInst and FCmpInst into common
methods in CmpInst. This allows CmpInsts to be manipulated
generically.

llvm-svn: 51810
2008-05-31 02:47:54 +00:00
Dan Gohman
ac5c3382fe IR, bitcode reader, bitcode writer, and asmparser changes to
insertvalue and extractvalue to use constant indices instead of
Value* indices. And begin updating LangRef.html.

There's definately more to come here, but I'm checking this 
basic support in now to make it available to people who are
interested.

llvm-svn: 51806
2008-05-31 00:58:22 +00:00
Gabor Greif
0b9cf0d491 prune unneeded #includes
llvm-svn: 51590
2008-05-27 11:06:03 +00:00
Gabor Greif
0fb81af839 remove unneeded reinterpret_casts
llvm-svn: 51589
2008-05-27 11:03:29 +00:00
Gabor Greif
b93cb3dc6f We have the correct headers included to know that BB isa Value. No reinterpret_cast necessary.
llvm-svn: 51588
2008-05-27 10:48:39 +00:00
Gabor Greif
e052a42a62 eliminate calls to deprecated Use::init() interface
llvm-svn: 51570
2008-05-26 21:33:52 +00:00
Dan Gohman
9674662036 Add more IR support for the new extractvalue and insertvalue
instructions.

llvm-svn: 51461
2008-05-23 00:36:11 +00:00
Eric Christopher
11359e9b1c Add functions to enable adding a single attribute to a function and
its associated call site.

llvm-svn: 51204
2008-05-16 20:39:43 +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
Dan Gohman
fe7f6bc9ce Revert the change from r51157 in
test/Verifier/2002-11-05-GetelementptrPointers.ll, which was incorrect.
Instead, fix getIndexedType to not follow pointer types, as
PointerType is a subclass of CompositeType.

llvm-svn: 51171
2008-05-16 00:16:32 +00:00
Dan Gohman
821bf58428 IR support for extractvalue and insertvalue instructions. Also, begin
moving toward making structs and arrays first-class types.

llvm-svn: 51157
2008-05-15 19:50:34 +00:00
Gabor Greif
48ffb6c7dc Fix a bunch of 80col violations that arose from the Create API change. Tweak makefile targets to find these better.
llvm-svn: 51143
2008-05-15 10:04:30 +00:00
Gabor Greif
dd2f5c797d Merge of r51073-51074 from use-diet branch.
Do not rely on std::swap<Use>, provide a (faster) member function instead.
This change is primarily necessitated by MSVC++'s incompatibility with
declaring std::swap<Use> to be a friend of Use.

Also contains some minor tweaks to Use inline functions,
to undo pointless changes that sneaked in with the last merge.

llvm-svn: 51078
2008-05-13 22:51:52 +00:00
Gabor Greif
22afb1f8f0 Derive GetResultInst from UnaryInstruction, this simplifies code and removes a FIXME.
llvm-svn: 51023
2008-05-13 07:09:08 +00:00
Nate Begeman
b72a398339 Pointer comparisons should be handled by icmp, not vicmp :)
llvm-svn: 50994
2008-05-12 20:11:05 +00:00
Nate Begeman
6258a36fe3 Hard code CmpInst back to i1 for now while I go track down what in the bitcode reader/writer is assuming i1
This was breaking a bunch of tests

llvm-svn: 50992
2008-05-12 20:01:56 +00:00
Nate Begeman
b5b1e1353b Add two new instructions to the llvm IR, vicmp and vfcmp. see updated LangRef
for details.  CodeGen support coming in a follow up patch

llvm-svn: 50985
2008-05-12 19:01:56 +00:00
Dan Gohman
4f0d9d18c3 Update comments.
llvm-svn: 50974
2008-05-12 16:34:30 +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
39e4b2e5d2 Enforce that multiple return values have to have at least one result.
llvm-svn: 50137
2008-04-23 05:36:34 +00:00
Gabor Greif
6c6b8a57f3 API changes for class Use size reduction, wave 1.
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.

llvm-svn: 49277
2008-04-06 20:25:17 +00:00
Dan Gohman
fec60bb357 Shrink the size of AllocationInst by using its SubclassData
field to store the alignment value instead of haing a
separate field.

llvm-svn: 48727
2008-03-24 16:55:58 +00:00
Chris Lattner
a14cdebdd9 move a bunch of trivial methods to be inline.
llvm-svn: 48326
2008-03-13 05:00:21 +00:00
Chris Lattner
7925cc72c0 Reimplement the parameter attributes support, phase #1. hilights:
1. There is now a "PAListPtr" class, which is a smart pointer around
   the underlying uniqued parameter attribute list object, and manages
   its refcount.  It is now impossible to mess up the refcount.
2. PAListPtr is now the main interface to the underlying object, and
   the underlying object is now completely opaque.
3. Implementation details like SmallVector and FoldingSet are now no
   longer part of the interface.
4. You can create a PAListPtr with an arbitrary sequence of
   ParamAttrsWithIndex's, no need to make a SmallVector of a specific 
   size (you can just use an array or scalar or vector if you wish).
5. All the client code that had to check for a null pointer before
   dereferencing the pointer is simplified to just access the 
   PAListPtr directly.
6. The interfaces for adding attrs to a list and removing them is a
   bit simpler.

Phase #2 will rename some stuff (e.g. PAListPtr) and do other less 
invasive changes.

llvm-svn: 48289
2008-03-12 17:45:29 +00:00
Devang Patel
d0d7028a2b s/isReturnStruct()/hasStructRetAttr()/g
llvm-svn: 47857
2008-03-03 21:46:28 +00:00
Chris Lattner
ffde7a642a Add a new ShuffleVectorInst::getMaskValue method.
llvm-svn: 47813
2008-03-02 05:28:33 +00:00
Devang Patel
c68e26f9fe Add comment.
llvm-svn: 47653
2008-02-27 01:20:54 +00:00
Devang Patel
5c00c6bafa Remove unncessary ReturnInst constructors.
llvm-svn: 47633
2008-02-26 22:12:58 +00:00
Devang Patel
0be97b2118 Use SmallVector while constructing ReturnInst.
llvm-svn: 47619
2008-02-26 19:38:17 +00:00
Devang Patel
e5766a12da Avoid const_casts
llvm-svn: 47616
2008-02-26 19:15:26 +00:00
Devang Patel
6d492c3caf Remove unnecessary getOperand/setOperand overriders.
Simplify getReturnValue()

llvm-svn: 47614
2008-02-26 19:08:13 +00:00
Devang Patel
e0f9c6f281 Unify to ReturnInst::init() member functions.
llvm-svn: 47611
2008-02-26 18:49:29 +00:00
Devang Patel
b35d15edf9 Optimize most common case by using single RetVal in ReturnInst.
llvm-svn: 47607
2008-02-26 17:56:20 +00:00
Devang Patel
5b3d61f5ed Pass const vectors by reference.
llvm-svn: 47577
2008-02-26 00:12:13 +00:00
Devang Patel
f674975a65 To support multiple return values, now ret instruction supports multiple operands instead of one aggregate operand.
llvm-svn: 47508
2008-02-23 00:35:18 +00:00
Dale Johannesen
ae08bdb4cf Split ParameterAttributes.h, putting the complicated
stuff into ParamAttrsList.h.  Per feedback from
ParamAttrs changes.

llvm-svn: 47504
2008-02-22 22:17:59 +00:00
Dale Johannesen
a96eb3a1d8 Pass alignment on ByVal parameters, from FE, all
the way through.  It is now used for codegen.

llvm-svn: 47484
2008-02-22 17:49:45 +00:00
Devang Patel
4034343b67 getresult does not support nested aggregates.
llvm-svn: 47396
2008-02-20 19:39:41 +00:00
Devang Patel
de35f122f2 getresult type is the type of indexed aggregate element
llvm-svn: 47392
2008-02-20 19:26:55 +00:00
Devang Patel
6266d7147e Specify GetResultInst index as an unsigned.
llvm-svn: 47390
2008-02-20 19:10:47 +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
Devang Patel
a74d2cbb6f Add GetResultInst. First step for multiple return value support.
llvm-svn: 47348
2008-02-19 22:15:16 +00:00
Dale Johannesen
ecb2b233b1 Expand ParameterAttributes to 32 bits (in preparation
for adding alignment info, not there yet).  Clean up
interfaces to reference ParameterAttributes consistently.

llvm-svn: 47342
2008-02-19 21:38:47 +00:00
Duncan Sands
a85448506d Simplify caller updating using a CallSite, as
requested by Chris.  While there, do the same
for an existing function committed by someone
called "lattner" :)

llvm-svn: 47273
2008-02-18 17:32:13 +00:00
Nick Lewycky
6b070b1b93 Handle some more combinations of extend and icmp. Fixes PR1940.
llvm-svn: 46431
2008-01-28 03:48:02 +00:00
Duncan Sands
26de25066c Be consistent with other attribute methods, and
check the callee also if it is known.

llvm-svn: 46206
2008-01-21 11:27:55 +00:00
Duncan Sands
087d6020ee Simplify CallInst::hasByValArgument using a new method.
llvm-svn: 45974
2008-01-14 19:57:00 +00:00
Evan Cheng
12fb1dc67e Simplify code.
llvm-svn: 45950
2008-01-14 02:38:45 +00:00
Evan Cheng
a5183224b0 Add hasByValArgument() to test if a call instruction has byval argument(s).
llvm-svn: 45913
2008-01-12 18:57:32 +00:00
Duncan Sands
b8489f09a2 When transforming a call to a bitcast function into
a direct call with cast parameters and cast return
value (if any), instcombine was prepared to cast any
non-void return value into any other, whether castable
or not.  Add a new predicate for testing whether casting
is valid, and check it both for the return value and
(as a cleanup) for the parameters.

llvm-svn: 45657
2008-01-06 10:12:28 +00:00
Chris Lattner
9ec341b120 Split param attr implementation out from Function.cpp into its
own file.  Don't #include ParameterAttributes.h into any major
public header files: just move methods out of line as appropriate.

llvm-svn: 45517
2008-01-02 23:42:30 +00:00
Chris Lattner
25b9530d7b remove blob of #if'd out code.
llvm-svn: 45512
2008-01-02 23:10:45 +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
Duncan Sands
56f3add5b7 When inlining through an 'nounwind' call, mark inlined
calls 'nounwind'.  It is important for correct C++
exception handling that nounwind markings do not get
lost, so this transformation is actually needed for
correctness.

llvm-svn: 45218
2007-12-19 21:13:37 +00:00
Duncan Sands
242f80be86 Rename isNoReturn to doesNotReturn, and isNoUnwind to
doesNotThrow.

llvm-svn: 45160
2007-12-18 09:59:50 +00:00
Christopher Lamb
a608afb52e Change the PointerType api for creating pointer types. The old functionality of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space.
llvm-svn: 45082
2007-12-17 01:12:55 +00:00
Duncan Sands
bf62f62058 Make instcombine promote inline asm calls to 'nounwind'
calls.  Remove special casing of inline asm from the
inliner.  There is a potential problem: the verifier
rejects invokes of inline asm (not sure why).  If an
asm call is not marked "nounwind" in some .ll, and
instcombine is not run, but the inliner is run, then
an illegal module will be created.  This is bad but
I'm not sure what the best approach is.  I'm tempted
to remove the check in the verifier...

llvm-svn: 45073
2007-12-16 15:51:49 +00:00
Christopher Lamb
7368604860 Implement address space attribute for LLVM pointer types. Address spaces are
regions of memory that have a target specific relationship, as described in the 
Embedded C Technical Report. 

This also implements the 2007-12-11-AddressSpaces test, 
which demonstrates how address space attributes can be used in LLVM IR.

In addition, this patch changes the bitcode signature for stores (in a backwards 
compatible manner), such that the pointer type, rather than the pointee type, is 
encoded. This permits type information in the pointer (e.g. address space) to be 
preserved for stores.

LangRef updates are forthcoming.

llvm-svn: 44858
2007-12-11 08:59:05 +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
Duncan Sands
1e2e4972ff Rather than having special rules like "intrinsics cannot
throw exceptions", just mark intrinsics with the nounwind
attribute.  Likewise, mark intrinsics as readnone/readonly
and get rid of special aliasing logic (which didn't use
anything more than this anyway).

llvm-svn: 44544
2007-12-03 20:06:50 +00:00
Duncan Sands
19a1638e99 Small parameter attributes cleanup.
llvm-svn: 44433
2007-11-29 08:30:15 +00:00
Duncan Sands
1b0feb42e2 Add some convenience methods for querying attributes, and
use them.

llvm-svn: 44403
2007-11-28 17:07:01 +00:00
Duncan Sands
3602011bec Fix PR1146: parameter attributes are longer part of
the function type, instead they belong to functions
and function calls.  This is an updated and slightly
corrected version of Reid Spencer's original patch.
The only known problem is that auto-upgrading of
bitcode files doesn't seem to work properly (see
test/Bitcode/AutoUpgradeIntrinsics.ll).  Hopefully
a bitcode guru (who might that be? :) ) will fix it.

llvm-svn: 44359
2007-11-27 13:23:08 +00:00
Nate Begeman
2a8ef3f29a Add support for vectors to int <-> float casts.
llvm-svn: 44204
2007-11-17 03:58:34 +00:00
Chris Lattner
80a2b5e53b fix typo
llvm-svn: 43129
2007-10-18 16:10:48 +00:00
David Greene
8cda5af2e7 Update GEP constructors to use an iterator interface to fix
GLIBCXX_DEBUG issues.

llvm-svn: 41697
2007-09-04 15:46:09 +00:00
David Greene
5b85021be8 Update InvokeInst to work like CallInst
llvm-svn: 41506
2007-08-27 19:04:21 +00:00
Chris Lattner
af91aa2f5e sink clone() down the class hierarchy from CmpInst into ICmpInst/FCmpInst.
This eliminates a conditional on that path, and ensures ICmpInst/FCmpInst
both have an out-of-line virtual method to home the class.

llvm-svn: 41371
2007-08-24 20:48:18 +00:00
David Greene
f06a395bb9 New CallInst interface to address GLIBCXX_DEBUG errors caused by
indexing an empty std::vector.

Updates to all clients.

llvm-svn: 40660
2007-08-01 03:43:44 +00:00
Dan Gohman
4d64f82ab5 Add constructor overloads for LoadInst and StoreInst that insert at the
end of a BasicBlock and have an alignment parameter.

llvm-svn: 40016
2007-07-18 20:51:11 +00:00
Chris Lattner
c2985cea59 Enhance BinaryOperator::isNot to support vector not.
llvm-svn: 37585
2007-06-15 06:04:24 +00:00
Dan Gohman
03114bee5f Update comments to say "vector" instead of "packed".
llvm-svn: 36995
2007-05-11 21:43:24 +00:00
Chris Lattner
9bfe8f4517 add a GEP helper function
llvm-svn: 36515
2007-04-27 20:35:56 +00:00
Christopher Lamb
5606cd66e2 PR400 work phase 1. Add attributed load/store instructions for volatile/align to LLVM.
llvm-svn: 36349
2007-04-22 19:24:39 +00:00
Reid Spencer
4169952dab For PR1136:
Add reference counting to ParamAttrsList and make use of it in Function,
CallInst and InvokeInst classes.

llvm-svn: 36346
2007-04-22 17:28:03 +00:00
Reid Spencer
4721577334 For PR1146:
Make ParamAttrsList objects unique. You can no longer directly create or
destroy them but instead must go through the ParamAttrsList::get()
interface.

llvm-svn: 36327
2007-04-22 05:46:44 +00:00
Reid Spencer
81070d52da Revert Christopher Lamb's load/store alignment changes.
llvm-svn: 36309
2007-04-21 18:36:27 +00:00
Christopher Lamb
b56b6a7ad7 add support for alignment attributes on load/store instructions
llvm-svn: 36301
2007-04-21 08:16:25 +00:00
Chris Lattner
5ed58fc4a9 add GetElementPtrInst::hasAllZeroIndices, a long-overdue helper method.
Writing it twice in the same day was too much for me.

llvm-svn: 35978
2007-04-14 00:12:57 +00:00
Reid Spencer
bd2afc8391 Fix a bug where ICmpInst objects instantiated directly with a name would
not retain that name. Not noticed because AsmParser always sets name after
construction. However, llvm2cpp noticed.

llvm-svn: 35903
2007-04-11 13:04:48 +00:00
Reid Spencer
93a57ef458 For PR1146:
* Add ParamAttrs to InvokeInst class too.
* Make sure all initializes of ParamAttrs in CallInst and InvokeInst are 0
* Destruct the ParamAttrs in Call/Invoke destructors to avoid memory
  leaks. This will change when ParamAttrsList is uniquified but needs to
  be correct until then.

llvm-svn: 35824
2007-04-09 18:00:57 +00:00
Reid Spencer
d2380cfb76 For PR1146:
* Add ParamAttrList pointers to Function and CallInst.
* Move the implementation of ParamAttrList from Type.cpp to Function.cpp

llvm-svn: 35818
2007-04-09 15:01:12 +00:00
Dan Gohman
d0a0ea9916 Change uses of Function::front to Function::getEntryBlock for readability.
llvm-svn: 35265
2007-03-22 16:38:57 +00:00
Reid Spencer
5d9574f37e Use modern variable name. ConstantUnsignedInt is long since dead. No
functional change with this patch.

llvm-svn: 34806
2007-03-01 20:27:41 +00:00
Reid Spencer
f632e1cd14 Provide an ICmpInst::makeConstantRange to generate a ConstantRange value
from a predicate and an APInt. This is removed from ConstantRange class
so that ConstantRange doesn't have to depend on lib/VMCore.

llvm-svn: 34760
2007-02-28 22:00:54 +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
Reid Spencer
e7ff3305d6 For PR1195:
Change use of "packed" term to "vector" in comments, strings, variable
names, etc.

llvm-svn: 34300
2007-02-15 03:39:18 +00:00
Reid Spencer
55e4e98a2a For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.

llvm-svn: 34293
2007-02-15 02:26:10 +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
Chris Lattner
326271ee46 eliminate instruction ctors that take vectors.
llvm-svn: 34228
2007-02-13 06:22:32 +00:00
Chris Lattner
bc384d8d50 Add invokeinst and callinst ctors that don't take vectors.
llvm-svn: 34214
2007-02-13 01:04:01 +00:00
Chris Lattner
94ce3e4550 remove some dead methods.
llvm-svn: 34213
2007-02-13 00:58:44 +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
ca583c51b3 silence some warnings when assertions are disabled.
llvm-svn: 33747
2007-02-01 04:59:37 +00:00
Reid Spencer
a22881da40 Fix build breakage by using correct arguments to getIndexedType in the
GEP constructors.

llvm-svn: 33726
2007-01-31 22:30:26 +00:00
Chris Lattner
55e5440018 implement the new GEP instruction ctors.
llvm-svn: 33708
2007-01-31 19:47:18 +00:00
Chris Lattner
b5aa990588 Revise APIs for creating constantexpr GEPs to not require the use of vectors.
This allows us to eliminate many temporary vectors, and theirassociated malloc/free pairs.

llvm-svn: 33692
2007-01-31 04:40:28 +00:00
Reid Spencer
25d0264daa Fix an assertion message.
llvm-svn: 33519
2007-01-26 06:30:34 +00:00
Reid Spencer
e33c18f4d2 For PR970:
Clean up handling of isFloatingPoint() and dealing with PackedType.
Patch by Gordon Henriksen!

llvm-svn: 33415
2007-01-21 00:29:26 +00:00
Reid Spencer
d98055f3fe For PR1117:
Expose the previously hidden checkCast function as CastInst::castIsValid.

llvm-svn: 33282
2007-01-17 02:46:11 +00:00
Chris Lattner
c5e1611848 rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent.  For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)

llvm-svn: 33225
2007-01-15 02:27:26 +00:00
Chris Lattner
f1797fe8bf teach VMCore to accept i1 add's and shifts
llvm-svn: 33223
2007-01-15 02:05:34 +00:00
Reid Spencer
373d2bccea For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types.  Future increments
will rectify this situation.

llvm-svn: 33113
2007-01-12 07:05:14 +00:00
Reid Spencer
f3265181e2 Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Zhou Sheng
23d24526b2 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.

llvm-svn: 33073
2007-01-11 12:24:14 +00:00
Reid Spencer
0e961ea8f7 For PR950:
Change signed integer type names to unsigned equivalents.

llvm-svn: 32780
2006-12-31 05:26:44 +00:00