1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-27 05:53:07 +01:00
Commit Graph

31462 Commits

Author SHA1 Message Date
David Greene
1df248be05 Add missing includes.
llvm-svn: 79473
2009-08-19 21:52:55 +00:00
Owen Anderson
bbc67a90d5 Get rid of a helgrind warning. If this is _actually_ a performance problem,
we can find a way to cache the answer that isn't racy.

llvm-svn: 79472
2009-08-19 21:48:34 +00:00
Eli Friedman
fe70446342 Add triple parsing support for TCE.
llvm-svn: 79461
2009-08-19 20:46:03 +00:00
Daniel Dunbar
2cf5eb67b4 Switch to SmallString::str from SmallString::c_str, and remove
SmallString::c_str.

llvm-svn: 79456
2009-08-19 20:07:03 +00:00
Daniel Dunbar
2411847839 Change ValueSymbolTable to use raw_svector_ostream for string concatenation.
llvm-svn: 79449
2009-08-19 19:22:52 +00:00
Daniel Dunbar
115971f6a7 Change raw_svector_ostream to reserve the input buffer if necessary, Ted was
right.
 - This class turns out to be much more convenient to use if we do this; clients
   can make sure the buffer is always big enough if they care (since our current
   idiom tends to be to use a SmallString<256> for the input to this we should
   generally be avoiding an unnecessary malloc).

Also, add a convenience raw_svector_ostream::str method which flushes the buffer
and returns a StringRef for the vector contents.

llvm-svn: 79446
2009-08-19 18:40:58 +00:00
Dan Gohman
b19c5b81dd Remove temporary testing code.
llvm-svn: 79443
2009-08-19 18:27:08 +00:00
Dan Gohman
e982de2e30 Make SROA and PredicateSimplifier cope if TargetData is not
available. This is very conservative for now.

llvm-svn: 79442
2009-08-19 18:22:18 +00:00
Dan Gohman
ba656de4a4 Use hasDefinitiveInitializer() instead of testing the same thing
by hand, and fix a few places that were using hasInitializer() that
appear to depend on the initializer value.

llvm-svn: 79441
2009-08-19 18:20:44 +00:00
Dan Gohman
bc59c24278 Canonicalize indices in a constantexpr GEP. If Indices exceed the
static extents of the static array type, it causes GlobalOpt and
other passes to be more conservative. This canonicalization also
allows the constant folder to add "inbounds" to GEPs.

llvm-svn: 79440
2009-08-19 18:18:36 +00:00
Dan Gohman
eb6fbd7fd1 Add an x86 peep that narrows TEST instructions to forms that use
a smaller encoding. These kinds of patterns are very frequent in
sqlite3, for example.

llvm-svn: 79439
2009-08-19 18:16:17 +00:00
Daniel Dunbar
7c093c9ac4 Switch Twine::str() to use toVector(), which is now efficient.
llvm-svn: 79437
2009-08-19 18:09:47 +00:00
David Goodwin
d57f44783c Update Cortex-A8 instruction itineraries for integer instructions.
llvm-svn: 79436
2009-08-19 18:00:44 +00:00
Daniel Dunbar
2e2969f9e1 Switch raw_svector_ostream to use the vector as the ostream buffer.
- This avoids unnecessary malloc/free overhead in the common case, and
   unnecessary copying from the ostream buffer into the output vector.

llvm-svn: 79434
2009-08-19 17:54:29 +00:00
Owen Anderson
9e0bb1bd44 Reapply my less-lock-contention-in-leak-detector patch, now with new files
actually added.

llvm-svn: 79429
2009-08-19 17:07:46 +00:00
Bob Wilson
fae9057bf0 Add support for Neon VEXT (vector extract) shuffles.
This is derived from a patch by Anton Korzh.  I modified it to recognize
the VEXT shuffles during legalization and lower them to a target-specific
DAG node.

llvm-svn: 79428
2009-08-19 17:03:43 +00:00
Daniel Dunbar
988ae00460 Speculatively revert r79375, which may be breaking bootstrap, although in a
rather obscure way (the other candidate is r79377).

