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

9476 Commits

Author SHA1 Message Date
Benjamin Kramer
a4a0c5e88a Fix build on platforms where stdint.h is not implicitly included in the standard headers.
llvm-svn: 79629
2009-08-21 13:59:49 +00:00
Daniel Dunbar
7e81ff0f87 llvm-mc: Start MCAssembler and MCMachOStreamer.
- Together these form the (Mach-O) back end of the assembler.

 - MCAssembler is the actual assembler backend, which is designed to have a
   reasonable API. This will eventually grow to support multiple object file
   implementations, but for now its Mach-O/i386 only.

 - MCMachOStreamer adapts the MCStreamer "actions" API to the MCAssembler API,
   e.g. converting the various directives into fragments, managing state like
   the current section, and so on.

 - llvm-mc will use the new backend via '-filetype=obj', which may eventually
   be, but is not yet, since I hear that people like assemblers which actually
   assemble.

 - The only thing that works at the moment is changing sections. For the time
   being I have a Python Mach-O dumping tool in test/scripts so this stuff can
   be easily tested, eventually I expect to replace this with a real LLVM tool.

 - More doxyments to come.

I assume that since this stuff doesn't touch any of the things which are part of
2.6 that it is ok to put this in not so long before the freeze, but if someone
objects let me know, I can pull it.

llvm-svn: 79612
2009-08-21 09:11:24 +00:00
Bob Wilson
c046b62f1a Remove Neon intrinsics for VZIP, VUZP, and VTRN. We will represent these as
vector shuffles.  Temporarily remove the tests for these operations until the
new implementation is working.

llvm-svn: 79579
2009-08-21 00:01:42 +00:00
Owen Anderson
91de21580f Re-revert r79555. Apparently it's not just buildbot weirdness.
llvm-svn: 79578
2009-08-20 23:51:44 +00:00
Owen Anderson
277bc36265 Reapply r79555 for testing. Daniel's trying to work out some buildbot weirdnesss.
llvm-svn: 79572
2009-08-20 23:14:20 +00:00
Bill Wendling
c810ad4dc6 --- Reverse-merging r79555 into '.':
U    include/llvm/Target/TargetData.h
U    lib/Target/TargetData.cpp

Temporarily revert 79555. It was causing hangs and test failures.

llvm-svn: 79568
2009-08-20 22:04:42 +00:00
Owen Anderson
8eba306123 Make the StructType->StructLayout table private to TargetData, allowing us to avoid locking on it.
llvm-svn: 79555
2009-08-20 18:26:03 +00:00
Dan Gohman
6ec8176e22 Rename hasNoUnsignedOverflow and hasNoSignedOverflow to hasNoUnsignedWrap
and hasNoSignedWrap, for consistency with the nuw and nsw properties.

llvm-svn: 79539
2009-08-20 17:11:38 +00:00
Dan Gohman
d9766dcb85 Various comment and whitespace cleanups.
llvm-svn: 79533
2009-08-20 16:42:55 +00:00
Erick Tryzelaar
d7e3c40ecb Rename FirstExtendedValueType to INVALID_SIMPLE_VALUE_TYPE
as that's a bit more descriptive of what we're testing for.

llvm-svn: 79513
2009-08-20 05:09:43 +00:00
Dan Gohman
1d708297fc Add some comments clarifying what appear to be the intent of various
error handling mechanisms. Please correct these if I've misunderstood
something.

llvm-svn: 79505
2009-08-20 01:46:24 +00:00
Dan Gohman
1319eb4ab8 Reword a few comments for AnalyzeBranch and InsertBranch, and fix
a few typos.

llvm-svn: 79503
2009-08-20 01:33:25 +00:00
Daniel Dunbar
446d29370f Add a fast path for setName("") on an unnamed value.
llvm-svn: 79492
2009-08-19 23:37:23 +00:00
David Greene
c69536c40b Remove an unnecessary include. Now we won't have circular include
problems later on.

llvm-svn: 79487
2009-08-19 23:00:07 +00:00
Daniel Dunbar
d26934ba4a Switch IRBuilder to using Twine references for names.
llvm-svn: 79482
2009-08-19 22:34:21 +00:00
David Greene
e9ea0cbe04 Add missing includes.
llvm-svn: 79469
2009-08-19 21:22:18 +00:00
David Greene
1c25fc3544 Add missing includes.
llvm-svn: 79468
2009-08-19 21:19:41 +00:00
David Greene
56a7d80265 Add missing includes.
llvm-svn: 79467
2009-08-19 21:17:28 +00:00
David Greene
10a7eceb25 Add missing header.
llvm-svn: 79463
2009-08-19 20:52:54 +00:00
Eli Friedman
fe70446342 Add triple parsing support for TCE.
llvm-svn: 79461
2009-08-19 20:46:03 +00:00
Dan Gohman
6a85687468 Unbreak GetBufferSize() on uninitialized streams. This fixes a problem
that led to errs() getting made buffered.

llvm-svn: 79458
2009-08-19 20:27:57 +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
cb45b94032 Add SmallString::str (which returns a StringRef); this is more efficient than
c_str().

llvm-svn: 79453
2009-08-19 19:57:55 +00:00
Daniel Dunbar
07444dd862 Remove SmallString::append_*int* methods; how many copies of int -> str
conversion code do we really need?
 - S.append_uint(N) can be replaced with 'raw_svector_ostream(S) << N' which is
   somewhat slower due to the extra set up cost, but still plenty fast
   (especially if the svector set up cost can be amortized).

llvm-svn: 79450
2009-08-19 19:28:18 +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
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
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
Daniel Dunbar
6812c0db35 Add SmallVector::{capacity,set_size}.
- These allow clients to make use of the extra elements in the vector which
   have already been allocated, without requiring them to be value initialized.

llvm-svn: 79433
2009-08-19 17:48:28 +00:00
Erick Tryzelaar
adbe0cd3f7 BasicBlock::getContext can no longer return a NULL so update the doc.
llvm-svn: 79432
2009-08-19 17:40:05 +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
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
Chris Lattner
fd945d807a ExuberantAsm is no more.
llvm-svn: 79409
2009-08-19 06:36:30 +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
Erick Tryzelaar
935d99e9df Fix gcc-4.4/fedora 11 by adding a sentinel value to SimpleValueType.
gcc-4.4 was optimizing away comparisons against SimpleValueType when
it was compared to a value larger than the largest value in the enum.
This patch works around it by adding one extra item to the enum so
that these tests will now be valid.

