Commit Graph

3872 Commits

Author SHA1 Message Date
Devang Patel a59b24b090 Distinguish between two copies of one inlined variable.
llvm-svn: 135528
2011-07-19 22:31:15 +00:00
Devang Patel cfa82a378d Reapply r135457. This needs llvm-gcc change, that I forgot to check-in yesterday.
llvm-svn: 135504
2011-07-19 19:41:54 +00:00
Bob Wilson da30cf84c3 Revert "Make a provision to encode inline location in a variable. This will enable dwarf writer to easily distinguish between two instances of a inlined variable in one basic block."
This reverts commit 9fec5e346efdf744b151ae6604f912908315fa7a.

llvm-svn: 135486
2011-07-19 16:32:50 +00:00
Jay Foad b992a635fb Convert SimplifyGEPInst to use ArrayRef.
llvm-svn: 135482
2011-07-19 15:07:52 +00:00
Jay Foad bf904773bb Convert TargetData::getIndexedOffset to use ArrayRef.
llvm-svn: 135478
2011-07-19 14:01:37 +00:00
Jay Foad f4b14a2b0d Use ArrayRef in ConstantFoldInstOperands and ConstantFoldCall.
llvm-svn: 135477
2011-07-19 13:32:40 +00:00
Devang Patel ac532dedf1 Make a provision to encode inline location in a variable. This will enable dwarf writer to easily distinguish between two instances of a inlined variable in one basic block.
llvm-svn: 135457
2011-07-19 01:03:32 +00:00
Frits van Bommel 717d7edd3e Migrate LLVM and Clang to use the new makeArrayRef(...) functions where previously explicit non-default constructors were used.
Mostly mechanical with some manual reformatting.

llvm-svn: 135390
2011-07-18 12:00:32 +00:00
Chris Lattner 229907cd11 land David Blaikie's patch to de-constify Type, with a few tweaks.
llvm-svn: 135375
2011-07-18 04:54:35 +00:00
Benjamin Kramer a7606b993c Silence compiler warnings.
llvm-svn: 135358
2011-07-16 22:26:27 +00:00
Jakub Staszak 623e1971ce Remove "LoopInfo.h" include from BranchProbabilityInfo.h.
llvm-svn: 135353
2011-07-16 20:31:15 +00:00
Andrew Trick 244e2c3e82 Fix SCEVEXpander to handle arbitrary phi expansion. Includes two
related bug fixes and corresponding assertions for uninitialized data
and missing NULL check. Test cases will be included with the new LFTR.

llvm-svn: 135333
2011-07-16 00:59:39 +00:00
Jakub Staszak abb236fe9b Fix pointer heuristic. Check whether predicator is ICMP_NE instead of if it is
not isEquality().

llvm-svn: 135296
2011-07-15 20:51:06 +00:00
Jay Foad 5bd375a6cc Convert CallInst and InvokeInst APIs to use ArrayRef.
llvm-svn: 135265
2011-07-15 08:37:34 +00:00
Jay Foad 57aa636794 Convert InsertValueInst and ExtractValueInst APIs to use ArrayRef.
llvm-svn: 135040
2011-07-13 10:26:04 +00:00
Chris Lattner 13879a7091 stop using WriteTypeSymbolic.
llvm-svn: 134833
2011-07-09 18:02:13 +00:00
Devang Patel c3239d3965 Preserve debug loc.
llvm-svn: 134441
2011-07-05 21:48:22 +00:00
Dan Gohman a293f24a0d Teach IVUsers to stop at non-affine expressions unless they are both
outside the loop and reducible.

This more completely hides them from LSR, which isn't usually able to
do anything meaningful with non-affine expressions anyway, and this
consequently hides them from SCEVExpander, which is acutely unprepared
for non-affine expressions.

Replace test/CodeGen/X86/lsr-nonaffine.ll with a new test that tests
the new behavior.

This works around the bug in PR10117 / rdar://problem/9633149, and is
generally an improvement besides.

llvm-svn: 134268
2011-07-01 22:05:19 +00:00
Dan Gohman 54664ed714 Improve constant folding of undef for cmp and select operators.
llvm-svn: 134223
2011-07-01 01:03:43 +00:00
Andrew Trick 154d78a661 Cleanup. Fix a stupid variable name.
llvm-svn: 133995
2011-06-28 05:41:52 +00:00
Andrew Trick 411daa5e81 SCEVExpander: give new insts a name that identifies the reponsible pass.
llvm-svn: 133992
2011-06-28 05:07:32 +00:00
Andrew Trick 56b315a9cf indvars --disable-iv-rewrite: sever ties with IVUsers.
llvm-svn: 133988
2011-06-28 03:01:46 +00:00
Nick Lewycky 3e334a42d7 Move onlyUsedByLifetimeMarkers to ValueTracking so that it can be used by other
passes as well.

llvm-svn: 133904
2011-06-27 04:20:45 +00:00
Devang Patel 503c3998f3 Fix struct member's scope. Patch by Xi Wang.
llvm-svn: 133828
2011-06-24 22:00:39 +00:00
Jakub Staszak 1aae619933 Calculate backedge probability correctly.
llvm-svn: 133776
2011-06-23 23:52:11 +00:00
Jakub Staszak 668c6fae76 Missing files for the BlockFrequency analysis added.
llvm-svn: 133767
2011-06-23 21:56:59 +00:00
Jakub Staszak be52acc98a Introduce BlockFrequency analysis for BasicBlocks.
llvm-svn: 133766
2011-06-23 21:45:20 +00:00
Rafael Espindola e2456536b5 Revert "revert 133714"
This reverts commit e8e00f5efb4a22238f2407bf813de4606f30c5aa.