llvm-svn: 79426
2009-08-19 16:25:25 +00:00
David Goodwin
9a605efb84 Use the schedule itinerary operand use/def cycle information to adjust dependence edge latency for post-RA scheduling.
llvm-svn: 79425
2009-08-19 16:08:58 +00:00
Eli Friedman
914b41055a PR4737: Fix a nasty bug in load narrowing with non-power-of-two types.
llvm-svn: 79415
2009-08-19 08:46:10 +00:00
Nick Lewycky
47bc7e0bd0 Fix up PHI nodes correctly in the presence of unreachable BBs, part two. Also
delete a newed pointer, and improve readability a little bit.

llvm-svn: 79411
2009-08-19 07:16:57 +00:00
Chris Lattner
aeed3004c1 fix asmstreaming of 2/4 byte elements with pow-2 alignments.
llvm-svn: 79408
2009-08-19 06:35:36 +00:00
Nick Lewycky
ed3dcdbdb8 Be more careful when modifying PHI nodes. Patch by Andre Tavares.
llvm-svn: 79407
2009-08-19 06:24:33 +00:00
Chris Lattner
57b873fda0 switch asmprinter to emit alignments through OutStreamer.
llvm-svn: 79406
2009-08-19 06:12:02 +00:00
Chris Lattner
9cbc9c2d13 eliminate AsmPrinter::SwitchToSection and just have clients
talk to the MCStreamer directly instead.

llvm-svn: 79405
2009-08-19 05:49:37 +00:00
Andreas Neustifter
7cffe838a8 Broke line before break.
llvm-svn: 79404
2009-08-19 05:44:39 +00:00
Daniel Dunbar
b606fc6b6c Make a SmallVector size more reasonable.
llvm-svn: 79403
2009-08-19 05:08:06 +00:00
Lang Hames
c26fb5727a Added an option to have the PBQP allocator attempt coalescing during allocation.
llvm-svn: 79397
2009-08-19 01:36:14 +00:00
Owen Anderson
bd652bf082 Revert my last patch temporarily.
llvm-svn: 79388
2009-08-19 00:52:13 +00:00
Owen Anderson
69a97af0b7 Privatize part of the leak detector mechanism, which turned out to be heavily contended
when trying to run opt in parallel.  This lets parallel opt crunch 403.gcc in about a third
of the time.

llvm-svn: 79387
2009-08-19 00:37:02 +00:00
Daniel Dunbar
fcac7e7345 raw_ostream: Simplify write(unsigned char) to match write(const char*, unsigned).
llvm-svn: 79386
2009-08-19 00:23:39 +00:00
Daniel Dunbar
6584ac1900 raw_ostream: Remove pointless redefinitions of tell().
- The base class implementation is correct.

llvm-svn: 79385
2009-08-19 00:14:25 +00:00
Dan Gohman
807652ac3a Fix SimplifyLibcalls and ValueTracking to check mayBeOverridden
before performing optimizations based on constant string values.

llvm-svn: 79384
2009-08-19 00:11:12 +00:00
Dan Gohman
1526c115c0 Be tidy and use a break to exit from a switch block rather than
just falling through the end.

llvm-svn: 79383
2009-08-18 23:52:48 +00:00
Daniel Dunbar
2f3cfb4d35 raw_ostream: Add the capability for subclasses to manually install an external
buffer.

llvm-svn: 79382
2009-08-18 23:42:36 +00:00
Dan Gohman
56c2c54a37 Legalize the shift amount operand of SRL_PARTS, SHL_PARTS, and
SRA_PARTS, as is done for SRL, SHL, and SRA.

llvm-svn: 79380
2009-08-18 23:36:17 +00:00
Daniel Dunbar
85b15d8e71 raw_ostream: Reduce FormattedStream's reliance on raw_ostream's implementation.
- Kill off begin(), end(), and iterator. It isn't clear what these
   mean. Instead provide getBufferStart(), which can be used with
   GetNumBytesInBuffer to the same effect.

 - Update ComputeColumn to take arguments for the buffer to scan, this
   simplifies the implementation of write_impl substantially.

 - This should also fix possible problems with the scanning pointer pointing
   outside of the current raw_ostream buffer.

llvm-svn: 79379
2009-08-18 23:36:04 +00:00
Lang Hames
0e2ecec9f9 Changes DOUT references in the PBQP allocator to use DEBUG(errs() ...)
llvm-svn: 79378
2009-08-18 23:34:50 +00:00
Eric Christopher
32d5222c4e Implement sse4.2 string/text processing instructions:
Add patterns and instruction encoding information.
Add custom lowering to deal with hardwired return register of
uncertain type (xmm0).

