Commit Graph

8564 Commits

Author SHA1 Message Date
Owen Anderson
ca37b511fa Factor out some common code, fix more typoes, and add a memory fence that might be needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71853 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15 08:22:07 +00:00
Owen Anderson
d300a28c40 Fix an unfortunate typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71852 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15 08:07:23 +00:00
Owen Anderson
8064c8b86d (Hopefully) unbreak Apple-style builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15 06:49:31 +00:00
Owen Anderson
8060424c40 Don't #include OSAtomic.h unless we really need it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71837 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15 05:13:57 +00:00
Owen Anderson
5f00b0c5b6 Now with working on Leopard!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71819 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15 00:01:40 +00:00
Owen Anderson
94555c2846 Dropped this #include by accident.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 21:33:57 +00:00
Owen Anderson
87ba22dc67 Make ManagedStatic threadsafe by using atomic operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71796 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 21:26:50 +00:00
Owen Anderson
9693813080 Add CompareAndSwap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71795 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 21:24:15 +00:00
Bill Wendling
dc817b6f42 Non-functionality changes:
- Reformatting.
- Use while() instead of do-while().
- Move simple constructors into .h file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71782 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 18:26:15 +00:00
Owen Anderson
c082324e19 Add an Atomic.h to the System library, for providing a platform independent API
to low-level sync operations.

The only one present at the moment is MemoryFence(), and only for the platforms
for which I could easily discern the proper way to do it.  If your favorite platform
isn't represented, patches are welcome!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71770 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 05:54:36 +00:00
Jim Grosbach
f957012866 Update the names of the exception handling sjlj instrinsics to
llvm.eh.sjlj.* for better clarity as to their purpose and scope. Add
a description of llvm.eh.sjlj.setjmp to ExceptionHandling.html.
(llvm.eh.sjlj.longjmp documentation coming when that implementation is
added).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71758 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 00:46:35 +00:00
Jim Grosbach
2afb3b7251 Removing the HasBuiltinSetjmp flag and associated bits. Flagging the presence
of exception handling builtin sjlj targets in functions turns out not to 
be necessary. Marking the intrinsic implementation in the .td file as 
defining all registers is sufficient to get the context saved properly by 
the containing function.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71743 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 23:50:53 +00:00
Evan Cheng
6ebf7bc740 Run code placement optimization for targets that want it (arm and x86 for now).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 21:42:09 +00:00
Evan Cheng
be1be5ef0d Indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71724 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 21:39:20 +00:00
Bill Wendling
587daedce2 Change MachineInstrBuilder::addReg() to take a flag instead of a list of
booleans. This gives a better indication of what the "addReg()" is
doing. Remembering what all of those booleans mean isn't easy, especially if you
aren't spending all of your time in that code.

