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

3989 Commits

Author SHA1 Message Date
Matt Beaumont-Gay
92f76e7901 Move default to top of switch
llvm-svn: 141366
2011-10-07 16:27:01 +00:00
Eli Friedman
4d63ca106a Remove the old atomic instrinsics. autoupgrade functionality is included with this patch.
llvm-svn: 141333
2011-10-06 23:20:49 +00:00
Matt Beaumont-Gay
13865f3e94 Fix -asserts build
llvm-svn: 141313
2011-10-06 20:59:09 +00:00
Torok Edwin
5a26a27370 Don't require C bindings opcode numbers to be kept in sync.
They are not in sync now, for example Bitcast would show up as LLVMCall.
So instead introduce 2 functions that map to and from the opcodes in the C
bindings.

llvm-svn: 141290
2011-10-06 12:39:34 +00:00
Torok Edwin
e5135b07e8 ocaml/C bindings: type->isSized()
llvm-svn: 141288
2011-10-06 12:13:28 +00:00
Torok Edwin
413276a992 add binding to read icmp predicate
llvm-svn: 141287
2011-10-06 12:13:20 +00:00
Torok Edwin
b0b404e35f ocaml/C bindings: getmdstring, add num_op, get_op should work on metadata too
llvm-svn: 141286
2011-10-06 12:13:11 +00:00
Torok Edwin
76fc6a1a53 C/OCaml API to retrieve struct name.
llvm-svn: 141285
2011-10-06 12:12:50 +00:00
Peter Collingbourne
253c6a3690 Build system infrastructure for multiple tblgens.
llvm-svn: 141266
2011-10-06 01:51:51 +00:00
Rafael Espindola
8247f7a5dd Check for the returns_twice attribute in callsFunctionThatReturnsTwice. This
fixes PR11038, but there are still some cleanups to be done.

llvm-svn: 141204
2011-10-05 20:05:13 +00:00
Ted Kremenek
e66beb2d1d Unbreak CMake build.
llvm-svn: 141097
2011-10-04 18:22:24 +00:00
Devang Patel
90c78f84f2 Put GCOVFile and other related interface in a common header so that llvm-cov tool can share it with GCOV writer.
llvm-svn: 141095
2011-10-04 17:24:48 +00:00
Devang Patel
659746207c Add C api for Instruction->eraseFromParent().
llvm-svn: 141023
2011-10-03 20:59:18 +00:00
Rafael Espindola
4700f53cee Add the returns_twice attribute to LLVM.
llvm-svn: 141001
2011-10-03 14:45:37 +00:00
Andrew Trick
e6f65d16d1 Tracing or debug-printing a newly formed instruction should not crash.
llvm-svn: 140874
2011-09-30 19:50:40 +00:00
Andrew Trick
6f589802f8 whitespace
llvm-svn: 140873
2011-09-30 19:48:58 +00:00
Eli Friedman
ac33381aa1 Clean up uses of switch instructions so they are not dependent on the operand ordering. Patch by Stepan Dyatkovskiy.
llvm-svn: 140803
2011-09-29 20:21:17 +00:00
Devang Patel
204df6030c Cosmetic changes, as per Nick's review.
llvm-svn: 140785
2011-09-29 16:46:47 +00:00
Duncan Sands
9a75d80f2c Check that catch clauses have pointer type.
llvm-svn: 140625
2011-09-27 19:34:22 +00:00
Duncan Sands
1695ec539b Have the verifier check that all landingpad operands are constants.
llvm-svn: 140606
2011-09-27 16:43:19 +00:00
Bill Wendling
97f5bfd1a3 The last verification check for the new EH model.
This makes sure that the unwind destination of an invoke is a landing pad.

llvm-svn: 140280
2011-09-21 22:57:02 +00:00
Richard Trieu
a675de9fac Change:
assert(!"error message");

To:

  assert(0 && "error message");

which is more consistant across the code base.

llvm-svn: 140234
2011-09-21 03:09:09 +00:00
Devang Patel
466c23b78a Add a check to make sure schedulePass() has not deleted stale RequiredPass.
llvm-svn: 139642
2011-09-13 21:13:29 +00:00
Duncan Sands
d1311488fe Add codegen support for vector select (in the IR this means a select
with a vector condition); such selects become VSELECT codegen nodes.
This patch also removes VSETCC codegen nodes, unifying them with SETCC
nodes (codegen was actually often using SETCC for vector SETCC already).
This ensures that various DAG combiner optimizations kick in for vector
comparisons.  Passes dragonegg bootstrap with no testsuite regressions
(nightly testsuite as well as "make check-all").  Patch mostly by
Nadav Rotem.

llvm-svn: 139159
2011-09-06 19:07:46 +00:00
Duncan Sands
6939ae53ac Split the init.trampoline intrinsic, which currently combines GCC's
init.trampoline and adjust.trampoline intrinsics, into two intrinsics
like in GCC.  While having one combined intrinsic is tempting, it is
not natural because typically the trampoline initialization needs to
be done in one function, and the result of adjust trampoline is needed
in a different (nested) function.  To get around this llvm-gcc hacks the
nested function lowering code to insert an additional parent variable
holding the adjust.trampoline result that can be accessed from the child
function.  Dragonegg doesn't have the luxury of tweaking GCC code, so it
stored the result of adjust.trampoline in the memory GCC set aside for
the trampoline itself (this is always available in the child function),
and set up some new memory (using an alloca) to hold the trampoline.
Unfortunately this breaks Go which allocates trampoline memory on the
heap and wants to use it even after the parent has exited (!).  Rather
than doing even more hacks to get Go working, it seemed best to just use
two intrinsics like in GCC.  Patch mostly by Sanjoy Das.

