Commit Graph

7801 Commits

Author SHA1 Message Date
Chris Lattner
d63e618212 Fix sentinels to use correctly 'aligned' pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60229 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 01:36:16 +00:00
Chris Lattner
9ac30537aa Fix spello, add DenseMapInfo specialization for PointerIntPair.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 01:18:05 +00:00
Chris Lattner
d55da4de04 fix comment typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60227 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 23:57:26 +00:00
Chris Lattner
762ac83271 fix a bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60225 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 23:36:15 +00:00
Chris Lattner
34b763694e add a generic "bitmangled pointer" class, which allows a parameterized
pointer and integer type to be used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60224 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 23:31:44 +00:00
Chris Lattner
956033a4f5 comment cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60220 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 22:41:36 +00:00
Chris Lattner
b390b1728e forward declare CallSite instead of #includ'ing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60217 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 21:47:19 +00:00
Chris Lattner
8b589fa135 rename "ping" to "verifyRemoved". I don't know why 'ping' what chosen,
but it doesn't make any sense at all.

Also make the method const, private, and fit in 80 cols while we're at it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60215 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 21:42:09 +00:00
Chris Lattner
e85866313a comment and indentation improvements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60214 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 21:36:43 +00:00
Mikhail Glushenkov
739c720e66 Add 'hidden' and 'really_hidden' option properties.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60198 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 00:13:25 +00:00
Chris Lattner
4f02c74a8e Enhance RecursivelyDeleteTriviallyDeadInstructions to optionally
return a list of deleted instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60193 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 23:14:34 +00:00
Chris Lattner
3481f24c06 remove doConstantPropagation and dceInstruction, they are just
wrappers around the interesting code and use an obscure iterator
abstraction that dates back many many years.

Move EraseDeadInstructions to Transforms/Utils and name it
RecursivelyDeleteTriviallyDeadInstructions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60191 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 22:57:53 +00:00
Chris Lattner
e3a0884ddf improve const correctness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60168 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 08:39:18 +00:00
Chris Lattner
52c95856b4 move FindAvailableLoadedValue from JumpThreading to Transforms/Utils.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60166 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 08:10:05 +00:00
Chris Lattner
b29714a10a move MergeBasicBlockIntoOnlyPred to Transforms/Utils.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60162 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 07:43:12 +00:00
Evan Cheng
884c70c912 On x86 favors folding short immediate into some arithmetic operations (e.g. add, and, xor, etc.) because materializing an immediate in a register is expensive in turns of code size.
e.g.
movl 4(%esp), %eax
addl $4, %eax

is 2 bytes shorter than

