Commit Graph

9719 Commits

Author SHA1 Message Date
Dan Gohman
3778f21b17 Add a getOffsetOf, for building a target-independent expression for
offsetof, similar to getSizeOf for sizeof.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79208 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 21:26:11 +00:00
Jakob Stoklund Olesen
66a39699fb Replace RegScavenger::DistanceMap with a simpler local algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79195 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 17:41:39 +00:00
Jakob Stoklund Olesen
e689ce626c Clean up the public interface of RegScavenger.
Remove unused methods and make others private.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79194 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 17:41:20 +00:00
Erick Tryzelaar
02904d5d84 Add more casts to the IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 02:19:46 +00:00
Bill Wendling
af56634058 Reapply r79127. It was fixed by d0k.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79136 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 21:21:19 +00:00
Bill Wendling
f865ea85bd Revert r79127. It was causing compilation errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79135 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 21:14:01 +00:00
Evan Cheng
088880cb19 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79127 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 19:23:44 +00:00
Chris Lattner
7d996d907f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79077 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 05:56:11 +00:00
Dan Gohman
a4a68c1b43 Move FormattedStream's write_impl out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79064 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 02:01:04 +00:00
Eric Christopher
0abee0754b Add sse4.2 string/text processing intrinsics. We'll select these later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79037 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 20:27:57 +00:00
Eric Christopher
801179579e Whitespace cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79036 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 20:27:12 +00:00
Anton Korobeynikov
72977a45a8 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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79033 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 20:10:52 +00:00
Bruno Cardoso Lopes
abd7514a68 *try* to use a better name to describe how common symbols are marked on the elf object file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79029 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 19:45:38 +00:00
Owen Anderson
5ee3ba2f9e Add doxygen comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79027 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 19:41:50 +00:00
Argyrios Kyrtzidis
9a0b165cb5 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79023 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 19:01:37 +00:00
Erick Tryzelaar
d644cb8ff5 A couple IRBuilder functions were still using getGlobalContext().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78997 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 06:12:30 +00:00
Daniel Dunbar
c22e0b2443 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. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78986 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 03:48:55 +00:00
Daniel Dunbar
575327b77e Add virtual printMCInst method to AsmPrinter, as a quick way to expose the API
to print one instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78985 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 03:43:57 +00:00
Daniel Dunbar
1689e0cf55 Add MCSymbol::{print, dump}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78983 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 03:41:23 +00:00
Daniel Dunbar
2c11624b65 Add MCValue::{print, dump}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78982 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 03:11:09 +00:00
Owen Anderson
0668dc7955 Add helpers for fetching basic types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 00:30:41 +00:00
Daniel Dunbar
7894578470 TargetRegistry: Change AsmPrinter constructor to be typed as returning an
AsmPrinter instance (instead of just a FunctionPass)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 23:48:47 +00:00
Daniel Dunbar
011e4db845 llvm-mc: Add dummy MCStreamer implementation, (eventually) for use in profiling.
- Currently unused.

 - A few other random comment fixes lumped in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78960 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 23:36:34 +00:00
