Chris Lattner
cbab35746f
Make blockaddress(@func, null) be valid, and make 'deleting a basic
...
block with a blockaddress still referring to it' replace the invalid
blockaddress with a new blockaddress(@func, null) instead of a
inttoptr(1).
This changes the bitcode encoding format, and still needs codegen
support (this should produce a non-zero value, referring to the entry
block of the function would also be quite reasonable).
llvm-svn: 85678
2009-10-31 20:08:37 +00:00
Chris Lattner
1efa0c450a
add bitcode reader support for blockaddress. We can now fully
...
round trip blockaddress through .ll and .bc files, so add a testcase.
There are still a bunch of places in the optimizer and other places
that need to be updated to work with these constructs, but at least
the basics are in now.
llvm-svn: 85377
2009-10-28 05:53:48 +00:00
Chris Lattner
075e225442
bitcode writer support for blockaddress.
...
llvm-svn: 85376
2009-10-28 05:24:40 +00:00
Chris Lattner
f605b2e8f9
Previously, all operands to Constant were themselves constant.
...
In the new world order, BlockAddress can have a BasicBlock operand.
This doesn't permute much, because if you have a ConstantExpr (or
anything more specific than Constant) we still know the operand has
to be a Constant.
llvm-svn: 85375
2009-10-28 05:14:34 +00:00
Chris Lattner
2bc8002f4c
rename indbr -> indirectbr to appease the residents of #llvm.
...
llvm-svn: 85351
2009-10-28 00:19:10 +00:00
Chris Lattner
fdda543cea
add enough support for indirect branch for the feature test to pass
...
(assembler,asmprinter, bc reader+writer) and document it. Codegen
currently aborts on it.
llvm-svn: 85274
2009-10-27 19:13:16 +00:00
Chris Lattner
fa5b1df64a
Type.h doesn't need to #include LLVMContext.h
...
llvm-svn: 85254
2009-10-27 17:08:31 +00:00
Victor Hernandez
673c036bc7
Remove FreeInst.
...
Remove LowerAllocations pass.
Update some more passes to treate free calls just like they were treating FreeInst.
llvm-svn: 85176
2009-10-26 23:43:48 +00:00
Daniel Dunbar
4a18e32e25
Suppress -Asserts warning.
...
llvm-svn: 85078
2009-10-25 23:11:06 +00:00
Victor Hernandez
e8998896f5
Auto-upgrade free instructions to calls to the builtin free function.
...
Update all analysis passes and transforms to treat free calls just like FreeInst.
Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised.
llvm-svn: 84987
2009-10-24 04:23:03 +00:00
Devang Patel
5c461d6dcd
Hide MetadataContext implementation details.
...
llvm-svn: 84886
2009-10-22 19:36:54 +00:00
Devang Patel
2a0e2f1794
Fix getMDs() interface such that it does not expose implementation details.
...
llvm-svn: 84885
2009-10-22 18:55:16 +00:00
Devang Patel
1fa3e26912
Using TrackingVH instead of WeakVH or WeakMetadataVH.
...
llvm-svn: 84884
2009-10-22 18:25:28 +00:00
Devang Patel
6df2865e24
Fix getHandlerNames() interface. Now it populate clinet supplied small vector with handler names.
...
llvm-svn: 84820
2009-10-22 01:01:24 +00:00
Dale Johannesen
2bb120a97f
Rename msasm to alignstack per review.
...
llvm-svn: 84795
2009-10-21 23:28:00 +00:00
Devang Patel
d10159397a
Do not use SmallVector to store MDNode elements.
...
llvm-svn: 84784
2009-10-21 21:25:09 +00:00
Victor Hernandez
0996619220
Make changes to rev 84292 as requested by Chris Lattner.
...
Most changes are cleanup, but there is 1 correctness fix:
I fixed InstCombine so that the icmp is removed only if the malloc call is removed (which requires explicit removal because the Worklist won't DCE any calls since they can have side-effects).
llvm-svn: 84772
2009-10-21 19:11:40 +00:00
Chris Lattner
3c31b79b45
simplify.
...
llvm-svn: 84465
2009-10-19 05:51:03 +00:00
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
Dale Johannesen
7db511a23e
Add an "msasm" flag to inline asm as suggested in PR 5125.
...
A little ugliness is accepted to keep the binary file format
compatible. No functional change yet.
llvm-svn: 84020
2009-10-13 20:46:56 +00:00
Devang Patel
8f81b906ab
Do not write empty METADATA_ATTACHMENT record.
...
llvm-svn: 84006
2009-10-13 18:51:28 +00:00
Devang Patel
934fb4274a
Remove unnecessary assert.
...
llvm-svn: 84004
2009-10-13 18:51:03 +00:00
Chris Lattner
a3cf123e86
strength reduce a ton of type equality tests to check the typeid (Through
...
the new predicates I added) instead of going through a context and doing a
pointer comparison. Besides being cheaper, this allows a smart compiler
to turn the if sequence into a switch.
llvm-svn: 83297
2009-10-05 05:54:46 +00:00
Devang Patel
292bcd8ca1
Only one custom meadata of each kind can be attached with an instruction.
...
llvm-svn: 83105
2009-09-29 20:30:57 +00:00
Devang Patel
1070b7a713
s/class Metadata/class MetadataContext/g
...
llvm-svn: 83019
2009-09-28 21:41:20 +00:00
Devang Patel
d836a7d651
Do not use global typedef for MDKindID.
...
llvm-svn: 83016
2009-09-28 21:14:55 +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
Daniel Dunbar
378331a13d
Tabs -> spaces, and remove trailing whitespace.
...
llvm-svn: 82355
2009-09-20 02:20:51 +00:00
Devang Patel
c195f74dee
Write and read metadata attachments.
...
llvm-svn: 82259
2009-09-18 19:26: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
Duncan Sands
750b1f5de2
Public and private corrections, warned about by icc ( #304 ).
...
Patch by Erick Tryzelaar.
llvm-svn: 81107
2009-09-06 08:55:57 +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
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
Devang Patel
8d50a366e4
Add new value for given index in MDValuePtrs.
...
llvm-svn: 80867
2009-09-03 01:38:02 +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
Devang Patel
fbaeda732e
Reapply 79977.
...
Use MDNodes to encode debug info in llvm IR.
llvm-svn: 80406
2009-08-28 23:24:31 +00:00
Devang Patel
10c075a316
Revert 79977. It causes llvm-gcc bootstrap failures on some platforms.
...
llvm-svn: 80073
2009-08-26 05:01:18 +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
53f0d68f87
Make LLVM command-line tools overwrite their output files without -f.
...
This is conventional command-line tool behavior. -f now just means
"enable binary output on terminals".
Add a -f option to llvm-extract and llvm-link, for consistency.
Remove F_Force from raw_fd_ostream and enable overwriting and
truncating by default. Introduce an F_Excl flag to permit users to
enable a failure when the file already exists. This flag is
currently unused.
Update Makefiles and documentation accordingly.
llvm-svn: 79990
2009-08-25 15:34:52 +00:00
Devang Patel
7d42bfab6c
Update DebugInfo interface to use metadata, instead of special named llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well.
...
This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!)
llvm-svn: 79977
2009-08-25 05:24:07 +00:00
Chris Lattner
e22a1d941e
remove some uses of llvm/Support/Streams.h
...
llvm-svn: 79842
2009-08-23 08:43:55 +00:00
Chris Lattner
b0478019b4
eliminate the std::ostream forms of the bitcode writing APIs.
...
llvm-svn: 79840
2009-08-23 07:49:08 +00:00
Dan Gohman
6ec8176e22
Rename hasNoUnsignedOverflow and hasNoSignedOverflow to hasNoUnsignedWrap
...
and hasNoSignedWrap, for consistency with the nuw and nsw properties.
llvm-svn: 79539
2009-08-20 17:11:38 +00:00
Daniel Dunbar
2cf5eb67b4
Switch to SmallString::str from SmallString::c_str, and remove
...
SmallString::c_str.
llvm-svn: 79456
2009-08-19 20:07:03 +00:00
Owen Anderson
dc11fe967d
Actually privatize a IntegerTypes, and fix a few bugs exposed by this.
...
llvm-svn: 78955
2009-08-13 23:27:32 +00:00
Owen Anderson
9df206d02d
Push LLVMContexts through the IntegerType APIs.
...
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Benjamin Kramer
9a590500ea
Make LLVMContext and LLVMContextImpl classes instead of structs.
...
llvm-svn: 78690
2009-08-11 17:45:13 +00:00
Erick Tryzelaar
85056aa5c8
Change llvm-c's ordering of contexts to make it consistent.
...
llvm-svn: 78656
2009-08-11 07:46:16 +00:00
Owen Anderson
3d0e1b855d
Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs.
...
llvm-svn: 78258
2009-08-05 23:16:16 +00:00
Chris Lattner
46f946526c
revert r78048, it isn't worth using assertingvh here.
...
llvm-svn: 78119
2009-08-04 23:07:12 +00:00
Owen Anderson
cf2c39dc30
Factor some of the constants+context related code out into a separate header, to make LLVMContextImpl.h
...
not hideous. Also, fix some MSVC compile errors.
llvm-svn: 78115
2009-08-04 22:41:48 +00:00
Devang Patel
ada7454774
Use separate ValueList for metadata.
...
This fixes PR4666.
llvm-svn: 78056
2009-08-04 06:00:18 +00:00
Devang Patel
90df234b2d
Revert recent bitcode writer patches.
...
llvm-svn: 78053
2009-08-04 05:01:35 +00:00
Chris Lattner
43d32f0969
switch ValueMap to using AssertingVH. This is an old patch I had laying
...
around in a tree I forgot about.
llvm-svn: 78048
2009-08-04 04:31:02 +00:00
Devang Patel
53ecc650f2
Remove dead code.
...
llvm-svn: 78035
2009-08-04 02:54:15 +00:00
Devang Patel
e4c893540b
Fix MDString Abbrev setup.
...
llvm-svn: 78034
2009-08-04 02:36:39 +00:00
Devang Patel
5312364dd4
Constants and Metadata share ValueList. This means they must be emitted interleaved (using appropriate BLOCK_IDs) otherwise ValuePtrs index gets out of sync.
...
llvm-svn: 78033
2009-08-04 02:26:56 +00:00
Owen Anderson
034ab4f8b1
Move the metadata constructors back to 2.5 syntax.
...
llvm-svn: 77733
2009-07-31 21:35:40 +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
Benjamin Kramer
162dc26fb9
Work around a dangling pointer dereference when enumerating NamedMDNodes.
...
llvm-svn: 77675
2009-07-31 14:22:13 +00:00
Devang Patel
c3f4aa73cc
Do not use abbrev while writing NamedMDNode name.
...
llvm-svn: 77637
2009-07-30 23:06:35 +00:00
Devang Patel
da86d84743
Enumerate NamedMDNode elements first.
...
llvm-svn: 77636
2009-07-30 23:03:43 +00:00
Owen Anderson
93ccaf5c60
Move more code back to 2.5 APIs.
...
llvm-svn: 77635
2009-07-30 23:03:37 +00:00
Devang Patel
d5b7c64109
Read and write NamedMDNode.
...
llvm-svn: 77517
2009-07-29 22:34:41 +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
0ce2151b36
Move ConstantExpr to 2.5 API.
...
llvm-svn: 77494
2009-07-29 18:55:55 +00:00
Devang Patel
57fbaa252c
Refactor. Fix indentation.
...
llvm-svn: 77482
2009-07-29 18:15:02 +00:00
Devang Patel
cb23671431
Rename MDNode.h header. It defines MDnode and other metadata classes.
...
New name is Metadata.h.
llvm-svn: 77370
2009-07-28 21:49:47 +00:00
Owen Anderson
390e9778d4
Return ConstantVector to 2.5 API.
...
llvm-svn: 77366
2009-07-28 21:19:26 +00:00
Owen Anderson
aa8c94b051
Change ConstantArray to 2.5 API.
...
llvm-svn: 77347
2009-07-28 18:32:17 +00:00
Owen Anderson
d729f993b8
Move ConstantStruct back to 2.5 API.
...
llvm-svn: 77266
2009-07-27 22:29:26 +00:00
Dan Gohman
490eb36e1d
Add a new keyword 'inbounds' for use with getelementptr. See the
...
LangRef.html changes for details.
llvm-svn: 77259
2009-07-27 21:53:46 +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
3e85b410ab
Remove Value::setName(const char*, unsigned).
...
llvm-svn: 77100
2009-07-26 00:34:27 +00:00
Daniel Dunbar
9f50ab3c49
Finish migrating VMCore to StringRef/Twine based APIs.
...
llvm-svn: 77051
2009-07-25 06:02:13 +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
Devang Patel
45ce5c2ac1
MDString
...
- Rename member function size(). New name is length().
- Store string beginning and length. Earlier it used to store string end.
llvm-svn: 76841
2009-07-23 02:00:51 +00:00
Devang Patel
6b2162686a
Derive MDNode from MetadataBase instead of Constant. Emit MDNodes into METADATA_BLOCK in bitcode file.
...
llvm-svn: 76834
2009-07-23 01:07:34 +00:00
Devang Patel
963b3bc974
Fix indentation.
...
llvm-svn: 76787
2009-07-22 21:10:50 +00:00
Devang Patel
04a1939c08
Use isa<> instead of dyn_cast<>.
...
llvm-svn: 76767
2009-07-22 18:35:25 +00:00
Sanjiv Gupta
2168098478
Fixed build warning. No functionality change.
...
llvm-svn: 76761
2009-07-22 17:58:47 +00:00
Devang Patel
5794cb80ad
Introduce MetadataBase, a base class for MDString and MDNode.
...
Derive MDString directly from MetadataBase.
Introduce new bitcode block to hold metadata.
llvm-svn: 76759
2009-07-22 17:43:22 +00:00
Dan Gohman
d2ad3e183b
Assembly and Bitcode support for unsigned/signed overflow flags and
...
exact sdiv flags.
llvm-svn: 76475
2009-07-20 21:19:07 +00:00
Bill Wendling
1a10a060cb
Add plumbing for the `linker_private' linkage type. This type is meant for
...
"private" symbols which the assember shouldn't strip, but which the linker may
remove after evaluation. This is mostly useful for Objective-C metadata.
This is plumbing, so we don't have a use of it yet. More to come, etc.
llvm-svn: 76385
2009-07-20 01:03:30 +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
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
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
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
Owen Anderson
cc20598b25
LLVMContext-ify the bitcode reader.
...
llvm-svn: 74942
2009-07-07 20:18:58 +00:00
Devang Patel
63050d96b5
!"i" is a valid MDString.
...
llvm-svn: 74881
2009-07-06 23:40:48 +00:00
Owen Anderson
4ddc0eaff0
Ack, missed one incompatibility.
...
llvm-svn: 74695
2009-07-02 07:21:49 +00:00