llvm-svn: 79377
2009-08-18 22:50:32 +00:00
Daniel Dunbar
8a23b8621a Speed up raw_ostream::<<(unsigned long long) for 32-bit systems by doing most
div/mods in 32-bits.

llvm-svn: 79375
2009-08-18 22:24:00 +00:00
Jakob Stoklund Olesen
9496240bbf Simplify RegScavenger::FindUnusedReg.
- Drop the Candidates argument and fix all callers. Now that RegScavenger
  tracks available registers accurately, there is no need to restict the
  search.
- Make sure that no aliases of the found register are in use. This was a potential bug.

llvm-svn: 79369
2009-08-18 21:14:54 +00:00
Richard Osborne
a3a49aeee0 Add support for mergeable sections back into the XCore backend.
llvm-svn: 79368
2009-08-18 21:14:31 +00:00
Dan Gohman
1d84247c99 Fix a bug in raw_ostream::write(char) introduced by the change to
allow underlying stream classes to decline buffering. After
calling SetBuffered(), re-check whether the stream is Unbuffered
in order to handle the case where the underlying stream has
declined buffering.

llvm-svn: 79362
2009-08-18 20:09:59 +00:00
Daniel Dunbar
5aa51a83c7 Revert r78924, disabling buffering defeats all the fast paths in raw_ostream.
llvm-svn: 79361
2009-08-18 20:07:36 +00:00
Daniel Dunbar
d334c67f60 Improve Triple to recognize the OS in i386-mingw32.
llvm-svn: 79359
2009-08-18 19:26:55 +00:00
David Greene
4347d5d424 Make various changes suggested by Chris.
llvm-svn: 79358
2009-08-18 19:22:55 +00:00
Owen Anderson
73825c1f37 Privatize the ValueHandle global map. Because this is used so heavily throughout the code base, locking all accesses to
it is not practical performance-wise.

llvm-svn: 79355
2009-08-18 18:28:58 +00:00
Erick Tryzelaar
fc2856cec4 Fix an uninitialized value warning in APFloat.
llvm-svn: 79353
2009-08-18 18:20:37 +00:00
Richard Osborne
84785e0714 Put data with relocations in the same sections as data without relocations.
llvm-svn: 79351
2009-08-18 17:58:17 +00:00
Chris Lattner
17c3a9cf99 fix COFF targets (mingw/cygwin) to provide ehframe and LSDA sections
llvm-svn: 79346
2009-08-18 16:56:17 +00:00
Dan Gohman
b0cf049a1e Generalize ScalarEvolution to be able to analyze GEPs when
TargetData is not present. It still uses TargetData when available.
This generalization also fixed some limitations in the TargetData
case; the attached testcase covers this.

llvm-svn: 79344
2009-08-18 16:46:41 +00:00
Chris Lattner
bc4e7e0815 null streamer needs to maintain the current section as well.
llvm-svn: 79343
2009-08-18 16:46:29 +00:00
Dan Gohman
5022dd9cc9 Make tail merging handle blocks with repeated predecessors correctly, and
remove RemoveDuplicateSuccessor, as it is no longer necessary, and because
it breaks assumptions made in
MachineBasicBlock::isOnlyReachableByFallthrough.

Convert test/CodeGen/X86/omit-label.ll to FileCheck and add a testcase
for PR4732.

test/CodeGen/Thumb2/thumb2-ifcvt2.ll sees a diff with this commit due to
it being bugpoint-reduced to the point where it doesn't matter what the
condition for the branch is.

Add some more interesting code to
test/CodeGen/X86/2009-08-06-branchfolder-crash.ll, which is the testcase
that originally motivated the RemoveDuplicateSuccessor code, to help
verify that the original problem isn't being re-broken.

llvm-svn: 79338
2009-08-18 15:18:18 +00:00
Dan Gohman
0b1af29372 Fix a bug that caused globalopt to miscompile tramp3d: don't miss
unruly indices for arrays that are members of structs.

llvm-svn: 79337
2009-08-18 14:58:19 +00:00
Anton Korobeynikov
d2d8c91b9f Text sections should have 'exec' flag set. This seems to unbreak libstdc++ on linux.
Patch by Dmitry Gorbachev!