Bruno Cardoso Lopes
fdf229eda9 Remove HasCrazyBSS and add a flag in TAI to indicate that '.section'
must be emitted for PowerPC-Linux '.bss' section


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78958 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 23:30:21 +00:00
Owen Anderson
0e275dc538 Actually privatize a IntegerTypes, and fix a few bugs exposed by this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78955 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 23:27:32 +00:00
Dan Gohman
6c304f2314 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78952 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 23:16:59 +00:00
Owen Anderson
1d0be15f89 Push LLVMContexts through the IntegerType APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 21:58:54 +00:00
Bruno Cardoso Lopes
b8e1055f41 Add a method to return BSSSection from TargetLoweringObjectFile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78939 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 21:10:28 +00:00
Bruno Cardoso Lopes
4aa688e997 Add a method to return if the ELF section contains only common symbols!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78937 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 21:08:56 +00:00
Dan Gohman
2907542a3f Add unimplemented destructor declarations to hopefully address
compiler warnings on windows (PR4714).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 20:43:13 +00:00
Daniel Dunbar
67d894ea64 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78928 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 19:38:51 +00:00
Dan Gohman
0ba50bb056 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78924 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 17:41:40 +00:00
Dan Gohman
208ec0f32e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78923 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 17:27:29 +00:00
Dan Gohman
b3667ae9b6 Make raw_ostream non-copyable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 17:07:08 +00:00
Daniel Dunbar
b42dad4761 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78919 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 17:03:38 +00:00
Jakob Stoklund Olesen
4a0f08c5fc Add MachineFrameInfo::getPristineRegisters(MBB) method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78911 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 16:19:33 +00:00
David Goodwin
710461688b Add callback to allow target to adjust latency of schedule dependency edge.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78910 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 16:05:04 +00:00
Dan Gohman
524dea4d4c Move SetBufferSize and SetUnbuffered out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78909 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 15:58:55 +00:00
Dan Gohman
33e49ef5e5 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78907 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 15:44:52 +00:00
Jakob Stoklund Olesen
d4c00c0f55 Fix the N>=64 case in the isInt<> and isUint<> templates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78899 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 06:24:02 +00:00
Chris Lattner
b2d3169d96 fix a minor fixme. When building with SL and later tools, the ".eh" symbols
don't need to be exported from the .o files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78892 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 05:30:22 +00:00
Bruno Cardoso Lopes
b808588a3a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78890 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 05:07:35 +00:00
Daniel Dunbar
689ad6ef3f Convert APint::{fromString,APInt,getBitsNeeded} to use StringRef.
- Patch by Erick Tryzelaar, with some edits (and a bug fix) from me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 02:33:34 +00:00
Daniel Dunbar
ac55b85438 Add StringRef::front (with some small tweaks while I was in the area).
- Patch by Erick Tryzelaar


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78883 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 02:03:30 +00:00
Chris Lattner
38cff389af sink uniquing of sections out of MCContext into the ELF and PECOFF TLOF implementations.
MCContext no longer maintains a string -> section map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 00:37:15 +00:00
Chris Lattner
c9d31524ee add some comments: MCContext owns the MCSections, but it bump pointer allocates
them, so it doesn't have to explicitly free them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78870 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 00:21:53 +00:00
Chris Lattner
e309cfa0d8 reject invalid code like:
int x __attribute__((section("_foo, _bar"))) = 4;
int y __attribute__((section("_foo, _bar, 4byte_literals"))) = 1;




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78867 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 00:05:07 +00:00
Chris Lattner
5dc47ff039 implement support for uniquing MachO sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78866 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 23:55:02 +00:00
Chris Lattner
d3c4486f46 reduce #includage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78860 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 23:34:27 +00:00
Jim Grosbach
066dbb6415 Mark the callsite intrinsic such that the opimizers know it's not dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78856 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 23:03:43 +00:00
Bob Wilson
36e3e668be 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 22:30:59 +00:00
Dan Gohman
a9ad04191c This void is implicit in C++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78848 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 22:10:57 +00:00
Dan Gohman
f3e488476e Add a GetBufferSize() member to raw_ostream and use it to
simplify some formatted_raw_ostream code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78836 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 20:52:45 +00:00
David Goodwin
1a8f36e3ce 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 18:31:53 +00:00
Dan Gohman
4ae5126d04 Remove a bunch more now-unnecessary Context arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78809 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 16:23:25 +00:00
Gabor Greif
e2b16504be catch a typo and simplify call syntax
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78804 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 09:05:11 +00:00
Gabor Greif
9befba80be here comes the CMAKE part on LLVM_COMPACT_SENTINELS; see also r78628 and r78661
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 08:37:37 +00:00
Chris Lattner
a7ac47cee1 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 07:22:17 +00:00
Chris Lattner
8e6208304b add support for mingw64 target triples.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78797 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 06:32:10 +00:00
Jakob Stoklund Olesen
d6eb635d1a Move immediate constant predicate templates from the Blackfin target to MathExtras.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78793 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 06:22:07 +00:00
Chris Lattner
dfc17f75e8 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78792 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 06:19:40 +00:00
Bob Wilson
394346ba3a Add some comments to clarify the arguments to the vtbl and vtbx intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 01:48:30 +00:00
Owen Anderson
23b9b19b1a 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78759 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 00:36:31 +00:00
Daniel Dunbar
7417b761c2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78731 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 22:17:52 +00:00
Owen Anderson
766b5efd99 Fix warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78725 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 21:59:30 +00:00
Daniel Dunbar
59fc42debd llvm-mc/AsmParser: Allow target to specific a comment delimiter, which will be
used to strip hard coded comments out of .td assembly strings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78716 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 20:59:47 +00:00
Owen Anderson
a942ad3d99 struct -> class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 20:52:44 +00:00
Owen Anderson
825b72b057 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 20:47:22 +00:00
Daniel Dunbar
0ad7f9bb2f StringRef: Add find(char) and find(StringRef).
Also, regroup functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78712 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 20:47:15 +00:00
Chris Lattner
0a31d2f645 pass the TargetTriple down from each target ctor to the
LLVMTargetMachine ctor.  It is currently unused.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 20:42:37 +00:00
Chris Lattner
dfab291702 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78709 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 20:30:58 +00:00
Dan Gohman
d6474fa1f1 Add convenience functions for creating nsw add operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78707 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 20:20:39 +00:00
Daniel Dunbar
3603d7a352 Revert 78680 until I figure out why it completely broke things.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78697 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 18:11:15 +00:00
Devang Patel
ab67e705f5 Link NamedMDNodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78696 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 18:01:24 +00:00
Dan Gohman
e2574d3215 Add convenience functions for creating inbounds GEPs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78695 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 17:57:01 +00:00
Chris Lattner
1d96ccc69a add a trivial line # cache to SourceMgr to make repeated queries to
FindLineNumber much faster when in sequence.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78693 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 17:49:14 +00:00
Benjamin Kramer
12ddd40953 Make LLVMContext and LLVMContextImpl classes instead of structs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78690 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 17:45:13 +00:00
Daniel Dunbar
c588d55810 Remove some unnecessary LoadInst constructors, missed during Twinification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78689 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 17:38:47 +00:00
Benjamin Kramer
754bdacf46 Fix struct/class mismatch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78686 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 17:27:20 +00:00
Dan Gohman
104eac156e Use isa instead of dyn_cast when the result is only converted to bool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78685 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 17:20:16 +00:00
Devang Patel
a44fa8333e Fix cut-n-pasto in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78684 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 17:15:47 +00:00
Dan Gohman
59c4f5c2fc Add convenience functions for creating exact sdiv operators, and
use them in CreatePtrDiff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78682 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 17:05:24 +00:00
Dan Gohman
d30658c3ff Avoid implicitly depending on Instructions.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78681 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 17:03:18 +00:00
Benjamin Kramer
f221c0bd0d Revert 78662 to fix broken windows build. Add a comment which explains the problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78679 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 16:41:22 +00:00
Dan Gohman
ffef8acc3e Tidy #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78677 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 16:02:12 +00:00
Dan Gohman
b2d746ce6d Add an explicit keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78675 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 15:57:42 +00:00
Dan Gohman
7f4151bc69 ConstantFolder and NoFolder no longer require their Context members.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78673 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 15:56:12 +00:00
Dan Gohman
3751aa559d Use the default copy-ctor, copy-assignment, and destructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78670 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 15:52:30 +00:00
Dan Gohman
d1ad72f54f Add a comment about the additional meaning of setPreservesCFG() for
MachineFunctionPass passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78669 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 15:50:56 +00:00
Dan Gohman
3c8178e625 Remove an unnecessary mutable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78662 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 15:03:52 +00:00
Shantonu Sen
7e83697c8e Regenerate per request of Gabor Greif (r78628)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78661 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 13:39:52 +00:00
Devang Patel
9d3627ea27 Remove dead metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78651 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 06:31:57 +00:00
Jakob Stoklund Olesen
8c54a62061 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78650 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 06:25:12 +00:00
Bob Wilson
b0abb4dc42 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78646 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 05:39:44 +00:00
Bob Wilson
f24bd401eb Use new EVT::vAny type to combine Neon intrinsics for VPADD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78632 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 01:15:26 +00:00
Bob Wilson
61fc4cf7aa Add a new overloaded EVT::vAny type for use in TableGen to allow intrinsic
arguments that are vectors of any size and element type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78631 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 01:14:02 +00:00
Jim Grosbach
1b747ad8a0 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78625 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 00:09:57 +00:00
Lang Hames
52c1afcaea 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 23:43:28 +00:00
Owen Anderson
e50ed30282 Rename MVT to EVT, in preparation for splitting SimpleValueType out into its own struct type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78610 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 22:56:29 +00:00
Devang Patel
1490d0f209 Align comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78605 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 22:20:38 +00:00
Devang Patel
72bcdb6c9b Keep track of DIType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 22:09:58 +00:00
Daniel Dunbar
5c468e3d70 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78597 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 21:00:45 +00:00
Daniel Dunbar
e74f3c0ce6 Rename ConvertType to ConvertConstant to avoid a name conflict on llvm-gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78596 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 20:56:46 +00:00
Owen Anderson
d6662add68 SimpleValueType-ify a few more methods on TargetLowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78595 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 20:46:15 +00:00
Owen Anderson
70671845ad Continue the SimpleValueType-ification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78593 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 20:18:46 +00:00
Erick Tryzelaar
a84b155759 Convert comments to C90-style so llvm-c can import DataTypes.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78590 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 19:44:53 +00:00
Devang Patel
d7de19ad7b We are not using FoldingSet for metadata uniquing anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78585 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 18:59:07 +00:00
Owen Anderson
77547befdc Start moving TargetLowering away from using full MVTs and towards SimpleValueType, which will simplify the privatization of IntegerType in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 18:56:59 +00:00
Daniel Dunbar
338825c192 llvm-mc/AsmMatcher: Change assembler parser match classes to their own record
structure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78581 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 18:41:10 +00:00
Owen Anderson
0631fce850 Change the MDNode uniquing to a ValueMap, at Devang's request.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78577 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 18:16:08 +00:00
Chris Lattner
f9bdeddb96 split MachO section handling stuff out to its out .h/.cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78576 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 18:15:01 +00:00
David Greene
b71d1b2fe2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 16:38:07 +00:00
David Goodwin
d94a4e5d8d 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78563 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 15:55:25 +00:00
Daniel Dunbar
ca15f3d6d6 Add support for a user supplied pointer argument to llvm_install_error_handler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 03:36:26 +00:00
Chris Lattner
ff4bc460c5 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?



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78547 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 01:39:42 +00:00
Chris Lattner
e36df3fd31 add a simple back() method to StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78544 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 00:44:02 +00:00
Bob Wilson
1ff446fef6 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78525 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-09 06:03:09 +00:00
Daniel Dunbar
98164afb01 Extend comment on ParserMatchClass .td field, and add some missing
classes for X86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-09 06:00:04 +00:00
Daniel Dunbar
6745d42e8e llvm-mc/AsmParser: Define match classes in the .td file.
-2 FIXMEs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78523 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-09 05:18:30 +00:00
Daniel Dunbar
094da67bd7 STLExtras: Add less_ptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-09 03:36:59 +00:00
Chris Lattner
93b6db3de9 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!! ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78517 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 23:39:42 +00:00
Chris Lattner
892e182393 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78510 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 22:41:53 +00:00
Chris Lattner
7c599d056a make target-specific TLOF impls (except PIC16) create target-specific
MCSection instances.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78500 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 20:52:13 +00:00
Chris Lattner
a1c31b779c stub out PECOFF/MachO/ELF MCSection classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78499 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 20:50:49 +00:00
Chris Lattner
5277b22687 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78498 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 20:43:12 +00:00
Chris Lattner
0c0cb71233 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78495 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 20:22:20 +00:00
Chris Lattner
fbf1d271e6 sink getOrCreateSection down into all the object file implementations,
now that they create *all* the sections.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78494 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 20:14:13 +00:00
Eric Christopher
d34ab83c16 Fix some cut and paste-os.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78493 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 20:09:33 +00:00
Daniel Dunbar
c43782cf71 Some ProfileInfo cleanups.
- Part of optimal static profiling patch sequence by Andreas Neustifter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78485 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 18:59:03 +00:00
Daniel Dunbar
55e354ac0e Add a basic static ProfileInfo provider (ProfileEstimatorPass).
- Part of optimal static profiling patch sequence by Andreas Neustifter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78484 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 18:44:18 +00:00
Eric Christopher
63cd7e557c Define intrinsics for crc instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78482 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 18:07:59 +00:00
Daniel Dunbar
caaa49336b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78477 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 17:43:09 +00:00
Bruno Cardoso Lopes
3e0094d969 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 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78476 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 17:29:04 +00:00
Jakob Stoklund Olesen
9390cd0e86 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>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78466 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 13:19:10 +00:00
Jakob Stoklund Olesen
dffb051c21 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78465 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 13:18:47 +00:00
Bob Wilson
9e699cc726 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 23:53:05 +00:00
Daniel Dunbar
c3c9239d76 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", ...)
--


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78435 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 23:48:59 +00:00
Chris Lattner
db0a9706e7 remove a bunch of now-dead crud from the asmprinter and TAI interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78428 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 23:16:27 +00:00
Chris Lattner
59e8677b19 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78427 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 23:13:38 +00:00
Argyrios Kyrtzidis
8b6d86df06 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) {
    ....
  }
}



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78424 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 22:49:24 +00:00
Chris Lattner
b124be4f97 fix comment pastos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78422 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 22:44:56 +00:00
Jeffrey Yasskin
0d5bd59553 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78400 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 19:54:29 +00:00
Andreas Bolka
699db99c1a 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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78394 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 18:23:41 +00:00
Dan Gohman
1eaf391458 Use std::string() instead of std::string("").
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78364 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 01:43:45 +00:00
Dan Gohman
7db949df78 Fix a bunch of namespace pollution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78363 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 01:32:21 +00:00
Jakob Stoklund Olesen
31f5591c91 Get rid of RegScavenger::backwards() before the bitrot spreads.
If we need it one day, there is nothing wrong with putting it back in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78337 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 21:19:03 +00:00
Devang Patel
bceda93251 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78335 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 20:57:44 +00:00
Chris Lattner
24f654c8a4 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! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78319 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 16:39:58 +00:00
John Mosby
e0161ea105 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78318 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 16:32:47 +00:00
Devang Patel
27a201d236 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78313 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 15:39:34 +00:00
Daniel Dunbar
8113c6739e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78287 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 06:04:35 +00:00
Owen Anderson
d7f2a6cb3f Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78258 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 23:16:16 +00:00
Daniel Dunbar
c9008c5cc7 Make block and function count available via ProfileInfo.
- Part of optimal static profiling patch sequence by Andreas Neustifter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 21:51:16 +00:00
David Greene
a5bb59f856 Fix some column padding bugs, reorganize things as suggested by Chris
and eliminate complexity.  Yay!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78243 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 21:00:52 +00:00
Chris Lattner
cafbdc5c09 remove the 'DataSectionStartSuffix' and 'TextSectionStartSuffix' knobs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78242 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 20:49:52 +00:00
Dan Gohman
197f728d49 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 20:21:17 +00:00
Dan Gohman
d87dc0fdab Add an explicit keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78208 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 16:40:32 +00:00
Dan Gohman
892fe182c8 Delete an obsolete sentance from a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78206 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 16:39:42 +00:00
Daniel Dunbar
ee16638bfc Remove unnecessary ProfileInfoLoader methods.
- Part of optimal static profiling patch sequence by Andreas Neustifter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 15:55:56 +00:00
Daniel Dunbar
c9af366fc3 Add StringRef::endswith
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 15:48:26 +00:00
Andrew Lenharth
ea2381eb71 only point to dest labels if the graph has them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78192 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 15:04:22 +00:00
Benjamin Kramer
19229581ba Remove unused forward decls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78187 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 11:33:27 +00:00
Bruno Cardoso Lopes
52d0851446 - 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 06:57:03 +00:00
Andreas Bolka
831f6f6d2a ZIV tester for LDA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78157 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 04:26:05 +00:00
Chris Lattner
58bed8fc29 expose SectionKindForGlobal to curious clients, named as
getKindForGlobal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 04:25:40 +00:00
Dan Gohman
98ca4f2a32 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78142 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 01:29:28 +00:00
Bruno Cardoso Lopes
e55fef36a9 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78129 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 00:11:21 +00:00
Chris Lattner
4f95d2bda4 revert r78048, it isn't worth using assertingvh here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78119 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 23:07:12 +00:00
Owen Anderson
48b2f3e485 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78115 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 22:41:48 +00:00
Owen Anderson
d03eecd063 Privatize the last bit of Constant-creation state.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78097 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 20:25:11 +00:00
Chris Lattner
f9c1ccf280 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78096 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 20:09:41 +00:00
Douglas Gregor
c7a6da6e14 Add some type traits that are used for Clang's statically-checked
canonical types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78076 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 17:04:52 +00:00
Chris Lattner
ec409759e9 enhance codegen to put 16-bit character strings into the
__TEXT,__ustring section on darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78068 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 16:27:13 +00:00
Chris Lattner
7e88a50428 fix a fixme: don't create an explicit "CStringSection" for ELF,
it is just being used as a prefix, so forward substitute it directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 16:19:50 +00:00
Chris Lattner
3b24c01720 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78055 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 05:35:56 +00:00
Chris Lattner
0a0193edf9 switch ValueMap to using AssertingVH. This is an old patch I had laying
around in a tree I forgot about.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78048 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 04:31:02 +00:00
Daniel Dunbar
a277f4e33d Remove unused function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78046 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 04:04:25 +00:00
Daniel Dunbar
214e22396f Remove now unused Module argument to createTargetMachine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78043 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 04:02:45 +00:00
Chris Lattner
290c2f56ce eliminate CurrentSection, rename CurrentSection_ -> CurrentSection, make it private,
eliminate IsInTextSection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78017 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 23:20:21 +00:00
Chris Lattner
c6fdced3db Kill off SwitchToDataSection and SwitchToTextSection, woo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78015 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 23:10:34 +00:00
Devang Patel
4771e16fa9 Keep track of metadata used by other metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 22:51:10 +00:00
Dan Gohman
5544c6cad8 Minor whitespace fix, so this doesn't look like a unary *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78010 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 22:30:18 +00:00
Dan Gohman
43ee5f7c08 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78005 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 22:07:33 +00:00
David Greene
b525766479 Re-apply LiveInterval index dumping patch, with fixes suggested by Bill
and others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78003 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 21:55:09 +00:00
Chris Lattner
11e9657eeb Eliminate textual section switching from the x86 backend, one
more step towards "semantics sections"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78002 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 21:53:27 +00:00
Chris Lattner
38c398808c make getObjFileLowering() return a non-const reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 19:12:26 +00:00
Benjamin Kramer
d5fe92efbc llvm_report_error already prints "LLVM ERROR:". So stop reporting errors like "LLVM ERROR: llvm: error:" or "LLVM ERROR: ERROR:".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 13:33:33 +00:00
Anton Korobeynikov
4ab15535e7 Add 'Indirect' LocInfo class and use to pass __m128 on win64. Also minore fixes here and there (mostly __m64).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 08:13:56 +00:00
Devang Patel
a82f8838c6 Add NamedMDNode destructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 06:19:01 +00:00
Daniel Dunbar
defc85327a Fix a race condition in getting the process exit code on Win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77953 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 05:02:46 +00:00
Daniel Dunbar
4bd03abe59 Remove now unused arguments from TargetRegistry::lookupTarget.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77950 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 04:20:57 +00:00
Daniel Dunbar
3c2d4bf97f Pass target triple string in to TargetMachine constructor.
This is not just a matter of passing in the target triple from the module;
currently backends are making decisions based on the build and host
architecture. The goal is to migrate to making these decisions based off of the
triple (in conjunction with the feature string). Thus most clients pass in the
target triple, or the host triple if that is empty.