llvm-svn: 139140
2011-09-06 13:37:06 +00:00
Bill Wendling
dbea8de893 The insertion point for the loads is right before the llvm.eh.exception
call. The call may be in the same BB as the landingpad instruction. If that's
the case, then inserting the loads after the landingpad inst, but before the
extractvalues, causes undefined behavior.

llvm-svn: 139088
2011-09-04 09:02:18 +00:00
Bill Wendling
c273c3f456 Don't reload the values that are already there. The llvm.eh.resume uses the same
values that the resume instruction uses.
PR10850

llvm-svn: 139076
2011-09-03 01:38:17 +00:00
Bill Wendling
e35fdee39e No need to get fancy inserting a PHI node when the values are stored in stack
slots. This fixes a bug where the number of nodes coming into the PHI node may
not equal the number of predecessors. E.g., two or more landingpad instructions
may require a PHI before reaching the eh.exception and eh.selector instructions.

llvm-svn: 139035
2011-09-02 21:17:08 +00:00
Jakub Staszak
4df162e09b Return undef value (instead of arbitrary) for wrong or undef index in
ConstantVector.

llvm-svn: 139007
2011-09-02 17:01:40 +00:00
Jakub Staszak
132e24bf28 ConstantVector returns arbitrary value for the wrong index.
This fixes PR10813.

llvm-svn: 139006
2011-09-02 15:43:43 +00:00
Bill Wendling
66d5793dcf Perform the upgrading of the old EH to the new EH in a more sane manner.
Perform the upgrading in steps.

* First, create a map of the invokes to the EH intrinsics.

* Next, take that mapping and determine if the invoke's unwind destination has a
  single predecessor. If not, then create a new empty block to hold the new
  landingpad instruction.

* Create a landingpad instruction into the uwnind destination. Fill it with the
  values from the old selector. Map the old intrinsic calls to the new
  landingpad values (there may be multiple landingpad instructions per instrinic
  call pairs).

* Go through the old intrinsic calls, create a PHI node when necessary, and then
  replace their values with the new values from the landingpad instructions.

* Delete all dead instructions.

* ???

* Profit!

llvm-svn: 138990
2011-09-02 01:30:08 +00:00
Eli Friedman
3e1fc84a39 Make isSafeToSpeculativelyExecute() return the right answer for some new instructions. Found by inspection; not sure what practical impact, if any, this has.
llvm-svn: 138962
2011-09-01 21:03:03 +00:00
Nadav Rotem
43912ff374 Fixes following the CR by Chris and Duncan:
Optimize chained bitcasts of the form A->B->A.
Undo r138722 and change isEliminableCastPair to allow this case.

llvm-svn: 138756
2011-08-29 19:58:36 +00:00
Benjamin Kramer
da658378b3 Dump with dbgs() instead of printf.
llvm-svn: 138749
2011-08-29 18:14:17 +00:00
Benjamin Kramer
442620e4c4 Make GCC happy by adding parens.
llvm-svn: 138748
2011-08-29 18:14:15 +00:00
Andrew Trick
026fa4da72 Reapply r138695. Fix PassManager stack depths.
Patch by Xiaoyi Guo!

llvm-svn: 138737
2011-08-29 17:07:00 +00:00
Andrew Trick
65754eb3f7 Reverting r138695 to see if it fixes clang self host.
llvm-svn: 138701
2011-08-27 06:10:16 +00:00
Bill Wendling
607b3c3898 Only delete instructions once.
llvm-svn: 138700
2011-08-27 06:10:02 +00:00
Andrew Trick
e38568bc07 Fix PassManager stack depths.
Patch by Xiaoyi Guo!

llvm-svn: 138695
2011-08-27 02:11:03 +00:00
Bill Wendling
546c7a05de Initial check in that will auto-upgrade the old EH scheme to the new EH scheme.
This upgrade suffers from the problems of the old EH scheme - i.e., that the
calls to llvm.eh.exception() and llvm.eh.selector() can wander off and get
lost. It makes a valiant effort to reclaim these little lost lambs.

This is a first draft, so it hasn't yet been hooked up to the parser.

llvm-svn: 138602
2011-08-25 23:22:40 +00:00
Nadav Rotem
43673d6d0b Implement Constant::isAllOnesValue(). Fix ConstantFolding to use the new api.
llvm-svn: 138469
2011-08-24 20:18:38 +00:00
Nate Begeman
87ffb9491b Add some useful accessors to c++ api that appear to be missing from the c api
llvm-svn: 138371
2011-08-23 20:27:46 +00:00
Eric Christopher
aa4993b9aa Revert "Address Duncan's CR request:"
This reverts commit 20a05be15ea5271ab6185b83200fa88263362400. (svn rev 138340)

Conflicts:

	test/Transforms/InstCombine/bitcast.ll

llvm-svn: 138366
2011-08-23 20:11:10 +00:00
Nadav Rotem
d449bc9bff Address Duncan's CR request:
1. Cleanup the tests in ConstantFolding.cpp
2. Implement isAllOnes for Constant, ConstantFP, ConstantVector

llvm-svn: 138340
2011-08-23 17:48:43 +00:00
Chris Lattner
8213fad390 Rip out the old StructType APIs as warned about on llvmdev last week.
llvm-svn: 137953
2011-08-18 17:39:28 +00:00
Bill Wendling
3566980062 Revert r137655. There is some question about whether the 'landingpad'
instruction should be marked as potentially reading and/or writing memory.

llvm-svn: 137863
2011-08-17 20:36:44 +00:00
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