llvm-svn: 79401
2009-08-19 02:53:07 +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
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
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
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
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
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
Daniel Dunbar
09f40a7871 Fix pasto in StringRef::count(char)
llvm-svn: 79356
2009-08-18 18:34:22 +00:00
Daniel Dunbar
4a9a98a5de Add StringRef::count({char,StringRef})
llvm-svn: 79354
2009-08-18 18:26:35 +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
Misha Brukman
0961ce48c4 Fixed spelling of MSP430.
llvm-svn: 79333
2009-08-18 13:50:28 +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
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
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
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
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
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
Chris Lattner
69a19050c0 give MCAsmStreamer a TargetAsmInfo.
llvm-svn: 79222
2009-08-17 04:23:44 +00:00
Oscar Fuentes
58ce88fded Make a declaration consistent with its definition.
llvm-svn: 79220
2009-08-17 04:10:20 +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
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
Erick Tryzelaar
532ab606ff Add more casts to the IRBuilder.
llvm-svn: 79158
2009-08-16 02:19:46 +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
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
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
4541bef274 Move FormattedStream's write_impl out of line.
llvm-svn: 79064
2009-08-15 02:01:04 +00:00
Eric Christopher
6fd0214a67 Add sse4.2 string/text processing intrinsics. We'll select these later.
llvm-svn: 79037
2009-08-14 20:27:57 +00:00
Eric Christopher
12c6e08c7c Whitespace cleanup.
llvm-svn: 79036
2009-08-14 20:27:12 +00:00
Anton Korobeynikov
3a0cde8c91 Allow targets to specify their choice of calling conventions per
libcall. Take advantage of this in the ARM backend to rectify broken
choice of CC when hard float is in effect. PIC16 may want to see if
it could be of use in MakePIC16Libcall, which works unchanged.

Patch by Sandeep!

llvm-svn: 79033
2009-08-14 20:10:52 +00:00
Bruno Cardoso Lopes
e298b64a93 *try* to use a better name to describe how common symbols are marked on the elf object file.
llvm-svn: 79029
2009-08-14 19:45:38 +00:00
Owen Anderson
cc33bb3cdf Add doxygen comments.
llvm-svn: 79027
2009-08-14 19:41:50 +00:00
Argyrios Kyrtzidis
e8ee71bbd8 Revert r78424.
In order for the changes in r78424 to work properly, cast_retty<X,Y> should return an object instead of a reference, and it's not clear that this approach has real advantages.

llvm-svn: 79023
2009-08-14 19:01:37 +00:00
Erick Tryzelaar
7adf1fa7ad A couple IRBuilder functions were still using getGlobalContext().
llvm-svn: 78997
2009-08-14 06:12:30 +00:00
Daniel Dunbar
dc5840c57c Update llvm-mc / MCAsmStreamer to print the instruction using the actual target
specific printer (this only works on x86, for now).
 - This makes it possible to do some correctness checking of the parsing and
   matching, since we can compare the results of 'as' on the original input, to
   those of 'as' on the output from llvm-mc.

 - In theory, we could now have an easy ATT -> Intel syntax converter. :)

llvm-svn: 78986
2009-08-14 03:48:55 +00:00
Daniel Dunbar
ca38bc510e Add virtual printMCInst method to AsmPrinter, as a quick way to expose the API
to print one instruction.

llvm-svn: 78985
2009-08-14 03:43:57 +00:00
Daniel Dunbar
259bc4b0e7 Add MCSymbol::{print, dump}
llvm-svn: 78983
2009-08-14 03:41:23 +00:00
Daniel Dunbar
127e3bc13f Add MCValue::{print, dump}
llvm-svn: 78982
2009-08-14 03:11:09 +00:00
Owen Anderson
c78a800e7e Add helpers for fetching basic types.
llvm-svn: 78969
2009-08-14 00:30:41 +00:00
Daniel Dunbar
eab68eaec4 TargetRegistry: Change AsmPrinter constructor to be typed as returning an
AsmPrinter instance (instead of just a FunctionPass)

llvm-svn: 78962
2009-08-13 23:48:47 +00:00
Daniel Dunbar
d4c5293717 llvm-mc: Add dummy MCStreamer implementation, (eventually) for use in profiling.
- Currently unused.

 - A few other random comment fixes lumped in.

llvm-svn: 78960
2009-08-13 23:36:34 +00:00
Bruno Cardoso Lopes
98ffbd5041 Remove HasCrazyBSS and add a flag in TAI to indicate that '.section'
must be emitted for PowerPC-Linux '.bss' section

llvm-svn: 78958
2009-08-13 23:30:21 +00:00
Owen Anderson
dc11fe967d Actually privatize a IntegerTypes, and fix a few bugs exposed by this.
llvm-svn: 78955
2009-08-13 23:27:32 +00:00
Dan Gohman
f55822e7cd Make formatted_raw_ostream restore the buffer settings of the
underlying stream when it is finished, so that clients don't
have to do this manually.

llvm-svn: 78952
2009-08-13 23:16:59 +00:00
Owen Anderson
9df206d02d Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Bruno Cardoso Lopes
55e6bc0c07 Add a method to return BSSSection from TargetLoweringObjectFile
llvm-svn: 78939
2009-08-13 21:10:28 +00:00
Bruno Cardoso Lopes
15f3e9a5fa Add a method to return if the ELF section contains only common symbols!
llvm-svn: 78937
2009-08-13 21:08:56 +00:00
Dan Gohman
aeed373413 Add unimplemented destructor declarations to hopefully address
compiler warnings on windows (PR4714).

llvm-svn: 78934
2009-08-13 20:43:13 +00:00
Daniel Dunbar
62eec42595 TargetRegistry: Reorganize AsmPrinter construction so that clients pass in the
TargetAsmInfo. This eliminates a dependency on TargetMachine.h from
TargetRegistry.h, which technically was a layering violation.
 - Clients probably can only sensibly pass in the same TargetAsmInfo as the
   TargetMachine has, but there are only limited clients of this API.

llvm-svn: 78928
2009-08-13 19:38:51 +00:00
Dan Gohman
c692477e5e Set raw_os_ostream, raw_string_ostream, and raw_svector_ostream to be
unbuffered. std::ostream does its own buffering, and std::string and
SmallVector both have allocation strategies intended to handle frequent
appending.

llvm-svn: 78924
2009-08-13 17:41:40 +00:00
Dan Gohman
4ac7200d66 Add support to raw_ostream for sizing the buffer according to the
needs of the underlying output mechanism. raw_fd_ostream now uses
st_blksize from fstat to determine a buffer size.

llvm-svn: 78923
2009-08-13 17:27:29 +00:00
Dan Gohman
d5c9d0b2b7 Make raw_ostream non-copyable.
llvm-svn: 78920
2009-08-13 17:07:08 +00:00
Daniel Dunbar
40f904fcfb Revert 78892 and 78895, these break generating working executables on
x86_64-apple-darwin10.