llvm-svn: 79334
2009-08-18 14:06:12 +00:00
Daniel Dunbar
6d9b38bd58 Fix Triple to recognize the 'bfin' arch.
llvm-svn: 79325
2009-08-18 07:06:26 +00:00
Chris Lattner
b82fc63e02 Make AsmStreamer maintain a notion of the current section, pushing it up from the
MCAsmStreamer.  Based on this, eliminate the current section from AsmPrinter.

While I'm at it, clean up the last of the horrible "switch to null section" stuff
and add an assert.  This change is in preparation for completely eliminating 
asmprinter::switchtosection.

llvm-svn: 79324
2009-08-18 06:15:16 +00:00
Chris Lattner
7a382434b5 add a horrible hack to the dwarf printer. It looks like mingw is not specifying
an EHFrame section, so we just emit ehframe data into a random section.

This is clearly bad.

llvm-svn: 79323
2009-08-18 06:13:03 +00:00
Chris Lattner
e01c6eb25a remove some pointless null switchtosections. The IntelAsmPrinter doesn't really work anyway.
llvm-svn: 79321
2009-08-18 06:03:07 +00:00
Evan Cheng
d4d2a3d0a6 Fix revsh pattern.
llvm-svn: 79318
2009-08-18 05:43:23 +00:00
Chris Lattner
178666f2e3 add support for some targetflags on GV operands. This allows us to
send instructions like:

NEW: 	movl	"L___stack_chk_guard$non_lazy_ptr" - "L1$pb"(%esi), %eax
OLD: 	movl	L___stack_chk_guard$non_lazy_ptr-"L1$pb"(%esi), %eax

through the streamer.  Several fixmes.

llvm-svn: 79317
2009-08-18 05:33:27 +00:00
Daniel Dunbar
763d4d3648 Recognize xscale as an ARM arch.
- Patch by Yonggang Luo.

llvm-svn: 79315
2009-08-18 04:51:26 +00:00
Daniel Dunbar
d4a31156e7 Add Triple matching for pic16 arch and solaris OS.
- Patch by Yonggang Luo.

llvm-svn: 79314
2009-08-18 04:43:27 +00:00
Chris Lattner
4efe44f456 fix another bozo bug
llvm-svn: 79313
2009-08-18 04:34:36 +00:00
Chris Lattner
64ac9ab553 fix accidentally inverted conditional and add comment.
llvm-svn: 79312
2009-08-18 04:33:15 +00:00
Chris Lattner
6270a4cc48 turn this conditional into something humans might actually
be able to understand ;-)

llvm-svn: 79311
2009-08-18 04:30:35 +00:00
Dan Gohman
b4a24b3b8b Make TargetData optional in MemCpyOptimizer.
llvm-svn: 79306
2009-08-18 01:17:52 +00:00
Dan Gohman
3137ac23bc Make TargetData optional in SimplifyLibCalls.
llvm-svn: 79298
2009-08-18 00:48:13 +00:00
Anton Korobeynikov
c9d9a008b5 The attached patches attempt to fix cross builds. For example, if you
try to use i686-darwin to build for arm-eabi, you'll quickly run into
several false assumptions that the target OS must be the same as the
host OS. These patches split $(OS) into $(HOST_OS) and $(TARGET_OS) to
help builds like "make check" and the test-suite able to cross
compile. Along the way a target of *-unknown-eabi is defined as
"Freestanding" so that TARGET_OS checks have something to work with.

Patch by Sandeep Patel!

llvm-svn: 79296
2009-08-18 00:40:33 +00:00
Dan Gohman
e28638faa2 Fix function alignment at -Os on x86 to be 1, not 2. getFunctionAlignment
returns a log2 value.

llvm-svn: 79293
2009-08-18 00:20:06 +00:00
Dale Johannesen
ff6e66e502 PowerPC inline asm was emitting two output operands
for a single "m" constraint; this is wrong because the
opcode of a load or store would have to change in parallel.
This patch makes it always compute addresses into a register,
which is correct but not as efficient as possible.  7144566.

