Commit Graph

35965 Commits

Author SHA1 Message Date
Gordon Henriksen 8790a22a30 Document a more robust implementation of performCustomLowering.
llvm-svn: 45326
2007-12-22 23:32:32 +00:00
Chris Lattner 00602f6105 fix some warnings. This code needs to be de-tabified :(
llvm-svn: 45325
2007-12-22 22:47:03 +00:00
Chris Lattner 91f3379660 fix strict-aliasing violation
llvm-svn: 45324
2007-12-22 22:45:38 +00:00
Chris Lattner de272b1b63 initial code for forming an FGETSIGN node. This is disabled until
legalizer support goes in.

llvm-svn: 45323
2007-12-22 21:35:38 +00:00
Chris Lattner afc8f13bf5 improve support for fgetsign
llvm-svn: 45322
2007-12-22 21:26:52 +00:00
Chris Lattner efd1cddb5a Tell TargetLoweringOpt whether it is running before
or after legalize.

llvm-svn: 45321
2007-12-22 20:56:36 +00:00
Chris Lattner 843cad4df2 Add a new FGETSIGN operation, which defaults to expand on all
targets.

llvm-svn: 45320
2007-12-22 20:47:56 +00:00
Anton Korobeynikov 1b1250770c Erm, really disable :)
llvm-svn: 45319
2007-12-22 20:46:24 +00:00
Anton Korobeynikov d34112a4ee Disable, until we'll really need it
llvm-svn: 45318
2007-12-22 20:41:12 +00:00
Gordon Henriksen 0c43064daf Fix a partial application typo.
llvm-svn: 45317
2007-12-22 19:41:30 +00:00
Gordon Henriksen 41689b52ab Use getIntrinsicID instead of looking up intrinsic prototypes. Also
fixes a bug with indirect calls. (Test case will be included with
ocaml collector patch.)

llvm-svn: 45316
2007-12-22 17:27:01 +00:00
Anton Korobeynikov eed7c0b9f7 Unbreak build on gcc 3.x
llvm-svn: 45315
2007-12-22 14:27:49 +00:00
Anton Korobeynikov 2ffb2c9e59 Unbreak mingw build
llvm-svn: 45314
2007-12-22 14:26:49 +00:00
Evan Cheng 345a00ba05 Preliminary PIC JIT support for X86 (32-bit) / Darwin.
llvm-svn: 45313
2007-12-22 09:40:20 +00:00
Evan Cheng db33a0211b Oops.
llvm-svn: 45312
2007-12-22 09:14:34 +00:00
Chris Lattner 74b2ab59fd implement InstCombine/shift-trunc-shift.ll. This allows
us to compile:
#include <math.h>
int t1(double d) { return signbit(d); }

into:

_t1:
	movd	%xmm0, %rax
	shrq	$63, %rax
	ret

instead of:

_t1:
	movd	%xmm0, %rax
	shrq	$32, %rax
	shrl	$31, %eax
	ret

on x86-64.

llvm-svn: 45311
2007-12-22 09:07:47 +00:00
Owen Anderson 5a4c05d047 Note what still needs doing.
llvm-svn: 45310
2007-12-22 04:59:10 +00:00
Owen Anderson 4534100765 Remove critical edge breaking. It won't be necessary as long as we are very careful when inserting copies.
llvm-svn: 45309
2007-12-22 04:50:11 +00:00
Evan Cheng f4f52dbc8c Fix JIT code emission of X86::MovePCtoStack.
llvm-svn: 45307
2007-12-22 02:26:46 +00:00
Devang Patel 7a2c66b11e If succ has succ itself as one of the predecessors then do
not merge current bb and succ even if bb's terminator is
unconditional branch to succ.

llvm-svn: 45305
2007-12-22 01:32:53 +00:00
Evan Cheng ac134551c6 Allow JIT with non-static relocation model.
llvm-svn: 45304
2007-12-22 01:12:14 +00:00
Anton Korobeynikov 1e8c1308bb Fix silly typo in the FP CEP handling.
llvm-svn: 45300
2007-12-21 23:33:44 +00:00
Duncan Sands 85f26f28b9 Fix a brain fart by our beloved leader (the content
of this patch is the last line).