--- Reverse-merging r78895 into '.':
U    test/CodeGen/PowerPC/2008-12-12-EH.ll
U    lib/Target/DarwinTargetAsmInfo.cpp
--- Reverse-merging r78892 into '.':
U    include/llvm/Target/DarwinTargetAsmInfo.h
U    lib/Target/X86/X86TargetAsmInfo.cpp
U    lib/Target/X86/X86TargetAsmInfo.h
U    lib/Target/ARM/ARMTargetAsmInfo.h
U    lib/Target/ARM/ARMTargetMachine.cpp
U    lib/Target/ARM/ARMTargetAsmInfo.cpp
U    lib/Target/PowerPC/PPCTargetAsmInfo.cpp
U    lib/Target/PowerPC/PPCTargetAsmInfo.h
U    lib/Target/PowerPC/PPCTargetMachine.cpp
G    lib/Target/DarwinTargetAsmInfo.cpp

llvm-svn: 78919
2009-08-13 17:03:38 +00:00
Jakob Stoklund Olesen
96890fb0cf Add MachineFrameInfo::getPristineRegisters(MBB) method.
llvm-svn: 78911
2009-08-13 16:19:33 +00:00
David Goodwin
dbb30ec8df Add callback to allow target to adjust latency of schedule dependency edge.
llvm-svn: 78910
2009-08-13 16:05:04 +00:00
Dan Gohman
fb52ff3ba7 Move SetBufferSize and SetUnbuffered out of line.
llvm-svn: 78909
2009-08-13 15:58:55 +00:00
Dan Gohman
3469d2e1a9 Fix the buffer handling logic so that write_impl is always called with
a full buffer, rather than often being called with a
slightly-less-than-full buffer.

llvm-svn: 78907
2009-08-13 15:44:52 +00:00
Jakob Stoklund Olesen
e074d71247 Fix the N>=64 case in the isInt<> and isUint<> templates.
llvm-svn: 78899
2009-08-13 06:24:02 +00:00
Chris Lattner
4df533ba16 fix a minor fixme. When building with SL and later tools, the ".eh" symbols
don't need to be exported from the .o files.

llvm-svn: 78892
2009-08-13 05:30:22 +00:00
Bruno Cardoso Lopes
f2855aabec Change MCSectionELF to represent a section semantically instead of
syntactically as a string, very similiar to what Chris did with MachO.
The parsing support and validation is not introduced yet.

llvm-svn: 78890
2009-08-13 05:07:35 +00:00
Daniel Dunbar
3a5a25d5d5 Convert APint::{fromString,APInt,getBitsNeeded} to use StringRef.
- Patch by Erick Tryzelaar, with some edits (and a bug fix) from me.

llvm-svn: 78885
2009-08-13 02:33:34 +00:00
Daniel Dunbar
791bb8ce44 Add StringRef::front (with some small tweaks while I was in the area).
- Patch by Erick Tryzelaar

llvm-svn: 78883
2009-08-13 02:03:30 +00:00
Chris Lattner
04f74d3510 sink uniquing of sections out of MCContext into the ELF and PECOFF TLOF implementations.
MCContext no longer maintains a string -> section map.

llvm-svn: 78874
2009-08-13 00:37:15 +00:00
Chris Lattner
7ead5b498b add some comments: MCContext owns the MCSections, but it bump pointer allocates
them, so it doesn't have to explicitly free them.

llvm-svn: 78870
2009-08-13 00:21:53 +00:00
Chris Lattner
52e6d663b3 reject invalid code like:
int x __attribute__((section("_foo, _bar"))) = 4;
int y __attribute__((section("_foo, _bar, 4byte_literals"))) = 1;

llvm-svn: 78867
2009-08-13 00:05:07 +00:00
Chris Lattner
4c9dae455e implement support for uniquing MachO sections.
llvm-svn: 78866
2009-08-12 23:55:02 +00:00
Chris Lattner
7eeb032b37 reduce #includage
llvm-svn: 78860
2009-08-12 23:34:27 +00:00
Jim Grosbach
ef0a7f38e3 Mark the callsite intrinsic such that the opimizers know it's not dead.
llvm-svn: 78856
2009-08-12 23:03:43 +00:00
Bob Wilson
d5c0351c79 Add a new "SDTCisVec" SDTypeConstraint. This complements the vAny type.
There have been a few times where I've wanted this but ended up leaving the
operand type unconstrained.  It is easy to add this now and should help
catch errors in the future.

llvm-svn: 78849
2009-08-12 22:30:59 +00:00
Dan Gohman
bc6b14ba00 This void is implicit in C++.
llvm-svn: 78848
2009-08-12 22:10:57 +00:00
Dan Gohman
a255ba7c44 Add a GetBufferSize() member to raw_ostream and use it to
simplify some formatted_raw_ostream code.

llvm-svn: 78836
2009-08-12 20:52:45 +00:00
David Goodwin
90e7f9873c Enhance the InstrStage object to enable the specification of an Itinerary with overlapping stages. The default is to maintain the current behavior that the "next" stage immediately follows the previous one.
llvm-svn: 78827
2009-08-12 18:31:53 +00:00
Dan Gohman
9a6b2f19e5 Remove a bunch more now-unnecessary Context arguments.
llvm-svn: 78809
2009-08-12 16:23:25 +00:00
Gabor Greif
5ce04c066b catch a typo and simplify call syntax
llvm-svn: 78804
2009-08-12 09:05:11 +00:00
Gabor Greif
c81cd5ffca here comes the CMAKE part on LLVM_COMPACT_SENTINELS; see also r78628 and r78661
llvm-svn: 78803
2009-08-12 08:37:37 +00:00
Chris Lattner
55df534293 Change TargetAsmInfo to be constructed via TargetRegistry from a Target+Triple
pair instead of from a virtual method on TargetMachine.  This cuts the final
ties of TargetAsmInfo to TargetMachine, meaning that MC can now use 
TargetAsmInfo.

llvm-svn: 78802
2009-08-12 07:22:17 +00:00
Chris Lattner
a6e6f5f728 add support for mingw64 target triples.
llvm-svn: 78797
2009-08-12 06:32:10 +00:00
Jakob Stoklund Olesen
7ec5ee575e Move immediate constant predicate templates from the Blackfin target to MathExtras.h
llvm-svn: 78793
2009-08-12 06:22:07 +00:00
Chris Lattner
29efb6cf1f add a couple of helpers to the Triple class for decoding
the darwin version string.  This should help consolidate
the variety of weird functions we have scattered around the
codebase that do stuff like this.

