1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 22:42:46 +02:00
Commit Graph

25822 Commits

Author SHA1 Message Date
Duncan Sands
613d060c2e Get this building on 64 bit machines (error:
cast from ‘const llvm::PointerType*’ to ‘unsigned int’
loses precision).

llvm-svn: 58561
2008-11-02 09:00:33 +00:00
Owen Anderson
146d114669 Don't do pre-splitting if doing so would create a value join that did not
exist before.  Updating the live intervals in that care is tricky in the general
case.

Evan, if you see a tighter guard condition for this, let me know.

llvm-svn: 58560
2008-11-02 08:08:18 +00:00
Oscar Fuentes
45b63793cf CMake: added a source file.
llvm-svn: 58559
2008-11-02 06:01:39 +00:00
Nick Lewycky
15a23d029c Add a new MergeFunctions pass. It finds identical functions and merges them.
This triggers only 60 times in llvm-test (look at .llvm.bc, not .linked.rbc)
and so it probably wont be turned on by default. Also, may of those are likely
to go away when PR2973 is fixed.

llvm-svn: 58557
2008-11-02 05:52:50 +00:00
Nick Lewycky
bcadcbb1ec Fix demanded bits analysis with srem by negative number. Based on a patch
by Richard Osborne.

llvm-svn: 58555
2008-11-02 02:41:50 +00:00
Dan Gohman
1f1ebc5389 Fix this recently moved code to use the correct type. CI is now a
ConstantInt, and SI is the original cast instruction. This fixes
PR2996.

llvm-svn: 58549
2008-11-02 00:17:33 +00:00
Mon P Wang
0d137a1c51 Added interface to allow clients to create a MemIntrinsicNode for
target intrinsics that touches memory

llvm-svn: 58548
2008-11-01 20:24:53 +00:00
Sanjiv Gupta
945942c4ad Reverting back 58505. Will commit it once I have the bc reader/writer/docs
ready.

llvm-svn: 58547
2008-11-01 10:57:12 +00:00
Bill Wendling
c4e34b42f3 Whitespace fixes. No functionality change.
llvm-svn: 58539
2008-10-31 21:26:08 +00:00
Anton Korobeynikov
705faa7911 Invalidate debug/eh/gc labels when unreachable MBB is deleted.
Based on patch by Martin Nowack!

llvm-svn: 58536
2008-10-31 20:08:30 +00:00
Evan Cheng
53d4b6531e Add comment.
llvm-svn: 58533
2008-10-31 19:56:03 +00:00
Evan Cheng
07f57f0e41 Use better data structure for ConstPoolId2AddrMap.
llvm-svn: 58532
2008-10-31 19:55:13 +00:00
Evan Cheng
31306c546f Actually make debug output understandable.
llvm-svn: 58529
2008-10-31 19:15:52 +00:00
Mon P Wang
6363e90277 x86_64 rip-relative and magic mode address
llvm-svn: 58528
2008-10-31 19:13:42 +00:00
Evan Cheng
6a824a7741 Forgot this in last commit.
llvm-svn: 58527
2008-10-31 19:11:09 +00:00
Evan Cheng
afe2deb372 Encode PICADD; some code clean up.
llvm-svn: 58526
2008-10-31 19:10:44 +00:00
Dan Gohman
f46431018c Remove some unused virtual function bodies.
llvm-svn: 58524
2008-10-31 19:06:33 +00:00
Bill Wendling
f8f6ed82f1 Revert r58489. It isn't correct for all cases.
llvm-svn: 58523
2008-10-31 18:30:19 +00:00
Evan Cheng
168bd3be1b Change x86 register allocation ordering to match that of gcc. Otherwise some tools get confused by prologue generated by llvm.
llvm-svn: 58517
2008-10-31 16:52:57 +00:00
Evan Cheng
d3b31c4fe1 Add a fixme.
llvm-svn: 58514
2008-10-31 16:41:59 +00:00
Duncan Sands
d2500010a3 Add a bunch of libcalls for ppcf128 that were somehow
completely forgotten about when writing LegalizeTypes.

llvm-svn: 58508
2008-10-31 14:06:52 +00:00
Sanjiv Gupta
5cd04857b1 For some targets pointer and int are 16-bits. Allow 16-bits as a valid index
in such cases.

llvm-svn: 58505
2008-10-31 10:26:20 +00:00
Bill Wendling
0f1f4f8bb1 Don't skip over all "terminator" instructions when determining where to put the
callee-saved restore code. It could skip over conditional jumps
accidentally. Instead, just skip the "return" instructions.

llvm-svn: 58489
2008-10-31 04:00:23 +00:00
Daniel Dunbar
8abdac1eb4 Fix warning.
llvm-svn: 58486
2008-10-31 01:50:01 +00:00
Dan Gohman
481e1fd0a6 Use MOVSSmr instead of EXTRACTPSmr in the case of extracting
vector element 0 for a store, as it's smaller and faster.

llvm-svn: 58483
2008-10-31 00:57:24 +00:00
Jim Grosbach
31e64cbf49 Revert errant deletion. The target needs to be able to specify that it doesn't want the generic constant pool to be emitted.
llvm-svn: 58475
2008-10-30 23:44:39 +00:00
Evan Cheng
56f4944f9a I think we got non-machine specific constpool entries covered.
llvm-svn: 58474
2008-10-30 23:43:36 +00:00
Dan Gohman
50061675c5 Canonicalize sext(i1) to i1?-1:0, and update various instcombine
optimizations accordingly.

llvm-svn: 58457
2008-10-30 20:40:10 +00:00
Duncan Sands
615567edc6 Fix PR2986: do not use a potentially illegal
type for the shift amount type.  Add a check
that shifts and rotates use the type returned
by getShiftAmountTy for the amount.  This
exposed some problems in CellSPU and PPC,
which have already been fixed.

llvm-svn: 58455
2008-10-30 20:26:50 +00:00
Duncan Sands
720e5548cb Shift amounts should have type getShiftAmountTy
(i32 for PPC, not i8).  Correct this, and some
formatting while there.

llvm-svn: 58451
2008-10-30 19:28:32 +00:00
Daniel Dunbar
097da598fb Add InlineCost class for represent the estimated cost of inlining a
function.
 - This explicitly models the costs for functions which should
   "always" or "never" be inlined. This fixes bugs where such costs
   were not previously respected.

llvm-svn: 58450
2008-10-30 19:26:59 +00:00
Duncan Sands
ae31c14963 Shift amounts should have the type given by
getShiftAmountTy (i32 in the case of CellSPU).

llvm-svn: 58449
2008-10-30 19:24:28 +00:00
Mon P Wang
64e6e15947 Add missing vsetcc expansion for widening
llvm-svn: 58443
2008-10-30 18:21:52 +00:00
Evan Cheng
6f41528b91 ARM JIT should observe -relocation-model command line option.
llvm-svn: 58433
2008-10-30 16:10:54 +00:00
Mon P Wang
d7e34cd378 Add initial support for vector widening. Logic is set to widen for X86.
One will only see an effect if legalizetype is not active.  Will move
support to LegalizeType soon.

llvm-svn: 58426
2008-10-30 08:01:45 +00:00
Scott Michel
5b588212d8 Resolve bug 2947: vararg-marked functions must spill registers R3-R79 to stack
so that va_start/va_arg/et.al. will walk arguments correctly for Cell SPU.

N.B.: Because neither clang nor llvm-gcc-4.2 can be built for CellSPU, this is
still unexorcised code.

llvm-svn: 58415
2008-10-30 01:51:48 +00:00
Evan Cheng
69c2588244 Correct way to handle CONSTPOOL_ENTRY instructions.
llvm-svn: 58409
2008-10-29 23:55:43 +00:00
Evan Cheng
5e8fa6ef36 Add debugging support.
llvm-svn: 58408
2008-10-29 23:55:17 +00:00
Evan Cheng
479adf22ee Let target resolve some relocation results.
llvm-svn: 58407
2008-10-29 23:54:46 +00:00
Nate Begeman
e621f0539e Fix PEXTRQ encoding
llvm-svn: 58403
2008-10-29 23:07:17 +00:00
Dale Johannesen
ff738e8897 Add a RM pseudoreg for the rounding mode, which
allows ppcf128->int conversion to work with
DeadInstructionElimination.  This is now turned
off but RM is harmless.  It does not do a complete
job of modeling the rounding mode.

Revert marking MFCR as using all 7 CR subregisters;
while correct, this caused the problem in PR 2964,
plus the local RA crash noted in the comments.
This was needed to make DeadInstructionElimination,
but as we are not running that, it is backed out
for now.  Eventually it should go back in and the
other problems fixed where they're broken.

llvm-svn: 58391
2008-10-29 18:26:45 +00:00
Duncan Sands
4f4d9d24a4 Uniformize capitalization of NodeId.
llvm-svn: 58386
2008-10-29 17:52:12 +00:00
Chris Lattner
4af91a146a Fix PR2967 by not deleting volatile load/stores that occur before unreachable.
I don't really see this as being needed, but there is little harm from doing
it.

llvm-svn: 58385
2008-10-29 17:46:26 +00:00
Duncan Sands
fd032c5bef Fix PR2977: LegalizeTypes support for expanding
VAARG.

llvm-svn: 58379
2008-10-29 14:25:28 +00:00
Duncan Sands
ada9e7a16d Add sanity checking for BUILD_PAIR (I noticed the
other day that PPC custom lowering could create
a BUILD_PAIR of two f64 with a result type of...
f64! - already fixed).  Fix a place that triggers
the sanity check.

llvm-svn: 58378
2008-10-29 14:22:20 +00:00
Evan Cheng
6125b9e097 - More pre-split fixes: spill slot live interval computation bug; restore point bug.
- If a def is spilt, remember its spill index to allow its reuse.

llvm-svn: 58375
2008-10-29 08:39:34 +00:00
Duncan Sands
3faee6737e Fix a FIXME: in ReplaceNodeWith, if the new node
is morphed by AnalyzeNewNode into a previously
processed node, and different result values of
that node are remapped to values with different
nodes, then we could end up using wrong values
here [we were assuming that all results remap
to values with the same underlying node].  This
seems theoretically possible, but I don't have
a testcase.  The meat of the patch is in the
changes to AnalyzeNewNode/AnalyzeNewValue and
ReplaceNodeWith.  While there, I changed names
like RemapNode to RemapValue, since it really
remaps values.  To tell the truth, I would be
much happier if we were only remapping nodes
(it would simplify a bunch of logic, and allow
for some cute speedups) but I haven't yet worked
out how to do that.

llvm-svn: 58372
2008-10-29 06:42:19 +00:00
Duncan Sands
cb5432cdb4 Fix 80 column violations.
llvm-svn: 58371
2008-10-29 06:33:00 +00:00
Duncan Sands
790e7e655b Fix 80 column violations.
llvm-svn: 58370
2008-10-29 06:31:03 +00:00
Evan Cheng
cd21d433bb - Rewrite code that update register live interval that's split.
- Create and update spill slot live intervals.
- Lots of bug fixes.

llvm-svn: 58367
2008-10-29 05:06:14 +00:00
Daniel Dunbar
2265cf485e Factor shouldInline method out of Inliner.
- No functionality change.

llvm-svn: 58355
2008-10-29 01:02:02 +00:00
Daniel Dunbar
e2fe2de3f4 Assorted comment/naming fixes, 80-col violations, and reindentation.
- No functionality change.

