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

3943 Commits

Author SHA1 Message Date
Bill Wendling
3e01808007 The resume instruction may throw. Return 'true' in this case.
llvm-svn: 137757
2011-08-16 21:15:50 +00:00
Bill Wendling
4ad70bfedd Add getFirstInsertionPt() method.
getFirstInsertionPt() returns an iterator to the first insertion point in a
basic block. This is after all PHIs and any other instruction which is required
to be at the top of the basic block (like LandingPadInst).

llvm-svn: 137744
2011-08-16 20:42:52 +00:00
Bill Wendling
a75d2d0416 Duncan pointed out that the LandingPadInst might read memory. (It might also
write to memory.) Marking it as such makes some checks for immobility go away.

llvm-svn: 137655
2011-08-15 21:14:31 +00:00
Eli Friedman
bfebfae6f6 Fix predicates methods on Instruction to handle atomic load/store correctly.
llvm-svn: 137652
2011-08-15 21:00:18 +00:00
Nick Lewycky
5b5b31917d Remove the last improper use of getGlobalContext() from LLVM.
This caused a race condition where a thread calls ~LLVMContextImpl which calls
Module::dropAllReferences which calls begin() on an empty ilist that would
create the sentinel, which racily accesses the global context.

This can not be fixed by locking inside createSentinel because the lock would
need to be shared with all users of the global context, including those that
reside outside LLVM's own code.

llvm-svn: 137546
2011-08-13 01:04:44 +00:00
Eli Friedman
baf0f69f9a Move "atomic" and "volatile" designations on instructions after the opcode
of the instruction.

Note that this change affects the existing non-atomic load and store
instructions; the parser now accepts both forms, and the change is noted
in the release notes.

llvm-svn: 137527
2011-08-12 22:50:01 +00:00
Bill Wendling
4cbbcd4f82 Initial commit of the 'landingpad' instruction.
This implements the 'landingpad' instruction. It's used to indicate that a basic
block is a landing pad. There are several restrictions on its use (see
LangRef.html for more detail). These restrictions allow the exception handling
code to gather the information it needs in a much more sane way.

This patch has the definition, implementation, C interface, parsing, and bitcode
support in it.

llvm-svn: 137501
2011-08-12 20:24:12 +00:00
Chris Lattner
d297c1dd99 add ifdef's to let people easily remove these dead api for testing.
llvm-svn: 137483
2011-08-12 18:08:19 +00:00
Chris Lattner
109982ca44 switch to the new struct apis.
llvm-svn: 137481
2011-08-12 18:07:07 +00:00
Chris Lattner
605a2173f8 forward to the correct constructor.
llvm-svn: 137479
2011-08-12 18:03:30 +00:00
Chris Lattner
7f69a7da6e add two missing function impls
llvm-svn: 137470
2011-08-12 17:43:05 +00:00
Chris Lattner
d666fbc755 add new accessors to reflect new terminology in struct types.
llvm-svn: 137468
2011-08-12 17:31:02 +00:00
Eli Friedman
fa9191bd9f Whitespace.
llvm-svn: 137226
2011-08-10 17:39:11 +00:00
NAKAMURA Takumi
604b538820 VMCore/BasicBlock.cpp: Don't assume BasicBlock::iterator might end with a non-PHInode Instruction in successors.
Frontends(eg. clang) might pass incomplete form of IR, to step off the way beyond iterator end. In the case I had met, it took infinite loop due to meeting bogus PHInode.

Thanks to Jay Foad and John McCall.

llvm-svn: 137175
2011-08-09 23:13:05 +00:00
NAKAMURA Takumi
9c7aa146af Fix whitespace.
llvm-svn: 137174
2011-08-09 23:12:56 +00:00
Eli Friedman
5a2d27800e Representation of 'atomic load' and 'atomic store' in IR.
llvm-svn: 137170
2011-08-09 23:02:53 +00:00
Bill Wendling
8fb8ed6fc8 Indicate that there are changes if runOfFunction returns saying that there are.
Patch by Jingyue!

llvm-svn: 137072
2011-08-08 23:01:10 +00:00
Bill Wendling
ee869ce6c1 Remove unnecessary space.
llvm-svn: 137041
2011-08-08 08:02:48 +00:00
Chris Lattner
5099413082 strengthen up an assertion: you can't create a constant struct
with an opaque struct type, it doesn't make sense.  This should
resolve PR10473.