This has one important change in the way behavior of the JIT and llc.

For the JIT, it was previously selecting the Target based on the host
(naturally), but it was setting the target machine features based on the triple
from the module. Now it is setting the target machine features based on the
triple of the host.

For LLC, -march was previously only used to select the target, the target
machine features were initialized from the module's triple (which may have been
empty). Now the target triple is taken from the module, or the host's triple is
used if that is empty. Then the triple is adjusted to match -march.

The take away is that -march for llc is now used in conjunction with the host
triple to initialize the subtarget. If users want more deterministic behavior
from llc, they should use -mtriple, or set the triple in the input module.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 04:03:51 +00:00
Andreas Bolka
5eca4525f4 Restrict LDA to affine subscripts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77932 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 01:03:48 +00:00
Daniel Dunbar
275872e799 Fix some comments referring to std::cerr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77931 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 01:02:24 +00:00
Daniel Dunbar
e28039cfd1 Move most targets TargetMachine constructor to only taking a target triple.
- The C, C++, MSIL, and Mips backends still need the module.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77927 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 23:37:13 +00:00
Jakob Stoklund Olesen
1391cc19d0 Remove unneeded intrinsics from Blackfin backend.
__builtin_bfin_ones does the same as ctpop, so it can be implemented in the front-end.

__builtin_bfin_loadbytes loads from an unaligned pointer with the disalignexcpt instruction. It does the same as loading from a pointer with the low bits masked. It is better if the front-end creates a masked load. We can always instruction select the masked to disalignexcpt+load.