llvm-svn: 79292
2009-08-18 00:18:39 +00:00
Devang Patel
98fb10c182 Add prefix only if it is needed.
llvm-svn: 79289
2009-08-17 23:17:17 +00:00
Jim Grosbach
5883594589 cleanups per review. Mostly cosmetic, plus use SmallVector in place of std::vector.
llvm-svn: 79287
2009-08-17 21:40:03 +00:00
Devang Patel
b3c1574994 Oops. find all llvm.dbg.global_variables.
llvm-svn: 79274
2009-08-17 20:36:20 +00:00
Jim Grosbach
5d064eeb2a Remove a bit more cruft from the sjlj moving to a backend pass.
llvm-svn: 79272
2009-08-17 20:25:04 +00:00
Benjamin Kramer
452962eec7 Update CMakeLists.
llvm-svn: 79264
2009-08-17 18:47:11 +00:00
Dan Gohman
e78d27bcf9 Update comments to new-style syntax.
llvm-svn: 79263
2009-08-17 18:45:31 +00:00
Daniel Dunbar
14357fdab5 Fix build warning.
llvm-svn: 79262
2009-08-17 18:41:42 +00:00
Owen Anderson
c7e733e4fe Privatize the last bits of static type state.
llvm-svn: 79258
2009-08-17 17:59:35 +00:00
Owen Anderson
5d27af4989 Move the TypeMap lock to a member on LLVMContextImpl.
llvm-svn: 79256
2009-08-17 17:34:27 +00:00
Owen Anderson
43d358bde0 Add locking around the attributes list.
llvm-svn: 79255
2009-08-17 17:10:58 +00:00
Owen Anderson
ed218e5820 Add locking around signal handler registration.
llvm-svn: 79254
2009-08-17 17:07:22 +00:00
Benjamin Kramer
d1c6b5de4e Clear the uniquing table when initializing TLOF to avoid a crash when the TLOF is reinitialized with a different MCContext.
llvm-svn: 79253
2009-08-17 17:05:44 +00:00
Nick Lewycky
afaae7957e Don't crash on critical edge. Patch by Andre Tavares.
llvm-svn: 79252
2009-08-17 17:00:57 +00:00
Jim Grosbach
4643e96d36 Move the sjlj exception handling conversions to a back-end pass where they
more properly belong. This allows removing the front-end conditionalized
SJLJ code, and cleans up the generated IR considerably. All of the
infrastructure code (calling _Unwind_SjLj_Register/Unregister, etc) is
added by the SjLjEHPrepare pass.

llvm-svn: 79250
2009-08-17 16:41:22 +00:00
Richard Osborne
358842178f Update getSectionForConstant() to to allow mergable sections to be nulled out
if not supported by the ELF subtarget.

llvm-svn: 79249
2009-08-17 16:37:11 +00:00
David Goodwin
d65007a4a3 Extend the instruction itinerary model to include the ability to indicate the def and use cycle for each operand. This additional information is optional, so existing itineraries do not need to be changed.
llvm-svn: 79247
2009-08-17 16:02:57 +00:00
Chris Lattner
0ed3ef52af the MinPad argument to PadToColumn only really makes sense to be 1,
just remove the argument and replace it with 1.

llvm-svn: 79246
2009-08-17 15:48:08 +00:00
Dan Gohman
7c8c5606ce Fix more missing newlines.
llvm-svn: 79244
2009-08-17 15:29:31 +00:00
Dan Gohman
1749b4bb8a Fix printing of instructions with null operands.
llvm-svn: 79243
2009-08-17 15:28:08 +00:00
Dan Gohman
6c4c30550e Always print at least one space before adding a comment.
llvm-svn: 79242
2009-08-17 15:27:30 +00:00
Dan Gohman
e8847ebe10 Fix debug output to include a newline after printing a Value, now
that Value's operator<< doesn't include one.

llvm-svn: 79240
2009-08-17 15:25:05 +00:00
Duncan Sands
d0eda03882 Don't access the first element of a potentially empty
vector (&Formals[0]).  With this change llvm-gcc builds
with expensive checking enabled for C, C++ and Fortran.
While there, change a std::vector into a SmallVector.
This is partly gratuitous, but mostly because not all
STL vector implementations define the data method (and
it should be faster).

llvm-svn: 79237
2009-08-17 14:33:27 +00:00
Chris Lattner
fc68e5368b change AsmPrinter to switch sections using AsmStreamer instead of
doing it directly.  This requires const'izing a bunch of stuff that
took sections, but this seems like the right semantic thing to do:
emitting a label to a section shouldn't mutate the MCSection object
itself, for example.