llvm-svn: 78792
2009-08-12 06:19:40 +00:00
Bob Wilson
e000c1a6c4 Add some comments to clarify the arguments to the vtbl and vtbx intrinsics.
llvm-svn: 78775
2009-08-12 01:48:30 +00:00
Owen Anderson
dbf9a912fb Add contexts to some of the MVT APIs. No functionality change yet, just the infrastructure work needed to get the contexts to where they need to be first.
llvm-svn: 78759
2009-08-12 00:36:31 +00:00
Daniel Dunbar
63f93255ae Add 'isCodeGenOnly' bit to Instruction .td records.
- Used to mark fake instructions which don't correspond to an actual machine
   instruction (or are duplicates of a real instruction). This is to be used for
   "special cases" in the .td files, which should be ignored by things like the
   assembler and disassembler. We still need a good solution to handle pervasive
   duplication, like with the Int_ instructions.

 - Set the bit on fake "mov 0" style instructions, which allows turning an
   assembler matcher warning into a hard error.

 - -2 FIXMEs.

llvm-svn: 78731
2009-08-11 22:17:52 +00:00
Owen Anderson
75ebfc8728 Fix warnings.
llvm-svn: 78725
2009-08-11 21:59:30 +00:00
Daniel Dunbar
186ba504b3 llvm-mc/AsmParser: Allow target to specific a comment delimiter, which will be
used to strip hard coded comments out of .td assembly strings.

llvm-svn: 78716
2009-08-11 20:59:47 +00:00
Owen Anderson
e3b5c648eb struct -> class
llvm-svn: 78715
2009-08-11 20:52:44 +00:00
Owen Anderson
48f2f0ae72 Split EVT into MVT and EVT, the former representing _just_ a primitive type, while
the latter is capable of representing either a primitive or an extended type.

llvm-svn: 78713
2009-08-11 20:47:22 +00:00
Daniel Dunbar
f4e8af6ecc StringRef: Add find(char) and find(StringRef).
Also, regroup functions.

llvm-svn: 78712
2009-08-11 20:47:15 +00:00
Chris Lattner
30d9c39337 pass the TargetTriple down from each target ctor to the
LLVMTargetMachine ctor.  It is currently unused.

llvm-svn: 78711
2009-08-11 20:42:37 +00:00
Chris Lattner
45bdc96988 split "JumpTableDirective" (an existing hack) into a PIC and nonPIC
version.  This allows TAI implementations to specify the directive to use
based on the mode being codegen'd for.

The real fix for this is to remove JumpTableDirective, but I don't feel
like diving into the jumptable snarl just now.

llvm-svn: 78709
2009-08-11 20:30:58 +00:00
Dan Gohman
b0c54f532c Add convenience functions for creating nsw add operators.
llvm-svn: 78707
2009-08-11 20:20:39 +00:00
Daniel Dunbar
952aa01cb9 Revert 78680 until I figure out why it completely broke things.
llvm-svn: 78697
2009-08-11 18:11:15 +00:00
Devang Patel
df6d338da2 Link NamedMDNodes.
llvm-svn: 78696
2009-08-11 18:01:24 +00:00
Dan Gohman
aed57ee5b0 Add convenience functions for creating inbounds GEPs.
llvm-svn: 78695
2009-08-11 17:57:01 +00:00
Chris Lattner
be69fa08b6 add a trivial line # cache to SourceMgr to make repeated queries to
FindLineNumber much faster when in sequence.

llvm-svn: 78693
2009-08-11 17:49:14 +00:00
Benjamin Kramer
9a590500ea Make LLVMContext and LLVMContextImpl classes instead of structs.
llvm-svn: 78690
2009-08-11 17:45:13 +00:00
Daniel Dunbar
92bda7b2e0 Remove some unnecessary LoadInst constructors, missed during Twinification.
llvm-svn: 78689
2009-08-11 17:38:47 +00:00
Benjamin Kramer
15a20278ff Fix struct/class mismatch.
llvm-svn: 78686
2009-08-11 17:27:20 +00:00
Dan Gohman
cf73a006f0 Use isa instead of dyn_cast when the result is only converted to bool.
llvm-svn: 78685
2009-08-11 17:20:16 +00:00
Devang Patel
057559abba Fix cut-n-pasto in comment.
llvm-svn: 78684
2009-08-11 17:15:47 +00:00
Dan Gohman
82b3823bb7 Add convenience functions for creating exact sdiv operators, and
use them in CreatePtrDiff.

llvm-svn: 78682
2009-08-11 17:05:24 +00:00
Dan Gohman
1d382f0ee7 Avoid implicitly depending on Instructions.h.
llvm-svn: 78681
2009-08-11 17:03:18 +00:00
Benjamin Kramer
81ce360762 Revert 78662 to fix broken windows build. Add a comment which explains the problem.
llvm-svn: 78679
2009-08-11 16:41:22 +00:00
Dan Gohman
24939b2c4f Tidy #includes.
llvm-svn: 78677
2009-08-11 16:02:12 +00:00
Dan Gohman
0c6e8e18aa Add an explicit keyword.
llvm-svn: 78675
2009-08-11 15:57:42 +00:00
Dan Gohman
8e39bf3fb6 ConstantFolder and NoFolder no longer require their Context members.
llvm-svn: 78673
2009-08-11 15:56:12 +00:00
Dan Gohman
3056a83ca5 Use the default copy-ctor, copy-assignment, and destructor.
llvm-svn: 78670
2009-08-11 15:52:30 +00:00
Dan Gohman
f610241b61 Add a comment about the additional meaning of setPreservesCFG() for
MachineFunctionPass passes.

llvm-svn: 78669
2009-08-11 15:50:56 +00:00
Dan Gohman
618fc2fc8e Remove an unnecessary mutable.
llvm-svn: 78662
2009-08-11 15:03:52 +00:00
Shantonu Sen
9a3cc1a771 Regenerate per request of Gabor Greif (r78628)
llvm-svn: 78661
2009-08-11 13:39:52 +00:00
Devang Patel
4609ecd4bd Remove dead metadata.
llvm-svn: 78651
2009-08-11 06:31:57 +00:00
Jakob Stoklund Olesen
40c33bb2b2 Rebuild RegScavenger::DistanceMap each time it is needed.
The register scavenger maintains a DistanceMap that maps MI pointers to their
distance from the top of the current MBB. The DistanceMap is built
incrementally in forward() and in bulk in findFirstUse(). It is used by
scavengeRegister() to determine which candidate register has the longest
unused interval.