llvm-svn: 137028
2011-08-07 04:18:48 +00:00
Chris Lattner
d4b0ee77a9 fix PR10286, a problem with the .ll printer handling block addresses that are out-of-scope.
llvm-svn: 136768
2011-08-03 06:15:41 +00:00
Bill Wendling
b37af02067 Remove the LLVMBuildUnwind C API function.
The 'unwind' function is going away with the new EH rewrite. This is step 0 in
keeping front-ends from using it.

llvm-svn: 136683
2011-08-02 06:20:17 +00:00
Jay Foad
8a07eadb04 Add braces.
llvm-svn: 136612
2011-08-01 12:48:54 +00:00
Jay Foad
cf38f986e3 Simplify printAlias.
llvm-svn: 136611
2011-08-01 12:29:14 +00:00
Jay Foad
5001a9966f Micro-optimisation in getAliasedGlobal.
llvm-svn: 136610
2011-08-01 12:28:01 +00:00
Bill Wendling
8a625cebd2 Add the 'resume' instruction for the new EH rewrite.
This adds the 'resume' instruction class, IR parsing, and bitcode reading and
writing. The 'resume' instruction resumes propagation of an existing (in-flight)
exception whose unwinding was interrupted with a 'landingpad' instruction (to be
added later).

llvm-svn: 136589
2011-07-31 06:30:59 +00:00
Bill Wendling
57ddbb84ac Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,
r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444,
r136445, r136446, r136253 pending review.

llvm-svn: 136556
2011-07-30 05:42:50 +00:00
Chris Lattner
4e2659058e have the verifier catch gep's into opaque struct types. PR10473
llvm-svn: 136510
2011-07-29 20:32:28 +00:00
Eli Friedman
6f2419f1a2 Misc optimizer+codegen work for 'cmpxchg' and 'atomicrmw'. They appear to be
working on x86 (at least for trivial testcases); other architectures will
need more work so that they actually emit the appropriate instructions for
orderings stricter than 'monotonic'. (As far as I can tell, the ARM, PPC,
Mips, and Alpha backends need such changes.)

llvm-svn: 136457
2011-07-29 03:05:32 +00:00
Chandler Carruth
f7890e34b9 Rewrite the CMake build to use explicit dependencies between libraries,
specified in the same file that the library itself is created. This is
more idiomatic for CMake builds, and also allows us to correctly specify
dependencies that are missed due to bugs in the GenLibDeps perl script,
or change from compiler to compiler. On Linux, this returns CMake to
a place where it can relably rebuild several targets of LLVM.

I have tried not to change the dependencies from the ones in the current
auto-generated file. The only places I've really diverged are in places
where I was seeing link failures, and added a dependency. The goal of
this patch is not to start changing the dependencies, merely to move
them into the correct location, and an explicit form that we can control
and change when necessary.

This also removes a serialization point in the build because we don't
have to scan all the libraries before we begin building various tools.
We no longer have a step of the build that regenerates a file inside the
source tree. A few other associated cleanups fall out of this.

This isn't really finished yet though. After talking to dgregor he urged
switching to a single CMake macro to construct libraries with both
sources and dependencies in the arguments. Migrating from the two macros
to that style will be a follow-up patch.

Also, llvm-config is still generated with GenLibDeps.pl, which means it
still has slightly buggy dependencies. The internal CMake
'llvm-config-like' macro uses the correct explicitly specified
dependencies however. A future patch will switch llvm-config generation
(when using CMake) to be based on these deps as well.

This may well break Windows. I'm getting a machine set up now to dig
into any failures there. If anyone can chime in with problems they see
or ideas of how to solve them for Windows, much appreciated.

llvm-svn: 136433
2011-07-29 00:14:25 +00:00
Eli Friedman
f6797ffc9a LangRef and basic memory-representation/reading/writing for 'cmpxchg' and
'atomicrmw' instructions, which allow representing all the current atomic
rmw intrinsics.

The allowed operands for these instructions are heavily restricted at the
moment; we can probably loosen it a bit, but supporting general
first-class types (where it makes sense) might get a bit complicated,
given how SelectionDAG works.