We keep csync/ssync/idle. These intrinsics represent instructions that need workarounds for some silicon revisions. We may even want to convert inline assembler to intrinsics to enable the workarounds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77917 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 21:49:05 +00:00
Daniel Dunbar
bf4fc28303 Adjust comment to distinguish between target name and triple target name they
match.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77908 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 19:41:20 +00:00
Jakob Stoklund Olesen
0e6a4efdd4 Scavenger asserts.
Allow imp-def and imp-use of anything in the scavenger asserts, just like the machine code verifier.
Allow redefinition of a sub-register of a live register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77904 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 18:28:41 +00:00
Jakob Stoklund Olesen
6b30f5c867 Add some basic blackfin intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77903 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 18:28:11 +00:00
Jakob Stoklund Olesen
d950941e13 Analog Devices Blackfin back-end.
Generate code for the Blackfin family of DSPs from Analog Devices:

  http://www.analog.com/en/embedded-processing-dsp/blackfin/processors/index.html
  
We aim to be compatible with the exsisting GNU toolchain found at:

  http://blackfin.uclinux.org/gf/project/toolchain
  
The back-end is experimental.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 17:32:10 +00:00
Benjamin Kramer
e6864c1d35 Remove duplicated colons and spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77892 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 12:13:02 +00:00
Chris Lattner
18a4c16726 move dwarf debug info section selection stuff from TAI to
TLOF, unifying all the dwarf targets at the same time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77889 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 07:24:22 +00:00
Chris Lattner
35039ac241 convert EHFrameSection to be managed by TLOF instead of TAI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77888 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 06:52:36 +00:00
Chris Lattner
d90183d25d Move the getInlineAsmLength virtual method from TAI to TII, where
the only real caller (GetFunctionSizeInBytes) uses it.