llvm-svn: 79227
2009-08-17 05:49:08 +00:00
Nick Lewycky
e791519ea3 Don't crash trying to promote VLAs.
llvm-svn: 79226
2009-08-17 05:37:31 +00:00
Chris Lattner
69a19050c0 give MCAsmStreamer a TargetAsmInfo.
llvm-svn: 79222
2009-08-17 04:23:44 +00:00
Chris Lattner
a1acc7cab5 formatting cleanups, no functionality change.
llvm-svn: 79221
2009-08-17 04:17:34 +00:00
Erick Tryzelaar
f9173af0b5 Expose creating constant ints and floats from strings in llvm-c.
llvm-svn: 79213
2009-08-16 23:36:46 +00:00
Erick Tryzelaar
d7980d95e8 Add helper functions to ConstantInt and ConstantFP to accept strings.
llvm-svn: 79212
2009-08-16 23:36:33 +00:00
Erick Tryzelaar
930c879b9e Modify APFloat to take a StringRef instead of a c string.
This also adds unit tests to APFloat that mainly tests the
string handling of APFloat, but not much else of it's api.

llvm-svn: 79210
2009-08-16 23:36:19 +00:00
Dan Gohman
a7f21f1767 Add a getOffsetOf, for building a target-independent expression for
offsetof, similar to getSizeOf for sizeof.

llvm-svn: 79208
2009-08-16 21:26:11 +00:00
Dan Gohman
8a92a2475c Avoid emitting XMM save code in soft-float or no-implicit-float mode
or some other situation where no xmm registers need to be saved.

llvm-svn: 79207
2009-08-16 21:24:25 +00:00
Dan Gohman
a5e2aaee6d Delete an unused field.
llvm-svn: 79206
2009-08-16 21:19:53 +00:00
Jakob Stoklund Olesen
baae88d65a Replace RegScavenger::DistanceMap with a simpler local algorithm.
llvm-svn: 79195
2009-08-16 17:41:39 +00:00
Jakob Stoklund Olesen
0b361622ff Clean up the public interface of RegScavenger.
Remove unused methods and make others private.

llvm-svn: 79194
2009-08-16 17:41:20 +00:00
Jakob Stoklund Olesen
fcfe355efd Be more clever about regclasses in ScheduleDAGSDNodes::EmitCopyFromReg.
If two uses of a CopyFromReg want different regclasses, first try a common
sub-class, then fall back on the copy emitted in AddRegisterOperand. There is
no need for an assert here. The cross-class joiner usually cleans up nicely.

llvm-svn: 79193
2009-08-16 17:40:59 +00:00
Benjamin Kramer
a8760e3e5a Fix use after free in Thumb2SizeReduction (PR4707). A MachineInstr was used after erasure.
llvm-svn: 79189
2009-08-16 11:56:42 +00:00
Bill Wendling
ee380b1dd2 Styalistic and format changes. No functionality change.
llvm-svn: 79187
2009-08-16 11:00:26 +00:00
Chris Lattner
76b09f600c add support for external symbols + X86::MOVPC32r.
llvm-svn: 79175
2009-08-16 04:28:14 +00:00
Eli Friedman
ca19f19760 Fix for PR3016: detect the tricky case, where there are
unfoldable references to a PHI node in the block being folded, and disable
the transformation in that case.  The correct transformation of such PHI
nodes depends on whether BB dominates Succ, and dominance is expensive 
to compute here.  (Alternatively, it's possible to check whether any 
uses are live, but that's also essentially a dominance calculation. 
Another alternative is to use reg2mem, but it probably isn't a good idea to
use that in simplifycfg.)

Also, remove some incorrect code from CanPropagatePredecessorsForPHIs 
which is made unnecessary with this patch: it didn't consider the case 
where a PHI node in BB has multiple uses.

llvm-svn: 79174
2009-08-16 04:23:49 +00:00
Chris Lattner
ca89ccb1dd implement support for lowering references to global addresses. For example, we now
can asmprint:

NEW: 	movl	"L___stack_chk_guard$non_lazy_ptr", %eax
OLD: 	movl	L___stack_chk_guard$non_lazy_ptr, %eax

where 'new' is coming out of the MCInst version of the printer.

