Commit Graph

8081 Commits

Author SHA1 Message Date
Evan Cheng 161861deb0 Strengthen the "non-constant stride must dominate loop preheader" check.
llvm-svn: 64703
2009-02-17 00:13:06 +00:00
Daniel Dunbar eaebae55db Add llvm::RoundUpToAlignment.
- No functionality change.

llvm-svn: 64691
2009-02-16 22:57:04 +00:00
Ted Kremenek 772e6f3c93 Fix bug where APSInt::operator-- incremented instead of decremented.
llvm-svn: 64687
2009-02-16 22:39:08 +00:00
Mikhail Glushenkov e68b888550 80-column violation.
llvm-svn: 64586
2009-02-15 11:32:31 +00:00
Cedric Venet b8aa2ea72a Add mode_t to the config.h generated by cmake on win32. Used by clang.
llvm-svn: 64555
2009-02-14 16:13:26 +00:00
Cedric Venet d1e179d992 Unbreak the build on win32.
Cleanup some warning.

Remark: when struct/class are declared differently than they are defined, this make problem for VC++ since it seems to mangle class differently that struct. These error are very hard to understand and find. So please, try to keep your definition/declaration in sync.

Only tested with VS2008. hope it does not break anything. feel free to revert.

llvm-svn: 64554
2009-02-14 16:06:42 +00:00
Mikhail Glushenkov 0575bfdeaa 80-column violation.
llvm-svn: 64550
2009-02-14 08:41:25 +00:00
Duncan Sands 1ba13931b6 The trampoline intrinsic can be marked IntrWriteArgMem,
now that this no longer implies nocapture.

llvm-svn: 64540
2009-02-14 05:33:26 +00:00
Duncan Sands 809d9167da IntrWriteArgMem implies nocapture, but this wasn't
taken advantage of anywhere.  Change the definition
of IntrWriteArgMem to no longer imply nocapture, and
explicitly add nocapture attributes everywhere (well,
not quite everywhere, because some of these intrinsics
did capture their arguments!).  Also, make clear that
the lack of other side-effects does not exclude doing
volatile loads or stores - the atomic intrinsics do
these, yet they are all marked IntrWriteArgMem (this
change is safe because nothing exploited it).

llvm-svn: 64539
2009-02-14 05:16:25 +00:00
Duncan Sands a738e8b854 Correct a comment: since AccessArguments is now
being used for atomic intrinsics, it seems the
access may be volatile.  No code was exploiting
the original non-volatile definition, so only
the comment needs changing.

llvm-svn: 64464
2009-02-13 17:36:13 +00:00
Dale Johannesen 026b56a9bc Remove non-DebugLoc versions of BuildMI.
"I got blisters on my fingers."

llvm-svn: 64439
2009-02-13 02:35:20 +00:00
Dale Johannesen 6b8c76a910 Eliminate a couple of non-DebugLoc BuildMI variants.
Modify callers.

llvm-svn: 64409
2009-02-12 23:08:38 +00:00
Dan Gohman eb6be650ce Teach IndVarSimplify to optimize code using the C "int" type for
loop induction on LP64 targets. When the induction variable is
used in addressing, IndVars now is usually able to inserst a
64-bit induction variable and eliminates the sign-extending cast.
This is also useful for code using C "short" types for
induction variables on targets with 32-bit addressing.

Inserting a wider induction variable is easy; the tricky part is
determining when trunc(sext(i)) expressions are no-ops. This
requires range analysis of the loop trip count. A common case is
when the original loop iteration starts at 0 and exits when the
induction variable is signed-less-than a fixed value; this case
is now handled.

This replaces IndVarSimplify's OptimizeCanonicalIVType. It was
doing the same optimization, but it was limited to loops with
constant trip counts, because it was running after the loop
rewrite, and the information about the original induction
variable is lost by that point.

Rename ScalarEvolution's executesAtLeastOnce to
isLoopGuardedByCond, generalize it to be able to test for
ICMP_NE conditions, and move it to be a public function so that
IndVars can use it.

llvm-svn: 64407
2009-02-12 22:19:27 +00:00
Nate Begeman 94aa38d568 Add suppport for ConstantExprs of shufflevectors whose result type is not equal to the
type of the vectors being shuffled.