Unfortunately the DistanceMap contents can become outdated. The first time
scavengeRegister() is called, the DistanceMap is filled to cover the MBB. If
then instructions are inserted in the MBB (as they always are following
scavengeRegister()), the recorded distances are too short. This causes bad
behaviour in the included test case where a register use /after/ the current
position is ignored because findFirstUse() thinks is is /before/ the current
position. A "using an undefined register" assertion follows promptly.

The fix is to build a fresh DistanceMap at the top of scavengeRegister(), and
discard it after use. This means that DistanceMap is no longer needed as a
RegScavenger member variable, and forward() doesn't need to update it.

The fix then discloses issue number two in the same test case: The candidate
search in scavengeRegister() finds a CSR that has been saved in the prologue,
but is currently unused. It would be both inefficient and wrong to spill such
a register in the emergency spill slot. In the present case, the emergency
slot restore is placed immediately before the normal epilogue restore, leading
to a "Redefining a live register" assertion.

Fix number two: When scavengerRegister() stumbles upon an unused register that
is overwritten later in the MBB, return that register early. It is important
to verify that the register is defined later in the MBB, otherwise it might be
an unspilled CSR.

llvm-svn: 78650
2009-08-11 06:25:12 +00:00
Bob Wilson
d64e304671 Use vAny type to get rid of Neon intrinsics that differed only in whether
the overloaded vector types allowed floating-point or integer vector elements.
Most of these operations actually depend on the element type, so bitcasting
was not an option.

If you include the vpadd intrinsics that I updated earlier, this gets rid
of 20 intrinsics.

llvm-svn: 78646
2009-08-11 05:39:44 +00:00
Bob Wilson
1c75a23299 Use new EVT::vAny type to combine Neon intrinsics for VPADD.
llvm-svn: 78632
2009-08-11 01:15:26 +00:00
Bob Wilson
4a3ccbda6a Add a new overloaded EVT::vAny type for use in TableGen to allow intrinsic
arguments that are vectors of any size and element type.

llvm-svn: 78631
2009-08-11 01:14:02 +00:00
Jim Grosbach
c9a1dd9291 SjLj based exception handling unwinding support. This patch is nasty, brutish
and short. Well, it's kinda short. Definitely nasty and brutish.

The front-end generates the register/unregister calls into the SjLj runtime,
call-site indices and landing pad dispatch. The back end fills in the LSDA
with the call-site information provided by the front end. Catch blocks are
not yet implemented.

Built on Darwin and verified no llvm-core "make check" regressions.

llvm-svn: 78625
2009-08-11 00:09:57 +00:00
Lang Hames
1503988bb5 Modified VNInfo. The "copy" member is now a union which holds the copy for a register interval, or the defining register for a stack interval. Access is via getCopy/setCopy and getReg/setReg.
llvm-svn: 78620
2009-08-10 23:43:28 +00:00
Owen Anderson
b4bce99769 Rename MVT to EVT, in preparation for splitting SimpleValueType out into its own struct type.
llvm-svn: 78610
2009-08-10 22:56:29 +00:00
Devang Patel
6858a6e408 Align comments.
llvm-svn: 78605
2009-08-10 22:20:38 +00:00
Devang Patel
86894d4e56 Keep track of DIType.
llvm-svn: 78602
2009-08-10 22:09:58 +00:00
Daniel Dunbar
15c79b6fd7 llvm-mc/AsmParser: Allow .td users to redefine the names of the methods to call
on target specific operands for testing class membership and converting to
MCInst operands.

llvm-svn: 78597
2009-08-10 21:00:45 +00:00
Daniel Dunbar
d71d99853c Rename ConvertType to ConvertConstant to avoid a name conflict on llvm-gcc.
llvm-svn: 78596
2009-08-10 20:56:46 +00:00
Owen Anderson
30bf6c8dab SimpleValueType-ify a few more methods on TargetLowering.
llvm-svn: 78595
2009-08-10 20:46:15 +00:00
Owen Anderson
cf56d576eb Continue the SimpleValueType-ification.
llvm-svn: 78593
2009-08-10 20:18:46 +00:00
Erick Tryzelaar
64635cc637 Convert comments to C90-style so llvm-c can import DataTypes.h.
llvm-svn: 78590
2009-08-10 19:44:53 +00:00
Devang Patel
762e9641fd We are not using FoldingSet for metadata uniquing anymore.
llvm-svn: 78585
2009-08-10 18:59:07 +00:00
Owen Anderson
dcb47bda67 Start moving TargetLowering away from using full MVTs and towards SimpleValueType, which will simplify the privatization of IntegerType in the future.
llvm-svn: 78584
2009-08-10 18:56:59 +00:00
Daniel Dunbar
749ff1de5a llvm-mc/AsmMatcher: Change assembler parser match classes to their own record
structure.

llvm-svn: 78581
2009-08-10 18:41:10 +00:00
Owen Anderson
4cd02c843b Change the MDNode uniquing to a ValueMap, at Devang's request.
llvm-svn: 78577
2009-08-10 18:16:08 +00:00
Chris Lattner
3e6da637f6 split MachO section handling stuff out to its out .h/.cpp file.
llvm-svn: 78576
2009-08-10 18:15:01 +00:00
David Greene
91e0e06670 Add support for printing loop structure information in asm comments.
This definitely slows down asm output so put it under an -asm-exuberant
flag.

This information is useful when doing static analysis of performance
issues.

llvm-svn: 78567
2009-08-10 16:38:07 +00:00
David Goodwin
3245141543 Post RA scheduler changes. Introduce a hazard recognizer that uses the target schedule information to accurately model the pipeline. Update the scheduler to correctly handle multi-issue targets.
llvm-svn: 78563
2009-08-10 15:55:25 +00:00
Daniel Dunbar
86ddd268b4 Add support for a user supplied pointer argument to llvm_install_error_handler.
llvm-svn: 78553
2009-08-10 03:36:26 +00:00
Chris Lattner
cc70d578be Make the big switch: Change MCSectionMachO to represent a section *semantically*
instead of syntactically as a string.  This means that it keeps track of the 
segment, section, flags, etc directly and asmprints them in the right format.
This also includes parsing and validation support for llvm-mc and 
"attribute(section)", so we should now start getting errors about invalid 
section attributes from the compiler instead of the assembler on darwin.

Still todo: 
1) Uniquing of darwin mcsections
2) Move all the Darwin stuff out to MCSectionMachO.[cpp|h]
3) there are a few FIXMEs, for example what is the syntax to get the
   S_GB_ZEROFILL segment type?