The custom ARM implementation of this is basically reimplementing
an assembler poorly for negligible gain.  It should be removed 
IMNSHO, but I'll leave that to ARMish folks to decide.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77877 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 05:20:37 +00:00
Chris Lattner
b6bbfebdc6 move a virtual method body to its .cpp file to avoid a #include
in a header.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:58:19 +00:00
Chris Lattner
9ba8c6872d remove the dead ELFTargetAsmInfo.h/cpp file. TargetAsmInfo
defaults to being ELF.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77866 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:33:09 +00:00
Chris Lattner
8d4a0a328a remove TargetAsmInfo::TM, which is now dead. The basic TAI class now
no longer depends on TM!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77863 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:27:24 +00:00
Chris Lattner
05e5fcab09 move an enum from TM -> TargetOptions. This makes TargetOptions.h
be self contained, and it isn't used from TM.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77857 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:08:52 +00:00
Chris Lattner
b6d667403f remove the dead PreferredEHDataFormat TAI hook: its now dead
even considering #if 0 code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77856 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:02:52 +00:00
Chris Lattner
d5bbb07ec8 move getDwarfExceptionSection from TAI to TLOF and rename it to
getLSDASection() to be more specific.  This makes it pretty obvious
that the ELF LSDA section is being specified wrong in PIC mode.  We're
probably getting a lot of startup-time relocations to a readonly page,
which is expensive and bad.