The cmake build on OS X is still broken.

llvm-svn: 133718
2011-06-23 14:19:39 +00:00
Dylan Noblesmith 8a4f22d017 revert 133714
It broke the build worse.

llvm-svn: 133716
2011-06-23 13:56:01 +00:00
Rafael Espindola 250360d4bd 133713 broke the build, revert it.
llvm-svn: 133714
2011-06-23 13:37:38 +00:00
Dylan Noblesmith 3595357772 Support: make floating-exception header private
It has only one user. This eliminates the last include of
config.h from the public headers -- ideally, config.h
shouldn't even be installed by `make install` anymore.

llvm-svn: 133713
2011-06-23 12:45:54 +00:00
Devang Patel ccf8dbf885 New binops need debug loc.
llvm-svn: 133642
2011-06-22 20:56:56 +00:00
Andrew Trick fc4ccb20c6 IVUsers no longer needs to record the phis.
llvm-svn: 133518
2011-06-21 15:43:52 +00:00
Chris Lattner cc19efaa97 Revamp the "ConstantStruct::get" methods. Previously, these were scattered
all over the place in different styles and variants.  Standardize on two
preferred entrypoints: one that takes a StructType and ArrayRef, and one that
takes StructType and varargs.

In cases where there isn't a struct type convenient, we now add a
ConstantStruct::getAnon method (whose name will make more sense after a few
more patches land).  

It would be "really really nice" if the ConstantStruct::get and 
ConstantVector::get methods didn't make temporary std::vectors.

llvm-svn: 133412
2011-06-20 04:01:31 +00:00
Chris Lattner 67733f6557 simplify some code.
llvm-svn: 133362
2011-06-18 21:46:23 +00:00
Benjamin Kramer 9319e9c5d8 Simplify code. No functionality change.
llvm-svn: 133351
2011-06-18 14:42:42 +00:00
Jakub Staszak 12a43bdde5 Introduce MachineBranchProbabilityInfo class, which has similar API to
BranchProbabilityInfo (expect setEdgeWeight which is not available here).
Branch Weights are kept in MachineBasicBlocks. To turn off this analysis
set -use-mbpi=false.

llvm-svn: 133184
2011-06-16 20:22:37 +00:00
Eli Friedman 8b098b0d57 Add a limit to the number of instructions memdep will scan in a single block. This prevents (at least in some cases) O(N^2) runtime in passes like DSE.
The limit in this patch is probably too high, but it is enough to stop DSE from going completely insane on a testcase I have (which has a single block with around 50,000 non-aliasing stores in it).

rdar://9471075

llvm-svn: 133111
2011-06-15 23:59:25 +00:00
Eli Friedman 7d58bc7bc0 Add "unknown" results for memdep, which mean "I don't know whether a dependence for the given instruction exists in the given block". This cleans up all the existing hacks in memdep which represent this concept by returning clobber with various unrelated instructions.
llvm-svn: 133031
2011-06-15 00:47:34 +00:00
Benjamin Kramer 558d09d87e Move class into an anonymous namespace.
llvm-svn: 132925
2011-06-13 18:38:56 +00:00
Andrew Trick 3d4e64b082 Branch profiling: floating-point avoidance.
Patch by: Jakub Staszak!

Introduces BranchProbability. Changes unsigned to uint32_t all over and
uint64_t only when overflow is expected.

llvm-svn: 132867
2011-06-11 01:05:22 +00:00
Dan Gohman cc59548793 Initialize BasicAA's AliasCache to set it to use fewer buckets by
default, since it usually has very few elements. This speeds up
alias queries in many cases, because AliasCache.clear() doesn't
have to visit as many buckets.

llvm-svn: 132862
2011-06-10 22:30:30 +00:00
John McCall 729c35b680 Teach the CallGraph to ignore calls to intrinsics.
llvm-svn: 132797
2011-06-09 19:46:27 +00:00
Dan Gohman adf80ae9e4 Reapply r131781, now that the GVN bug with partially-aliasing loads
is disabled.

llvm-svn: 132632
2011-06-04 06:50:18 +00:00
Dan Gohman a471751c24 Disable the main feature of 130180, the elimination of loads that are
redundant with partially-aliasing loads.

When computing what portion of a clobbering load value is needed,
it doesn't consider phi-translation which may have occurred
between the clobbing load and the redundant load.

llvm-svn: 132631
2011-06-04 06:48:50 +00:00
Dan Gohman 87fdceaf73 Revert r131781 again. Apparently there is more going on here.
llvm-svn: 132625
2011-06-04 05:11:22 +00:00
Nick Lewycky 75b2053863 Fold assert-only-used variable into the assert.
llvm-svn: 132620
2011-06-04 02:07:10 +00:00
Andrew Trick c73aa1ee81 Missing include of climits in the new BranchProbability pass.
llvm-svn: 132616
2011-06-04 01:30:52 +00:00
Andrew Trick 49371f3f33 New BranchProbabilityInfo analysis. Patch by Jakub Staszak!
BranchProbabilityInfo provides an interface for IR passes to query the
likelihood that control follows a CFG edge. This patch provides an
initial implementation of static branch predication that will populate
BranchProbabilityInfo for branches with no external profile
information using very simple heuristics. It currently isn't hooked up
to any external profile data, so static prediction does all the work.

llvm-svn: 132613
2011-06-04 01:16:30 +00:00
Dan Gohman 27b82f2f91 Reapply r131781 (revert r131809), now that some BasicAA shortcomings
it exposed are fixed.

llvm-svn: 132611
2011-06-04 00:46:31 +00:00