As an initial cut, these operations do not support specifying an alignment,
but it would be possible to add if we think it's useful. Specifying an
alignment lower than the natural alignment would be essentially
impossible to support on anything other than x86, but specifying a greater
alignment would be possible.  I can't think of any useful optimizations which
would use that information, but maybe someone else has ideas.

Optimizer/codegen support coming soon.

llvm-svn: 136404
2011-07-28 21:48:00 +00:00
Bill Wendling
22f729dcfb The personality function should be a Function* and not just a Value*.
llvm-svn: 136392
2011-07-28 21:14:13 +00:00
Bill Wendling
62385f232c Don't add in the asked for size so that we don't copy too much from the old to new vectors.
llvm-svn: 136338
2011-07-28 07:26:41 +00:00
Bill Wendling
b75e5fc784 Make sure that the landingpad instruction takes a Constant* as the clause's value.
llvm-svn: 136326
2011-07-28 02:27:12 +00:00
Bill Wendling
03445c79b9 Add a couple of convenience functions:
* InvokeInst: Get the landingpad instruction associated with this invoke.
* LandingPadInst: A method to reserve extra space for clauses.

llvm-svn: 136325
2011-07-28 02:15:52 +00:00
Bill Wendling
b20cfdfe95 Merge the contents from exception-handling-rewrite to the mainline.
This adds the new instructions 'landingpad' and 'resume'.

llvm-svn: 136253
2011-07-27 20:18:04 +00:00
Eli Friedman
f226974353 Misc mid-level changes for new 'fence' instruction.
llvm-svn: 136205
2011-07-27 01:08:30 +00:00
Eli Friedman
50291d09da Initial implementation of 'fence' instruction, the new C++0x-style replacement for llvm.memory.barrier.
This is just a LangRef entry and reading/writing/memory representation; optimizer+codegen support coming soon.

llvm-svn: 136009
2011-07-25 23:16:38 +00:00
Jay Foad
4f279f9a6f Use ArrayRef in the (protected) constructors of ConstantArray, ConstantStruct and ConstantVector.
llvm-svn: 135905
2011-07-25 10:14:44 +00:00
Jay Foad
6513dac6e2 Convert GetElementPtrInst to use ArrayRef.
llvm-svn: 135904
2011-07-25 09:48:08 +00:00
Jay Foad
42463ed852 Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to use
ArrayRef.

llvm-svn: 135761
2011-07-22 08:16:57 +00:00
Jay Foad
42eb18b051 Make better use of ConstantExpr::getGetElementPtr's InBounds parameter.
llvm-svn: 135676
2011-07-21 15:15:37 +00:00
Jay Foad
d4458dd707 Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.

llvm-svn: 135673
2011-07-21 14:31:17 +00:00
Chris Lattner
c4ab50bd33 move tier out of an anonymous namespace, it doesn't make sense
to for it to be an an anon namespace and be in a header.

Eliminate some extraenous uses of tie.

llvm-svn: 135669
2011-07-21 06:21:31 +00:00
Jay Foad
6d007bef3c Convert ConstantFoldGetElementPtr to use ArrayRef.
llvm-svn: 135483
2011-07-19 15:30:30 +00:00
Jeffrey Yasskin
2e0f2a0985 Add APInt(numBits, ArrayRef<uint64_t> bigVal) constructor to prevent future ambiguity
errors like the one corrected by r135261.  Migrate all LLVM callers of the old
constructor to the new one.

llvm-svn: 135431
2011-07-18 21:45:40 +00:00
Frits van Bommel
6c24f9c277 Migrate LLVM and Clang to use the new makeArrayRef(...) functions where previously explicit non-default constructors were used.
Mostly mechanical with some manual reformatting.

llvm-svn: 135390
2011-07-18 12:00:32 +00:00
Chris Lattner
e1fe7061ce land David Blaikie's patch to de-constify Type, with a few tweaks.
llvm-svn: 135375
2011-07-18 04:54:35 +00:00
Chris Lattner
1810c19d8e tidy up
llvm-svn: 135360
2011-07-17 06:01:30 +00:00
Chris Lattner
7fc89c5ff8 deconstify getType()'s.
llvm-svn: 135323
2011-07-15 23:15:45 +00:00
Jay Foad
c826df8fb7 Convert CallInst and InvokeInst APIs to use ArrayRef.
llvm-svn: 135265
2011-07-15 08:37:34 +00:00