movl $4, %eax
addl 4(%esp), %eax


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60139 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 00:49:46 +00:00
Ted Kremenek
9f1f00ab1b Add typedef to StringMapEntry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60134 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 00:17:25 +00:00
Mikhail Glushenkov
7e6d70a425 Disallow multiple edges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60127 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 22:59:45 +00:00
Devang Patel
da278753c4 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60111 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 18:13:11 +00:00
Mikhail Glushenkov
1f1fab8c91 Fix the -I option (llvmc -I dir1 -I dir2 didn't work).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60101 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 10:57:31 +00:00
Mikhail Glushenkov
8b4c5f5d26 Refactor Tools.td to remove repetition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60100 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 10:56:56 +00:00
Dan Gohman
2ad8245566 LiveRanges are represented as half-open ranges. Fix the findLiveInMBBs code
and the LiveInterval.h top-level comment and accordingly. This fixes blocks
having spurious live-in registers in boundary cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 05:50:31 +00:00
Ted Kremenek
5984680c1f Add 'tell' method to raw_fd_ostream that clients can use to query the current location in the file the stream is writing to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60085 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 03:33:13 +00:00
Chris Lattner
c5dd22a333 add a long-overdue AllocaInst::isStaticAlloca method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60080 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 02:54:17 +00:00
Nuno Lopes
08d67c7763 change AnnotationManager to use 'const char*' instead of std::string. this fixes the leakage of those strings and avoids the creation of such strings in static cosntructors (should result in a little improvement of startup time)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60064 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 00:00:44 +00:00
Mikhail Glushenkov
d91487785f Make -fsyntax-only, -include and -emit-llvm work for C++ and Objective-C/C++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60047 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 21:35:20 +00:00
Dan Gohman
21d9003087 Initial support for anti-dependence breaking. Currently this code does not
introduce any new spilling; it just uses unused registers.

Refactor the SUnit topological sort code out of the RRList scheduler and
make use of it to help with the post-pass scheduler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59999 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 00:52:40 +00:00
Dan Gohman
ad38b6e4e5 Move the scheduler constructor functions to SchedulerRegistry.h, to
simplify header dependencies for front-ends that just want to choose
a scheduler and don't need all the scheduling machinery declarations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59978 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 19:53:21 +00:00
Dan Gohman
d59b083d22 Fix an unused-parameter warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59977 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 19:51:59 +00:00
Dan Gohman
942b8c8533 Check in the rest of this change. The isAntiDep flag needs to be passed
to removePred because an SUnit can both data-depend and anti-depend
on the same SUnit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59969 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 17:33:52 +00:00
Duncan Sands
25cf2275ff If the type legalizer actually legalized anything
(this doesn't happen that often, since most code
does not use illegal types) then follow it by a
DAG combiner run that is allowed to generate
illegal operations but not illegal types.  I didn't
modify the target combiner code to distinguish like
this between illegal operations and illegal types,
so it will not produce illegal operations as well
as not producing illegal types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59960 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 14:53:14 +00:00
Evan Cheng
027fdbe3ba Move target independent td files from lib/Target/ to include/llvm/Target so they can be distributed along with the header files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59953 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 07:34:46 +00:00
Scott Michel
2cd91804ec Roll back rev 59890, since Chris says this can never happen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59914 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 19:22:48 +00:00
Duncan Sands
03228089d5 Rename SetCCResultContents to BooleanContents. In
practice these booleans are mostly produced by SetCC,
however the concept is more general.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59911 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 15:47:28 +00:00
Scott Michel
bab6436b17 Check for NULL before traversing the isa<> type hierarchy checking with a
NULL-based reference.

Note: Encountered this a few times on Tiger + gcc 4.0.1. Might just be a
platform-specific compiler issue, but it's good defensive programming in any
case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59890 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 23:49:26 +00:00
Anton Korobeynikov
7751ad92da Make a convenient helper for printing offsets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59872 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 16:15:34 +00:00
Bill Wendling
253174bf50 Cleanup of the [SU]ADDO type legalization code. Patch by Duncan!
"It simplifies the type legalization part a bit, and produces better code by
teaching SelectionDAG about the extra bits in an i8 SADDO/UADDO node.  In
essence, I spontaneously decided that on x86 this i8 boolean result would be
either 0 or 1, and on other platforms 0/1 or 0/-1, depending on whether the
platform likes it's boolean zero extended or sign extended."


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59864 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 07:24:01 +00:00
Chris Lattner
824b958e6f reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an
arbitrary integer width for the count.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59823 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 16:42:48 +00:00
Bill Wendling
dc770929cb Revert r59802. It was breaking the build of llvm-gcc:
g++ -m32 -c -g -DIN_GCC -W -Wall -Wwrite-strings -Wmissing-format-attribute -fno-common -mdynamic-no-pic -DHAVE_CONFIG_H -Wno-unused -DTARGET_NAME=\"i386-apple-darwin9.5.0\" -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include  -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DENABLE_LLVM -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/../llvm.src/include  -D_DEBUG  -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS   -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include  -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include ../../llvm-gcc.src/gcc/llvm-types.cpp -o llvm-types.o
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemCpy(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i64' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemMove(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i64' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemSet(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i64' is not a member of 'llvm::Intrinsic'
make[3]: *** [llvm-convert.o] Error 1
make[3]: *** Waiting for unfinished jobs....
rm fsf-funding.pod gcov.pod gfdl.pod cpp.pod gpl.pod gcc.pod
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59809 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 09:09:41 +00:00
Sanjiv Gupta
219ab405e6 Make mem[cpy,move,set] intrinsics overloaded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59802 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 07:49:09 +00:00
Dan Gohman
cddd428459 Add a flag to SDep for tracking which edges are anti-dependence edges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59785 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 02:27:52 +00:00
Bill Wendling
e1a6d160e5 Update comment to reflect a semblance of reality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59784 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 02:24:44 +00:00
Dan Gohman
98adea1149 Rename SDep's isSpecial to isArtificial, to make this field a little
less mysterious.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59782 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 02:18:56 +00:00
Bill Wendling
1c55a9c0cc Rename "ADDO" to "SADDO" and "UADDO". The "UADDO" isn't equivalent to "ADDC"
because the boolean it returns to indicate an overflow may not be treated like
as a flag. It could be stored to memory, for instance.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59780 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 02:12:42 +00:00
Bill Wendling
7cdc3c8ad2 Implement the sadd_with_overflow intrinsic. This is converted into
"ISD::ADDO". ISD::ADDO is lowered into a target-independent form that does the
addition and then checks if the result is less than one of the operands. (If it
is, then there was an overflow.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59779 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 02:03:52 +00:00
Bill Wendling
08c85d1209 Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59766 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 00:45:00 +00:00
Dan Gohman
c8c2827993 Implement ComputeLatency for MachineInstr ScheduleDAGs. Factor
some of the latency computation logic out of the SDNode
ScheduleDAG code into a TargetInstrItineraries helper method
to help with this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59761 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 00:12:10 +00:00
Bill Wendling
ea7b527aa5 Add UADDO and SADDO nodes. These will be used for determining an overflow
condition in an addition operation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59760 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 00:11:16 +00:00
Bill Wendling
e6ed6ecfb0 Introduce two new "add" intrinsics. These return the sum plus a bit indicating
that an overflow/carry occured. These are converted into ISD::[SU]ADDO nodes,
which are lowered in a target-independent way into something sane. Eventually,
each target can implement their own method of checking the overflow/carry flags.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59756 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 00:05:31 +00:00
Dan Gohman
eb3904bc25 Delete redundant inline keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59754 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 22:10:21 +00:00
Dan Gohman
33372a18c5 Doxygenate comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59753 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 22:09:52 +00:00
Bill Wendling
8449edf599 Reformatting. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59717 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 07:23:34 +00:00
Chris Lattner
0fbdfc3664 add an operator= to assign to smallstring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59715 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 07:09:17 +00:00
Evan Cheng
d37c13cfd1 - Register scavenger should use MachineRegisterInfo and internal map to find the first use of a register after a given machine instruction.
- When scavenging a register, in addition to the spill, insert a restore before the first use.
- Abort if client is looking to scavenge a register even when a previously scavenged register is still live.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59697 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 02:32:35 +00:00
Dan Gohman
a1e6d363e5 Factor out the code for verifying the work of the scheduler,
extend it a bit, and make use of it in all schedulers, to
ensure consistent checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59689 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 01:26:25 +00:00
Dan Gohman
343f0c0467 Experimental post-pass scheduling support. Post-pass scheduling
is currently off by default, and can be enabled with
-disable-post-RA-scheduler=false.

This doesn't have a significant impact on most code yet because it doesn't
yet do anything to address anti-dependencies and it doesn't attempt to
disambiguate memory references. Also, several popular targets
don't have pipeline descriptions yet.

The majority of the changes here are splitting the SelectionDAG-specific
code out of ScheduleDAG, so that ScheduleDAG can be moved to
libLLVMCodeGen.a. The interface between ScheduleDAG-using code and
the rest of the scheduling code is somewhat rough and will evolve.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59676 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 23:18:57 +00:00
Dan Gohman
7d1cd3f21d Move the code for printing a graph node label for an SUnit into
a virtual method of SelectionDAG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59667 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 22:09:45 +00:00
Dan Gohman
252ae9e8ae Convert SUnit's dump method into a print method and implement
dump in terms of it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59665 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 21:32:03 +00:00
Devang Patel
dfca407c79 Do not use separate utility to walk all instructions and remove dead dbg intrinsics. Let instcombiner do this job.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 19:01:37 +00:00
Sanjiv Gupta
021f3f252e Int type for PIC16 is i16. Added i16 intrinsics for memmove, memcpy and memset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59612 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 08:50:17 +00:00
Chris Lattner
16062ca93a add a write method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59595 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 06:45:06 +00:00
Daniel Dunbar
911cfdb7d7 LLVMC2: -emit-llvm stops compilation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59586 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 04:15:56 +00:00
Daniel Dunbar
ff6477b720 LLVMC2: Teach llvm_gcc_c tool about -include and -fsyntax-only.
- Only focusing on llvm_gcc_c for now, eventually this needs to be
   refactored so it can be shared via all the gcc-like tools.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59582 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 02:59:00 +00:00
Evan Cheng
01f63cdb04 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59558 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 22:27:13 +00:00
Devang Patel
f17fc461d1 Add new helper pass that strips all symbol names except debugging information.
This pass makes it easier to test wheter debugging info. influences optimization passes or not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59552 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 21:34:39 +00:00
Oscar Fuentes
56608780c3 CMake: Remove HAVE_LT_DLOPEN from config.h.cmake because it was
removed from config.h.in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59546 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 21:12:01 +00:00
Dan Gohman
cbad42cfd1 Add more const qualifiers. This fixes build breakage from r59540.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59542 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 19:49:32 +00:00
Dan Gohman
b3b930a011 Make some methods const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59540 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 19:04:29 +00:00
Dan Gohman
3dbc4e3502 Whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59532 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 17:05:42 +00:00
Bill Wendling
5734450d40 Rename stackprotector_create intrinsic to stackprotector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59519 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 11:01:33 +00:00
Nicolas Geoffray
67c8c4caba Implement support for JIT exceptions on X86_64. Relative offsets are
encoded on 32 bytes, and the personality function is not encoded as
relative.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59516 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 10:44:46 +00:00
Bill Wendling
733bbc5320 Remove the stackprotector_check intrinsic. Use a volatile load instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59504 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 07:30:57 +00:00
Dan Gohman
3cc6243ddf Change SUnit's dump method to take a ScheduleDAG* instead of
a SelectionDAG*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59488 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 02:06:40 +00:00
Dan Gohman
e45b6f10e2 There is no InstrStage class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59480 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 01:05:04 +00:00
Mikhail Glushenkov
35fde15059 Support dependencies between plugins by priority-sorting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59449 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 17:30:25 +00:00
Mikhail Glushenkov
010887765a Add a layer of indirection to make plugins more flexible.
Use strings instead of TableGen defs in the compilation graph
definition. Makes it easier for the plugins to modify an existing graph.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59447 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 17:29:18 +00:00
Zhongxing Xu
69e3bd10ec move partial template specialization to FoldingSet.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59434 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 02:40:00 +00:00
Zhongxing Xu
0cf717d6b8 Fix 80-col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59394 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:44:41 +00:00
Chris Lattner
a236c89ee3 add a new m_Specific pattern that matches only if we have a specific Value*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59393 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:38:30 +00:00
Chris Lattner
67abc10616 add a new template for matching a select between two constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59391 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:33:10 +00:00
Zhongxing Xu
f5b55475b3 Add partial specialization of FoldingSetTrait for ImmutableList.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59387 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:23:49 +00:00
Zhongxing Xu
2c228834fc Fix 80-column violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59385 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:14:33 +00:00
Nick Lewycky
ac44d25bdd Clean up some strange whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59373 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 20:32:33 +00:00
Zhongxing Xu
2ef5d4cd6a Add Profile method to ImmutableList.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59362 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 09:26:02 +00:00
Oscar Fuentes
50925fbed4 CMake: Adds header and TableGen files to Visual Studio solution. A new
dummy library, `llvm_headers_do_not_build', is created for containing
all header and TableGen files under include/llvm.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59346 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 02:08:08 +00:00
Oscar Fuentes
422fcf3837 CMake: Moved generation of Intrinsics.gen to
include/llvm/CMakeLists.txt. Does it with the `tablegen' cmake macro.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59342 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 00:24:38 +00:00
Dan Gohman
7e6a1bc0fa Add support for building a ScheduleDAG from MachineInstrs. This is currently
fairly conservative; it doesn't do alias-analysis queries and it doesn't
attempt to break anti-dependencies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59324 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 21:47:58 +00:00
Richard Osborne
1d8f975890 Add XCore intrinsics for getid (returns thread id) and bitrev (reverses
bits in a word).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59296 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 10:12:16 +00:00
Dan Gohman
59d5f1d13b Add a version of NewSUnit for creating units with MachineInstrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59282 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 00:41:36 +00:00
Dan Gohman
f449bf36ef Initial support for carrying MachineInstrs in SUnits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59278 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 00:06:09 +00:00
Dan Gohman
ae78a88e12 Clarify the comment about NumPreds and NumSuccs to reflect that they only
count non-control preds and succs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59276 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 23:41:41 +00:00
Dan Gohman
d23e0f81bc Remove the FlaggedNodes member from SUnit. Instead of requiring each SUnit
to carry a SmallVector of flagged nodes, just calculate the flagged nodes
dynamically when they are needed.

The local-liveness change is due to a trivial scheduling change where
the scheduler arbitrary decision differently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59273 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 23:24:17 +00:00
Dale Johannesen
330169fa3e Extend InlineAsm::C_Register to allow multiple specific registers
(actually, code already all worked, only the comment
changed).  Use this to implement 'A' constraint on x86.
Fixes PR 1779.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59266 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 21:52:36 +00:00
Dan Gohman
550f5afb68 Make the Node member of SUnit private, and add accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59264 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 21:36:12 +00:00
Dan Gohman
a23b3b803e Change ScheduleDAG's DAG member from a reference to a pointer, to prepare
for the possibility of scheduling without a SelectionDAG being present.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59263 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 21:21:28 +00:00
Bill Wendling
cdcc3e6e12 Modify the intrinsics pattern to separate out the "return" types from the
"parameter" types. An intrinsic can now return a multiple return values like
this:

  def add_with_overflow : Intrinsic<[llvm_i32_ty, llvm_i1_ty],
                                    [LLVMMatchType<0>, LLVMMatchType<0>]>;



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59237 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 09:08:33 +00:00
Daniel Dunbar
0d9eb9b491 Add Binary flag to raw_fd_ostream constructor.
Document raw_fd_ostream's treatment of "-".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59219 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 05:01:07 +00:00
Bill Wendling
e9e6bdf27f Implement stack protectors as function attributes: "ssp" and "sspreq".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59202 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 01:02:14 +00:00
Dan Gohman
7fc610f073 Revert the part of r59145 that changed the comment about
virtual registers possibly having multiple kills while still
being defined and killed in the same block. If LiveIntervals
is manually re-run after two-address lowering, it currently
does add extra kills to two-address instructions, but this
is considered a bug.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59194 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 23:24:15 +00:00
Dan Gohman
bc5cbb8be9 Move the code that inserts X87 FP_REG_KILL instructions from a
special-purpose hook to a new pass. Also, add check to see if any
x87 virtual registers are used, to avoid doing any work in the
common case that no x87 code is needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59190 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 22:55:05 +00:00
Dan Gohman
e8f4ac2b10 Update VarInfo's comments to reflect the current code. LiveVar
no longer records a unique defining instruction, and virtual
registers may have multiple kills while still being defined
and killed in the same block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59145 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 17:02:24 +00:00
Dan Gohman
4974b6aae1 Correct a function name in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 16:53:40 +00:00
Tanya Lattner
0a6b8fd44a Add ptr annotation intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59106 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 07:17:57 +00:00
Devang Patel
94b29c3eac Undo previous check-in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 23:57:33 +00:00
Devang Patel
90d45b8a4a Add utility pass to remove dbg info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59068 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 19:33:39 +00:00
Dan Gohman
9b75b37375 Change the scheduler accessor methods to accept an explicit TargetMachine
argument instead of taking the SelectionDAG's TargetMachine. This is
needed for some upcoming scheduler changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59055 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 17:50:47 +00:00
Mon P Wang
00ec49b6ba Cleaned up and fix bugs in convert_rndsat node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59025 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 05:40:06 +00:00
Devang Patel
780c38d84f Add utility routines to remove dead debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59011 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 00:53:02 +00:00
Mon P Wang
77cdf30742 Added CONVERT_RNDSAT (conversion with rounding and saturation) SDNode to
support targets that support these conversions. Users should avoid using
this node as the current targets don't generating code for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59001 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 20:54:11 +00:00
Duncan Sands
6959b2bb65 Small cleanups. No functionality change intended!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58992 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 17:29:56 +00:00
Duncan Sands
c04b6917c1 Work around PR1000.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58984 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 10:05:09 +00:00
Chris Lattner
886645a3c3 split out the functionality of utohexstr into a new utohex_buffer
helper.  This allows us to convert numbers to hex without necessarily
needing to make a std::string to hold the result.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58961 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 04:22:46 +00:00
Chris Lattner
497a7a81a8 Move getCastToEmpty out of DIDescriptor into DIFactory. It is an
implementation detail of DIFactory anyway, and this allows it to avoid
recomputing the same type over and over.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58960 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 04:10:34 +00:00
Chris Lattner
3b78185a18 Fix a bug with default arguments that apple gcc doesn't notice that llvmbb does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58958 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 03:11:39 +00:00
Chris Lattner
09e99e41aa move some cases around to silence these sorts of warnings in
release-asserts build:

llvm/CodeGen/SelectionDAGNodes.h:1298: warning: control may reach end of non-void function 'unsigned int llvm::MVT::getSizeInBits() const' being inlined

what an unhelpful warning.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58957 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 03:05:41 +00:00
Chris Lattner
a45664f709 Add a new set of helper classes for creating and reading debug
information.  This logically replaces the "Desc" classes in
MachineModuleInfo.  Nice features of these classes are that they:

1. Are much more efficient than MMI because they don't create a 
   temporary parallel data structure for debug info that has to be
   'serialized' and 'deserialized' into/out of the module.
2. These provide a much cleaner abstraction for debug info than 
   MMI, which will make it easier to change the implementation in 
   the future (to be MDNode-based).
3. These are much easier to use than the MMI interfaces, requiring
   a lot less code in the front-ends.
4. These can be used to both create (for frontends) and read (for
   codegen) debug information.  DebugInfoBuilder can only be used
   to create the nodes.

So far, this is implemented just enough to support the debug info
generation needs of clang.  This can and should be extended to 
support the full set of debug info constructs, and we should switch
llvm-gcc and llc over to using this in the near future.

This code also has a ton of FIXMEs in it, because the way we 
currently represent debug info in LLVM IR is basically insane in a
variety of details.  This sort of issue should be fixed when we
eventually reimplement debug info on top of MDNodes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58954 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 02:56:27 +00:00
Evan Cheng
9ed2f80910 Rename isGVNonLazyPtr to isIndirectSym to reflect how it will be used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58949 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 01:08:07 +00:00
Anton Korobeynikov
0b45c9957f Temporary revert my last commit: it seems it's triggering some subtle bug in backend
and breaks llvm-gcc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58926 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 23:05:05 +00:00
Anton Korobeynikov
0f56953567 Factor out offset printing code into generic AsmPrinter.
FIXME: it seems, that most of targets don't support
offsets wrt CPI/GlobalAddress', was it intentional?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58917 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 17:21:38 +00:00
Evan Cheng
ce4a70bd76 Rename startFunctionStub to startGVStub since it's also used for GV non-lazy ptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58897 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 08:02:53 +00:00
Evan Cheng
d7398c9b69 Rename isString -> isExternalSymbol; getString -> getExternalSymbol since these work on externsym machine relocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58895 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 07:37:34 +00:00
Daniel Dunbar
77e0c85dcc Add LLVMC2 tool definitions for Objective-C and Objective-C++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58885 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 03:25:47 +00:00
Evan Cheng
fd827c41ce Indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58881 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 01:30:20 +00:00
Duncan Sands
47b3417cf0 Sign-extend rather than zero-extend when promoting
the condition for a BRCOND, according to what is
returned by getSetCCResultContents.  Since all
targets return the same thing (ZeroOrOneSetCCResult),
this should be harmless!  The point is that all over
the place the result of SETCC is fed directly into
BRCOND.  On machines for which getSetCCResultContents
returns ZeroOrNegativeOneSetCCResult, this is a
sign-extended boolean.  So it seems dangerous to
also feed BRCOND zero-extended booleans in some
circumstances - for example, when promoting the
condition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58861 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 20:13:04 +00:00
Evan Cheng
47c01a0099 Jump tables may be emitted by target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58835 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 09:02:17 +00:00
Evan Cheng
a27b3532e2 Jump table relocation addresses may be resolved by target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58834 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 09:01:15 +00:00
Bill Wendling
b7c6ebcb47 - Modify the stack protector algorithm so that the stack slot is allocated in
LLVM IR code and not in the selection DAG ISel. This is a cleaner solution.

- Fix the heuristic for determining if protectors are necessary. The previous
  one wasn't checking the proper type size.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58824 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 01:23:58 +00:00
Bill Wendling
4c3a1d8d2b - Rename stackprotector_{prologue,epilogue} to stackprotector_{create,check}.
- Get rid of "HasStackProtector" in MachineFrameInfo.
- Modify intrinsics to tell which are doing what with memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58799 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 07:23:03 +00:00
Bill Wendling
b2a4298ce4 Implement the stack protector stack accesses via intrinsics:
- stackprotector_prologue creates a stack object and stores the guard there.

- stackprotector_epilogue reads the stack guard from the stack position created
  by stackprotector_prologue.

- The PrologEpilogInserter was changed to make sure that the stack guard is
  first on the stack frame.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58791 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 02:29:10 +00:00
Dan Gohman
33a9cb4f40 Make ISel ignore dead nodes. The DAGCombiner normally eliminates
dead nodes, but in this case its missing one. Fixing the DAGCombiner
is desirable, but it's somewhat involved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58777 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 22:56:47 +00:00
Andrew Lenharth
8ad0919786 opt was not exporting the Mangler symbols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58775 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 22:42:50 +00:00
Dan Gohman
fbcb52afdf The HadDelete field is no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58761 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 17:35:14 +00:00
Dan Gohman
695ea6e57e Update some comments to reflect the new code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58759 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 17:13:57 +00:00
Dan Gohman
8be6bbe5bf Eliminate the ISel priority queue, which used the topological order for a
priority function. Instead, just iterate over the AllNodes list, which is
already in topological order. This eliminates a fair amount of bookkeeping,
and speeds up the isel phase by about 15% on many testcases.

The impact on most targets is that AddToISelQueue calls can be simply removed.

In the x86 target, there are two additional notable changes.

The rule-bending AND+SHIFT optimization in MatchAddress that creates new
pre-isel nodes during isel is now a little more verbose, but more robust.
Instead of either creating an invalid DAG or creating an invalid topological
sort, as it has historically done, it can now just insert the new nodes into
the node list at a position where they will be consistent with the topological
ordering.

Also, the address-matching code has logic that checked to see if a node was
"already selected". However, when a node is selected, it has all its uses
taken away via ReplaceAllUsesWith or equivalent, so it won't recieve any
further visits from MatchAddress. This code is now removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58748 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 04:14:16 +00:00
Evan Cheng
c96a8e7df1 Rename isGVLazyPtr to isGVNonLazyPtr relocation. This represents Mac OS X
indirect gv reference. Please don't call it lazy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58746 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 01:50:32 +00:00
Devang Patel
b7c6bf1e07 Do now allow InlineAlways pass to remove dead functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58744 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 01:39:16 +00:00
Dan Gohman
8f027c7fea Add a new pass to simplify specific half_powr function calls. This is
a specialized pass that it not likely to be generally useful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58732 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 23:41:45 +00:00
Bill Wendling
b7c2c1246f - Add a "getOrInsertGlobal" method to the Module class. This acts similarly to
"getOrInsertFunction" in that it either adds a new declaration of the global
  and returns it, or returns the current one -- optionally casting it to the
  correct type.
- Use the new getOrInsertGlobal in the stack protector code.
- Use "splitBasicBlock" in the stack protector code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58727 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 22:51:24 +00:00
Bill Wendling
80a320d974 Update in response to feedback from Chris:
- Use enums instead of magic numbers.

- Rework algorithm to use the bytes size from the target to determine when to
  emit stack protectors.

- Get rid of "propolice" in any comments.

- Renamed an option to its expanded form.

- Other miscellanenous changes.

More changes will come after this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58723 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 21:53:09 +00:00
Evan Cheng
b0b53491ef For some targets, it's not possible to place GVs in the same memory buffer as the MachineCodeEmitter allocated memory. Code and data has different read / write / execution privilege requirements.
This is a short term workaround. The current solution is for the JIT memory manager to manage code and data memory separately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58688 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 09:30:48 +00:00
Bill Wendling
2b58ce5ab4 Initial checkin for stack protectors. Here's what it does:
* The prologue is modified to read the __stack_chk_guard global and insert it
  onto the stack.

* The epilogue is modified to read the stored guard from the stack and compare
  it to the original __stack_chk_guard value. If they differ, then the
  __stack_chk_fail() function is called.

* The stack protector needs to be first on the stack (after the parameters) to
  catch any stack-smashing activities.

Front-end support will follow after a round of beta testing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58673 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 02:10:20 +00:00
Dan Gohman
b593117b44 Add C bindings for extractvalue and insertvalue. Patch by Frits van Bommel!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58650 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 22:55:43 +00:00
Dan Gohman
20cd13f54f Overload AddInteger on int/long/long long instead of on int/int64_t,
to avoid overload ambiguities. This fixes build errors introduced
by r58623.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58632 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 19:40:18 +00:00
Dan Gohman
8f092252d3 Refactor various TargetAsmInfo subclasses' TargetMachine members away
adding a TargetMachine member to the base TargetAsmInfo class instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58624 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 18:22:42 +00:00
Dan Gohman
3a5797d946 Change how extended types are represented in MVTs. Instead of fiddling
bits, use a union of a SimpleValueType enum and a regular Type*.

This increases the size of MVT on 64-bit hosts from 32 bits to 64 bits.
In most cases, this doesn't add significant overhead. There are places
in codegen that use arrays of MVTs, so these are now larger, but
they're small in common cases.

This eliminates restrictions on the size of integer types and vector
types that can be represented in codegen. As the included testcase
demonstrates, it's now possible to codegen very large add operations.
There are still some complications with using very large types. PR2880
is still open so they can't be used as return values on normal targets,
there are no libcalls defined for very large integers so operations
like multiply and divide aren't supported.

This also introduces a minimal tablgen Type library, capable of
handling IntegerType and VectorType. This will allow parts of
TableGen that don't depend on using SimpleValueType values to handle
arbitrary integer and vector types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58623 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 17:56:27 +00:00
Dan Gohman
958fdf07b5 Remove redundant inline keywords from functions defined within
class definitions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58620 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 17:10:24 +00:00
Nick Lewycky
b90c37f64c Typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58594 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 03:50:40 +00:00
Nick Lewycky
579a024661 Add a new MergeFunctions pass. It finds identical functions and merges them.
This triggers only 60 times in llvm-test (look at .llvm.bc, not .linked.rbc)
and so it probably wont be turned on by default. Also, may of those are likely
to go away when PR2973 is fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58557 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-02 05:52:50 +00:00
Mon P Wang
3efcd4a65c Added interface to allow clients to create a MemIntrinsicNode for
target intrinsics that touches memory


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58548 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-01 20:24:53 +00:00
Anton Korobeynikov
476527a19d Symbol visibility is unsupported on cygwin too.
Patch by Jay Foad!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58520 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 18:05:01 +00:00