llvm-svn: 45289
2007-12-21 20:18:41 +00:00
Duncan Sands 8c5822802e Get the verifier to check attributes on calls as well
as on functions.  Make it verify invokes and not just
ordinary calls.  As a (desired) side-effect, it is no
longer legal to have call attributes on arguments that
are being passed to the varargs part of a varargs
function (llvm-as drops them on the floor anyway).

llvm-svn: 45286
2007-12-21 19:19:01 +00:00
Duncan Sands 6a7703ed63 Make DAE not wipe out attributes on calls, and not drop
return attributes on the floor.  In the case of a call
to a varargs function where the varargs arguments are
being removed, any call attributes on those arguments
need to be dropped.  I didn't do this because I plan to
make it illegal to have such attributes (see next patch).
With this change, compiling the gcc filter2 eh test at -O0
and then running opt -std-compile-opts on it results in
a correctly working program (compiling at -O1 or higher
results in the test failing due to a problem with how we
output eh info into the IR).

llvm-svn: 45285
2007-12-21 19:16:16 +00:00
Nicolas Geoffray 31a2c3948e Fix unintented change from last commit
llvm-svn: 45282
2007-12-21 12:22:29 +00:00
Nicolas Geoffray 80c741e160 Enable EH for linux/ppc32 targets
llvm-svn: 45281
2007-12-21 12:19:44 +00:00
Evan Cheng 78c460c8c4 New entry.
llvm-svn: 45280
2007-12-21 01:31:58 +00:00
Evan Cheng b54038fc29 Add a few more missing gcc builtin's.
llvm-svn: 45278
2007-12-21 01:30:39 +00:00
Ted Kremenek 1cf6c7aa5b Removed scoped_ptr, as its functionality is subsumed by OwningPtr.
llvm-svn: 45274
2007-12-21 00:15:29 +00:00
Evan Cheng 01c7c198ee Fix JIT encoding for CMPSD as well.
llvm-svn: 45268
2007-12-20 19:57:09 +00:00
Ted Kremenek 5e2413384e Added OwningArrayPtr smart pointer class to provide an analogous class to
OwningPtr except that it works for pointers to arrays.

llvm-svn: 45266
2007-12-20 19:53:47 +00:00
Chris Lattner 63fbcdf6ca add new smart pointer for clang.
llvm-svn: 45261
2007-12-20 19:14:02 +00:00
Evan Cheng c226ed0273 Type specification didn't match gcc's.
llvm-svn: 45260
2007-12-20 09:35:28 +00:00
Evan Cheng f989141d30 More accurate checks for two-address constraints.
llvm-svn: 45259
2007-12-20 09:25:31 +00:00
Christopher Lamb 7d82bc46b8 Implement review feedback, including additional transforms
(icmp slt (sub A B) 1) -> (icmp sle A B)
icmp sgt (sub A B) -1) -> (icmp sge A B)

and add testcase.

llvm-svn: 45256
2007-12-20 07:21:11 +00:00
Chris Lattner e2cf5b8c5c Add m_Zero().
llvm-svn: 45255
2007-12-20 04:47:44 +00:00
Evan Cheng ddc9af11f0 Remove xfail. This is fixed.
llvm-svn: 45254
2007-12-20 02:25:21 +00:00
Evan Cheng a509537e25 The physical register + virtual register joining requirement was much too strict.
llvm-svn: 45253
2007-12-20 02:23:25 +00:00
Evan Cheng 61bc51ee97 Bring back a burr scheduling heuristic that's still needed.
llvm-svn: 45252
2007-12-20 02:22:36 +00:00
Evan Cheng 26ee54eb05 Clean up previous patch: PHI uses should not prevent iv reuse if all other uses are addresses. This trades a constant multiply for one fewer iv.
llvm-svn: 45251
2007-12-20 02:20:53 +00:00
Chris Lattner 16a51da0e2 simplify this code with the new m_Zero() pattern. Make sure the select only
has a single use, and generalize it to not require N to be a constant.

