Commit Graph

6752 Commits

Author SHA1 Message Date
Dan Gohman fb8ed43349 Make bugpoint dead-argument-hacking actually work, and actually test it.
llvm-svn: 105551
2010-06-07 20:20:33 +00:00
Kenneth Uildriks 1850444000 Partial specialization was not checking the callsite to make sure it was using the same constants as the specialization, leading to calls to the wrong specialization. Patch by Takumi Nakamura\!
llvm-svn: 105528
2010-06-05 14:50:21 +00:00
Dan Gohman 67b4403101 Don't track users of undef values; they aren't interesting for
register pressure.

llvm-svn: 105501
2010-06-04 23:16:05 +00:00
Devang Patel 36da24b546 Copy location info for current function argument from dbg.declare if respective store instruction does not have any location info.
llvm-svn: 105490
2010-06-04 22:27:30 +00:00
Jim Grosbach 5ba76b94f8 Remove unused code
llvm-svn: 105293
2010-06-01 21:56:30 +00:00
Jim Grosbach 0e20dc5cd6 fix think-o
llvm-svn: 105291
2010-06-01 21:35:50 +00:00
Jim Grosbach b69c68742a Simplify things a bit more. Fix prototype to use SmallVectorImpl and
change a few SmallVectors to vanilla C arrays.

llvm-svn: 105289
2010-06-01 21:06:46 +00:00
Jim Grosbach a37af16221 mirror of r105280 changes for LowerInvoke, which uses the same basic logic here
llvm-svn: 105281
2010-06-01 18:04:56 +00:00
Jim Grosbach 7352167560 Use SmallVector instead of std::vector.
llvm-svn: 105279
2010-06-01 17:56:41 +00:00
Duncan Sands 4c904fa797 Fix PR7272: when inlining through a callsite with byval arguments,
the newly created allocas may be used by inlined calls, so these
need to have their tail call flags cleared.  Fixes PR7272.

llvm-svn: 105255
2010-05-31 21:00:26 +00:00
Benjamin Kramer 5ac57e3440 Avoid swap when a copy suffices.
llvm-svn: 105220
2010-05-31 12:50:41 +00:00
Nick Lewycky aee2632be3 The memcpy intrinsic only takes i8* for %src and %dst, so cast them to that
first. Fixes PR7265.

llvm-svn: 105206
2010-05-31 06:16:35 +00:00
Dan Gohman 826bdf8c10 Move FindAvailableLoadedValue isSafeToLoadUnconditionally out of
lib/Transforms/Utils and into lib/Analysis so that Analysis passes
can use them.

llvm-svn: 104949
2010-05-28 16:19:17 +00:00
Dan Gohman df5d7dcef1 Teach instcombine to promote alloca array sizes.
llvm-svn: 104945
2010-05-28 15:09:00 +00:00
Dan Gohman 05a6555acb Fix instcombine's handling of alloca to accept non-i32 types.
llvm-svn: 104935
2010-05-28 04:33:04 +00:00
Devang Patel 3e0fbafab2 Fix typo.
llvm-svn: 104914
2010-05-28 01:29:50 +00:00
Devang Patel e2099e8088 Fix typo.
llvm-svn: 104913
2010-05-28 01:17:51 +00:00
Devang Patel 7a9dedf0ab Do not drop location info for inlined function args.
llvm-svn: 104884
2010-05-27 20:25:04 +00:00
Duncan Sands f162eace49 Teach instCombine to remove malloc+free if malloc's only uses are comparisons
to null.  Patch by Matti Niemenmaa.

llvm-svn: 104871
2010-05-27 19:09:06 +00:00
Benjamin Kramer 6877119ef3 Kill unneeded SExt.
llvm-svn: 104692
2010-05-26 09:45:04 +00:00
Benjamin Kramer 9439084cea Properly promote operands when optimizing a single-character memcmp.
llvm-svn: 104648
2010-05-25 22:53:43 +00:00
Dan Gohman a4abd035ea Fix a missing newline in debug output.
llvm-svn: 104644
2010-05-25 21:50:35 +00:00
Dan Gohman 9b48b856ea DominatorTree.getNode can return null for unreachable blocks.
llvm-svn: 104290
2010-05-20 22:46:54 +00:00
Dan Gohman 86110fa2bb Minor code cleanups.
llvm-svn: 104287
2010-05-20 22:25:20 +00:00
Dan Gohman 6295f2ebb8 Make Solve check its own post-condition, to reduce clutter in the
top-level LSRInstance logic.

llvm-svn: 104278
2010-05-20 20:59:23 +00:00
Dan Gohman a4ca28a3ae Add comments.
llvm-svn: 104276
2010-05-20 20:52:00 +00:00
Dan Gohman 927bcaadda More code cleanups. Use iterators instead of indices when indices
aren't needed.