llvm-svn: 58352
2008-10-28 23:24:26 +00:00
Dan Gohman
3ceee36545 (A & sext(C)) | (B & ~sext(C) -> C ? A : B
llvm-svn: 58351
2008-10-28 22:38:57 +00:00
Dan Gohman
eb869eb116 Take Chris' suggestion and define EnableFastISelVerbose and
EnableFastISelAbort variables for Release mode instead of
using ifdefs in the code.

llvm-svn: 58350
2008-10-28 20:35:31 +00:00
Daniel Dunbar
ffd2bedc44 Reuse PrintEscapedString for printing names in .ll
- One functionality change, '\\' in a name is now printed as a hex
   escape instead of "\\\\". This is consistent with other users of
   PrintEscapedString.

llvm-svn: 58343
2008-10-28 19:33:02 +00:00
Dan Gohman
5a2a8f4b9b Protect the code for fast-isel debugging with #ifndef NDEBUG.
llvm-svn: 58340
2008-10-28 19:08:46 +00:00
Jim Grosbach
d735f403a0 Support for constant islands in the ARM JIT.
Since the ARM constant pool handling supercedes the standard LLVM constant
pool entirely, the JIT emitter does not allocate space for the constants,
nor initialize the memory. The constant pool is considered part of the 
instruction stream.

Likewise, when resolving relocations into the constant pool, a hook into
the target back end is used to resolve from the constant ID# to the
address where the constant is stored.

For now, the support in the ARM emitter is limited to 32-bit integer. Future
patches will expand this to the full range of constants necessary.

llvm-svn: 58338
2008-10-28 18:25:49 +00:00
Duncan Sands
a64641fbd2 Fix darwin ppc llvm-gcc build breakage: intercept
ppcf128 to i32 conversion and expand it into a code
sequence like in LegalizeDAG.  This needs custom
ppc lowering of FP_ROUND_INREG, so turn that on and
make it work with LegalizeTypes.  Probably PPC should
simply custom lower the original conversion.

llvm-svn: 58329
2008-10-28 15:00:32 +00:00
Duncan Sands
ce82e0aa82 Fix a testcase provided by Bill in which the node
id could end up being wrong mostly because of
forgetting to remap new nodes that morphed into
processed nodes through CSE.

llvm-svn: 58323
2008-10-28 09:38:36 +00:00
Chris Lattner
508a62823e Don't produce invalid comparisons after legalize.
llvm-svn: 58320
2008-10-28 07:11:07 +00:00
Chris Lattner
e39269e22a fix some whitespace stuff
llvm-svn: 58319
2008-10-28 07:10:51 +00:00
Chris Lattner
63e92876e0 Fix a nasty miscompilation of 176.gcc on linux/x86 where we synthesized
a memset using 16-byte XMM stores, but where the stack realignment code
didn't work.  Until it does (PR2962) disable use of xmm regs in memcpy
and memset formation for linux and other targets with insufficiently
aligned stacks.

This is part of PR2888

llvm-svn: 58317
2008-10-28 05:49:35 +00:00
Evan Cheng
8f9bfa5bff If def is in the same mbb as the barrier, spilt the value after the last use before the barrier.
llvm-svn: 58314
2008-10-28 05:28:21 +00:00
Evan Cheng
6242a4f47b Add command line option to limit the number splits to help debugging.
llvm-svn: 58312
2008-10-28 01:48:24 +00:00
Evan Cheng
9bbf76a1e9 Avoid putting a split past the end of the live range; always shrink wrap live interval in the barrier mbb.
llvm-svn: 58309
2008-10-28 00:47:49 +00:00
Evan Cheng
420490d6c4 Silence a bogus compile time warning.
llvm-svn: 58297
2008-10-27 23:29:28 +00:00
David Greene
48e4fdef50 Re-apply 55137 with fixes.
llvm-svn: 58296
2008-10-27 23:24:03 +00:00
Evan Cheng
056ef89e68 Remove val# defined by a remat'ed def that is now dead.
llvm-svn: 58294
2008-10-27 23:21:01 +00:00
Ted Kremenek
03c067710c Fix bogus comparison of "const char *" with c-string literal. Use strcmp instead.
llvm-svn: 58290
2008-10-27 22:43:07 +00:00
David Greene
93f9f0f718 Have TableGen emit setSubgraphColor calls under control of a -gen-debug
flag.  Then in a debugger developers can set breakpoints at these calls
to see waht is about to be selected and what the resulting subgraph
looks like.  This really helps when debugging instruction selection.

llvm-svn: 58278
2008-10-27 21:56:29 +00:00
David Greene
5015610892 Add setSubgraphColor to color an entire portion of a SelectionDAG. This
will be used to support debug features in TableGen.

llvm-svn: 58257
2008-10-27 18:17:03 +00:00
David Greene
78744a795a Fix PR2634. Create new virtual registers from spills early so that we
can give it the same stack slot as the spilled interval if it is folded.
This prevents the fold/unfold code from pointing to the wrong register.

llvm-svn: 58255
2008-10-27 17:38:59 +00:00
Duncan Sands
22451e0303 Fix UpdateNodeOperands so that it does CSE of calls
(and a bunch of other node types).  While there, I
added a doNotCSE predicate and used it to reduce code
duplication (some of the duplicated code was wrong...).
This fixes ARM/cse-libcalls.ll when using LegalizeTypes. 

llvm-svn: 58249
2008-10-27 15:30:53 +00:00
Duncan Sands
039edb065f Fix a bug in which a node could be added to the
worklist twice: UpdateNodeOperands could morph
a new node into a node already on the worklist.
We would then recalculate the NodeId for this
existing node and add it to the worklist.  The
testcase is ARM/cse-libcalls.ll, the problem
showing up once UpdateNodeOperands is taught to
do CSE for calls.

llvm-svn: 58246
2008-10-27 13:18:32 +00:00
Torok Edwin
ebd7fd5e7a Avoid crashing if instruction is not part of a loop.
If it is not part of a loop it is obviously invariant wrt to all loops.

llvm-svn: 58240
2008-10-27 10:18:45 +00:00
Torok Edwin
0c0acebd09 export an ID for the instructionNamer, allowing analysis/transformation passes
that need it to require it by ID.

llvm-svn: 58238
2008-10-27 10:16:27 +00:00
Duncan Sands
a6bbc047d5 Turn on LegalizeTypes, the new type legalization
codegen infrastructure, by default.  Please report
any breakage to the mailing lists.

llvm-svn: 58232
2008-10-27 08:42:46 +00:00
Nick Lewycky
c1f8a23665 Fix an obvious copy/pasto.
llvm-svn: 58231
2008-10-27 07:28:44 +00:00
Evan Cheng
3bcbccf563 For now, don't split live intervals around x87 stack register barriers. FpGET_ST0_80 must be right after a call instruction (and ADJCALLSTACKUP) so we need to find a way to prevent reload of x87 registers between them.
llvm-svn: 58230
2008-10-27 07:14:50 +00:00
Chris Lattner
17afc211e7 Rewrite all the 'PromoteLocallyUsedAlloca[s]' logic. With the power of
LargeBlockInfo, we can now dramatically simplify their implementation
and speed them up at the same time.  Now the code has time proportional
to the number of uses of the alloca, not the size of the block.

This also eliminates code that tried to batch up different allocas which
are used in the same blocks, and eliminates the 'retry list' logic which
was baroque and no unneccesary.  In addition to being a speedup for crazy
cases, this is also a nice cleanup:

PromoteMemoryToRegister.cpp |  270 +++++++++++++++-----------------------------
 1 file changed, 96 insertions(+), 174 deletions(-)

llvm-svn: 58229
2008-10-27 07:05:53 +00:00
Chris Lattner
39c853cf16 Add a new LargeBlockInfo helper, which is just a wrapper around
a trivial dense map.  Use this in RewriteSingleStoreAlloca to
avoid aggressively rescanning blocks over and over again.  This
fixes PR2925, speeding up mem2reg on the testcase in that bug
from 4.56s to 0.02s in a debug build on my machine.

llvm-svn: 58227
2008-10-27 06:05:26 +00:00
Dale Johannesen
d0a0ce909b Increase default setting of tail-merge-threshold to
150, based on llvm-test measurements.

llvm-svn: 58225
2008-10-27 02:10:21 +00:00
Chris Lattner
3fed68158c fix PR2953, an off-by-one error handling formatted i/o.
Thanks to Török Edwin for the awesome reduced testcase.

llvm-svn: 58199
2008-10-26 19:20:47 +00:00
Evan Cheng
8a7f04e7c2 Do not shrink wrap live interval in a mbb if it's livein any of its successor blocks. The mbb can be revisited again after all of the successors are processed.
llvm-svn: 58184
2008-10-26 07:49:03 +00:00
Bill Wendling
617f3d4b3a Fix type-o in ExprMapKeyType::operator ==(). The "&&" was missing.
Patch by Frits van Bommel!

llvm-svn: 58175
2008-10-26 00:19:56 +00:00
Evan Cheng
db1c135283 Handle cases where there aren't uses in the barrier mbb.
llvm-svn: 58174
2008-10-25 23:49:39 +00:00
Dan Gohman
64431fe1db Make comments and code for QuietWarnings and QuietErrors
actually correspond to what their names suggest.

llvm-svn: 58146
2008-10-25 17:57:20 +00:00
Dan Gohman
e7c43e94b0 SDNodes may have at most one Flag result. Update this comment
to reflect that.

llvm-svn: 58145
2008-10-25 17:51:24 +00:00
Dan Gohman
66e878f316 Move the code that adds the DeadMachineInstructionElimPass from
target-independent code to target-specific code. This prevents it
from running on targets that aren't using fast-isel.

In addition to saving compile time, this addresses the problem
that not all targets are prepared for it. In order to use this
pass, all instructions must declare all their fixed uses and
defs of physical registers.

llvm-svn: 58144
2008-10-25 17:46:52 +00:00
Gordon Henriksen
e5b0182e94 Related to PR2911, reject as invalid non-pointer GC roots.
llvm-svn: 58143
2008-10-25 16:28:35 +00:00
Nicolas Geoffray
ce30b5caf0 Support for allocation of TLS variables in the JIT. Allocation of a global
variable is moved to the execution engine. The JIT calls the TargetJITInfo
to allocate thread local storage. Currently, only linux/x86 knows how to
allocate thread local global variables.

llvm-svn: 58142
2008-10-25 15:41:43 +00:00
Nicolas Geoffray
323dc44a69 Generate code for TLS instructions.
llvm-svn: 58141
2008-10-25 15:22:06 +00:00
Oscar Fuentes
51e77b801a CMake: lib/Target/ARM/AsmPrinter/CMakeLists.txt added.
llvm-svn: 58133
2008-10-25 03:40:32 +00:00
Oscar Fuentes
64fd2ab298 CMake: Cross-platform support for using pre-generated llvmAsmParser.cpp and llvmAsmParser.h.
llvm-svn: 58130
2008-10-25 03:19:08 +00:00
Evan Cheng
0c78ace7dc If val# def is ~0U, meaning it's defined by a PHI, and it's previously split, spill before the barrier because it's impossible to determine if all the defs are spilled in the same spill slot.
llvm-svn: 58129
2008-10-25 00:52:41 +00:00
Dale Johannesen
20f93b45e7 Mark MFCR as reading all condition code registers.
Prevents some more overzealous deletions (mostly
in AltiVec code).

llvm-svn: 58121
2008-10-24 22:08:01 +00:00
Dale Johannesen
a3d7e7e900 Rewrite logic to figure out whether LR needs to
be saved/restored in the prolog/epilog.  We need
to do this iff something in the function stores
into it.

llvm-svn: 58116
2008-10-24 21:24:23 +00:00
Torok Edwin
e0ecce06a0 move the note to the correct README
llvm-svn: 58104
2008-10-24 19:23:07 +00:00
Torok Edwin
5560590122 add note about va_arg code on x86 and x86-64
llvm-svn: 58103
2008-10-24 19:20:05 +00:00
Evan Cheng
cfd2ecd29f Fix a pasto.
llvm-svn: 58102
2008-10-24 18:46:44 +00:00
Duncan Sands
4b148a29ef Fix translateX86CC: if SetCCOpcode is SETULE and
LHS is a foldable load, then LHS and RHS are swapped
and SetCCOpcode is changed to SETUGT.  But the later
code is expecting operands to be the wrong way round
for SETUGT, but they are not in this case, resulting
in an inverted compare.  The solution is to move the
load normalization before the correction for SETUGT.
This bug was tickled by LegalizeTypes which happened
to legalize the testcase slightly differently to
LegalizeDAG.

llvm-svn: 58092
2008-10-24 13:03:10 +00:00
Cedric Venet
c5bd480a57 Modify the cmake build system so that if it doesn't find bison, it will use the pregenerated file in from the svn (.cvs). Work only for windows for the moment. Tested on Vista64 with MSVC2008express.
llvm-svn: 58090
2008-10-24 11:24:33 +00:00
Nick Lewycky
44356e13da Don't try to create a mask when we don't need one. Fixes a crash.
llvm-svn: 58075
2008-10-24 06:14:27 +00:00
Evan Cheng
efb8edb805 Fix a end() dereference; remove an abort() that wasn't meant to be left in.
llvm-svn: 58072
2008-10-24 05:53:44 +00:00
Nick Lewycky
3d4f21006b Add value range analyzing of Add and Sub.
Understand that mul %x, 1 = %x.

llvm-svn: 58069
2008-10-24 04:00:26 +00:00
Evan Cheng
a7a0aabf99 Avoid splitting an interval multiple times; avoid splitting re-materializable val# (for now).
llvm-svn: 58068
2008-10-24 02:05:00 +00:00
Dan Gohman
ed90fd3ecf Fix constant-offset emission for x86-64 absolute addresses. This
fixes a bunch of test-suite JIT failures on x86-64 in
-relocation-model=static mode.

llvm-svn: 58066
2008-10-24 01:57:54 +00:00
Dale Johannesen
9edd60f710 Initialize uninitialized variable.
llvm-svn: 58057
2008-10-24 01:06:58 +00:00
Ted Kremenek
b04b85f615 Added raw_fd_ostream::close().
llvm-svn: 58052
2008-10-23 23:49:09 +00:00
Evan Cheng
c906d4938e Committing a good chunk of the pre-register allocation live interval splitting pass. It's handling simple cases and appear to do good things. Next: avoid splitting an interval multiple times; renumber registers when possible; record stack slot live intervals for coloring; rematerialize defs when possible.
llvm-svn: 58044
2008-10-23 20:43:13 +00:00
Dale Johannesen
b79ddda5bf Mark defs and uses of CTR and LR correctly.
Prevents DeadMachineInstructionElim from thinking
things like MTCTR are dead (fixes massive
testsuite breakage at -O0).

llvm-svn: 58043
2008-10-23 20:41:28 +00:00
Daniel Dunbar
fba54dec6a Make sure to set stdout to binary when writing bitcode files via
std::ostream API.

llvm-svn: 58042
2008-10-23 19:37:34 +00:00
Duncan Sands
d4ea54fd77 Fix thinko - the operand number has nothing to do
with the result number.

llvm-svn: 58041
2008-10-23 19:34:23 +00:00
Daniel Dunbar
5447f9679d Change create*Pass factory functions to return Pass* instead of
LoopPass*.
 - Although less precise, this means they can be used in clients
   without RTTI (who would otherwise need to include LoopPass.h, which
   eventually includes things using dynamic_cast). This was the
   simplest solution that presented itself, but I am happy to use a
   better one if available.

llvm-svn: 58010
2008-10-22 23:32:42 +00:00
Jim Grosbach
a8a40398e8 remove extraneous #ifdef's
llvm-svn: 58006
2008-10-22 22:27:51 +00:00
Daniel Dunbar
287cf9f1f7 Add raw_ostream versions of WriteBitcodeToFile and BitcodeWriterPass.
- The old versions are still hanging around, but should be migrated
   away from.

llvm-svn: 57989
2008-10-22 17:39:14 +00:00
Dale Johannesen
c146b1b281 Remove allocation of unused stack slot.
llvm-svn: 57987
2008-10-22 17:26:06 +00:00
Julien Lerouge
89f4df3eae Fix for PR2881: fix a small leak exposed by valgrind, using a ManagedStatic.
llvm-svn: 57984
2008-10-22 16:30:41 +00:00
Duncan Sands
91535074e9 LegalizeTypes soft-float support for fpow.
llvm-svn: 57973
2008-10-22 11:49:09 +00:00
Duncan Sands
9d8f7ab614 Get this working with LegalizeTypes: (1) don't
assume that i64 has been turned into a BUILD_PAIR
node (when called from LegalizeTypes this hasn't
happened yet) and don't use a vector shuffle mask
with an illegal element type.

llvm-svn: 57972
2008-10-22 11:24:12 +00:00
Duncan Sands
0d122150ce Be nice to CellSPU: for this target getSetCCResultType
may return i8, which can result in SELECT nodes for
which the type of the condition is i8, but there are
no patterns for select with i8 condition.  Tweak the
LegalizeTypes logic to avoid this as much as possible.
This isn't a real fix because it is still perfectly
possible to end up with such select nodes - CellSPU
needs to be fixed IMHO.

llvm-svn: 57968
2008-10-22 09:23:20 +00:00
Duncan Sands
ebf65ef3f9 Port from LegalizeDAG the logic to only generate
ADDC/ADDE/SUBC/SUBE if the target supports it.

llvm-svn: 57967
2008-10-22 09:07:29 +00:00
Duncan Sands
81c4c88859 Add some comments explaining the meaning of a boolean
that is not of type MVT::i1 in SELECT and SETCC nodes.
Relax the LegalizeTypes SELECT condition promotion
sanity checks to allow other condition types than i1.

llvm-svn: 57966
2008-10-22 09:06:24 +00:00
Duncan Sands
7ba0cc16c1 Temporarily allow the operands of a BUILD_VECTOR
to have a different type to the vector element
type.  This should be fairly harmless because in
the past guys like this were being built all over
the place (and were cleaned up when I added this
check).  The reason for relaxing this check is
that it helps LegalizeTypes legalize vector
shuffles: the mask is a BUILD_VECTOR that it is
*not always possible* to legalize while keeping it
a BUILD_VECTOR (vector_shuffle requires the mask
to be a BUILD_VECTOR, as opposed to a vector with
the right vector type).  With this check it is even
harder to legalize the mask - turning the check off
means that LegalizeTypes manages to legalize almost
all vector shuffles encountered in practice.  The
correct solution is to change vector_shuffle to be a
variadic node with the mask built into it as operands.
While waiting for that change, this hack stops the
problem with vector_shuffle from blocking the turning
on of LegalizeTypes.

llvm-svn: 57965
2008-10-22 09:00:33 +00:00
Chris Lattner
cf48fee0c7 Fix PR2907 by digging through constant expressions to find FP constants that
are their operands.

llvm-svn: 57956
2008-10-22 04:53:16 +00:00
Daniel Dunbar
d1169ccaf2 Move Print*Pass to use raw_ostream.
llvm-svn: 57946
2008-10-22 03:25:22 +00:00
Oscar Fuentes
a932cae97a CMake: Turned some libraries into partially linked objects. Corrected
names of LLVMCore and ARMCodeGen.

llvm-svn: 57943
2008-10-22 02:51:53 +00:00
Dale Johannesen
3bd1c1e5cd Adjust comments for pedantic satisfaction.
llvm-svn: 57940
2008-10-22 00:02:32 +00:00
Oscar Fuentes
4a377fbeae CMake: updated lib/VMCore/CMakeLists.txt
llvm-svn: 57937
2008-10-21 23:52:03 +00:00
Daniel Dunbar
919ce3c16a Privatize PrintModulePass and PrintFunctionPass and add
createPrintModulePass and createPrintFunctionPass.
 - So clients who compile w/o RTTI can use them.

llvm-svn: 57933
2008-10-21 23:33:38 +00:00
Dale Johannesen
9185d28b4b Add comments to explain uint64->f64 algorithm,
well, sort of.  (Algorithm by Ian Ollmann.)

llvm-svn: 57932
2008-10-21 23:07:49 +00:00
Dale Johannesen
eb7e2deb1d Add an SSE2 algorithm for uint64->f64 conversion.
The same one Apple gcc uses, faster.  Also gets the
extreme case in gcc.c-torture/execute/ieee/rbug.c
correct which we weren't before; this is not
sufficient to get the test to pass though, there
is another bug.

llvm-svn: 57926
2008-10-21 20:50:01 +00:00
Dan Gohman
b6f073ce21 Fix SelectionDAGBuild lowering of Select instructions to
handle first-class aggregate values. Also, fix a bug in
the Ret handling for empty aggregates.

llvm-svn: 57925
2008-10-21 20:00:42 +00:00
Daniel Dunbar
aa7a7ae8d5 Clear raw_fd_ostream error string on success and explain behavior in
documentation.

Add C++ header marker.

llvm-svn: 57923
2008-10-21 19:53:10 +00:00
Dan Gohman
34306e122d Implement the optimized FCMP_OEQ/FCMP_UNE code for x86 fast-isel.
llvm-svn: 57915
2008-10-21 18:24:51 +00:00
Jim Grosbach
24a4744d53 use pre-UAL mnemonics for push/pop for compilaton callback function
llvm-svn: 57911
2008-10-21 16:54:12 +00:00
Nuno Lopes
112ac04abd fix a tricky bug in the JIT global variable emitter, that was triggered when JITing a variable independently of a function. This lead to sharing memory memory between functions and GVs thus changing the value of a GV could change the code in execution. more details on the ML.
llvm-svn: 57900
2008-10-21 11:42:16 +00:00
Dan Gohman
e49a93ccea Disable constant-offset folding for PowerPC, as the PowerPC target
isn't yet prepared for it.

llvm-svn: 57886
2008-10-21 03:41:46 +00:00
Dan Gohman
847a83dbad Don't create TargetGlobalAddress nodes with offsets that don't fit
in the 32-bit signed offset field of addresses. Even though this
may be intended, some linkers refuse to relocate code where the
relocated address computation overflows.

Also, fix the sign-extension of constant offsets to use the
actual pointer size, rather than the size of the GlobalAddress
node, which may be different, for example on x86-64 where MVT::i32
is used when the address is being fit into the 32-bit displacement
field.

llvm-svn: 57885
2008-10-21 03:38:42 +00:00
Dan Gohman
281881b8e2 Optimized FCMP_OEQ and FCMP_UNE for x86.
Where previously LLVM might emit code like this:

        ucomisd %xmm1, %xmm0
        setne   %al
        setp    %cl
        orb     %al, %cl
        jne     .LBB4_2

it now emits this:

        ucomisd %xmm1, %xmm0
        jne     .LBB4_2
        jp      .LBB4_2

It has fewer instructions and uses fewer registers, but it does
have more branches. And in the case that this code is followed by
a non-fallthrough edge, it may be followed by a jmp instruction,
resulting in three branch instructions in sequence. Some effort
is made to avoid this situation.

To achieve this, X86ISelLowering.cpp now recognizes FCMP_OEQ and
FCMP_UNE in lowered form, and replace them with code that emits
two branches, except in the case where it would require converting
a fall-through edge to an explicit branch.

Also, X86InstrInfo.cpp's branch analysis and transform code now
knows now to handle blocks with multiple conditional branches. It
uses loops instead of having fixed checks for up to two
instructions. It can now analyze and transform code generated
from FCMP_OEQ and FCMP_UNE.

llvm-svn: 57873
2008-10-21 03:29:32 +00:00
Dan Gohman
d692070372 When the coalescer is doing rematerializing, have it remove
the copy instruction from the instruction list before asking the
target to create the new instruction. This gets the old instruction
out of the way so that it doesn't interfere with the target's
rematerialization code. In the case of x86, this helps it find
more cases where EFLAGS is not live.

Also, in the X86InstrInfo.cpp, teach isSafeToClobberEFLAGS to check
to see if it reached the end of the block after scanning each
instruction, instead of just before. This lets it notice when the
end of the block is only two instructions away, without doing any
additional scanning.

These changes allow rematerialization to clobber EFLAGS in more
cases, for example using xor instead of mov to set the return value
to zero in the included testcase.

llvm-svn: 57872
2008-10-21 03:24:31 +00:00
Dan Gohman
d9b79484e0 Make the NaN test come second, heuristically assuming
that NaNs are less common.

llvm-svn: 57871
2008-10-21 03:12:54 +00:00
Dan Gohman
a480933bbd Use Function::getEntryBlock() instead of Function::front(), for clarity.
llvm-svn: 57870
2008-10-21 03:10:28 +00:00
Oscar Fuentes
912b6c40d7 CMake: updated lib/CodeGen/CMakeLists.txt
llvm-svn: 57869
2008-10-21 02:37:50 +00:00
Dan Gohman
080dca2129 Fix a bug that prevented llvm-extract -delete from working.
llvm-svn: 57864
2008-10-21 01:08:07 +00:00
Chris Lattner
c4a880e03c Fix gcc.c-torture/compile/920520-1.c by inserting bitconverts
for strange asm conditions earlier.  In this case, we have a
double being passed in an integer reg class.  Convert to like
sized integer register so that we allocate the right number 
for the class (two i32's for the f64 in this case).

llvm-svn: 57862
2008-10-21 00:45:36 +00:00
Evan Cheng
1bc92a1aa6 Add skeleton for the pre-register allocation live interval splitting pass.
llvm-svn: 57847
2008-10-20 21:44:59 +00:00
Jim Grosbach
1de8b23129 Update the stub and callback code to handle lazy compilation. The stub
is re-written by the callback to branch directly to the compiled code
in future invocations.

Added back in range-based memory permission functions for the updating of
the stub on Darwin.

llvm-svn: 57846
2008-10-20 21:39:23 +00:00
Dan Gohman
204cc4e5ff Fast-isel no longer an experiment.
llvm-svn: 57845
2008-10-20 21:30:12 +00:00
Evan Cheng
c4d1fb1435 Add a register class -> virtual registers map.
llvm-svn: 57844
2008-10-20 20:03:28 +00:00
Duncan Sands
9a3acf8d88 Support operations like fp_to_uint with a vector
result type when the result type is legal but
not the operand type.  Add additional support
for EXTRACT_SUBVECTOR and CONCAT_VECTORS,
needed to handle such cases.

llvm-svn: 57840
2008-10-20 16:31:21 +00:00
Duncan Sands
53a9bbae16 LegalizeTypes support for atomic operation promotion.
llvm-svn: 57838
2008-10-20 16:17:42 +00:00
Duncan Sands
e2c4d654e3 Use DAG.getIntPtrConstant rather than DAG.getConstant
with TLI.getPointerTy for a small simplification.

llvm-svn: 57837
2008-10-20 16:14:43 +00:00
Duncan Sands
b912b4c4c4 Always use either MVT::i1 or getSetCCResultType for
the condition of a SELECT node.  Make sure that the
correct extension type (any-, sign- or zero-extend)
is used.

llvm-svn: 57836
2008-10-20 16:13:04 +00:00
Duncan Sands
81b834c160 Formatting - no functional change.
llvm-svn: 57834
2008-10-20 16:06:47 +00:00
Duncan Sands
1872cc22b0 Don't use a random type for the select condition,
use an MVT::i1 and simplify the code while there.

llvm-svn: 57833
2008-10-20 16:04:57 +00:00
Duncan Sands
98fc39f607 Have X86 custom lowering for LegalizeTypes use
LowerOperation if it doesn't know what else to do.
This methods should probably be factorized some,
but this is good enough for the moment.  Have
LowerATOMIC_BINARY_64 use EXTRACT_ELEMENT rather
than assuming the operand is a BUILD_PAIR (if it
is then getNode will automagically simplify the
EXTRACT_ELEMENT).  This way LowerATOMIC_BINARY_64
usable from LegalizeTypes.

llvm-svn: 57831
2008-10-20 15:56:33 +00:00
Bill Wendling
ed477995f1 Set N->OperandList to 0 after deletion. Otherwise, it's possible that it will
be either deleted or referenced afterwards.

llvm-svn: 57786
2008-10-19 20:51:12 +00:00
Bill Wendling
980c8ad152 Fix comment. Other formatting changes. No functionality changes.
llvm-svn: 57785
2008-10-19 20:34:04 +00:00
Duncan Sands
0a9525febd Vector shuffle mask elements may be "undef". Handle
this everywhere in LegalizeTypes.

llvm-svn: 57783
2008-10-19 15:00:25 +00:00
Duncan Sands
65f39e9819 Use a legal integer type for vector shuffle mask
elements.  Otherwise LegalizeTypes will, reasonably
enough, legalize the mask, which may result in it
no longer being a BUILD_VECTOR node (LegalizeDAG
simply ignores the legality or not of vector masks).

llvm-svn: 57782
2008-10-19 14:58:05 +00:00
Chris Lattner
c369db13cc Reapply r57699 with a fix to not crash on asms with multiple results. Unlike
the previous patch this one actually passes make check.

"Fix PR2356 on PowerPC: if we have an input and output that are tied together
that have different sizes (e.g. i32 and i64) make sure to reserve registers for
the bigger operand."

llvm-svn: 57771
2008-10-18 18:49:30 +00:00
Dan Gohman
ea1d0d8823 Don't truncate GlobalAddress offsets to int in debug output.
llvm-svn: 57770
2008-10-18 18:22:42 +00:00
Evan Cheng
e742ce1a58 By min, I mean max.
llvm-svn: 57766
2008-10-18 05:21:37 +00:00
Evan Cheng
cf0977d7b1 When creating intervals, leave min(1, numdefs) holes after each instruction.
llvm-svn: 57765
2008-10-18 05:18:55 +00:00
Dan Gohman
15597f07b2 Teach DAGCombine to fold constant offsets into GlobalAddress nodes,
and add a TargetLowering hook for it to use to determine when this
is legal (i.e. not in PIC mode, etc.)

This allows instruction selection to emit folded constant offsets
in more cases, such as the included testcase, eliminating the need
for explicit arithmetic instructions.

This eliminates the need for the C++ code in X86ISelDAGToDAG.cpp
that attempted to achieve the same effect, but wasn't as effective.

Also, fix handling of offsets in GlobalAddressSDNodes in several
places, including changing GlobalAddressSDNode's offset from
int to int64_t.

The Mips, Alpha, Sparc, and CellSPU targets appear to be
unaware of GlobalAddress offsets currently, so set the hook to
false on those targets.

llvm-svn: 57748
2008-10-18 02:06:02 +00:00
Dan Gohman
2eaf4f1c48 Revert r57699. It's causing regressions in
test/CodeGen/X86/2008-09-17-inline-asm-1.ll
and a few others, and it breaks the llvm-gcc build.

llvm-svn: 57747
2008-10-18 01:03:45 +00:00
Dan Gohman
ac8c7772ba This is now partly done.
llvm-svn: 57734
2008-10-17 21:39:27 +00:00
Dan Gohman
69ac9cc00f This is done.
llvm-svn: 57733
2008-10-17 21:38:40 +00:00
Dan Gohman
e1e1c5197e Factor out the code for mapping LLVM IR condition opcodes to
ISD condition opcodes into helper functions.

llvm-svn: 57726
2008-10-17 21:16:08 +00:00
Evan Cheng
08d0796cf5 Add implicit defs of XMM8 to XMM15 on 32-bit call instructions. While this is not technically true, it tells tblgen that these instructions "clobber" the entire XMM register file.
llvm-svn: 57723
2008-10-17 21:02:22 +00:00
Evan Cheng
7792ca759d Fix PR2898. Spiller delete a store for reuse before it knows for sure the reuse happened.
Patch by Lang Hames!

llvm-svn: 57720
2008-10-17 20:56:41 +00:00
Chris Lattner
75618cbb6f add support for 128 bit aggregates.
llvm-svn: 57715
2008-10-17 19:59:51 +00:00
Bill Wendling
39b0625fe0 The Dwarf writer was comparing mangled and unmangled names for C++ code when we
have an unreachable block in a function. This was triggering the assert. This is
a horrid hack to cover this up.

Oh! for a good debug info architecture!

llvm-svn: 57714
2008-10-17 18:48:57 +00:00
Mon P Wang
fdfc9a2c4f Added MemIntrinsicNode which is useful to represent target intrinsics that
touches memory and need an associated MemOperand

llvm-svn: 57712
2008-10-17 18:22:58 +00:00
Dan Gohman
96269ec52a Factor out the code for mapping LLVM IR condition opcodes to
ISD condition opcodes into helper functions.

llvm-svn: 57710
2008-10-17 18:18:45 +00:00
Chris Lattner
d96b8d12bc add support for 128 bit inputs on both x86-64 and x86-32.
llvm-svn: 57709
2008-10-17 18:15:05 +00:00
Chris Lattner
231a9466df Fix a bug where the x86 backend would reject 64-bit r constraints when
in 32-bit mode instead of assigning a register pair.  This has nothing to
do with PR2356, but I happened to notice it while working on it.

llvm-svn: 57704
2008-10-17 17:59:52 +00:00
Chris Lattner
e2342cd790 Fix PR2356 on PowerPC: if we have an input and output that are tied together
that have different sizes (e.g. i32 and i64) make sure to reserve registers for
the bigger operand.

llvm-svn: 57699
2008-10-17 17:52:49 +00:00
Evan Cheng
fa61b6a4ba Fix lfence and mfence encoding. These look like MRM5r and MRM6r instructions except they do not have any operands. The RegModRM byte is encoded with register number 0.
llvm-svn: 57692
2008-10-17 17:14:20 +00:00
Evan Cheng
733b305f24 getX86RegNum has long been moved to X86RegisterInfo.
llvm-svn: 57691
2008-10-17 17:12:18 +00:00
Chris Lattner
bb4ae53b94 refactor some code into a helper method, no functionality change.
llvm-svn: 57690
2008-10-17 17:05:25 +00:00
Chris Lattner
d748d12000 Keep track of *which* input constraint matches an output
constraint.  Reject asms where an output has multiple
input constraints tied to it.

llvm-svn: 57687
2008-10-17 16:47:46 +00:00
Chris Lattner
1d0742a530 add an assert so that PR2356 explodes instead of running off an
array.  Improve some minor comments, refactor some helpers in
AsmOperandInfo.  No functionality change for valid code.

llvm-svn: 57686
2008-10-17 16:21:11 +00:00
Evan Cheng
5fe2abfee8 Fix a very subtle spiller bug: UpdateKills should not forget to track defs of aliases.
llvm-svn: 57673
2008-10-17 06:16:07 +00:00
Chris Lattner
e087da1d39 add some simple hacky long double support for the CBE. This
should work for intel long double, but ppc long double aborts
in convert.

llvm-svn: 57672
2008-10-17 06:11:48 +00:00
Dan Gohman
268cfea6bc Fun x86 encoding tricks: when adding an immediate value of 128,
use a SUB instruction instead of an ADD, because -128 can be
encoded in an 8-bit signed immediate field, while +128 can't be.
This avoids the need for a 32-bit immediate field in this case.

A similar optimization applies to 64-bit adds with 0x80000000,
with the 32-bit signed immediate field.

To support this, teach tablegen how to handle 64-bit constants.

llvm-svn: 57663
2008-10-17 01:33:43 +00:00
Dan Gohman
5d83bd89a5 Define patterns for shld and shrd that match immediate
shift counts, and patterns that match dynamic shift counts
when the subtract is obscured by a truncate node.

Add DAGCombiner support for recognizing rotate patterns
when the shift counts are defined by truncate nodes.

Fix and simplify the code for commuting shld and shrd
instructions to work even when the given instruction doesn't
have a parent, and when the caller needs a new instruction.

These changes allow LLVM to use the shld, shrd, rol, and ror
instructions on x86 to replace equivalent code using two
shifts and an or in many more cases.

llvm-svn: 57662
2008-10-17 01:23:35 +00:00
Dan Gohman
133708df57 Use 0 instead of false to return a null pointer.
llvm-svn: 57660
2008-10-17 00:56:52 +00:00
Dan Gohman
90f776986d Trim #includes.
llvm-svn: 57649
2008-10-16 20:18:31 +00:00
Chris Lattner
39f881ab69 fix typo noticed by sdt
llvm-svn: 57644
2008-10-16 17:02:50 +00:00
Gabor Greif
2fa8672ee6 Introduce a typing refinenement on tagged data
using the 'volatile' qualifier. This should not have any operational consequences
on code, because tags should always be stripped off (giving a non-volatile pointer)
before dereferencing. The new qualification is there to catch some attempts to use
tagged pointers in a context where an untagged pointer is appropriate.

Notably this approach does not catch dereferencing of tagged pointers, but helps
in separating the two concepts a bit.

llvm-svn: 57641
2008-10-16 15:33:02 +00:00
Duncan Sands
1349af7df4 Fix warnings about mb/me being potentially used
uninitialized in these functions with gcc-4.3.

llvm-svn: 57635
2008-10-16 13:02:33 +00:00
Duncan Sands
e6315b4179 Fix "large integer implicitly truncated to unsigned type"
warning on x86-64 with gcc-4.3.

llvm-svn: 57634
2008-10-16 09:14:58 +00:00
Chris Lattner
9afb6adf17 add some notes
llvm-svn: 57631
2008-10-16 07:04:06 +00:00
Chris Lattner
9d39b11d10 add some notes and a file to collect unimplemented features in the
x86 backend.  These will all be answered with "patches welcome", so
a PR doesn't help drive them along.

llvm-svn: 57630
2008-10-16 06:46:12 +00:00
Chris Lattner
562984c110 mark some targets as experimental. Andrew, if you think that Alpha is
basically working, feel free to remove the tag.  The other targets have
really basic things that break them.

llvm-svn: 57628
2008-10-16 06:16:50 +00:00
Chris Lattner
6d79672ba0 Verify prefetch arguments, PR2576.
llvm-svn: 57626
2008-10-16 06:00:36 +00:00
Chris Lattner
3048ccc1f9 apply Eli's patch for PR2165 and provide a testcase.
llvm-svn: 57625
2008-10-16 05:26:51 +00:00
Dan Gohman
86527c1834 Const-ify several TargetInstrInfo methods.
llvm-svn: 57622
2008-10-16 01:49:15 +00:00
Dan Gohman
991376be85 Remove an unused variable.
llvm-svn: 57621
2008-10-16 01:47:47 +00:00
Dan Gohman
11c8a9a63a Fix Instruction::isIdenticalTo and isSameOperationAs to recognize
additional information in Loads, Stores, Calls, Invokes,
InsertValueInsts, and ExtractValueInsts.

llvm-svn: 57620
2008-10-16 01:24:45 +00:00
Dan Gohman
3526f97d13 Rename AliasSet to SubRegs, to reflect changes in the surrounding code.
llvm-svn: 57618
2008-10-16 01:06:18 +00:00
Dan Gohman
46dafc2fb9 Move the include of MachineLocation.h into MachineModuleInfo.h
because it declares a std::vector<MachineMove>, and strict
concept checking requires the definition of MachineMove to be
available.

llvm-svn: 57617
2008-10-16 00:20:14 +00:00
Dan Gohman
8075c32a55 Fix a subtle bug in DeadMachineInstructionElim's liveness
computation. A def of a register doesn't necessarily kill
live super-registers.

llvm-svn: 57614
2008-10-16 00:11:23 +00:00
Dan Gohman
6dba6b2384 Fix the predicate for memop64 to be a regular load, not just
an unindexed load.

llvm-svn: 57612
2008-10-16 00:03:00 +00:00
Dan Gohman
6f40163d83 Teach instcombine's visitLoad to scan back several instructions
to find opportunities for store-to-load forwarding or load CSE,
in the same way that visitStore scans back to do DSE. Also, define
a new helper function for testing whether the addresses of two
memory accesses are known to have the same value, and use it in
both visitStore and visitLoad.

These two changes allow instcombine to eliminate loads in code
produced by front-ends that frequently emit obviously redundant
addressing for memory references.

llvm-svn: 57608
2008-10-15 23:19:35 +00:00
Dan Gohman
0c160fbe89 Correct the name of isTrapping in comments.
llvm-svn: 57606
2008-10-15 22:56:21 +00:00
Anton Korobeynikov
e322e95ecd Also properly handle linking of strong alias and weak global
llvm-svn: 57595
2008-10-15 20:10:50 +00:00
Anton Korobeynikov
d514695f79 Properly handle linking of strong alias with weak function, this fixes PR2883
llvm-svn: 57594
2008-10-15 20:10:08 +00:00
Dan Gohman
df18b6f3db Fix a missing space after the return type in invoke statements.
This fixes PR2894.

llvm-svn: 57589
2008-10-15 18:02:08 +00:00
Chris Lattner
2ce4f1e7ad move PR1941 here.
llvm-svn: 57586
2008-10-15 16:33:52 +00:00
Chris Lattner
866578b51b move PR1604 here.
llvm-svn: 57582
2008-10-15 16:06:03 +00:00
Chris Lattner
4ccc775d89 move PR1488 into this file.
llvm-svn: 57579
2008-10-15 16:02:15 +00:00
Nuno Lopes
fcab7d3d0c regenerate
llvm-svn: 57577
2008-10-15 12:05:02 +00:00
Nuno Lopes
8d27c6100b fix memleak in GetForwardRefForGlobal()
llvm-svn: 57576
2008-10-15 12:04:36 +00:00
Nuno Lopes
5b1a422162 regenerate
llvm-svn: 57575
2008-10-15 11:20:21 +00:00
Nuno Lopes
067c8791fe fix memleak in getTypeVal()
llvm-svn: 57574
2008-10-15 11:19:34 +00:00
Nuno Lopes
970117385a regenerate
llvm-svn: 57573
2008-10-15 11:11:12 +00:00
Nuno Lopes
0e2359f53d fix memleak in ResolveTypeTo()
llvm-svn: 57572
2008-10-15 11:10:21 +00:00
Dan Gohman
65702b2eb8 Now that predicates can be composed, simplify several of
the predicates by extending simple predicates to create
more complex predicates instead of duplicating the logic
for the simple predicates.

This doesn't reduce much redundancy in DAGISelEmitter.cpp's
generated source yet; that will require improvements to
DAGISelEmitter.cpp's instruction sorting, to make it more
effectively group nodes with similar predicates together.

llvm-svn: 57565
2008-10-15 06:50:19 +00:00
Chris Lattner
33e7093540 regenerate
llvm-svn: 57561
2008-10-15 06:16:57 +00:00
Chris Lattner
9449f199b3 Fix the .ll grammar rules to allow any type before an 'i32', not just an
integer type.  Invalid things like 'float 42' are now rejected by the
semantic analysis in the productions not the parser.  This fixes PR2733.

llvm-svn: 57560
2008-10-15 06:16:45 +00:00
Chris Lattner
33079f9c37 regenerate
llvm-svn: 57559
2008-10-15 06:03:48 +00:00
Chris Lattner
dc80d9772a Eliminate the "IntType ::= INTTYPE" production, just use
INTTYPE everywhere.

llvm-svn: 57558
2008-10-15 06:03:37 +00:00
Chris Lattner
d91c01484c add a note
llvm-svn: 57557
2008-10-15 05:53:25 +00:00
Chris Lattner
7194e8406a add support for folding immediates into stores when they
are due to argument passing in calls.  This is significant because
it hits all immediate arguments to calls on x86-32.

llvm-svn: 57556
2008-10-15 05:38:32 +00:00
Chris Lattner
214643296b fold immediates into stores in simple cases, this produces diffs like
this:

-	movl	$0, %eax
-	movl	%eax, _yy_n_chars
+	movl	$0, _yy_n_chars

llvm-svn: 57555
2008-10-15 05:30:52 +00:00
Chris Lattner
5716b8daa4 fold compare of null pointer into compare with 0.
llvm-svn: 57553
2008-10-15 05:18:04 +00:00
Chris Lattner
928e8e5092 Some minor cleanups:
1. Compute action in X86SelectSelect based on MVT instead of type.
2. Use TLI.getValueType(..) instead of MVT::getVT(..) because the former
   handles pointers and the later doesn't.
3. Don't pass TLI into isTypeLegal, since it already has access to it as 
   an ivar.

#2 gives fast isel some minor new functionality: handling load/stores of
pointers.

llvm-svn: 57552
2008-10-15 05:07:36 +00:00
Chris Lattner
da69b5e401 Use switch on VT instead of Type* comparisons.
llvm-svn: 57551
2008-10-15 04:32:45 +00:00
Chris Lattner
052e062f08 Use X86FastEmitCompare for FCMP_OEQ and FCMP_UNE: it doesn't
change the generated code, but makes the code simpler.

llvm-svn: 57550
2008-10-15 04:29:23 +00:00
Chris Lattner
d7024dafbf refactor compare emission out into a new X86FastEmitCompare method,
which makes it easy to share the compare/imm folding logic with 'setcc'.
This shaves a bunch of instructions off the common select case, which
happens a lot in llvm-gcc.

llvm-svn: 57549
2008-10-15 04:26:38 +00:00
Chris Lattner
cbea6edde5 Fold immediates into compares when possible, producing "cmp $4, %eax" instead of
loading 4 into a register and then doing the compare.

llvm-svn: 57548
2008-10-15 04:13:29 +00:00
Chris Lattner
905dbd0dea more minor refactoring of X86SelectBranch, no functionality change.
llvm-svn: 57547
2008-10-15 04:02:26 +00:00
Chris Lattner
99d88895b6 factor buildmi calls in X86SelectBranch
llvm-svn: 57546
2008-10-15 03:58:05 +00:00
Chris Lattner
97e96bcca0 factor some more BuildMI's in X86SelectCmp
llvm-svn: 57545
2008-10-15 03:52:54 +00:00
Chris Lattner
e66c12b3f5 factor some BuildMI calls, no functionality change.
llvm-svn: 57544
2008-10-15 03:47:17 +00:00
Dan Gohman
2ed6f318da Adjust whitespace in debug messages to be more consistent
with other debug messages.

llvm-svn: 57543
2008-10-15 02:57:38 +00:00
Evan Cheng
cb8b4e9dd4 - Add target lowering hooks that specify which setcc conditions are illegal,
i.e. conditions that cannot be checked with a single instruction. For example,
SETONE and SETUEQ on x86.
- Teach legalizer to implement *illegal* setcc as a and / or of a number of
legal setcc nodes. For now, only implement FP conditions. e.g. SETONE is
implemented as SETO & SETNE, SETUEQ is SETUO | SETEQ.
- Move x86 target over.

llvm-svn: 57542
2008-10-15 02:05:31 +00:00
Dan Gohman
c070ffc493 FastISel support for exception-handling constructs.
- Move the EH landing-pad code and adjust it so that it works
   with FastISel as well as with SDISel.
 - Add FastISel support for @llvm.eh.exception and
   @llvm.eh.selector.

llvm-svn: 57539
2008-10-14 23:54:11 +00:00
Daniel Dunbar
e11e618cc6 Prevent assert when using '"' in names (via hexadecimal).
Update LangRef to mention \xx quoting in names.

llvm-svn: 57538
2008-10-14 23:51:43 +00:00
Daniel Dunbar
f3b4f45878 Change getLLVMName to use raw_ostream & PrintLLVMName.
- Avoids duplicated quotification code.
 - Remove QuoteNameIfNeeded.
 - No functionality change.

llvm-svn: 57537
2008-10-14 23:28:09 +00:00
Dale Johannesen
19407daf55 Accept -march=i586, because gcc does (a synonym
for pentium).  Fixes
gcc.target/i386/20000720-1.c
gcc.target/i386/pr26826.c

llvm-svn: 57528
2008-10-14 22:06:33 +00:00
Evan Cheng
3faedff2de Rename LoadX to LoadExt.
llvm-svn: 57526
2008-10-14 21:26:46 +00:00
Jim Grosbach
d0ff59ec42 Update ARM Insn encoding to get endian-ness to match the documentation (31-0 left to right)
llvm-svn: 57524
2008-10-14 20:36:24 +00:00
Dan Gohman
9543edc4ef Fix command-line option printing to print two spaces where needed,
instead of requiring all "short description" strings to begin with
two spaces. This makes these strings less mysterious, and it fixes
some cases where short description strings mistakenly did not
begin with two spaces.

llvm-svn: 57521
2008-10-14 20:25:08 +00:00
Evan Cheng
591baeed7c Combine (fcmp cc0 x, y) | (fcmp cc1 x, y) into a single fcmp when possible.
llvm-svn: 57515
2008-10-14 18:44:08 +00:00
Evan Cheng
778b47e6c0 - Somehow I forgot about one / une.
- Renumber fcmp predicates to match their icmp counterparts.
- Try swapping operands to expose more optimization opportunities.

llvm-svn: 57513
2008-10-14 18:13:38 +00:00
Evan Cheng
39a819027c Fix indentation.
llvm-svn: 57508
2008-10-14 17:15:39 +00:00
Evan Cheng
91528965e7 Optimize anding of two fcmp into a single fcmp if the operands are the same. e.g. uno && ueq -> ueq
ord && olt -> olt
     ord && ueq -> oeq

llvm-svn: 57507
2008-10-14 17:15:11 +00:00
Nuno Lopes
08a1a82acc little optimization: reuse getPointerToGlobalIfAvailable(CGV) value in emitGlobals()
llvm-svn: 57484
2008-10-14 10:04:52 +00:00
Dan Gohman
e08e0dcfcc When doing the very-late shift-and address-mode optimization,
create a new DAG node to represent the new shift to keep the
DAG consistent, even though it'll almost always be folded into
the address.

If a user of the resulting address has multiple uses, the
nodes may get revisited by a later MatchAddress call, in which
case DAG inconsistencies do matter.

This fixes PR2849.

llvm-svn: 57465
2008-10-13 20:52:04 +00:00
Evan Cheng
de99d94c58 FIX PR2794. Make sure SIGN_EXTEND_INREG nodes introduced by LegalizeSetCCOperands are leglized. Patch by Richard Pennington.
llvm-svn: 57460
2008-10-13 18:46:18 +00:00
Evan Cheng
731f400eac Also update sub-register intervals after a trivial computation is rematt'ed for a copy instruction. PR2775.
llvm-svn: 57458
2008-10-13 18:35:52 +00:00
Matthijs Kooijman
b86d48c717 Make InstructionCombining::getBitCastOperand() recognize GEP instructions and
constant expression with all zero indices as being the same as a bitcast.

llvm-svn: 57442
2008-10-13 15:17:01 +00:00
Matthijs Kooijman
1ea1008e1f * Make TargetLowering not crash when TargetMachine::getTargetAsmInfo() returns
null. This assumes that any target that does not have AsmInfo, does not
   support "LocAndDot".

llvm-svn: 57438
2008-10-13 12:41:46 +00:00
Matthijs Kooijman
28ae70be64 Make MachineFunction not crash when TargetMachine::getRegisterInfo() returns
NULL, but just hide some debug output then.

llvm-svn: 57437
2008-10-13 12:37:16 +00:00
Gabor Greif
5f75f1372e do not use deprecated interfaces
llvm-svn: 57433
2008-10-13 10:21:17 +00:00
Nick Lewycky
ed4cd79ffc Disallow the construction of SCEVs with could-not-compute operands. Catch CNCs
returned by BinomialCoefficient and don't try to operate with them. This
replaces the previous fix for PR2857.

llvm-svn: 57431
2008-10-13 03:58:02 +00:00
Chris Lattner
16c0109fd4 calls can be supported.
llvm-svn: 57428
2008-10-13 01:59:13 +00:00
Dale Johannesen
7fbfe2a371 Change TAG_ names to DW_TAG for gcc (testsuite) compatibility.
llvm-svn: 57425
2008-10-12 21:23:01 +00:00
Owen Anderson
dbb4904467 Fix a bug in live-in detection that caused lost-copy problems to show up.
llvm-svn: 57424
2008-10-12 20:39:30 +00:00
Anton Korobeynikov
6204f4ac43 Update size of inst correctly with segment override.
llvm-svn: 57414
2008-10-12 10:30:11 +00:00
Owen Anderson
fe70fff286 Add special-case code to allow null-guards on calls to malloc.
llvm-svn: 57413
2008-10-12 08:10:46 +00:00
Owen Anderson
86d9a902dc Make Escape Analysis work for any pointer.
llvm-svn: 57412
2008-10-12 07:33:29 +00:00
Dale Johannesen
2d23786266 Change Dwarf comments starting with AT_ to DW_AT_ to
match gcc.  Helps with the testsuite.

llvm-svn: 57410
2008-10-12 06:20:47 +00:00
Owen Anderson
9b86d152be Fix crashes and infinite loops.
llvm-svn: 57408
2008-10-12 06:03:38 +00:00
Owen Anderson
d724368eeb Duncan convinced me that it's not possible to transform control-based escapes into
data-based ones.  Just be conservative when analyzing control-based escapes.

llvm-svn: 57400
2008-10-12 03:59:45 +00:00
Chris Lattner
3c8eace4da fix typo
llvm-svn: 57388
2008-10-11 23:59:03 +00:00
Chris Lattner
7a61ef92f5 Fix PR2697 by rewriting the '(X / pos) op neg' logic. This also changes
a couple other cases for clarity, but shouldn't affect correctness.

Patch by Eli Friedman!

llvm-svn: 57387
2008-10-11 22:55:00 +00:00
Chris Lattner
7910d59d44 Change CALLSEQ_BEGIN and CALLSEQ_END to take TargetConstant's as
parameters instead of raw Constants.  This prevents the constants from
being selected by the isel pass, fixing PR2735.

llvm-svn: 57385
2008-10-11 22:08:30 +00:00
Chris Lattner
3d1cdfc99e rearrange some code.
llvm-svn: 57384
2008-10-11 22:07:19 +00:00
Duncan Sands
f175d9eae0 Fix comment typo.
llvm-svn: 57381
2008-10-11 19:34:24 +00:00
Anton Korobeynikov
d8b3e6f0ce Add ability to override segment (mostly for code emitter purposes).
llvm-svn: 57380
2008-10-11 19:09:15 +00:00
Daniel Dunbar
73ceb8010b Unbreak DbgStopPointInst::getFileName().
llvm-svn: 57373
2008-10-11 06:40:56 +00:00
Chris Lattner
2f2ef3f25f simplify comparison
llvm-svn: 57371
2008-10-11 00:08:02 +00:00
Dale Johannesen
03d0a7d70c Fix SSE4.1 roundss, roundsd. While the instructions have
the same pattern as roundpd/roundps, the Intel compiler 
builtins do not:  rounds* has an extra operand.  Fixes
gcc.target/i386/sse4_1-rounds[sd]-[1234].c

llvm-svn: 57370
2008-10-10 23:51:03 +00:00
Devang Patel
255fee3bce Check loop exit predicate properly while eliminating one iteration loop.
This patch fixes PR 2869

llvm-svn: 57369
2008-10-10 22:02:57 +00:00
Anton Korobeynikov
e44fccb2f0 Fix a thinko and unbreak sparc default CC
llvm-svn: 57368
2008-10-10 21:47:37 +00:00
Dale Johannesen
0c6ea38b92 Remove some overzealous checks that were rejecting
valid comments in inline assembly.
gcc.target/i386/20011009-1.c

llvm-svn: 57365
2008-10-10 21:04:42 +00:00
Anton Korobeynikov
f5398df73c Extend set of return registers on sparc until someone will implement MRV support there. At least, this will allow libgcc compile, however we are not ABI-compatible with stuff compiled with native gcc.
llvm-svn: 57364
2008-10-10 20:30:14 +00:00
Anton Korobeynikov
1ead869e67 Ignore extra 'r' modifier for now
llvm-svn: 57363
2008-10-10 20:29:50 +00:00
Anton Korobeynikov
ffdc3498b4 Use expand for smul_lohi for now
llvm-svn: 57362
2008-10-10 20:29:31 +00:00
Anton Korobeynikov
8ed548b24a Add rudimentary support for 'r' register operand
llvm-svn: 57359
2008-10-10 20:28:10 +00:00
Anton Korobeynikov
ba8bb3e12f Cleanup
llvm-svn: 57358
2008-10-10 20:27:31 +00:00
Oscar Fuentes
32e927030e CMake: updated lib/Analysis/CMakeLists.txt.
llvm-svn: 57357
2008-10-10 18:51:36 +00:00
Mon P Wang
dc1aa21e4e Revert r57340 move guard mutex in getPointerToFunction as this can cause
deadlock issues with java

llvm-svn: 57356
2008-10-10 18:07:10 +00:00
Nuno Lopes
cc4f37aa68 fix memleak by cleaning the global sets on pass exit
llvm-svn: 57353
2008-10-10 16:25:50 +00:00
Anton Korobeynikov
6054846989 Add rudimentary asmprinter support for printing inline asm operands for sparc.
llvm-svn: 57346
2008-10-10 10:15:03 +00:00
Anton Korobeynikov
a12d563611 Add dummy 'm' inline asm constraint handler for Sparc. I'm not sure, whether it is correct, however :)
llvm-svn: 57345
2008-10-10 10:14:47 +00:00
Anton Korobeynikov
8cfd14b138 Cleanup
llvm-svn: 57344
2008-10-10 10:14:15 +00:00
Owen Anderson
5a5a9162e6 Add a basic intra-procedural escape analysis. This hasn't be extensively tested yet, but feedback is welcome.
llvm-svn: 57342
2008-10-10 08:36:25 +00:00
Mon P Wang
6c79c8e822 Moved guard mutex upwards to guard materializing a function
in getPointerToFunction

llvm-svn: 57340
2008-10-10 01:47:42 +00:00
Mon P Wang
3b3ab0fa30 Added missing print functions that take a raw_ostream
llvm-svn: 57339
2008-10-10 01:43:55 +00:00
Dale Johannesen
cc34c2da3a Generated files for previous checkin.
llvm-svn: 57331
2008-10-09 23:01:34 +00:00
Dale Johannesen
075a62519f Add a "loses information" return value to APFloat::convert
and APFloat::convertToInteger.  Restore return value to
IEEE754.  Adjust all users accordingly.

llvm-svn: 57329
2008-10-09 23:00:39 +00:00
Dale Johannesen
9e57068854 Rename APFloat::convertToAPInt to bitcastToAPInt to
make it clearer what the function does.  No functional
change.

llvm-svn: 57325
2008-10-09 18:53:47 +00:00
Nick Lewycky
843c7dfe05 Don't drop alignment on globals when cloning.
llvm-svn: 57320
2008-10-09 06:27:14 +00:00
Chris Lattner
284ae75537 get CodeGen/Alpha/mul128.ll to work.
llvm-svn: 57318
2008-10-09 04:50:56 +00:00
Dale Johannesen
9c6ffd55b4 Align EH tables before label is emitted, not after,
thus aligning the label.

llvm-svn: 57310
2008-10-08 21:50:21 +00:00
Dale Johannesen
817eff07b1 (re)Put const weak strings in appropriate section on Darwin.
g++dg/abi/key2.C

llvm-svn: 57309
2008-10-08 21:49:47 +00:00
Nuno Lopes
a4813e472c dont specialize weak functions and the like
llvm-svn: 57305
2008-10-08 18:45:59 +00:00
Jim Grosbach
974799922e Comment to be explicit that the enumeration values for CondCodes matter.
llvm-svn: 57295
2008-10-08 16:24:35 +00:00
Duncan Sands
bc53ce331a Use template to distinguish between function variants.
GCC 4.4.0 gives an error on the "int" declaration for example
saying that it has already been declared (using the "short"
one). Using templates here allow the compiler to distinguish
between the function to choose.

Also, "llvm/Support/DataTypes.h" was not included, leading to
error messages about not knowing "uint32_t" for example.

Patch by Samuel Tardieu.

llvm-svn: 57292
2008-10-08 07:44:52 +00:00
Duncan Sands
8f296a3788 Add <cstdio> include where needed by gcc-4.4.
Patch by Samuel Tardieu.

llvm-svn: 57291
2008-10-08 07:23:46 +00:00
Chris Lattner
293590ca07 regenerate
llvm-svn: 57290
2008-10-08 06:44:45 +00:00
Chris Lattner
4afce47e9b Add missing semicolumns in parser rules, those missing semicolumns
are required to compile with the latest Bison.

Patch by Samuel Tardieu!

llvm-svn: 57289
2008-10-08 06:44:36 +00:00
Chris Lattner
0aa4423c8c Add parentheses to avoid warnings in GCC 4.4.0,
patch by Samuel Tardieu!

llvm-svn: 57288
2008-10-08 06:42:28 +00:00
Owen Anderson
7f99714393 Fix the case where an instruction is not properly marked as using all registers that alias its inputs.
llvm-svn: 57286
2008-10-08 04:30:51 +00:00
Dan Gohman
08e60cee90 Remove -disable-fast-isel. Use cl::boolOrDefault with -fast-isel
instead.

So now: -fast-isel or -fast-isel=true enable fast-isel, and
-fast-isel=false disables it. Fast-isel is also on by default
with -fast, and off by default otherwise.

llvm-svn: 57270
2008-10-07 23:00:56 +00:00
Dan Gohman
c65ca09308 Add MBB successors and physreg Uses in the same order that
SDISel typically adds them in. This makes it a little easier
to compare FastISel output with SDISel output.

llvm-svn: 57266
2008-10-07 22:10:33 +00:00
Dan Gohman
6d98c5ab31 Avoid emitting redundant materializations of integer constants
for things like null pointers, which at this level aren't
different from regular integer constants.

llvm-svn: 57265
2008-10-07 22:03:27 +00:00
Dan Gohman
2561119124 Instead of emitting an implicit use for the super-register of
X86::CL that was used, emit an EXTRACT_SUBREG from the CL
super-register to CL. This more precisely describes how the
CL register is being used.

llvm-svn: 57264
2008-10-07 21:50:36 +00:00
Jim Grosbach
8ac554209f Unconditional branch instruction encoding fix. Needs to use ABI, not AXI, to get the proper opcode bits.
llvm-svn: 57262
2008-10-07 21:08:09 +00:00
Jim Grosbach
5fb8bb7434 need ARM.h for ARMCC definition
llvm-svn: 57261
2008-10-07 21:01:51 +00:00
Owen Anderson
c9a628af26 Add an option to enable StrongPHIElimination, for ease of testing.
llvm-svn: 57259
2008-10-07 20:22:28 +00:00
Jim Grosbach
d44d20be6e Encode the conditional execution predicate when JITing.
llvm-svn: 57258
2008-10-07 19:05:35 +00:00
Dale Johannesen
3d2e449078 Model hardwired inputs & outputs of x86 8-bit divides correctly.
Fixes local RA miscompilation of gcc.c-torture/execute/20020904-1.c -O0.

llvm-svn: 57257
2008-10-07 18:54:28 +00:00
Andrew Lenharth
66cc9d5e53 Use Dan's supperior check
llvm-svn: 57255
2008-10-07 18:27:23 +00:00
Andrew Lenharth
c83731e00a Correctly set attributes when removing args during cloning. Fixes PR2765
llvm-svn: 57254
2008-10-07 18:08:38 +00:00
Jim Grosbach
61f8207ac9 Clarify naming and correct conditional so that CMP and CMN instructions get the Rn operand encoded properly
llvm-svn: 57252
2008-10-07 17:42:09 +00:00
Jim Grosbach
a52546fec4 Fix Opcode values of CMP and CMN
llvm-svn: 57251
2008-10-07 17:40:46 +00:00
Andrew Lenharth
950618a347 No need for |=
llvm-svn: 57249
2008-10-07 17:11:29 +00:00
Andrew Lenharth
2399c6cb95 Use ADDC if it is valid at any smaller size. Do it right this time
llvm-svn: 57248
2008-10-07 17:09:16 +00:00
Andrew Lenharth
84166420cc Use ADDC if it is valid at any smaller size. fixes test/Codegen/Generic/i128-addsub.ll on x86
llvm-svn: 57247
2008-10-07 17:03:15 +00:00
Anders Carlsson
a9c42526f8 Certain patterns involving the "movss" instruction were marked as requiring SSE2, when in reality movss is an SSE1 instruction.
llvm-svn: 57246
2008-10-07 16:14:11 +00:00
Andrew Lenharth
c00c2a0058 Expand arith on machines without carry flags
llvm-svn: 57243
2008-10-07 14:15:42 +00:00
Andrew Lenharth
7a997d1cfd Note that ADDC and company don't actually expand yet (missing in legalize
llvm-svn: 57226
2008-10-07 02:10:26 +00:00
Dale Johannesen
3b86d974bc Mark negative-zero-to-int conversion as Inexact,
since -0.0 can't be represented as an int.
This prevents llvm from reducing -0.0 to a
load-and-convert of int 0.  Fixes
ieee.exp/mzero[2356].c in gcc testsuite.

llvm-svn: 57224
2008-10-07 00:40:01 +00:00
Dan Gohman
188af3ae0d Correctly handle calls with no return values. This fixes
2006-01-23-UnionInit on x86-64 when inlining is not enabled.

llvm-svn: 57223
2008-10-07 00:12:37 +00:00
Devang Patel
378c8633e5 Fix typo, fix PR 2865.
llvm-svn: 57221
2008-10-06 23:22:54 +00:00
Dale Johannesen
40d00c0979 Be more precise about which conversions of NaNs
are Inexact.  (These are not Inexact as defined
by IEEE754, but that seems like a reasonable way
to abstract what happens:  information is lost.)

llvm-svn: 57218
2008-10-06 22:59:10 +00:00
Evan Cheng
88d76ffe8a Fix PR2850 and PR2863. Only generate movddup for 128-bit SSE vector shuffles.
llvm-svn: 57210
2008-10-06 21:13:08 +00:00
Dale Johannesen
24ea5f2be7 Temporarily revert functionality change from my previous patch;
it is too aggressive.

llvm-svn: 57203
2008-10-06 20:43:48 +00:00
Devang Patel
ca66d093c0 Remove interfaces implemented by dead pass from the list of available passes.
Patch By Matthijs Kooijman.

llvm-svn: 57202
2008-10-06 20:36:36 +00:00
Dale Johannesen
89329a1d0a Mark shortening NaN conversions as Inexact. PR 2856.
Improve description of unsupported formats.

llvm-svn: 57185
2008-10-06 18:22:29 +00:00
Devang Patel
07a9ce22e4 It is possible that all functions in one module are not being
optimized for size. Set OptForSize for each function separately.

llvm-svn: 57182
2008-10-06 18:03:39 +00:00
Dan Gohman
8b33abdd5b Don't dereference the end() iterator. Thanks to
ENABLE_EXPENSIVE_CHECKS for finding this.

llvm-svn: 57181
2008-10-06 18:00:07 +00:00
Devang Patel
4f91b766d2 Remove unncessary isDeclaration() checks.
llvm-svn: 57179
2008-10-06 17:30:07 +00:00
Matthijs Kooijman
12cd5d041d Allow scalarrepl to treat an all-zero GEP just as bitcast.
This includes not marking a GEP involving a vector as unsafe, but only when it
has all zero indices. This allows scalarrepl to work in a few more cases.

llvm-svn: 57177
2008-10-06 16:23:31 +00:00
Chris Lattner
8e41e3ac13 reorder #include order, patch by Kenneth Boyd!
llvm-svn: 57148
2008-10-06 03:54:25 +00:00
Chris Lattner
5d6871b940 Add #include to get alloca, patch by Kenneth Boyd!
llvm-svn: 57147
2008-10-06 03:53:16 +00:00
Chris Lattner
4622ca2262 fix an incorrect and extremely confusing error message
llvm-svn: 57123
2008-10-05 18:24:03 +00:00
Chris Lattner
1e4f7de3b6 make the autoupgrade code for ret attributes dramatically simpler
and actually work.  We can now read the llvm 2.3 bc file from PR2849

llvm-svn: 57122
2008-10-05 18:22:09 +00:00
Nuno Lopes
4cf7f0e3cd regenerate
llvm-svn: 57114
2008-10-05 16:49:34 +00:00
Nuno Lopes
9e274c3532 clean ArgTypeListI production: free the PATypeHolder
llvm-svn: 57113
2008-10-05 16:49:03 +00:00
Anton Korobeynikov
8106145480 Emit type-correct constant null. Also fix a typo.
Patch by Robert G. Jakabosky!

llvm-svn: 57110
2008-10-05 15:07:06 +00:00
Anton Korobeynikov
1f7e8162d9 Fix weird think-o and unbreak build on all gcc-3.4.x-based platforms (e.g. mingw)
llvm-svn: 57106
2008-10-05 08:53:29 +00:00
Chris Lattner
ed0f84ee2d this case is matched now.
llvm-svn: 57096
2008-10-05 02:16:12 +00:00
Chris Lattner
107e8f8b60 rewrite bswap matching to be more general, allowing arbitrary
shifting and masking inside a bswap expr.  This allows it to handle
the cases from PR2842, which involve the intermediate 'or' 
expressions being shifted, not just the input value.

llvm-svn: 57095
2008-10-05 02:13:19 +00:00
Chris Lattner
6fae76bbf3 fix a bug where the bswap matcher could match a case involving
ashr.  It should only apply to lshr.

llvm-svn: 57089
2008-10-05 00:50:57 +00:00
Chris Lattner
576e29c87d wrap some long lines and expand i32 mul's to libcalls, inspired by a
patch by Mikael Lepisto!

llvm-svn: 57077
2008-10-04 21:27:46 +00:00
Oscar Fuentes
4bf1c53073 CMake: Reflected changes on source file structure. New plugin support
for llvmc2 incomplete.

llvm-svn: 57076
2008-10-04 21:18:50 +00:00
Duncan Sands
e22385630e Ignore loads from and stores to local memory (i.e. allocas)
when deciding whether to mark a function readnone/readonly.
Since the pass is currently run before SROA, this may be
quite helpful.  Requested by Chris on IRC.

llvm-svn: 57050
2008-10-04 13:24:24 +00:00
Nick Lewycky
53e751fcba Allow the construction of SCEVs with SCEVCouldNotCompute operands, by
implementing folding. Fixes PR2857.

llvm-svn: 57049
2008-10-04 11:19:07 +00:00
Anton Korobeynikov
4cc9051fbb Revert r56675 - it breaks unwinding runtime everywhere.
llvm-svn: 57048
2008-10-04 11:09:36 +00:00
Argyrios Kyrtzidis
8614f628d2 Add implementations for sys::Memory::setWritable and sys::Memory::setExecutable on Win32 platform.
llvm-svn: 57047
2008-10-04 08:15:32 +00:00
Argyrios Kyrtzidis
b9e76c172c Fix compilation error on MSVC.
llvm-svn: 57046
2008-10-04 08:11:49 +00:00
Dan Gohman
5944450d5f Fix fast-isel's handling of atomic instructions. They may
expand to multiple basic blocks, in which case fast-isel
needs to informed of which block to use as it resumes
inserting instructions.

llvm-svn: 57040
2008-10-04 00:56:36 +00:00
Dan Gohman
638a8001c8 Fix a bug in the local allocator's liveness computation where it
was setting kill flags on tied uses in two-address instructions.
The kill flags were causing the allocator to think it could
allocate the use and its tied def in different registers.

llvm-svn: 57039
2008-10-04 00:31:14 +00:00
Dale Johannesen
dc83b95ba5 Make atomic Swap work, 64-bit on x86-32.
Make it all work in non-pic mode.

llvm-svn: 57034
2008-10-03 22:25:52 +00:00
Dan Gohman
700611dfc6 Clean up some multiple-return-value code that is no longer
applicable.

llvm-svn: 57033
2008-10-03 22:21:24 +00:00
Devang Patel
0d22d8ebdb Fix function attribute verification check.
Thanks Duncan!

llvm-svn: 57029
2008-10-03 21:11:02 +00:00
Dale Johannesen
27d8955b8f Pass MemOperand through for 64-bit atomics on 32-bit,
incidentally making the case where the memop is a
pointer deref work.  Fix cmp-and-swap regression.

llvm-svn: 57027
2008-10-03 19:41:08 +00:00
Devang Patel
55401473f9 Nick Lewycky's patch.
While hosting instruction check PHI node.

llvm-svn: 57025
2008-10-03 18:57:37 +00:00
Dan Gohman
dc99a744fd Use -1ULL instead of uint64_t(-1), at Anton's suggestion.
llvm-svn: 57021
2008-10-03 17:56:45 +00:00
Devang Patel
2bed4d4ca0 Verify function attributes.
llvm-svn: 57020
2008-10-03 17:50:00 +00:00
Evan Cheng
d572afd76c Fix typos pointed out by Duncan. Also untabify these files.
llvm-svn: 57018
2008-10-03 17:11:58 +00:00
Daniel Dunbar
40fb36a42c Unbreak build.
llvm-svn: 57017
2008-10-03 17:11:57 +00:00
Dan Gohman
00034b1416 Avoid creating two TargetLowering objects for each target.
Instead, just create one, and make sure everything that needs
it can access it. Previously most of the SelectionDAGISel
subclasses all had their own TargetLowering object, which was
redundant with the TargetLowering object in the TargetMachine
subclasses, except on Sparc, where SparcTargetMachine
didn't have a TargetLowering object. Change Sparc to work
more like the other targets here.

llvm-svn: 57016
2008-10-03 16:55:19 +00:00
Dan Gohman
e41ac02dce Remove an unused field.
llvm-svn: 57014
2008-10-03 16:17:33 +00:00
Jim Grosbach
a49386d8e7 On Darwin ARM, memory needs special handling to do JIT. This patch expands
this handling to work properly for modifying stub functions, relocations
back to entry points after JIT compilation, etc..

llvm-svn: 57013
2008-10-03 16:17:20 +00:00
Jim Grosbach
d9ff019d3e Indexing off by one resulted in errant encoding of source register for
reg->reg moves.

llvm-svn: 57011
2008-10-03 15:53:56 +00:00
Jim Grosbach
e398f553b2 NeedStub/DoesntNeedStub logic was reversed, leading to not using a stub
for global relocations that do need them (libc calls, for example).

llvm-svn: 57010
2008-10-03 15:52:42 +00:00
Nuno Lopes
3fbdc238d6 regenerate
llvm-svn: 57009
2008-10-03 15:52:39 +00:00
Nuno Lopes
5cb07eb550 fix more memleaks in ResolveTypeTo() and ParseGlobalVariable()
llvm-svn: 57008
2008-10-03 15:51:46 +00:00
Nuno Lopes
263d218cd1 regenerate with bison 2.3
llvm-svn: 57007
2008-10-03 15:45:58 +00:00
Dan Gohman
30c5ce1b7d Switch the MachineOperand accessors back to the short names like
isReg, etc., from isRegister, etc.

llvm-svn: 57006
2008-10-03 15:45:36 +00:00
Nuno Lopes
949c7ea3e7 fix memleak in FunctionHeaderH
llvm-svn: 57005
2008-10-03 15:44:21 +00:00
Duncan Sands
00b25fea88 The result of getSetCCResultType (eg: i32) may be larger
than the type an i1 is promoted to (eg: i8).  Account
for this.  Noticed by Tilmann Scheller on CellSPU; he
will hopefully take care of fixing this in LegalizeDAG
and adding a testcase!

llvm-svn: 56997
2008-10-03 07:41:46 +00:00
Duncan Sands
5edd9b2350 Teach internalize to preserve the callgraph.
Why?  Because it was there!

llvm-svn: 56996
2008-10-03 07:36:09 +00:00
Nicolas Geoffray
c3efec61f5 Acquire the lock only when necessary. More precisely, do not acquire
the lock when calling a method which may materialize the llvm::Function.

llvm-svn: 56995
2008-10-03 07:27:08 +00:00
Owen Anderson
e98ca283b0 SplitBlock should only attempt to update LoopInfo if it is actually being used.
llvm-svn: 56994
2008-10-03 06:55:35 +00:00
Dan Gohman
68e27d0b27 Implement fast-isel support for zero-extending from i1.
It turns out that this is a fairly common operation,
and it's easy enough to handle.

llvm-svn: 56990
2008-10-03 01:28:47 +00:00
Dan Gohman
78ef9889c9 Fix X86FastISel to handle dynamic allocas that have avoided
getting inserted into the ValueMap. This avoids infinite
recursion in some rare cases.

llvm-svn: 56989
2008-10-03 01:27:49 +00:00
Dan Gohman
e75d14f8b0 Optimize conditional branches in X86FastISel. This replaces
sequences like this:
       sete    %al
       testb   %al, %al
       jne     LBB11_1
with this:
       je      LBB11_1

llvm-svn: 56969
2008-10-02 22:15:21 +00:00
Dan Gohman
bf63ae1e29 Add a new MachineBasicBlock utility function, isLayoutSuccessor, that
can be used when deciding if a block can transfer control to another
via a fall-through instead of a branch.

llvm-svn: 56968
2008-10-02 22:09:09 +00:00
Andrew Lenharth
106090d2a6 fix build gcc 4.3
llvm-svn: 56965
2008-10-02 20:15:08 +00:00
Owen Anderson
1c171e1d1c Use a multimap rather than a map for holding the list of copies to insert, so we don't lose copies when two of them have
the same source.  I don't know what I was thinking when I wrote this originally.
Note: There's probably a more efficient way to do this, but I need to think about it some more, and about what determinism
guarantees need to be present.

llvm-svn: 56964
2008-10-02 19:40:33 +00:00
Dale Johannesen
dbd7b1bd33 Handle some 64-bit atomics on x86-32, some of the time.
llvm-svn: 56963
2008-10-02 18:53:47 +00:00
Devang Patel
92bd02d528 Remove redundant check.
llvm-svn: 56960
2008-10-02 18:38:23 +00:00
Evan Cheng
c589085710 A Partitioned Boolean Quadratic Programming (PBQP) based register allocator.
Contributed by Lang Hames.

llvm-svn: 56959
2008-10-02 18:29:27 +00:00
Oscar Fuentes
c1d88c3b68 CMake: Added Host.cpp to lib/System/CMakeLists.txt.
llvm-svn: 56957
2008-10-02 17:39:29 +00:00
Dan Gohman
c48242640d Fix a think-o in isSafeToMove. This fixes it from thinking that
volatile memory references are safe to move.

llvm-svn: 56948
2008-10-02 15:04:30 +00:00
Dan Gohman
bba3fb6d18 Work around an interaction between fast-isel and regalloc=local. The
local register allocator's physreg liveness doesn't recognize subregs,
so it doesn't know that defs of %ecx that are immediately followed by
uses of %cl aren't dead. This comes up due to the way fast-isel emits
shift instructions.

This is a temporary workaround. Arguably, local regalloc should
handle subreg references correctly. On the other hand, perhaps
fast-isel should use INSERT_SUBREG instead of just assigning to the
most convenient super-register of %cl when lowering shifts.

This fixes MultiSource/Benchmarks/MallocBench/espresso,
MultiSource/Applications/hexxagon, and others, under -fast.

llvm-svn: 56947
2008-10-02 14:56:12 +00:00
Bill Wendling
1c97db4090 "The original bug was a complaint that _mm_srli_si128 mis-compiled when passed
a constant vector ("{0x123, 0x456}" syntax).  The fix is to simplify the
_mm_srli_si128 macro, and  move the "* 8" from the macro into the compiler
back-end.  I can't change the existing __builtins because so many people are
using them :-(."
Patch by Stuart Hastings!

llvm-svn: 56944
2008-10-02 05:56:52 +00:00
Daniel Dunbar
1fab10702e Add llvm::sys::{osName,osVersion} for retrieving operating system name
& version as strings.
 - Win32 code is untested.

llvm-svn: 56942
2008-10-02 01:17:28 +00:00
Devang Patel
d90556aed0 Attributes noinline alwaysinline are incompatible
llvm-svn: 56939
2008-10-01 23:41:25 +00:00
Devang Patel
a5cda569d3 Remove OptimizeForSize global. Use function attribute optsize.
llvm-svn: 56937
2008-10-01 23:18:38 +00:00
Dan Gohman
cd111d96c6 Enable FastISel by default (on x86 and x86-64) with the -fast option.
llvm-svn: 56930
2008-10-01 20:39:19 +00:00
Chris Lattner
91e5279de1 add a new form of Type::dump that takes a module for type names,
patch provided by Tomas Lindquist Olsen!

llvm-svn: 56929
2008-10-01 20:16:19 +00:00
Dan Gohman
e1d0930044 Make some implicit conversions explicit, to avoid compiler warnings.
llvm-svn: 56927
2008-10-01 19:58:59 +00:00
Dan Gohman
4aacc3ab83 Split x86's ADJCALLSTACK instructions into 32-bit and 64-bit forms.
This allows the 64-bit forms to use+def RSP instead of ESP. This
doesn't fix any real bugs today, but it is more precise and it
makes the debug dumps on x86-64 look more consistent.

Also, add some comments describing the CALL instructions' physreg
operand uses and defs.

llvm-svn: 56925
2008-10-01 18:28:06 +00:00
Jim Grosbach
0268ee4c25 Fix typo s/ther/there/
llvm-svn: 56924
2008-10-01 18:16:49 +00:00
Duncan Sands
88d8323743 Factorize code: remove variants of "strip off
pointer bitcasts and GEP's", and centralize the
logic in Value::getUnderlyingObject.  The
difference with stripPointerCasts is that
stripPointerCasts only strips GEPs if all
indices are zero, while getUnderlyingObject
strips GEPs no matter what the indices are.

llvm-svn: 56922
2008-10-01 15:25:41 +00:00
Dan Gohman
6466b44315 Fold trivial two-operand tokenfactors where the operands are equal
immediately.

llvm-svn: 56921
2008-10-01 15:11:19 +00:00
Dan Gohman
8ba73d6d60 Don't prepend a space character for constants in Value::print.
llvm-svn: 56920
2008-10-01 15:09:37 +00:00
Dan Gohman
81ade97fe0 Fix typos in comments.
llvm-svn: 56919
2008-10-01 15:07:49 +00:00
Nuno Lopes
8bf32ebde6 revert the addition of Preverves(CallGraph), per Duncan's comments
llvm-svn: 56917
2008-10-01 09:13:40 +00:00
Dan Gohman
d6e96e9888 Mark CALL instructions as having a Use of ESP/RSP.
llvm-svn: 56911
2008-10-01 04:14:30 +00:00
Dan Gohman
b6d0fe7797 Call ScalarEvolution's deleteValueFromRecords before deleting an
instruction, not after. This fixes some uses of free'd memory.

llvm-svn: 56908
2008-10-01 02:02:03 +00:00
Bill Wendling
d7effcf8da Implement the -fno-builtin option in the front-end, not in the back-end.
llvm-svn: 56900
2008-10-01 00:59:58 +00:00
Owen Anderson
9c1e298f14 Mark merged-in VNInfo's as being PHIKilled.
llvm-svn: 56893
2008-09-30 23:58:47 +00:00
Owen Anderson
b89aa47081 Fix a simple error in renumbering kill markaers, that took an inordinant amount of time to track down.
llvm-svn: 56889
2008-09-30 22:51:54 +00:00
Bill Wendling
618d422cdd Just don't transform this memset into "bzero" if no-builtin is specified.
llvm-svn: 56888
2008-09-30 22:05:33 +00:00
Nuno Lopes
36e7e0b190 add preserversCFG() + preservers(CallGraph)
llvm-svn: 56887
2008-09-30 22:04:30 +00:00
Bill Wendling
86f6fdc7e3 - Initialize "--no-builtin" to "false".
- Testcase for r56885.

llvm-svn: 56886
2008-09-30 21:40:30 +00:00
Bill Wendling
9ad453e943 Add the new `-no-builtin' flag. This flag is meant to mimic the GCC
`-fno-builtin' flag. Currently, it's used to replace "memset" with "_bzero"
instead of "__bzero" on Darwin10+. This arguably violates the meaning of this
flag, but is currently sufficient. The meaning of this flag should become more
specific over time.

llvm-svn: 56885
2008-09-30 21:22:07 +00:00
Dan Gohman
19530c810d Move the primary fast-isel top-level comments to FastISel.cpp, where
they'll be a little more visible. Also, update and reword them a bit.

llvm-svn: 56877
2008-09-30 20:48:29 +00:00
Nuno Lopes
2219758606 add AU.setPreservesCFG() since this pass only adds and removes function attributes
llvm-svn: 56868
2008-09-30 18:34:38 +00:00
Dan Gohman
5a2169ee6e Optimize SelectionDAG's AssignTopologicalOrder even further.
Completely eliminate the TopOrder std::vector. Instead, sort
the AllNodes list in place. This also eliminates the need to
call AllNodes.size(), a linear-time operation, before
performing the sort.

Also, eliminate the Sources temporary std::vector, since it
essentially duplicates the sorted result as it is being
built.

This also changes the direction of the topological sort
from bottom-up to top-down. The AllNodes list starts out in
roughly top-down order, so this reduces the amount of
reordering needed. Top-down is also more convenient for
Legalize, and ISel needed only minor adjustments.

llvm-svn: 56867
2008-09-30 18:30:35 +00:00
Evan Cheng
7eea8fb7cd Add runStaticConstructorsDestructors which runs ctors / dtors of a single module. Patch by David Chisnall.
llvm-svn: 56849
2008-09-30 15:51:21 +00:00
Evan Cheng
1c8ff02eeb Re-apply 56835 along with header file changes.
llvm-svn: 56848
2008-09-30 15:44:16 +00:00
Duncan Sands
a2c8482495 Revert commit 56835 since it breaks the build.
"If a re-materializable instruction has a register
operand, the spiller will change the register operand's
spill weight to HUGE_VAL to avoid it being spilled.
However, if the operand is already in the queue ready
to be spilled, avoid re-materializing it".

llvm-svn: 56837
2008-09-30 10:00:30 +00:00
Evan Cheng
4eee17f4fb If a re-materializable instruction has a register operand, the spiller will change the register operand's spill weight to HUGE_VAL to avoid it being spilled. However, if the operand is already in the queue ready to be spilled, avoid re-materializing it.
llvm-svn: 56835
2008-09-30 06:36:58 +00:00
Nick Lewycky
9e918179c8 Fix misoptimization of: xor i1 (icmp eq (X, C1), icmp s[lg]t (X, C2))
llvm-svn: 56834
2008-09-30 06:08:34 +00:00
Dan Gohman
b5824675e4 Fix X86FastISel's output for x86-32 PIC constant pool addresses.
llvm-svn: 56829
2008-09-30 01:21:32 +00:00
Dan Gohman
c28f40a821 Move the GlobalBaseReg field out of X86ISelDAGToDAG.cpp
and X86FastISel.cpp into X86MachineFunction.h, so that it
can be shared, instead of having each selector keep track
of its own.

llvm-svn: 56825
2008-09-30 00:58:23 +00:00
Dan Gohman
e76be890c9 Disable all x87 usage, including f32 and f64 when the subtarget
doesn't have SSE(2), with X86FastISel.

llvm-svn: 56823
2008-09-30 00:48:39 +00:00
Dale Johannesen
52987eab6e Remove misuse of ReplaceNodeResults for atomics with
valid types.  No functional change.

llvm-svn: 56808
2008-09-29 22:25:26 +00:00
Dan Gohman
f78676d0b6 Fix FastISel to not initialize the PIC-base register multiple times
in functions with PIC references from more than one basic block.

llvm-svn: 56807
2008-09-29 21:55:50 +00:00
Dan Gohman
c6184c4473 Fix an over-pessimization about GlobalVariable addresses in X86FastISel.
llvm-svn: 56802
2008-09-29 21:13:15 +00:00
Devang Patel
7536edca09 Support inreg, zext and sext as return value attributes.
llvm-svn: 56801
2008-09-29 20:49:50 +00:00
Evan Cheng
b749199c34 Fix PR2835. Do not change the width of a volatile load.
llvm-svn: 56792
2008-09-29 17:26:18 +00:00
Duncan Sands
187322048e Speed up these passes when the callgraph has
huge simply connected components.  Suggested
by Chris.

llvm-svn: 56787
2008-09-29 14:59:04 +00:00
Nuno Lopes
a4d69747c1 remove redundant test (mayBeOverriden() includes hasLinkOnceLinkage)
llvm-svn: 56786
2008-09-29 14:40:32 +00:00
Duncan Sands
60dc0b5cbe Tweak some comments.
llvm-svn: 56784
2008-09-29 13:35:31 +00:00
Duncan Sands
651eeb4be2 Rename isWeakForLinker to mayBeOverridden. Use it
instead of hasWeakLinkage in a bunch of optimization
passes.

llvm-svn: 56782
2008-09-29 11:25:42 +00:00
Evan Cheng
28d9b3a8ad Re-apply 56683 with fixes.
llvm-svn: 56748
2008-09-27 01:56:22 +00:00
Daniel Dunbar
dc1d75b1b5 Unbreak build.
llvm-svn: 56727
2008-09-27 00:22:09 +00:00
Devang Patel
47a504c87c Implement function notes as function attributes.
llvm-svn: 56716
2008-09-26 23:51:19 +00:00
Dale Johannesen
54cc5b6eee Generated files for warning fix.
llvm-svn: 56715
2008-09-26 23:46:20 +00:00
Dale Johannesen
96018ccd87 Fix a compiler warning.
llvm-svn: 56714
2008-09-26 23:45:53 +00:00
Evan Cheng
d63fc80c1e Implement "punpckldq %xmm0, $xmm0" as "pshufd $0x50, %xmm0, %xmm" unless optimizing for code size.
llvm-svn: 56711
2008-09-26 23:41:32 +00:00
Devang Patel
e4e6ea0728 Now Attributes are divided in three groups
- return attributes - inreg, zext and sext
- parameter attributes
- function attributes - nounwind, readonly, readnone, noreturn

Return attributes use 0 as the index.
Function attributes use ~0U as the index.

This patch requires corresponding changes in llvm-gcc and clang.

llvm-svn: 56704
2008-09-26 22:53:05 +00:00
Bill Wendling
7273078850 Temporarily reverting r56683. This is causing a failure during the build of llvm-gcc:
/Volumes/Gir/devel/llvm/clean/llvm-gcc.obj/./gcc/xgcc -B/Volumes/Gir/devel/llvm/clean/llvm-gcc.obj/./gcc/ -B/Volumes/Gir/devel/llvm/clean/llvm-gcc.install/i386-apple-darwin9.5.0/bin/ -B/Volumes/Gir/devel/llvm/clean/llvm-gcc.install/i386-apple-darwin9.5.0/lib/ -isystem /Volumes/Gir/devel/llvm/clean/llvm-gcc.install/i386-apple-darwin9.5.0/include -isystem /Volumes/Gir/devel/llvm/clean/llvm-gcc.install/i386-apple-darwin9.5.0/sys-include -mmacosx-version-min=10.4 -O2  -O2 -g -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include  -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Gir/devel/llvm/clean/llvm.obj/include -I/Volumes/Gir/devel/llvm/clean/llvm.src/include -fexceptions -fvisibility=hidden -DHIDE_EXPORTS -c ../../llvm-gcc.src/gcc/unwind-dw2-fde-darwin.c -o libgcc/./unwind-dw2-fde-darwin.o
Assertion failed: (TargetRegisterInfo::isVirtualRegister(regA) && TargetRegisterInfo::isVirtualRegister(regB) && "cannot update physical register live information"), function runOnMachineFunction, file /Volumes/Gir/devel/llvm/clean/llvm.src/lib/CodeGen/TwoAddressInstructionPass.cpp, line 311.
../../llvm-gcc.src/gcc/unwind-dw2.c:1527: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
{standard input}:3521:non-relocatable subtraction expression, "_dwarf_reg_size_table" minus "L20$pb"
{standard input}:3521:symbol: "_dwarf_reg_size_table" can't be undefined in a subtraction expression
{standard input}:3520:non-relocatable subtraction expression, "_dwarf_reg_size_table" minus "L20$pb"
...

llvm-svn: 56703
2008-09-26 22:10:44 +00:00
Dan Gohman
a9e963a0b4 Fix missing whitespace in the printing of function notes.
llvm-svn: 56702
2008-09-26 22:02:59 +00:00
Dan Gohman
989db64c93 Rename ConstantSDNode's getSignExtended to getSExtValue, for
consistancy with ConstantInt, and re-implement it in terms
of ConstantInt's getSExtValue.

llvm-svn: 56700
2008-09-26 21:54:37 +00:00
Dan Gohman
3bcb327e9c Mark lea fi# as being really rematerializable.
llvm-svn: 56698
2008-09-26 21:30:20 +00:00