llvm-svn: 79170
2009-08-16 03:12:25 +00:00
Chris Lattner
af83ac2ba5 more formatting improvements, no functionality change.
llvm-svn: 79167
2009-08-16 02:45:18 +00:00
Chris Lattner
9a017d13c8 code formatting improvements, no functionality change.
llvm-svn: 79165
2009-08-16 02:36:40 +00:00
Erick Tryzelaar
175dd821cc Add an llvm-c function that lets you insert an instruction with a name.
llvm-svn: 79163
2009-08-16 02:20:57 +00:00
Erick Tryzelaar
c0815ef591 Expose most of the Constant creation functions to llvm-c.
llvm-svn: 79160
2009-08-16 02:20:12 +00:00
Erick Tryzelaar
a439c22dbf Expose most of the rest of IRBuilder's functions to llvm-c.
llvm-svn: 79159
2009-08-16 02:19:59 +00:00
Evan Cheng
99a029d217 Needs to check whether unaligned load / store of i64 is legal here.
llvm-svn: 79150
2009-08-15 23:41:42 +00:00
Bill Wendling
29ea31a8ad Remove <iostream>.
llvm-svn: 79146
2009-08-15 22:28:08 +00:00
Dan Gohman
82430f54ec Mingw also doesn't have st_blksize.
llvm-svn: 79142
2009-08-15 21:41:03 +00:00
Bill Wendling
696d0388e9 An overhaul of the exception handling code. This is arguably more correct than
what was there before. In "no FP mode", we weren't generating labels and unwind
table entries after each "push" instruction. While more than likely "okay", it's
not technically correct. The major thing was that the ordering of when to define
a new CFA register and at what offset wasn't correct. This would cause the
exception handling to fail in ways most miserable to users.

I also cleaned up some code a bit. There's one function which has a "return" at
the beginning, so it's never used. Should I just remove it? :-)

llvm-svn: 79139
2009-08-15 21:27:32 +00:00
Bill Wendling
962adec4ee Reapply r79127. It was fixed by d0k.
llvm-svn: 79136
2009-08-15 21:21:19 +00:00
Bill Wendling
bfebbb6477 Revert r79127. It was causing compilation errors.
llvm-svn: 79135
2009-08-15 21:14:01 +00:00
Benjamin Kramer
5c54156e82 Don't try to get the context from an erased Instruction.
llvm-svn: 79134
2009-08-15 21:07:49 +00:00
Benjamin Kramer
b5771e5e21 Unbreak build. Evan, please make sure my changes are correct.
llvm-svn: 79133
2009-08-15 20:46:16 +00:00
Nick Lewycky
de61ef6c5e SSI construction should just go ahead and ignore instructions in unreachable
blocks.

llvm-svn: 79132
2009-08-15 20:12:18 +00:00
Evan Cheng
5d841097a9 Change allowsUnalignedMemoryAccesses to take type argument since some targets
support unaligned mem access only for certain types. (Should it be size
instead?)

ARM v7 supports unaligned access for i16 and i32, some v6 variants support it
as well.

llvm-svn: 79127
2009-08-15 19:23:44 +00:00
Jakob Stoklund Olesen
7f4ef2d59a Refine EarlyClobber assert in register scavenger.
It is legal for an inline asm operand to use an earlyclobber register if the
use operand is tied to the earlyclobber operand. The issue is discussed here:

  http://gcc.gnu.org/ml/gcc/1999-04n/msg00431.html

We should perhaps let only the machine code verifier worry about these finer
details. EarlyClobber operands are not really interesting to the scavenger.

This fixes PR4528 for the third time.

llvm-svn: 79122
2009-08-15 18:16:58 +00:00
Chris Lattner
07186e7840 the .eh_frame sections we generate need to be writable (which
is why they are datarel).  This should fix PR4724, and is fallout
from r78890.

llvm-svn: 79111
2009-08-15 16:54:02 +00:00
Nicolas Geoffray
572b4e6cb3 Use the new API for creating an OpaqueType.
llvm-svn: 79107
2009-08-15 15:41:32 +00:00
Chris Lattner
e12f92568f tidy up
llvm-svn: 79101
2009-08-15 15:08:28 +00:00
Nicolas Geoffray
679c83e1bf Update cpp generation with new LLVM API for primitive types.
llvm-svn: 79098
2009-08-15 14:47:42 +00:00
Sanjiv Gupta
2399e49802 Revert a few changes that were done in 78603.
PIC16DebugInfo currently rely on NameStr of composite type descriptors to uniquely
identify debug info for two aggregate type decls with same name.
This implementation will change when we have MDNodes based debug info implemenatation in place

llvm-svn: 79097
2009-08-15 14:36:48 +00:00
Jakob Stoklund Olesen
8f6660c417 Don't setCalleeSavedInfoValid() until spills are interted.
In a naked function, the flag is never set and getPristineRegs() returns an
empty list. That means naked functions are able to clobber callee saved
registers, but that is the whole point of naked functions.