llvm-svn: 78547
2009-08-10 01:39:42 +00:00
Chris Lattner
e024b843cd add a simple back() method to StringRef.
llvm-svn: 78544
2009-08-10 00:44:02 +00:00
Bob Wilson
326491672e Change Neon table lookup (VTBL) and table extension (VTBX) intrinsics to
take the table vectors as separate arguments, instead of the previous
approach where they were combined into one big vector.

llvm-svn: 78525
2009-08-09 06:03:09 +00:00
Daniel Dunbar
5a6c69d37d Extend comment on ParserMatchClass .td field, and add some missing
classes for X86.

llvm-svn: 78524
2009-08-09 06:00:04 +00:00
Daniel Dunbar
dff8502076 llvm-mc/AsmParser: Define match classes in the .td file.
-2 FIXMEs.

llvm-svn: 78523
2009-08-09 05:18:30 +00:00
Daniel Dunbar
ff95e6d5f8 STLExtras: Add less_ptr.
llvm-svn: 78521
2009-08-09 03:36:59 +00:00
Chris Lattner
9e2c3aa666 sink the 'name' and 'isdirective' state out of MCSection into its derived classes.
This totally optimizes PIC16 sections by not having an 'isdirective' bit anymore!! ;-)

llvm-svn: 78517
2009-08-08 23:39:42 +00:00
Chris Lattner
2849883bd5 1. Make MCSection an abstract class.
2. Move section switch printing to MCSection virtual method which takes a
   TAI.  This eliminates textual formatting stuff from TLOF.
3. Eliminate SwitchToSectionDirective, getSectionFlagsAsString, and 
   TLOFELF::AtIsCommentChar.

llvm-svn: 78510
2009-08-08 22:41:53 +00:00
Chris Lattner
53cc0d6439 make target-specific TLOF impls (except PIC16) create target-specific
MCSection instances.

llvm-svn: 78500
2009-08-08 20:52:13 +00:00
Chris Lattner
95ca008a43 stub out PECOFF/MachO/ELF MCSection classes
llvm-svn: 78499
2009-08-08 20:50:49 +00:00
Chris Lattner
1c704ad33e eliminate TargetLoweringObjectFileSparc in favor of a TAI hook.
A TAI hook is appropriate in this case because this is just an
asm syntax issue, not a semantic difference. TLOF should model
the semantics of the section.

llvm-svn: 78498
2009-08-08 20:43:12 +00:00
Chris Lattner
1e8ed03507 now that getOrCreateSection is all object-file specific,
give the impls an object-file-specific name.  In the future
they can take different arguments etc.

llvm-svn: 78495
2009-08-08 20:22:20 +00:00
Chris Lattner
637296415e sink getOrCreateSection down into all the object file implementations,
now that they create *all* the sections.

llvm-svn: 78494
2009-08-08 20:14:13 +00:00
Eric Christopher
93437b0d2e Fix some cut and paste-os.
llvm-svn: 78493
2009-08-08 20:09:33 +00:00
Daniel Dunbar
9d9f5741a8 Some ProfileInfo cleanups.
- Part of optimal static profiling patch sequence by Andreas Neustifter.

llvm-svn: 78485
2009-08-08 18:59:03 +00:00
Daniel Dunbar
6eb6029bc2 Add a basic static ProfileInfo provider (ProfileEstimatorPass).
- Part of optimal static profiling patch sequence by Andreas Neustifter.

llvm-svn: 78484
2009-08-08 18:44:18 +00:00
Eric Christopher
58b627bed1 Define intrinsics for crc instruction.
llvm-svn: 78482
2009-08-08 18:07:59 +00:00
Daniel Dunbar
87825212a4 More ProfileInfo improvements.
- Part of optimal static profiling patch sequence by Andreas Neustifter.

 - Store edge, block, and function information separately for each functions
   (instead of in one giant map).

 - Return frequencies as double instead of int, and use a sentinel value for
   missing information.

llvm-svn: 78477
2009-08-08 17:43:09 +00:00
Bruno Cardoso Lopes
9e93ee1c78 ELF improvements:
Handle large integers, x86_fp80, ConstantAggregateZero, and two more ConstantExpr:
GetElementPtr and IntToPtr
Set SHF_MERGE bit for mergeable strings
Avoid zero initialized strings to be classified as a bss symbol
Don't allow common symbols to be classified as STB_WEAK
Add a constant to be used as a global value offset in data relocations 

llvm-svn: 78476
2009-08-08 17:29:04 +00:00
Jakob Stoklund Olesen
153d425bb6 Remove RegisterScavenger::isSuperRegUsed(). This completely reverses the mistaken commit r77904.
Now there is no special treatment of instructions that redefine part of a
super-register. Instead, the super-register is marked with <imp-use,kill> and
<imp-def>. For instance, from LowerSubregs on ARM:

subreg: CONVERTING: %Q1<def> = INSERT_SUBREG %Q1<undef>, %D1<kill>, 5
subreg: %D2<def> = FCPYD %D1<kill>, 14, %reg0, %Q1<imp-def>

subreg: CONVERTING: %Q1<def> = INSERT_SUBREG %Q1, %D0<kill>, 6
subreg: %D3<def> = FCPYD %D0<kill>, 14, %reg0, %Q1<imp-use,kill>, %Q1<imp-def>
llvm-svn: 78466
2009-08-08 13:19:10 +00:00
Jakob Stoklund Olesen
f73b30b329 Simplify RegScavenger::forward a bit more.
Verify that early clobber registers and their aliases are not used.

All changes to RegsAvailable are now done as a transaction so the order of
operands makes no difference.

The included test case is from PR4686. It has behaviour that was dependent on the order of operands.

llvm-svn: 78465
2009-08-08 13:18:47 +00:00
Bob Wilson
54c5d7c31a Add new intrinsics for Neon VTRN, VZIP and VUZP operations. Modeling these
as vector shuffles did not work out well.  Shuffles that produce double-wide
vectors accurately represent the operation but make it hard to do anything
with the results.  I considered splitting them up into 2 shuffles, one to
write each register separately, but there doesn't seem to be a good way to
reunite them for codegen.

llvm-svn: 78437
2009-08-07 23:53:05 +00:00
Daniel Dunbar
60887bf820 Add DEBUG_WITH_TYPE as a clean alternative to tweaking DEBUG_TYPE.
This:
--
#undef DEBUG_TYPE
#define DEBUG_TYPE "foo"
DEBUG(...)
#undef DEBUG_TYPE
#define DEBUG_TYPE ""
--
becomes this:
--
DEBUG_WITH_TYPE("foo", ...)
--