llvm-svn: 45250
2007-12-20 01:56:58 +00:00
Devang Patel c006744c38 Revert my previous check-in.
llvm-svn: 45249
2007-12-20 01:46:01 +00:00
Anton Korobeynikov dce44d87f8 More eye-candy stuff :)
llvm-svn: 45247
2007-12-20 01:30:27 +00:00
Anton Korobeynikov 5ab614824d Add iterators for child traversal.
llvm-svn: 45246
2007-12-20 01:21:50 +00:00
Bill Wendling 65c001e6bc Updated comments to reflect what "side effects" means in this situation.
llvm-svn: 45245
2007-12-20 01:08:10 +00:00
Scott Michel 5f1470f03a More working CellSPU tests:
- vec_const.ll: Vector constant loads
- immed64.ll: i64, f64 constant loads

llvm-svn: 45242
2007-12-20 00:44:13 +00:00
Devang Patel 6d279d484a Add lto version check mechanism.
llvm-svn: 45238
2007-12-20 00:24:01 +00:00
Gordon Henriksen 59db63d5fc Use a module to group calling convention values, too.
llvm-svn: 45236
2007-12-20 00:13:26 +00:00
Evan Cheng e2a8ba7fec Allow iv reuse if the user is a PHI node which is in turn used as addresses.
llvm-svn: 45230
2007-12-19 23:33:23 +00:00
Gordon Henriksen eb4ce98f98 Using modules to group enumerations in Ocaml bindings.
llvm-svn: 45229
2007-12-19 22:54:12 +00:00
Gordon Henriksen 34eb6d877e Adding bindings for memory buffers and module providers. Switching
to exceptions rather than variants for error handling in Ocaml.

llvm-svn: 45226
2007-12-19 22:30:40 +00:00
Dale Johannesen eadbf4b91c Enable EH on PPC Darwin. This basically works; there
are a couple of issues that show up with the optimizer,
but I don't think they're really EH problems.
(llvm-gcc testsuite users note:  By default the testsuite
uses the unwinding code that's built as part of your local
llvm-gcc, which does not work.  You need to trick it into
using the installed system unwinding code to get useful
results.)

llvm-svn: 45221
2007-12-19 21:54:36 +00:00
Scott Michel 5ecac82f71 CellSPU testcase, extract_elt.ll: extract vector element.
llvm-svn: 45219
2007-12-19 21:17:42 +00:00
Duncan Sands aa31b92508 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
Scott Michel a246e09aa0 More working CellSPU test cases:
- call.ll: Function call
- ctpop.ll: Count population
- dp_farith.ll: DP arithmetic
- eqv.ll: Equivalence primitives
- fcmp.ll: SP comparisons
- fdiv.ll: SP division
- fneg-fabs.ll: SP negation, aboslute value
- int2fp.ll: Integer -> SP conversion
- rotate_ops.ll: Rotation primitives
- select_bits.ll: (a & c) | (b & ~c) bit selection
- shift_ops.ll: Shift primitives
- sp_farith.ll: SP arithmentic

llvm-svn: 45217
2007-12-19 20:50:49 +00:00
Scott Michel 098c113bc8 Two more test cases: or_ops.ll (arithmetic or operations) and vecinsert.ll
(vector insertions)

llvm-svn: 45216
2007-12-19 20:15:47 +00:00
Chris Lattner f1be288617 fix formatting
llvm-svn: 45214
2007-12-19 19:48:49 +00:00
Duncan Sands e9d8861cdf Simplify LowerCallTo by using a callsite.
llvm-svn: 45198
2007-12-19 09:48:52 +00:00
Duncan Sands 030bce7b83 The C++ exception handling personality function wants
to know about calls that cannot throw ('nounwind'):
if such a call does throw for some reason then the
personality will terminate the program.  The distinction
between an ordinary call and a nounwind call is that
an ordinary call gets an entry in the exception table
but a nounwind call does not.  This patch sets up the
exception table appropriately.  One oddity is that
I've chosen to bracket nounwind calls with labels (like
invokes) - the other choice would have been to bracket
ordinary calls with labels.  While bracketing
ordinary calls is more natural (because bracketing
by labels would then correspond exactly to getting an
entry in the exception table), I didn't do it because
introducing labels impedes some optimizations and I'm
guessing that ordinary calls occur more often than
nounwind calls.  This fixes the gcc filter2 eh test,
at least at -O0 (the inliner needs some tweaking at
higher optimization levels).