Someone who cares about ELF C++ should investigate this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77847 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 01:34:32 +00:00
Chris Lattner
80ec2792b2 convert ctors/dtors section to be in TLOF instead of
TAI.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77842 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 00:34:36 +00:00
Daniel Dunbar
cdcb388a58 Change MCOperand to use Create style instead of Make style for constructing
operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77837 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 00:09:22 +00:00
Chris Lattner
7b1dcdfce1 make SectionKind::Kind completely private now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77836 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 00:04:12 +00:00
Chris Lattner
1ef9be2883 Make SectionKind::get() private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77835 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 00:02:44 +00:00
Chris Lattner
2798119ab4 (re)introduce new simpler apis for creation sectionkinds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 23:57:16 +00:00
Chris Lattner
83d77faf6e Remove "JumpTableDataSection" from TAI, instead, have AsmPrinter
compute it based on what it knows.  As part of this, rename getSectionForMergeableConstant
to getSectionForConstant because it works for non-mergable constants also.

The only functionality change from this is that Xcore will start dropping
its jump tables into readonly section instead of data section in -static mode.
This should be fine as the linker resolves the relocations.  If this is a
problem, let me know and we'll come up with another solution.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77833 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 23:46:12 +00:00
Chris Lattner
b80610cd13 REmove dead fields of TAI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77820 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 22:40:22 +00:00
Chris Lattner
824583844a fix a fixme by sinking various target-specific directives down into
the appropriate subclasses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77815 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:56:13 +00:00
Chris Lattner
f9650c061e it turns out that isWeak() was basically dead anyway. Kill off SectionInfo :-/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77812 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:46:23 +00:00
Chris Lattner
0064e85050 fix a layering violation by moving SectionKind out to its own header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77808 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:30:49 +00:00
Dan Gohman
f17008844a Minor whitespace tidiness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:25:46 +00:00
Chris Lattner
423d190dbe with the previous refactoring, fixme fixed!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77805 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:21:43 +00:00
Chris Lattner
968ff11967 Change SectionKind to be a property that is true of a *section*, it
should have no state that is specific to particular globals in the
section.  In this case, it means the removal of the "isWeak" and
"ExplicitSection" bits.  MCSection uses the new form of SectionKind.