This fixes PR4716.

llvm-svn: 79096
2009-08-15 13:10:46 +00:00
Jakob Stoklund Olesen
db3f862b6f Allow double defs in the machine code verifier after the addPreRegAlloc passes.
llvm-svn: 79095
2009-08-15 13:10:15 +00:00
Richard Osborne
31f04e14f0 Move XCore AsmPrinter to XCore/AsmPrinter directory.
llvm-svn: 79094
2009-08-15 12:53:15 +00:00
Tilmann Scheller
03f517b799 Add support for the PowerPC 64-bit SVR4 ABI.
The Link Register is volatile when using the 32-bit SVR4 ABI.
Make it possible to use the 64-bit SVR4 ABI.
Add non-volatile registers for the 64-bit SVR4 ABI.
Make sure r2 is a reserved register when using the 64-bit SVR4 ABI.
Update PPCFrameInfo for the 64-bit SVR4 ABI.
Add FIXME for 64-bit Darwin PPC.
Insert NOP instruction after direct function calls.
Emit official procedure descriptors.
Create TOC entries for GlobalAddress references.
Spill 64-bit non-volatile registers to the correct slots.
Only custom lower VAARG when using the 32-bit SVR4 ABI.
Use simple VASTART lowering for the 64-bit SVR4 ABI.

llvm-svn: 79091
2009-08-15 11:54:46 +00:00
Jakob Stoklund Olesen
e093ae5810 Update LocalRewriter::DistanceMap when inserting stack loads.
In the included test case, a stack load was not included in DistanceMap. That
caused TransferDeadness to ignore the instruction, leading to a scavenger
assert.

llvm-svn: 79090
2009-08-15 11:03:03 +00:00
Evan Cheng
e65f967fa0 80 col violations.
llvm-svn: 79087
2009-08-15 08:38:52 +00:00
Evan Cheng
9d351a7246 Turn on if-conversion for thumb2.
llvm-svn: 79084
2009-08-15 07:59:10 +00:00
Chris Lattner
aa462f6d51 update for rename.
llvm-svn: 79082
2009-08-15 06:14:07 +00:00
Chris Lattner
8101f115c5 rename PIC16Section.h -> MCSectionPIC16.h for consistency with
the class it defines.

llvm-svn: 79081
2009-08-15 06:13:40 +00:00
Chris Lattner
7021a8b286 cmake likes its explicit list of files to build.
llvm-svn: 79080
2009-08-15 06:10:23 +00:00
Chris Lattner
ee52642cd3 use XCore-specific section with xcore specific cp/dp flags to restore
support for globals going into the appropriate sections with the flags.

This hopefully finishes unbreaking the previous behavior that I broke before.

llvm-svn: 79079
2009-08-15 06:09:35 +00:00
Chris Lattner
2c1a96d901 If ELF subtargets don't want to support 4/8/16-byte mergable sections, allow
them to null out the default section pointers.

llvm-svn: 79078
2009-08-15 06:08:34 +00:00
Chris Lattner
3665e2058e add support for target-specific ELF section flags, add a new MCSectionXCore
class which represents the XCore cp/dp section flags.  No functionality
change yet.

llvm-svn: 79077
2009-08-15 05:56:11 +00:00
Dan Gohman
fcb5e33aa1 Simplify a few more things, eliminating a few more dependencies on
"the current basic block".

llvm-svn: 79069
2009-08-15 02:07:36 +00:00
Dan Gohman
a68aa347d8 Simplify this code to not depend as much on CurMBB.
llvm-svn: 79068
2009-08-15 02:06:22 +00:00
Evan Cheng
cf13e0c732 Do not use frame register to reference fixed stack objects if the function is frameless.
llvm-svn: 79067
2009-08-15 02:05:35 +00:00
Dan Gohman
d0419623b1 Always check to see if raw_fd_ostream's file descriptor is attached to
a terminal, not just when it's STDOUT_FILENO.

llvm-svn: 79066
2009-08-15 02:05:19 +00:00
Dan Gohman
8aea7a0db0 Add support for column computation on unbuffered streams.
llvm-svn: 79065
2009-08-15 02:02:59 +00:00
Dan Gohman
4541bef274 Move FormattedStream's write_impl out of line.
llvm-svn: 79064
2009-08-15 02:01:04 +00:00