llvm-svn: 45197
2007-12-19 07:36:31 +00:00
Scott Michel 9b834469e0 Add new immed16.ll test case, fix CellSPU errata to make test case work.
llvm-svn: 45196
2007-12-19 07:35:06 +00:00
Bill Wendling b528a10e0a Modified to support comments better.
llvm-svn: 45192
2007-12-19 06:20:05 +00:00
Bill Wendling ca77ecb40a Mark the "isRemat" instruction as never having side effects.
llvm-svn: 45190
2007-12-19 06:07:48 +00:00
Chris Lattner 747359f973 fix more table abuses.
llvm-svn: 45187
2007-12-19 05:04:11 +00:00
Evan Cheng 9f06e5e2df Don't leave newly created nodes around if it turns out they are not needed.
llvm-svn: 45186
2007-12-19 01:34:38 +00:00
Ted Kremenek 14020706d8 Added "GetCurrentDirectory()" to sys::Path.
llvm-svn: 45182
2007-12-18 22:07:33 +00:00
Bill Wendling 166f746246 Add debugging info. Use the newly created "hasUnmodelledSideEffects" method.
llvm-svn: 45178
2007-12-18 21:38:04 +00:00
Christopher Lamb f00ac6dd93 Fold subtracts into integer compares vs. zero. This improves generate code for this case on X86
from
_foo:
        movl    $99, %ecx
        movl    4(%esp), %eax
        subl    %eax, %ecx
        xorl    %edx, %edx
        testl   %ecx, %ecx
        cmovs   %edx, %eax
        ret

to
_foo:
        xorl    %ecx, %ecx
        movl    4(%esp), %eax
        cmpl    $99, %eax
        cmovg   %ecx, %eax
        ret

llvm-svn: 45173
2007-12-18 21:32:20 +00:00
Anton Korobeynikov 95cc3e0e66 Support more insane CEP's in AsmPrinter (Yes, PyPy folks do really use them).
llvm-svn: 45172
2007-12-18 20:53:41 +00:00
Christopher Lamb b7016c53d1 Fix comments
llvm-svn: 45170
2007-12-18 20:33:11 +00:00
Christopher Lamb 74dbad9216 Remove an orthogonal transformation of the selection condition from my most recent submission.
llvm-svn: 45169
2007-12-18 20:30:28 +00:00
Ted Kremenek 74db04261b Added "isDirectory" method to llvm::sys::Path.
llvm-svn: 45168
2007-12-18 19:46:22 +00:00
Evan Cheng 483a969ece Fix PR1872: SrcValue and SrcValueOffset should not be used to compute load / store node id.
llvm-svn: 45167
2007-12-18 19:38:14 +00:00
Bill Wendling 7c0bea1ce9 Ignore shell scripts when doing "dsymutil" call.
llvm-svn: 45166
2007-12-18 19:21:52 +00:00
Chris Lattner 5f47cae3ce remove obviously dead uses of IncludeFile.
llvm-svn: 45165
2007-12-18 19:15:48 +00:00
Evan Cheng 78ced47a2f Also print alignment and volatileness.
llvm-svn: 45164
2007-12-18 19:06:30 +00:00
Chris Lattner d92e71cf9a remove a dead annotation
llvm-svn: 45163
2007-12-18 19:04:24 +00:00
Ted Kremenek 3d71ad1976 Added some sectioning comments to Serialize.h.
Added additional serialization functors for use with std::foreach.

llvm-svn: 45162
2007-12-18 18:25:55 +00:00
Chris Lattner 2583a66295 add an obvious load folding missed optzn.
llvm-svn: 45161
2007-12-18 16:48:14 +00:00
Duncan Sands 3353ed09ac Rename isNoReturn to doesNotReturn, and isNoUnwind to
doesNotThrow.