llvm-svn: 78435
2009-08-07 23:48:59 +00:00
Chris Lattner
bdb5a03875 remove a bunch of now-dead crud from the asmprinter and TAI interfaces.
llvm-svn: 78428
2009-08-07 23:16:27 +00:00
Chris Lattner
58ae68cdc2 fix the column output stuff in the asmwriter from being dynamic and
driven by TAI to being static, driven by tblgen.  This means that a
target doesn't get impacted by this stuff at all if it doesn't opt
into it.

llvm-svn: 78427
2009-08-07 23:13:38 +00:00
Argyrios Kyrtzidis
36a6dfff07 Modifications to dyn_cast/cast to make them work for objects too, instead of only pointers.
The use case is if you have a wrapper class:

class Base {
  void *Ptr;
public:
  Base() : Ptr(0) { }
  operator bool() const { return Ptr; }
.....
}

and sub-wrappers that have exactly the same size:

class Sub : public Base {
public:
....
static bool classof(const Base*);
}

and in the code you would do:

void f(Base b) {
  Sub sub = dyn_cast<Sub>(b);
  if (sub) {
    ....
  }
}

llvm-svn: 78424
2009-08-07 22:49:24 +00:00
Chris Lattner
7205f6c951 fix comment pastos
llvm-svn: 78422
2009-08-07 22:44:56 +00:00
Jeffrey Yasskin
20848835bf To catch bugs like the one fixed in
http://llvm.org/viewvc/llvm-project?view=rev&revision=78127, I'm changing the
ExecutionEngine's global mappings to hold AssertingVH<const GlobalValue>. That
way, if unregistering a mapping fails to actually unregister it, we'll get an
assert. Running the jit nightly tests didn't uncover any actual instances of
the problem.

This also uncovered the fact that AssertingVH<const X> didn't work, so I fixed
that too.

llvm-svn: 78400
2009-08-07 19:54:29 +00:00
Andreas Bolka
7ded8b7bdf SIV/MIV classification for LDA.
LoopDependenceAnalysis::getLoops is currently O(N*M) for a loop-nest of
depth N and a compound SCEV of M atomic SCEVs. As both N and M will
typically be very small, this should not be a problem. If it turns out
to be one, rewriting getLoops as SCEVVisitor will reduce complexity to
O(M).

llvm-svn: 78394
2009-08-07 18:23:41 +00:00
Dan Gohman
05d4015881 Use std::string() instead of std::string("").
llvm-svn: 78364
2009-08-07 01:43:45 +00:00
Dan Gohman
1c41d60c4a Fix a bunch of namespace pollution.
llvm-svn: 78363
2009-08-07 01:32:21 +00:00
Jakob Stoklund Olesen
83399fc5d2 Get rid of RegScavenger::backwards() before the bitrot spreads.
If we need it one day, there is nothing wrong with putting it back in.

llvm-svn: 78337
2009-08-06 21:19:03 +00:00
Devang Patel
86c0c7abf1 Remove dead code.
llvm-svn: 78335
2009-08-06 20:57:44 +00:00
Chris Lattner
2d90fbe8be Fix several fixmes and clean up code by sinking *all* section
creation activity into the target-specific subclasses of TLOF.
Before this, globals with explicit sections could be created by
the base class.

1. make getOrCreateSection protected, add a new getExplicitSectionGlobal
   pure virtual method to assign sections to globals with a specified
   section.
2. eliminate getSpecialCasedSectionGlobals, which is now PIC specific.
3. eliminate the getKindForNamedSection virtual method, which is
   now just a static method for ELF.
4. Add implementions of getExplicitSectionGlobal for ELF/PECOFF/Darwin/PIC16.
   They are now all detangled and understandable, woo! :)

llvm-svn: 78319
2009-08-06 16:39:58 +00:00
John Mosby
69ad27c7e3 Reg Scavenging generalization (Thumb support):
- start support for new PEI w/reg alloc, allow running RS from emit{Pro,Epi}logue() target hooks.
- fix minor issue with recursion detection.

llvm-svn: 78318
2009-08-06 16:32:47 +00:00
Devang Patel
d0c245bd84 Fix comment.
llvm-svn: 78313
2009-08-06 15:39:34 +00:00
Daniel Dunbar
5cce0d81d1 Don't search the entire type table just to delete a type by name.
- This also fixes the ENABLE_EXPENSIVE_CHECKS failure on vmcore.ml.

llvm-svn: 78287
2009-08-06 06:04:35 +00:00
Owen Anderson
3d0e1b855d Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs.
llvm-svn: 78258
2009-08-05 23:16:16 +00:00
Daniel Dunbar
49dc5e993d Make block and function count available via ProfileInfo.
- Part of optimal static profiling patch sequence by Andreas Neustifter.

llvm-svn: 78247
2009-08-05 21:51:16 +00:00
David Greene
af3c172859 Fix some column padding bugs, reorganize things as suggested by Chris
and eliminate complexity.  Yay!

llvm-svn: 78243
2009-08-05 21:00:52 +00:00
Chris Lattner
8a74485e06 remove the 'DataSectionStartSuffix' and 'TextSectionStartSuffix' knobs.
llvm-svn: 78242
2009-08-05 20:49:52 +00:00
Dan Gohman
ba72f59923 Fix FindExecutable to use sys::Path::GetMainExecutable instead of
just argv[0]. And remove the code for searching the current
working directory and for searching PATH; the point of FindExecutable
is not to find whatever version of the executable can be found by
searching around, but to find an executable that accompanies the
current executable.

Update the tools to use sys::Program::FindProgramByName when they
want PATH searching.

llvm-svn: 78240
2009-08-05 20:21:17 +00:00
Dan Gohman
ef4612175f Add an explicit keyword.
llvm-svn: 78208
2009-08-05 16:40:32 +00:00
Dan Gohman
6e58739bf2 Delete an obsolete sentance from a comment.
llvm-svn: 78206
2009-08-05 16:39:42 +00:00
Daniel Dunbar
eabd825693 Remove unnecessary ProfileInfoLoader methods.
- Part of optimal static profiling patch sequence by Andreas Neustifter.

