Commit Graph

8490 Commits

Author SHA1 Message Date
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
Duncan Sands
7af1c78b98 Allow readonly functions to unwind exceptions. Teach
the optimizers about this.  For example, a readonly
function with no uses cannot be removed unless it is
also marked nounwind.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71071 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 06:49:50 +00:00
Evan Cheng
8f18edd8b6 Quotes should be printed before private prefix; some code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71032 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 22:50:29 +00:00
Bill Wendling
16de013640 Add dump method to DIDescriptor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71028 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 22:19:25 +00:00
Dan Gohman
ff9977f8cd Add an explicit keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71022 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 21:23:20 +00:00
Evan Cheng
8c87ae229c Forgot this in the last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 20:54:11 +00:00
Evan Cheng
d923fc621f Move getInstrOperandRegClass from the scheduler to TargetInstrInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70950 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 00:30:09 +00:00
Dan Gohman
35738ac150 Re-apply 70645, converting ScalarEvolution to use
CallbackVH, with fixes. allUsesReplacedWith need to
walk the def-use chains and invalidate all users of a
value that is replaced. SCEVs of users need to be
recalcualted even if the new value is equivalent. Also,
make forgetLoopPHIs walk def-use chains, since any
SCEV that depends on a PHI should be recalculated when
more information about that PHI becomes available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70927 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 22:30:44 +00:00
Chris Lattner
af29a5235d Make DBG_STOPPOINT nodes, and therefore DBG_LABEL labels, get a DebugLoc, so that it
shows up in -print-machineinstrs.  This doesn't appear to affect anything, but it was
weird for some DBG_LABELs to have DebugLocs but not all of them.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 22:10:05 +00:00
Mike Stump
fe095f39e7 Restore minor deletion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70892 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 18:40:41 +00:00
Evan Cheng
c781a243a3 In some rare cases, the register allocator can spill registers but end up not utilizing registers at all. The fundamental problem is linearscan's backtracking can end up freeing more than one allocated registers. However, reloads and restores might be folded into uses / defs and freed registers might not be used at all.
VirtRegMap keeps track of allocations so it knows what's not used. As a horrible hack, the stack coloring can color spill slots with *free* registers. That is, it replace reload and spills with copies from and to the free register. It unfold instructions that load and store the spill slot and replace them with register using variants.

Not yet enabled. This is part 1. More coming.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70787 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 18:32:42 +00:00
Anton Korobeynikov
813090cf89 Properly handle sdiv / udiv / srem / urem libcalls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70764 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 13:18:16 +00:00
Argyrios Kyrtzidis
77eaa6880b -Move the DwarfWriter::ValidDebugInfo check to a static DIDescriptor::ValidDebugInfo
-Create DebugLocs without the need to have a DwarfWriter around


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70682 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 08:50:41 +00:00
Dan Gohman
f9a77b77c2 Revert r70645 for now; it's causing a variety of regressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70661 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 05:46:20 +00:00
Dan Gohman
db6fa29641 Convert ScalarEvolution to use CallbackVH for its internal map. This
makes ScalarEvolution::deleteValueFromRecords, and it's code that
subtly needed to be called before ReplaceAllUsesWith, unnecessary.

It also makes ValueDeletionListener unnecessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70645 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02 21:19:20 +00:00
Dan Gohman
c09b12c622 Apply Jeffrey Yasskin's CallbackVH patch, with minor tweaks from me
to make the copy constructor and destructor protected, and corresponding
adjustments to the unittests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70644 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02 21:10:48 +00:00
Dan Gohman
42da7f7542 Include <limits.h> to get the definition of CHAR_BIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70643 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02 21:03:21 +00:00
Dan Gohman
afc36a9520 Previously, RecursivelyDeleteDeadInstructions provided an option
of returning a list of pointers to Values that are deleted. This was
unsafe, because the pointers in the list are, by nature of what
RecursivelyDeleteDeadInstructions does, always dangling. Replace this
with a simple callback mechanism. This may eventually be removed if
all clients can reasonably be expected to use CallbackVH.

Use this to factor out the dead-phi-cycle-elimination code from LSR
utility function, and generalize it to use the
RecursivelyDeleteTriviallyDeadInstructions utility function.