I took Jakob's suggestion and made it illegal to pass in "true" for the
flag. This should hopefully prevent any unintended misuse of this (by reverting
to the old way of using addReg()).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71722 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 21:33:08 +00:00
Dan Gohman
467c430316 Add three new helper routines, getNoopOrZeroExtend,
getNoopOrSignExtend, and getTruncateOrNoop. These are similar
to getTruncateOrZeroExtend etc., except that they assert that
the conversion is either not widening or narrowing, as
appropriate. These will be used in some upcoming fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71632 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 03:46:30 +00:00
Dale Johannesen
7b9486ad43 Add an int64_t variant of abs, for host environments
without one.  Use it where we were using abs on
int64_t objects.
(I strongly suspect the casts to unsigned in the
fragments in LoopStrengthReduce are not doing whatever
the original intent was, but the obvious change to
uint64_t doesn't work.  Maybe later.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71612 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 00:24:22 +00:00
Jim Grosbach
0e0da734bb Add support for GCC compatible builtin setjmp and longjmp intrinsics. This is
a supporting preliminary patch for GCC-compatible SjLJ exception handling. Note that these intrinsics are not designed to be invoked directly by the user, but
rather used by the front-end as target hooks for exception handling.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71610 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12 23:59:14 +00:00
Bill Wendling
b877a1f545 More MSVC fixes -- class/struct conflicts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71601 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12 21:55:29 +00:00
Bill Wendling
13bb81addf Use struct instead of class to make MCVS compile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71600 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12 21:50:43 +00:00
Dan Gohman
f46ef0450f Clarify a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71561 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12 17:08:34 +00:00
Dan Gohman
81db61a2e6 Factor the code for collecting IV users out of LSR into an IVUsers class,
and generalize it so that it can be used by IndVarSimplify. Implement the
base IndVarSimplify transformation code using IVUsers. This removes
TestOrigIVForWrap and associated code, as ScalarEvolution now has enough
builtin overflow detection and folding logic to handle all the same cases,
and more. Run "opt -iv-users -analyze -disable-output" on your favorite
loop for an example of what IVUsers does.

This lets IndVarSimplify eliminate IV casts and compute trip counts in
more cases. Also, this happens to finally fix the remaining testcases
in PR1301.

Now that IndVarSimplify is being more aggressive, it occasionally runs
into the problem where ScalarEvolutionExpander's code for avoiding
duplicate expansions makes it difficult to ensure that all expanded
instructions dominate all the instructions that will use them. As a
temporary measure, IndVarSimplify now uses a FixUsesBeforeDefs function
to fix up instructions inserted by SCEVExpander. Fortunately, this code
is contained, and can be easily removed once a more comprehensive
solution is available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71535 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12 02:17:14 +00:00
Mike Stump
6dc4ade595 Add DW_AT_APPLE_isa and DW_AT_APPLE_block. Radar 6867696
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71479 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 21:58:01 +00:00
Jay Foad
8d730fbde5 Don't #include DerivedTypes.h from TargetData.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71468 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 19:38:09 +00:00
Dan Gohman
20b7ca1eb9 Add a comment about the special meaning of VoidTy in this context.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71466 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 19:11:53 +00:00
Douglas Gregor
01746745f1 Add terminal width detection to llvm::sys::Process. This is needed to
fix Clang PRs 4148 and 4183.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 18:05:52 +00:00
John Mosby
b9cfbd94ab Shrink wrapping in PEI:
- reduces _static_ callee saved register spills
  and restores similar to Chow's original algorithm.
- iterative implementation with simple heuristic
  limits to mitigate compile time impact.
- handles placing spills/restores for multi-entry,
  multi-exit regions in the Machine CFG without
  splitting edges.
- passes test-suite in LLCBETA mode.

Added contains() method to ADT/SparseBitVector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71438 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 17:04:19 +00:00
Jay Foad
7524b59062 Change TargetData::getIntPtrType() to return an IntegerType instead of
just a Type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71426 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 11:13:47 +00:00
Bill Wendling
26e2de135c Needed #includes. Thanks Fritz van Bommel!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71413 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-10 23:27:41 +00:00
Nick Lewycky
cb33799b9f Make MDNode use CallbackVH. Also change MDNode to store Value* instead of
Constant* in preperation of a future change to support holding non-Constants
in an MDNode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-10 20:57:05 +00:00
Duncan Sands
777d2306b3 Rename PaddedSize to AllocSize, in the hope that this
will make it more obvious what it represents, and stop
it being confused with the StoreSize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71349 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 07:06:46 +00:00
Dan Gohman
fb79160811 Fix another bug in r71252. This code supports GetElementPtr
constant exprs as well as instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71262 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 20:58:38 +00:00
Dan Gohman
6bce643c36 Add memoization for getSCEVAtScope results for instructions
which are not analyzed with SCEV techniques, which can require
brute-forcing through a large number of instructions. This
fixes a massive compile-time issue on 400.perlbench (in
particular, the loop in MD5Transform).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71259 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 20:47:27 +00:00
Dan Gohman
66a7e857aa Make the SCEV* form of getSCEVAtScope public, to allow ScalarEvolution
clients to use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71258 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 20:38:54 +00:00
Dan Gohman
26466c0eb3 Factor out the code for creating SCEVs for GEPs into a
separate function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71252 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 20:26:55 +00:00
Dan Gohman
1827e8263c Add a getExitBlock utility function to LoopInfo which returns the
exit block of a loop, if there is exactly one, similar to
getExitingBlock.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71245 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 20:07:23 +00:00
Anton Korobeynikov
c1c6ef8f74 Factor out cycle-finder code and make it generic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 18:51:58 +00:00
Duncan Sands
2a6e0a2140 Add some examples to show the difference between
the various notions of type size used in LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71230 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 17:49:48 +00:00
Dan Gohman
9a38e3e399 Revert 71165. It did more than just revert 71158 and it introduced
several regressions. The problem due to 71158 is now fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 19:46:24 +00:00
Bill Wendling
5b8479c385 Temporarily revert r71158. It was causing a failure during a full bootstrap:
checking for bcopy... no
checking for getc_unlocked... Assertion failed: (0 && "Unknown SCEV kind!"), function operator(), file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/Analysis/ScalarEvolution.cpp, line 511.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/libdecnumber/decUtility.c:360: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[4]: *** [decUtility.o] Error 1
make[4]: *** Waiting for unfinished jobs....
Assertion failed: (0 && "Unknown SCEV kind!"), function operator(), file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/Analysis/ScalarEvolution.cpp, line 511.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/libdecnumber/decNumber.c:5591: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[4]: *** [decNumber.o] Error 1
make[3]: *** [all-stage2-libdecnumber] Error 2
make[3]: *** Waiting for unfinished jobs....



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71165 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 17:26:14 +00:00
Dan Gohman
ecb403a9d3 Factor out a common base class between SCEVCommutativeExpr and
SCEVAddRecExpr. This eliminates redundant code for visiting
all the operands of an expression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71157 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 14:00:19 +00:00
Argyrios Kyrtzidis
cd76240f3d Move the tablegen-produced DebugLoc handling into a AsmWriter::processDebugLoc function.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 13:55:51 +00:00
Evan Cheng
bbf1db7213 Rename "loop aligner" pass to "code placement optimization" pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71150 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 05:42:24 +00:00
Jakob Stoklund Olesen
20683f9480 Add const modifiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71147 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 04:41:26 +00:00
Bill Wendling
2c1d7726f2 Just turn aggressive stack coloring off at -O3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71140 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 01:33:38 +00:00
Bill Wendling
d0c1f9c932 Temporarily revert r71010. It was causing massive failures during self-hosting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 01:27:25 +00:00
Argyrios Kyrtzidis
116b27444a Make DwarfWriter::RecordInlinedFnStart more like the other DwarfWriter's methods:
-Have it return a label ID
-Remove the unused Instruction parameter

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71132 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 00:16:31 +00:00
Dan Gohman
0ec4146db7 Add simplify_type specializations to allow WeakVH, AssertingVH, and
CallbackVH to participate in dyn_cast, isa, etc. without needing
an explicit conversion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 17:12:48 +00:00
Oscar Fuentes
d413c01088 CMake: Detects libpthread and sets HAVE_LIBPTHREAD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71084 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 14:40:37 +00:00
Oscar Fuentes
ec8b2a9530 CMake: Added cmakedefine for HAVE_PTHREAD_H.
Patch by Robert Schuster!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71083 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 14:27:59 +00:00