llvm-svn: 78199
2009-08-05 15:55:56 +00:00
Daniel Dunbar
7d08944f1f Add StringRef::endswith
llvm-svn: 78197
2009-08-05 15:48:26 +00:00
Andrew Lenharth
dd4ec41e89 only point to dest labels if the graph has them
llvm-svn: 78192
2009-08-05 15:04:22 +00:00
Benjamin Kramer
cde4b103b0 Remove unused forward decls.
llvm-svn: 78187
2009-08-05 11:33:27 +00:00
Bruno Cardoso Lopes
2ae97a2777 - Remove custom handling of jumptables by the elf writter (this was
a dirty hack and isn't need anymore since the last x86 code emitter patch)
- Add a target-dependent modifier to addend calculation
- Use R_X86_64_32S relocation for X86::reloc_absolute_word_sext
- Use getELFSectionFlags whenever possible
- fix getTextSection to use TLOF and emit the right text section 
- Handle global emission for static ctors, dtors and Type::PointerTyID
- Some minor fixes

llvm-svn: 78176
2009-08-05 06:57:03 +00:00
Andreas Bolka
4d59f26912 ZIV tester for LDA.
llvm-svn: 78157
2009-08-05 04:26:05 +00:00
Chris Lattner
fd211f171d expose SectionKindForGlobal to curious clients, named as
getKindForGlobal.

llvm-svn: 78156
2009-08-05 04:25:40 +00:00
Dan Gohman
5d566d918b Major calling convention code refactoring.
Instead of awkwardly encoding calling-convention information with ISD::CALL,
ISD::FORMAL_ARGUMENTS, ISD::RET, and ISD::ARG_FLAGS nodes, TargetLowering
provides three virtual functions for targets to override:
LowerFormalArguments, LowerCall, and LowerRet, which replace the custom
lowering done on the special nodes. They provide the same information, but
in a more immediately usable format.

This also reworks much of the target-independent tail call logic. The
decision of whether or not to perform a tail call is now cleanly split
between target-independent portions, and the target dependent portion
in IsEligibleForTailCallOptimization.

This also synchronizes all in-tree targets, to help enable future
refactoring and feature work.

llvm-svn: 78142
2009-08-05 01:29:28 +00:00
Bruno Cardoso Lopes
21bb984953 1) Proper emit displacements for x86, using absolute relocations where necessary
for ELF to work.  
2) RIP addressing: Use SIB bytes for absolute relocations where RegBase=0, 
IndexReg=0.
3) The JIT can get the real address of cstpools and jmptables during
code emission, fix that for object code emission

llvm-svn: 78129
2009-08-05 00:11:21 +00:00
Chris Lattner
46f946526c revert r78048, it isn't worth using assertingvh here.
llvm-svn: 78119
2009-08-04 23:07:12 +00:00
Owen Anderson
cf2c39dc30 Factor some of the constants+context related code out into a separate header, to make LLVMContextImpl.h
not hideous.  Also, fix some MSVC compile errors.

llvm-svn: 78115
2009-08-04 22:41:48 +00:00
Owen Anderson
762987e14b Privatize the last bit of Constant-creation state.
llvm-svn: 78097
2009-08-04 20:25:11 +00:00
Chris Lattner
87372c0978 rip out SectionEndDirectiveSuffix support, only uses by
the masm backend.  If anyone cares about masm in the future,
we'll have semantic sections it can hang off of.

llvm-svn: 78096
2009-08-04 20:09:41 +00:00
Douglas Gregor
60425b2194 Add some type traits that are used for Clang's statically-checked
canonical types.

llvm-svn: 78076
2009-08-04 17:04:52 +00:00
Chris Lattner
8f9a2d3c85 enhance codegen to put 16-bit character strings into the
__TEXT,__ustring section on darwin.

llvm-svn: 78068
2009-08-04 16:27:13 +00:00
Chris Lattner
ec75250455 fix a fixme: don't create an explicit "CStringSection" for ELF,
it is just being used as a prefix, so forward substitute it directly.

llvm-svn: 78067
2009-08-04 16:19:50 +00:00
Chris Lattner
8df05f13da make MergeableCString be a SectionKind "abstract class", and
add new concrete versions for 1/2/4-byte mergable strings.

These are not actually created yet.

llvm-svn: 78055
2009-08-04 05:35:56 +00:00
Chris Lattner
43d32f0969 switch ValueMap to using AssertingVH. This is an old patch I had laying
around in a tree I forgot about.

llvm-svn: 78048
2009-08-04 04:31:02 +00:00
Daniel Dunbar
0a3a222940 Remove unused function.
llvm-svn: 78046
2009-08-04 04:04:25 +00:00
Daniel Dunbar
4b7d44b4d6 Remove now unused Module argument to createTargetMachine.
llvm-svn: 78043
2009-08-04 04:02:45 +00:00
Chris Lattner
628047fd32 eliminate CurrentSection, rename CurrentSection_ -> CurrentSection, make it private,
eliminate IsInTextSection.

llvm-svn: 78017
2009-08-03 23:20:21 +00:00
Chris Lattner
b8fdfbce0a Kill off SwitchToDataSection and SwitchToTextSection, woo.
llvm-svn: 78015
2009-08-03 23:10:34 +00:00
Devang Patel
b7c719fbcf Keep track of metadata used by other metadata.
llvm-svn: 78012
2009-08-03 22:51:10 +00:00
Dan Gohman
958abd37ff Minor whitespace fix, so this doesn't look like a unary *.
llvm-svn: 78010
2009-08-03 22:30:18 +00:00
Dan Gohman
39f93f6443 Add a new Constant::getIntegerValue helper function, and convert a
few places in InstCombine to use it, to fix problems handling pointer
types. This fixes the recent llvm-gcc bootstrap error.

llvm-svn: 78005
2009-08-03 22:07:33 +00:00
David Greene
070216fa44 Re-apply LiveInterval index dumping patch, with fixes suggested by Bill
and others.

llvm-svn: 78003
2009-08-03 21:55:09 +00:00
Chris Lattner
505d63fc7f Eliminate textual section switching from the x86 backend, one
more step towards "semantics sections"

llvm-svn: 78002
2009-08-03 21:53:27 +00:00
Chris Lattner
a5a1e7b4ed make getObjFileLowering() return a non-const reference.
llvm-svn: 77984
2009-08-03 19:12:26 +00:00
Benjamin Kramer
7869bad67e llvm_report_error already prints "LLVM ERROR:". So stop reporting errors like "LLVM ERROR: llvm: error:" or "LLVM ERROR: ERROR:".
llvm-svn: 77971
2009-08-03 13:33:33 +00:00
Anton Korobeynikov
3a8e354d47 Add 'Indirect' LocInfo class and use to pass __m128 on win64. Also minore fixes here and there (mostly __m64).
llvm-svn: 77964
2009-08-03 08:13:56 +00:00
Devang Patel
b770039c5b Add NamedMDNode destructor.
llvm-svn: 77959
2009-08-03 06:19:01 +00:00
Daniel Dunbar
c5047d9d96 Fix a race condition in getting the process exit code on Win32.
llvm-svn: 77953
2009-08-03 05:02:46 +00:00
Daniel Dunbar
2781e4bd89 Remove now unused arguments from TargetRegistry::lookupTarget.
llvm-svn: 77950
2009-08-03 04:20:57 +00:00