llvm-svn: 45160
2007-12-18 09:59:50 +00:00
Christopher Lamb 30291f4a30 Fix typos.
llvm-svn: 45159
2007-12-18 09:45:40 +00:00
Christopher Lamb 8b09a464b4 Fold certain additions through selects (and their compares) so as to eliminate subtractions. This code is often produced by the SMAX expansion in SCEV.
This implements test/Transforms/InstCombine/2007-12-18-AddSelCmpSub.ll

llvm-svn: 45158
2007-12-18 09:34:41 +00:00
Evan Cheng 91e0fc9cb4 FIX for PR1799: When a load is unfolded from an instruction, check if it is a new node. If not, do not create a new SUnit.
llvm-svn: 45157
2007-12-18 08:42:10 +00:00
Evan Cheng e2dbba5828 SelectionDAG::dump() should print SrcValue of LoadSDNode and StoreSDNode.
llvm-svn: 45151
2007-12-18 07:02:08 +00:00
Chris Lattner 9a2e3cb48d avoid confusing terminology (what is a "word"?), fix scary markup, add section to TOC.
llvm-svn: 45150
2007-12-18 06:18:21 +00:00
Christopher Lamb ac7d631ed2 Don't forget to print address space qualifiers when printing out the type table! Thanks to Gordon Henriksen for pointing this out.
llvm-svn: 45147
2007-12-18 03:49:35 +00:00
Dale Johannesen a56aab57e9 Testcase for preceding FE fix
llvm-svn: 45144
2007-12-18 01:58:38 +00:00
Chris Lattner 52a9e40789 add a missed case.
llvm-svn: 45141
2007-12-18 01:19:18 +00:00
Evan Cheng a8288f4294 Remove int_x86_sse2_movl_dq. It's replaced with a string compare.
llvm-svn: 45140
2007-12-18 01:04:25 +00:00
Evan Cheng 61eacb9048 These have matching builtin's in 4.2.
llvm-svn: 45139
2007-12-18 00:52:20 +00:00
Scott Michel 8172f85e2f i32 immediate constant test case for CellSPU
llvm-svn: 45134
2007-12-17 23:45:52 +00:00
Bill Wendling 34cc217741 s/hasSideEffects/hasUnmodelledSideEffects/g
llvm-svn: 45133
2007-12-17 23:19:54 +00:00
Bill Wendling b3d85a5d4b Add "mayHaveSideEffects" and "neverHasSideEffects" flags to some instructions. I
based what flag to set on whether it was already marked as
"isRematerializable". If there was a further check to determine if it's "really"
rematerializable, then I marked it as "mayHaveSideEffects" and created a check
in the X86 back-end similar to the remat one.

llvm-svn: 45132
2007-12-17 23:07:56 +00:00
Evan Cheng 0e179d015f Bring back int_x86_sse2_movl_dq intrinsic for backward compatibility. Make sure
it's auto-upgraded to a shufflevector instruction.

llvm-svn: 45131
2007-12-17 22:33:23 +00:00
Scott Michel c5cccb9e60 - Restore some i8 functionality in CellSPU
- New test case: nand.ll

llvm-svn: 45130
2007-12-17 22:32:34 +00:00
Ted Kremenek bd5362511d Modified Deserializer::ReadCStr to allow C-strings to be read into a
std::vector<char> starting from any index in the vector.

llvm-svn: 45129
2007-12-17 22:25:12 +00:00
Bill Wendling a2401be121 LD_Fp64m should have "isRematerializable" set.
llvm-svn: 45128
2007-12-17 22:17:14 +00:00
Bill Wendling d5477afc1b Add "hasSideEffects" method to MachineInstrInfo class.
llvm-svn: 45126
2007-12-17 21:53:30 +00:00
Bill Wendling 842ddea5e4 Add MachineLICM.cpp
llvm-svn: 45123
2007-12-17 21:14:45 +00:00
Bill Wendling 939526a930 As per feedback, revised comments to (hopefully) make the different side effect
flags clearer.

llvm-svn: 45120
2007-12-17 21:02:07 +00:00