llvm-svn: 64401
2009-02-12 21:28:33 +00:00
Dan Gohman 656b097b8a Add a utility function to LoopInfo to return the exit block
when the loop has exactly one exit, and make use of it in
LoopIndexSplit.

llvm-svn: 64388
2009-02-12 18:08:24 +00:00
Chris Lattner 24ca124fc4 Add operator->, patch by Ben Laurie!
llvm-svn: 64378
2009-02-12 17:14:49 +00:00
Ted Kremenek 24760d113b Add method 'isSingleton()' to ImmutableSet. This returns true if the set contains exactly one element.
llvm-svn: 64359
2009-02-12 05:17:02 +00:00
Gabor Greif e3069ab6e5 Fill in a glaring omission in derived User classes, namely
add efficient versions of op_begin and op_end. Up to now always those from User have been
called, which in most cases follow an indirection (OperandList) even if the exact Instruction 
type is known.

llvm-svn: 64331
2009-02-11 22:09:00 +00:00
Ted Kremenek 88ceac46de Add FoldingSet profile method for bools. Patch by Ben Laurie!
llvm-svn: 64324
2009-02-11 20:53:17 +00:00
Dan Gohman dfaf646c34 When scheduling a block in parts, keep track of the overall
instruction index across each part. Instruction indices are used
to make live range queries, and live ranges can extend beyond
scheduling region boundaries.

Refactor the ScheduleDAGSDNodes class some more so that it
doesn't have to worry about this additional information.

llvm-svn: 64288
2009-02-11 04:27:20 +00:00
Dan Gohman c8dcf4d72b It isn't necessary to explicitly clear the contents of std::vector
and DenseMap members in a destructor. And tidy up a comment.

llvm-svn: 64265
2009-02-11 00:18:15 +00:00
Dan Gohman b95434356c Factor out more code for computing register live-range informationfor
scheduling, and generalize is so that preserves state across
scheduling regions. This fixes incorrect live-range information around
terminators and labels, which are effective region boundaries.

In place of looking for terminators to anchor inter-block dependencies,
introduce special entry and exit scheduling units for this purpose.

llvm-svn: 64254
2009-02-10 23:27:53 +00:00
Devang Patel caf4485781 Enable scalar replacement of AllocaInst whose one of the user is dbg info.
llvm-svn: 64207
2009-02-10 07:00:59 +00:00
Gabor Greif 5b9974a81f incorporate review feedback
llvm-svn: 64158
2009-02-09 20:27:45 +00:00
Mikhail Glushenkov 8ebeee37dc 80-column violations.
llvm-svn: 64147
2009-02-09 17:11:05 +00:00
Gabor Greif cab008f51f make sure that BranchInst::getSuccessor() does not assert in cast<>
even if the underlying operand is NULL. This may happen in debugging context
within opt with partial loop unrolling (see test/Transforms/LoopUnroll/partial.ll).
After this fix I can resubmit the (backed out) r63459:
* lib/VMCore/AsmWriter.cpp: use precise accessors.

llvm-svn: 64142
2009-02-09 15:45:06 +00:00
Bill Wendling cdd2f21dea These function return 'void'. Don't have 'return' return anything.
llvm-svn: 64136
2009-02-09 12:31:26 +00:00
Evan Cheng 64dfcacd5f Turns out AnalyzeBranch can modify the mbb being analyzed. This is a nasty
suprise to some callers, e.g. register coalescer. For now, add an parameter
that tells AnalyzeBranch whether it's safe to modify the mbb. A better
solution is out there, but I don't have time to deal with it right now.

llvm-svn: 64124
2009-02-09 07:14:22 +00:00
Mikhail Glushenkov f606bd6a6d 80-column violation.
llvm-svn: 64102
2009-02-08 22:48:07 +00:00
Mikhail Glushenkov 8b5bfbfc7a Add a Sleep() function.
llvm-svn: 64101
2009-02-08 22:47:39 +00:00
Evan Cheng b3783639cb Fix PR3486. Fix a bug in code that manually patch physical register live interval after its sub-register is coalesced with a virtual register.
llvm-svn: 64082
2009-02-08 11:04:35 +00:00
Evan Cheng 942519306e Strengthen the previous check.
llvm-svn: 64076
2009-02-08 08:24:28 +00:00
Evan Cheng e5e95f7717 (no commit message)
llvm-svn: 64073
2009-02-08 07:48:37 +00:00
Dan Gohman 747e55bc9a Constify TargetInstrInfo::EmitInstrWithCustomInserter, allowing
ScheduleDAG's TLI member to use const.