llvm-svn: 104273
2010-05-20 20:33:18 +00:00
Dan Gohman 4c4043cf34 Fix OptimizeShadowIV to set Changed. Change OptimizeLoopTermCond to set
Changed directly instead of using a return value.

Rename FilterOutUndesirableDedicatedRegisters's Changed variable to
distinguish it from LSRInstance's Changed member.

llvm-svn: 104269
2010-05-20 20:05:31 +00:00
Dan Gohman 8ec018cedf Add some comments.
llvm-svn: 104268
2010-05-20 20:00:41 +00:00
Dan Gohman 8ce95cc3c5 Simplify this code. Don't do a DomTreeNode lookup for each visited block.
llvm-svn: 104267
2010-05-20 20:00:25 +00:00
Dan Gohman ab5fb7f559 Minor code cleanups.
llvm-svn: 104263
2010-05-20 19:44:23 +00:00
Dan Gohman ee2fea3cd7 When canonicalizing icmp operand order to put the loop invariant
operand on the left, the interesting operand is on the right. This
fixes a bug where LSR was failing to recognize ICmpZero uses,
which led it to be unable to reverse the induction variable in the
attached testcase.

Delete test/CodeGen/X86/stack-color-with-reg-2.ll, because its test
is extremely fragile and hard to meaningfully update.

llvm-svn: 104262
2010-05-20 19:26:52 +00:00
Dan Gohman fdf9874ba7 Set Changed to true when canonicalizing ICmp operand order; even though
it isn't a very interesting change, it's a change nonetheless.

llvm-svn: 104260
2010-05-20 19:16:03 +00:00
Devang Patel e2ff7f3a7d Strip llvm.dbg.lv also.
llvm-svn: 104236
2010-05-20 16:49:22 +00:00
Dan Gohman 981563d0ba Rename a variable to avoid shadowing.
llvm-svn: 104234
2010-05-20 16:41:11 +00:00
Dan Gohman 6b733fc189 Minor code simplification.
llvm-svn: 104232
2010-05-20 16:23:28 +00:00
Dan Gohman 80a9608442 Move the code for deleting BaseRegs and LSRUses into helper functions,
and fix a bug that valgrind noticed where the code would std::swap an
element with itself.

llvm-svn: 104225
2010-05-20 15:17:54 +00:00
Dan Gohman 20fab456da Teach LSR how to cope better with unrolled loops on targets where
the addressing modes don't make this trivially easy. This allows
it to avoid falling into the less precise heuristics in more
cases.

llvm-svn: 104186
2010-05-19 23:43:12 +00:00
Dan Gohman beebef4137 Add a comment.
llvm-svn: 104089
2010-05-18 23:55:57 +00:00
Dan Gohman 50f8f2c23d Fix the predicate which checks for non-sensical formulae which have
constants in registers which partially cancel out their immediate fields.

llvm-svn: 104088
2010-05-18 23:48:08 +00:00
Dan Gohman 4cf99b5303 Factor out the code for recomputing an LSRUse's Regs set after some
of its formulae have been removed into a helper function, and also
teach it how to update the RegUseTracker.

llvm-svn: 104087
2010-05-18 23:42:37 +00:00
Dan Gohman a4eca05174 Factor out code for estimating search space complexity into a helper
function.

llvm-svn: 104082
2010-05-18 22:51:59 +00:00
Dan Gohman 63e9015248 Add some more debug output.
llvm-svn: 104080
2010-05-18 22:41:32 +00:00
Dan Gohman f1c7b1b42f Factor out the code for deleting a formula from an LSRUse into
a helper function.

llvm-svn: 104079
2010-05-18 22:39:15 +00:00
Dan Gohman 8aca7ef903 Make some debug output more informative.
llvm-svn: 104078
2010-05-18 22:37:37 +00:00
Dan Gohman 06ab08f795 Print an error message in Formula::print if the HasBaseReg flag
is inconsistent with the BaseRegs field. It's not print's job to
assert on an invalid condition, but it can make one more obvious.

llvm-svn: 104077
2010-05-18 22:35:55 +00:00
Dan Gohman 248c41d108 Rename RegUseTracker's RegUses member to RegUsesMap to avoid
confusion with LSRInstance's RegUses member.

llvm-svn: 104076
2010-05-18 22:33:00 +00:00
Nick Lewycky b35818eb25 Teach the always inliner to release its inline cost estimates, like the basic
inliner did in r103653. Why does the always inliner even bother with cost
estimates anyways?

llvm-svn: 103858
2010-05-15 04:26:25 +00:00
Nick Lewycky 002a45eb64 Clean up, no functional change.
llvm-svn: 103857
2010-05-15 03:41:58 +00:00
Nick Lewycky 2b3cbac0ee Remove heinous tabs.
llvm-svn: 103700
2010-05-13 06:45:13 +00:00