Commit Graph

8400 Commits

Author SHA1 Message Date
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