llvm-svn: 64018
2009-02-07 16:15:20 +00:00
Dan Gohman e9000829b0 Change several SmallPtrSetImpl members from public to protected,
to make the encapsulation more clear.

llvm-svn: 64017
2009-02-07 16:12:23 +00:00
Dan Gohman 1d258405ac Simplify some code by using blocks_begin(), blocks_end(), and
the iterator typedefs instead of handling the std::vector
directly.

llvm-svn: 64016
2009-02-07 16:10:35 +00:00
Nick Lewycky ef01e112aa Add an API for strings with possible NULLs in the middle. Refactor the other
two AddString methods to use it.

llvm-svn: 64005
2009-02-07 04:57:08 +00:00
Dale Johannesen 8ba7132128 Make SDNode constructors take a DebugLoc always.
Adjust derived classes to pass UnknownLoc where
a DebugLoc does not make sense.  Pick one of
DebugLoc and non-DebugLoc variants to survive
for all such classes.

llvm-svn: 64000
2009-02-07 02:15:05 +00:00
Dale Johannesen 773ca057b1 Deleted one line too many. oops.
llvm-svn: 63996
2009-02-07 01:34:19 +00:00
Dale Johannesen a72d41a67b Remove now-unused constructors.
llvm-svn: 63995
2009-02-07 01:27:09 +00:00
Dale Johannesen 62fd95d6ec Get rid of the last non-DebugLoc versions of getNode!
Many targets build placeholder nodes for special operands, e.g.
GlobalBaseReg on X86 and PPC for the PIC base.  There's no
sensible way to associate debug info with these.  I've left
them built with getNode calls with explicit DebugLoc::getUnknownLoc operands. 
I'm not too happy about this but don't see a good improvement;
I considered adding a getPseudoOperand or something, but it
seems to me that'll just make it harder to read.

llvm-svn: 63992
2009-02-07 00:55:49 +00:00
Bill Wendling e53ca3a246 Constify operators.
llvm-svn: 63979
2009-02-06 23:17:54 +00:00
Dale Johannesen 84935759d5 Remove more non-DebugLoc getNode variants. Use
getCALLSEQ_{END,START} to permit passing no DebugLoc
there.  UNDEF doesn't logically have DebugLoc; add
getUNDEF to encapsulate this.

llvm-svn: 63978
2009-02-06 23:05:02 +00:00
Dale Johannesen 400dc2e2e4 Remove more non-DebugLoc versions of getNode.
llvm-svn: 63969
2009-02-06 21:50:26 +00:00
Bill Wendling 3ebc1ca43e Add comparison operators to DebugLoc.
llvm-svn: 63966
2009-02-06 21:34:12 +00:00
Dan Gohman 1b32e0bbc2 Make Mutex's constructor explicit, and tidy up whitespace.
llvm-svn: 63963
2009-02-06 21:17:03 +00:00
Ted Kremenek 474f20efe3 Deallocate() methods now take a 'const void*' instead of a 'void *', matching observed behavior with how 'delete[]' can be used.
llvm-svn: 63956
2009-02-06 19:34:14 +00:00
Dale Johannesen ab8e4425a3 Eliminate remaining non-DebugLoc version of getTargetNode.
llvm-svn: 63951
2009-02-06 19:16:40 +00:00
Dan Gohman 817a24f8e9 Rename SelectionDAGISel::Schedule to
SelectionDAGISel::CreateScheduler, and make it just create the
scheduler. Leave running the scheduler to the higher-level code.
This makes the higher-level code a little more explicit and
easier to follow, and will help enable some future refactoring.

llvm-svn: 63944
2009-02-06 18:26:51 +00:00
Evan Cheng 51afb7c0bb We don't really need the abort here. This unbreak x86_64 linux build.
llvm-svn: 63940
2009-02-06 17:51:34 +00:00