To handle isWeak, I introduced a new SectionInfo class, which is
SectionKind + isWeak, and it is used by the part of the code generator
that does classification of a specific global.

The ExplicitSection disappears.  It is moved onto MCSection as a new
"IsDirective" bit.  Since the Name of a section is either a section
or directive, it makes sense to keep this bit in MCSection.  Ultimately
the creator of MCSection should canonicalize (e.g.) .text to whatever
the actual section is.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:11:14 +00:00
Dan Gohman
7aeff084a4 Use the default copy ctor and copy-assignment operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77793 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 19:11:31 +00:00
Chris Lattner
4a7bc1e5aa All MCSections are now required to have a SectionKind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77787 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 18:25:49 +00:00
Dan Gohman
f94083333c Give MachineFunctionAnalysis a destructor so it can verify that
that it released its allocated memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 04:19:43 +00:00
Ted Kremenek
458ba32680 Make default ctor for ImmutableSet::iterator public.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77762 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 01:28:23 +00:00
Owen Anderson
7e3142b012 Privatize all but one of the remaining constant tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77748 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 22:45:43 +00:00
Mikhail Glushenkov
7ea9de78ee Add a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77746 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 22:24:20 +00:00
David Greene
bef8768bd0 Simplify operand padding by keying off tabs in the asm stream. If
padding is disabled, tabs get replaced by spaces except in the case of
the first operand, where the tab is output to line up the operands after
the mnemonics.