This makes LSR more aggressive about eliminating dead PHI cycles;
adjust tests to either be less trivial or to simply expect fewer
instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02 18:29:22 +00:00
Dan Gohman
fb7d35f22a When ScalarEvolution is told to forget the trip count for a loop, have
it also forget any SCEVs associated with loop-header PHIs in the loop,
as they may be dependent on trip count information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70633 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02 17:43:35 +00:00
Chris Lattner
837e59e2e8 Drop the default assumption about alignment down to 2 bits from 3. This apparently
helps some problems on win32 platforms (PR4119)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70603 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-01 23:48:33 +00:00
Stuart Hastings
f0e4cac7eb Prevent looping when DenseSet is abused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70572 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-01 20:47:53 +00:00
Dan Gohman
cf5ab82022 Actually insert inserted instructions into the InsertedValues map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70557 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-01 17:13:31 +00:00
Dan Gohman
b52e1c587f Add an accessor method to allow clients to test if a given expression
is associated with a SCEV expansion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70556 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-01 17:08:34 +00:00
Dan Gohman
99a1302ae4 Make SCEVExpander::addInsertedValue able to accept Values, not just
Instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70552 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-01 16:58:31 +00:00
Argyrios Kyrtzidis
9eddfd3687 Fix compilation for some targets other than x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70522 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 23:50:26 +00:00
Stefanus Du Toit
c26672a2d2 Add a comment to refer to the section of the programmer's manual that explains what the pointer tagging in Use is for.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 23:28:50 +00:00
Argyrios Kyrtzidis
a26eae64dd Make DebugLoc independent of DwarfWriter.
-Replace DebugLocTuple's Source ID with CompileUnit's GlobalVariable*
-Remove DwarfWriter::getOrCreateSourceID
-Make necessary changes for the above (fix callsites, etc.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70520 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 23:22:31 +00:00
Jeffrey Yasskin
714257f5de Add a mention of TypeBuilder to the programmer's manual, and clean up the class
comment a bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70515 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 22:33:41 +00:00
Jakob Stoklund Olesen
ba67d87fe4 getCommonSubClass() - Calculate the largest common sub-class of two register
classes.

This is implemented as a function rather than a method on TargetRegisterClass
because it is symmetric in its arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70512 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 21:23:32 +00:00
Dan Gohman
3d739fe375 Add some comments, and tidy up some whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70510 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 20:48:53 +00:00
Dan Gohman
a1af757e0a Extend ScalarEvolution's getBackedgeTakenCount to be able to
compute an upper-bound value for the trip count, in addition to
the actual trip count. Use this to allow getZeroExtendExpr and
getSignExtendExpr to fold casts in more cases.

This may eventually morph into a more general value-range
analysis capability; there are certainly plenty of places where
more complete value-range information would allow more folding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70509 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 20:47:05 +00:00
Torok Edwin
7f09dd2f63 Make dataflow iteration possible on Value*, not only on User*: df_ext_iterator<Value*, SmallPtrSet<const Value*, 16> >
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70496 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 17:09:22 +00:00
Jay Foad
4e5ea553d0 Move helper functions for optimizing division by constant into the APInt
class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70488 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 10:15:35 +00:00
Bill Wendling
581b93415e Remove unused flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70459 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 00:57:51 +00:00
Bill Wendling
b8cb0bb08c Remove LTO optimization level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70445 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 23:40:42 +00:00
Bill Wendling
98a366d547 Instead of passing in an unsigned value for the optimization level, use an enum,
which better identifies what the optimization is doing. And is more flexible for
future uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70440 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 23:29:43 +00:00
Bill Wendling
b587f9662a Add support for a character after a command line option. Like '-Os'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 23:26:16 +00:00
Jakob Stoklund Olesen
ce9be2cf5d MachineInstr::isRegTiedTo{Use,Def}Operand can safely be made const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 20:57:16 +00:00
Nate Begeman
a641575828 Update comment, replace theoretically impossible check with an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70391 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 18:13:31 +00:00
Sanjiv Gupta
b27fa0afe2 Add directive to declare external globals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 08:23:18 +00:00
Nate Begeman
5a5ca1519e Implement review feedback for vector shuffle work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70372 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 05:20:52 +00:00
Sanjiv Gupta
a3518a1d6a Add a public method called getAddressSpace() to the GlobalAddressSDNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70366 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 04:43:24 +00:00
Dan Gohman
1e59aa1332 Add some more doxygen comments to SCEVAddRec.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70354 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 00:59:03 +00:00
Bill Wendling
5e5cb7985d The second part of the change from -fast to -O#. This changes the JIT to accept
an optimization level instead of a simple boolean telling it to generate code
"fast" or the other type of "fast".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70347 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 00:32:19 +00:00
Bill Wendling
be8cc2a3de Second attempt:
Massive check in. This changes the "-fast" flag to "-O#" in llc. If you want to
use the old behavior, the flag is -O0. This change allows for finer-grained
control over which optimizations are run at different -O levels.

Most of this work was pretty mechanical. The majority of the fixes came from
verifying that a "fast" variable wasn't used anymore. The JIT still uses a
"Fast" flag. I'll change the JIT with a follow-up patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 00:15:41 +00:00
Bill Wendling
a24d1b1558 Correct comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70340 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 00:09:22 +00:00
Evan Cheng
8a8a0dfc3b Move getMatchingSuperReg() out of coalescer and into TargetRegisterInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70309 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 18:29:27 +00:00
Sanjiv Gupta
d3d965714b Initialized arrays can be in any address space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70297 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 16:34:20 +00:00
Jakob Stoklund Olesen
fa4677b483 Move getSubRegisterRegClass from ScheduleDagSDNodesEmit.cpp to a TargetRegisterClass method.
Also make the method non-asserting. It will return NULL when given an invalid subreg index.

The method is needed by an upcoming patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70296 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 16:34:09 +00:00
Bill Wendling
c69d56f115 r70270 isn't ready yet. Back this out. Sorry for the noise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70275 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 01:04:53 +00:00
Bill Wendling
2e9d5f912a Massive check in. This changes the "-fast" flag to "-O#" in llc. If you want to
use the old behavior, the flag is -O0. This change allows for finer-grained
control over which optimizations are run at different -O levels.

Most of this work was pretty mechanical. The majority of the fixes came from
verifying that a "fast" variable wasn't used anymore. The JIT still uses a
"Fast" flag. I'm not 100% sure if it's necessary to change it there...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70270 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 00:21:31 +00:00
Jeffrey Yasskin
487fa01673 Add tests for WeakVH and AssertingVH. These pointed out that the overloads for
the comparison operators were not only unnecessary in the presence of the
implicit conversion; they caused ambiguous overload errors. So I deleted them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70243 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 20:32:07 +00:00
Chris Lattner
0370cc6399 give bitstreamreader an API to ignore names for blocks/records,
only llvm-bcanalyzer wants this info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70239 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 20:04:08 +00:00
Nate Begeman
9008ca6b6b 2nd attempt, fixing SSE4.1 issues and implementing feedback from duncan.
PR2957

ISD::VECTOR_SHUFFLE now stores an array of integers representing the shuffle
mask internal to the node, rather than taking a BUILD_VECTOR of ConstantSDNodes
as the shuffle mask.  A value of -1 represents UNDEF.

In addition to eliminating the creation of illegal BUILD_VECTORS just to 
represent shuffle masks, we are better about canonicalizing the shuffle mask,
resulting in substantially better code for some classes of shuffles.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70225 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 18:41:29 +00:00
Chris Lattner
f9a3ec86c1 Add two new record types to the blockinfo block:
BLOCKNAME and SETRECORDNAME.  This allows a bitcode
file to be self describing with pretty names for 
records and blocks in addition to numbers.  This
enhances llvm-bcanalyzer to use this to print prettily.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70165 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26 22:21:57 +00:00
Chris Lattner
7919b966a8 make BitstreamCursor's copyable and assignable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70159 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26 21:07:02 +00:00
Chris Lattner
962dde3cef Make a major API change to BitstreamReader: split all the reading
state out of the BitstreamReader class into a BitstreamCursor class.
Doing this allows the client to have multiple cursors into the same
file, each with potentially different live block stacks and
abbreviation records.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70157 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26 20:59:02 +00:00
Bill Wendling
3485d25a0e I cast, therefore I think I know what I'm doing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70151 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26 20:12:38 +00:00
Bill Wendling
b14a495c36 Use uint64_t instead of unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70148 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26 19:46:41 +00:00