Add some better comments and eliminate redundant code.

Fix some testcases to not assume tabs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77740 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 21:57:10 +00:00
Daniel Dunbar
76c4d7696c llvm-mc: Support quoted identifiers.
- Uses MCAsmToken::getIdentifier which returns the (sub)string representing the
   meaningfull contents a string or identifier token.

 - Directives aren't done yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77739 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 21:55:09 +00:00
Chris Lattner
7a01e95915 PreferredEHDataFormat is always call with data and global, but this whole
thing is #if0'd out anyway.  Just simplify the code by reducing the interface.
Not deleting this is essential for Bill's continuing happiness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 21:39:55 +00:00
Owen Anderson
647e3016de Move the metadata constructors back to 2.5 syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77733 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 21:35:40 +00:00
Chris Lattner
26630c1180 move emitUsedDirectiveFor to TargetLoweringObjectFile and rename it to
indicate that it is a predicate, not an emitter.  This eliminates TAI
dependencies on Mangler and GlobalValue.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:52:39 +00:00
Owen Anderson
a7235ea724 Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:28:14 +00:00
Dan Gohman
81acc554b9 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 19:26:54 +00:00
Dan Gohman
e243729b3d Delete spurious semicolons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77712 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:59:29 +00:00
Benjamin Kramer
548f8cbb94 Fix build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:58:46 +00:00
Chris Lattner
a87dea4f8c switch off of 'Section' onto MCSection. We're not properly using
MCSection subclasses yet, but this is a step in the right direction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77708 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:48:30 +00:00
Dan Gohman
5e5337a833 Remove Annotation.h, which is no longer used in the LLVM tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77706 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:36:25 +00:00
Dan Gohman
f266f89634 MachineFunction no longer needs Annotation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77704 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:35:51 +00:00
Dan Gohman
a818c30d66 Fix some problems with ASTCallbackVH in its use as a DenseMap key.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77696 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:21:48 +00:00
Dan Gohman
29384efb76 Teach ValueHandleBase to treat DenseMap's special Empty and Tombstone
values the same way it treats null pointers. This is needed to allow
CallbackVH to be used as a key in a DenseMap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77695 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:20:18 +00:00
Devang Patel
b4d31306a4 Process DbgDeclareInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77694 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:18:52 +00:00
Dan Gohman
fb3af88ba7 Split DenseMapInfo into a separate header file, so that it can be
included separately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77693 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:18:19 +00:00
Dan Gohman
ad2afc2a42 Reapply r77654 with a fix: MachineFunctionPass's getAnalysisUsage
shouldn't do AU.setPreservesCFG(), because even though CodeGen passes
don't modify the LLVM IR CFG, they may modify the MachineFunction CFG,
and passes like MachineLoop are registered with isCFGOnly set to true.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77691 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:16:33 +00:00
Chris Lattner
f26e03bc7e refactor section construction in TLOF to be through an explicit
initialize method, which can be called when an MCContext is available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 17:42:42 +00:00
Owen Anderson
5defacc6e6 Move getTrue() and getFalse() to 2.5-like APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77685 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 17:39:07 +00:00
Chris Lattner
ed47a0409b split MCSection stuff out to its own .cpp file, add a new
MCSectionWithKind subclass of MCSection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77684 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 17:02:00 +00:00
Chris Lattner
23b6ecffe1 move the sectionkind and section classes to TargetLoweringObjectFile.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77681 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 16:47:16 +00:00