Bill Wendling [Wed, 17 Dec 2008 20:59:57 +0000 (20:59 +0000)]
Forgot to revert r61031 when I reverted r61019, r61030, and r61040.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61150
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Wed, 17 Dec 2008 18:11:40 +0000 (18:11 +0000)]
Simplified marking code regions -- no need to use <div> to surround <pre> tags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61143
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Wed, 17 Dec 2008 18:06:53 +0000 (18:06 +0000)]
Instead of referring to the license file in the 2.3 release, refer to the
always-current SVN version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61142
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Wed, 17 Dec 2008 16:27:23 +0000 (16:27 +0000)]
Added mention of the RELEASE_24 tag for the 2.4 release.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61138
91177308-0d34-0410-b5e6-
96231b3b80d8
Mon P Wang [Wed, 17 Dec 2008 08:49:47 +0000 (08:49 +0000)]
Fix expansion of vsetcc to set the high bit for true instead of 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61129
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Dec 2008 05:42:08 +0000 (05:42 +0000)]
insert some sequence points and preincrement an iterator to avoid
iterator invalidation problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61124
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Dec 2008 05:28:49 +0000 (05:28 +0000)]
Enhance heap sra to be substantially more aggressive w.r.t PHI
nodes. This allows it to do fairly general phi insertion if a
load from a pointer global wants to be SRAd but the load is used
by (recursive) phi nodes. This fixes a pessimization on ppc
introduced by Load PRE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61123
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 17 Dec 2008 04:30:46 +0000 (04:30 +0000)]
Double the amount of memory reserved for SUnits. This is a
temporary workaround for an obscure bug. When node cloning is
used, it is possible that more SUnits will be created, and
if the SUnits std::vector has to reallocate, it will
invalidate all the graph edges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61122
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 17 Dec 2008 04:25:52 +0000 (04:25 +0000)]
Use getDepth() and getHeight() instead of accessing the
Depth and Height members directly, as they may not be
current.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61121
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 17 Dec 2008 04:24:23 +0000 (04:24 +0000)]
Fix the comments for getDepth and getHeight.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61120
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Wed, 17 Dec 2008 03:35:17 +0000 (03:35 +0000)]
Fix for PR3225: disable a broken optimization in
DAGTypeLegalizer::ExpandShiftWithKnownAmountBit.
In terms of restoring the optimization, the best fix here isn't
obvious... any ideas?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61119
91177308-0d34-0410-b5e6-
96231b3b80d8
Mikhail Glushenkov [Wed, 17 Dec 2008 02:47:30 +0000 (02:47 +0000)]
Update also the generated docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61118
91177308-0d34-0410-b5e6-
96231b3b80d8
Mikhail Glushenkov [Wed, 17 Dec 2008 02:47:01 +0000 (02:47 +0000)]
Some enhancements for the 'case' expression.
Add (error) and (empty).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61117
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Tue, 16 Dec 2008 22:16:28 +0000 (22:16 +0000)]
Clarify that the scale factor from CheckForIVReuse
can be negative. Keep track of whether all uses of
an IV are outside the loop. Some cosmetics; no
functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61109
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Tue, 16 Dec 2008 22:13:49 +0000 (22:13 +0000)]
A new dag combine; several permutations of this
are there under ADD, this one was missing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61107
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 16 Dec 2008 21:35:08 +0000 (21:35 +0000)]
Add code to renumber split intervals into new vregs. This is disabled for now until I finish working out some iterator invalidation issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61104
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 16 Dec 2008 21:24:51 +0000 (21:24 +0000)]
Fix another crash found by inspection. If we have a PHI node merging
the load multiple times, make sure the check the uses of the PHI to
ensure they are transformable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61102
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 16 Dec 2008 21:04:51 +0000 (21:04 +0000)]
fix a crash found by inspection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61101
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Tue, 16 Dec 2008 20:54:32 +0000 (20:54 +0000)]
Add a helper to remove a branch and DCE the condition, and use it
consistently for deleting branches. In addition to being slightly
more readable, this makes SimplifyCFG a bit better
about cleaning up after itself when it makes conditions unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61100
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 16 Dec 2008 19:27:52 +0000 (19:27 +0000)]
Eliminate the loop that walks the critical path. Instead, just track the
position in the critical path during the main instruction walk. This
eliminates the need for the CritialAntiDep DenseMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61096
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Tue, 16 Dec 2008 19:07:17 +0000 (19:07 +0000)]
Remove empty test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61095
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Tue, 16 Dec 2008 19:06:48 +0000 (19:06 +0000)]
Temporarily revert r61019, r61030, and r61040. These were breaking LLVM Release
builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61094
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 16 Dec 2008 18:25:36 +0000 (18:25 +0000)]
Preserve SourceValue information when lowering produces multiple loads from
different offsets within the same stack slot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61093
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 16 Dec 2008 18:21:39 +0000 (18:21 +0000)]
We have decided not to support inline asm where an output operand with a matching input operand with incompatible type (i.e. either one is a floating point and the other is an integer or the sizes of the types differ). SelectionDAGBuild will catch these and exit with an error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61092
91177308-0d34-0410-b5e6-
96231b3b80d8
Oscar Fuentes [Tue, 16 Dec 2008 12:25:04 +0000 (12:25 +0000)]
CMake: Added DbgInfoPrinter.cpp to lib/Analysis/CMakeFiles.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61087
91177308-0d34-0410-b5e6-
96231b3b80d8
Torok Edwin [Tue, 16 Dec 2008 10:10:23 +0000 (10:10 +0000)]
add testcase for -print-dbginfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61086
91177308-0d34-0410-b5e6-
96231b3b80d8
Torok Edwin [Tue, 16 Dec 2008 09:09:19 +0000 (09:09 +0000)]
Add -print-dbginfo pass that prints LLVM IR with comments inserted to show
which source/line a certain BB/instruction comes from, original variable names,
and original (unmangled) C++ name of functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61085
91177308-0d34-0410-b5e6-
96231b3b80d8
Torok Edwin [Tue, 16 Dec 2008 09:07:36 +0000 (09:07 +0000)]
Add utility functions to search for DbgStopPointInst corresponding to an
instruction or BasicBlock, and to search for DbgDeclareInst corresponding to a
variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61084
91177308-0d34-0410-b5e6-
96231b3b80d8
Torok Edwin [Tue, 16 Dec 2008 09:06:01 +0000 (09:06 +0000)]
use different name for parameter to make it clear that we set DIDescriptor::GV
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61083
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Tue, 16 Dec 2008 08:30:01 +0000 (08:30 +0000)]
Generalize support for analyzing loops to include SLE/SGE loop exit conditions
and support for non-unit strides with signed exit conditions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61082
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 16 Dec 2008 07:34:30 +0000 (07:34 +0000)]
switch some std::set/std::map to SmallPtrSet/DenseMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61081
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 16 Dec 2008 07:10:09 +0000 (07:10 +0000)]
fix PR3217: fully cached queries need to be verified against the
visited set before they are used. If used, their blocks need to be
added to the visited set so that subsequent queries don't use conflicting
pointer values in the cache result blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61080
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 16 Dec 2008 06:21:45 +0000 (06:21 +0000)]
Enable anti-dependence breaking by default when post-RA scheduling is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61078
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 16 Dec 2008 06:20:58 +0000 (06:20 +0000)]
When breaking an anti-dependency, don't use a register which has seen
one of its aliases defined. This is conservative, but tricky subreg
corner cases are outside the primary aim of this pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61077
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 16 Dec 2008 03:35:01 +0000 (03:35 +0000)]
Add initial support for back-scheduling address computations,
especially in the case of addresses computed from loop induction
variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61075
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 16 Dec 2008 03:31:11 +0000 (03:31 +0000)]
Remove some special-case logic in ScheduleDAGSDNodes's
latency computation code that is no longer needed with the
new method for handling latencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61074
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 16 Dec 2008 03:25:46 +0000 (03:25 +0000)]
Fix some register-alias-related bugs in the post-RA scheduler liveness
computation code. Also, avoid adding output-depenency edges when both
defs are dead, which frequently happens with EFLAGS defs.
Compute Depth and Height lazily, and always in terms of edge latency
values. For the schedulers that don't care about latency, edge latencies
are set to 1.
Eliminate Cycle and CycleBound, and LatencyPriorityQueue's Latencies array.
These are all subsumed by the Depth and Height fields.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61073
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Tue, 16 Dec 2008 03:07:49 +0000 (03:07 +0000)]
* Comply with HTML 4.01 Strict
* Added code-region markings to code sections to make them stand out
* Added pre.doc_code class to llvm.css to simplify marking code regions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61072
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Tue, 16 Dec 2008 02:54:22 +0000 (02:54 +0000)]
* Comply with HTML 4.01 Strict standard
* Converted absolute links to llvm.org/docs to relative links
* Fixed spelling and s/;/:/, as needed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61071
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 16 Dec 2008 02:38:22 +0000 (02:38 +0000)]
Add a simple target-independent heuristic to allow targets with no
instruction itinerary data to back-schedule loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61070
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 16 Dec 2008 01:05:52 +0000 (01:05 +0000)]
Move addPred and removePred out-of-line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61067
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 16 Dec 2008 01:00:55 +0000 (01:00 +0000)]
Make addPred and removePred return void, since the return value is not
currently used by anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61066
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 16 Dec 2008 00:55:00 +0000 (00:55 +0000)]
This getEdgeAttributes doesn't need a template argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61065
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 16 Dec 2008 00:51:33 +0000 (00:51 +0000)]
Add a getSDep() access function to SUnitIterator to return the
current SDep.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61064
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 16 Dec 2008 00:48:53 +0000 (00:48 +0000)]
Reorder some SDep methods. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61063
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 16 Dec 2008 00:47:19 +0000 (00:47 +0000)]
SDep's operator== should compare the Latency field too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61062
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Tue, 16 Dec 2008 00:42:25 +0000 (00:42 +0000)]
Change so that buildit won't need a parent directory with only the build scripts in them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61061
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 15 Dec 2008 21:46:23 +0000 (21:46 +0000)]
add testcase for r61051
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61052
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 15 Dec 2008 21:44:34 +0000 (21:44 +0000)]
enhance heap-sra to apply to fixed sized array allocations, not just
variable sized array allocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61051
91177308-0d34-0410-b5e6-
96231b3b80d8
Mon P Wang [Mon, 15 Dec 2008 21:44:00 +0000 (21:44 +0000)]
Added support for splitting and scalarizing vector shifts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61050
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 15 Dec 2008 21:20:32 +0000 (21:20 +0000)]
Use stripPointerCasts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61047
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 15 Dec 2008 21:08:54 +0000 (21:08 +0000)]
minor tweaks for formatting, allow bitcast in ValueIsOnlyUsedLocallyOrStoredToOneGlobal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61046
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 15 Dec 2008 21:02:25 +0000 (21:02 +0000)]
refactor some code into a new TryToOptimizeStoreOfMallocToGlobal function.
Use GetElementPtrInst::hasAllZeroIndices where possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61045
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 15 Dec 2008 19:42:05 +0000 (19:42 +0000)]
add a basic test for heap-sra
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61041
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 15 Dec 2008 18:59:22 +0000 (18:59 +0000)]
Teach basicaa to use the nocapture attribute when possible. When the
intrinsics are properly marked nocapture, the fixme should be addressed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61040
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 15 Dec 2008 17:28:10 +0000 (17:28 +0000)]
Fix printing of PseudoSourceValues in SDNode graphs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61036
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 15 Dec 2008 17:26:50 +0000 (17:26 +0000)]
Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61035
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 15 Dec 2008 08:32:28 +0000 (08:32 +0000)]
add some more notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61033
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 15 Dec 2008 07:49:24 +0000 (07:49 +0000)]
Add a testcase for GCC PR 23455, which lpre handles now. Add some
comments about why we're not getting other cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61032
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 15 Dec 2008 07:31:07 +0000 (07:31 +0000)]
Update generated files after nocapture syntax change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61031
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 15 Dec 2008 07:29:55 +0000 (07:29 +0000)]
It turns out that "align 1" and unaligned are different. Add a bias to the
alignment attribute such that 0 means unaligned.
This will probably require a rebuild of llvm-gcc because of the change to
Attributes.h. If you see many test failures on "make check", please rebuild
your llvm-gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61030
91177308-0d34-0410-b5e6-
96231b3b80d8
Mon P Wang [Mon, 15 Dec 2008 06:57:02 +0000 (06:57 +0000)]
Added support to LegalizeType for expanding the operands of scalar to vector
and insert vector element. Modified extract vector element to extend the
result to match the expected promoted type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61029
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 15 Dec 2008 06:34:48 +0000 (06:34 +0000)]
gvn now hoists this load out of the hot non-call path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61028
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 15 Dec 2008 05:28:29 +0000 (05:28 +0000)]
Enable Load PRE. This teaches GVN to push partially redundant loads up the
CFG when there is exactly one predecessor where the load is not available.
This is designed to not increase code size but still eliminate partially
redundant loads. This fires 1765 times on 403.gcc even though it doesn't
do critical edge splitting yet (the most common reason for it to fail).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61027
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 15 Dec 2008 04:58:29 +0000 (04:58 +0000)]
if we have a phi translation failure of the start block,
return *just* a clobber of the start block, not other
random stuff as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61026
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 15 Dec 2008 04:42:00 +0000 (04:42 +0000)]
Adjust testcase to make it more stable across visitation order changes,
unbreaking it after r61024.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61025
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 15 Dec 2008 03:52:17 +0000 (03:52 +0000)]
Ifdef out some code that I didn't mean to enable by default yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61024
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 15 Dec 2008 03:46:38 +0000 (03:46 +0000)]
make GVN try to rename inputs to the resultant replaced values, which
cleans up the generated code a bit. This should have the added benefit of
not randomly renaming functions/globals like my previous patch did. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61023
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 15 Dec 2008 03:35:32 +0000 (03:35 +0000)]
Implement initial support for PHI translation in memdep. This means that
memdep keeps track of how PHIs affect the pointer in dep queries, which
allows it to eliminate the load in cases like rle-phi-translate.ll, which
basically end up being:
BB1:
X = load P
br BB3
BB2:
Y = load Q
br BB3
BB3:
R = phi [P] [Q]
load R
turning "load R" into a phi of X/Y. In addition to additional exposed
opportunities, this makes memdep safe in many cases that it wasn't before
(which is required for load PRE) and also makes it substantially more
efficient. For example, consider:
bb1: // has many predecessors.
P = some_operator()
load P
In this example, previously memdep would scan all the predecessors of BB1
to see if they had something that would mustalias P. In some cases (e.g.
test/Transforms/GVN/rle-must-alias.ll) it would actually find them and end
up eliminating something. In many other cases though, it would scan and not
find anything useful. MemDep now stops at a block if the pointer is defined
in that block and cannot be phi translated to predecessors. This causes it
to miss the (rare) cases like rle-must-alias.ll, but makes it faster by not
scanning tons of stuff that is unlikely to be useful. For example, this
speeds up GVN as a whole from 3.928s to 2.448s (60%)!. IMO, scalar GVN
should be enhanced to simplify the rle-must-alias pointer base anyway, which
would allow the loads to be eliminated.
In the future, this should be enhanced to phi translate through geps and
bitcasts as well (as indicated by FIXMEs) making memdep even more powerful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61022
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 15 Dec 2008 02:03:00 +0000 (02:03 +0000)]
Add support for slow-path GVN with full phi construction for scalars. This is disabled for now, as it actually pessimizes code in the abscence
of phi translation for load elimination. This slow down GVN a bit, by about 2% on 403.gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61021
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 15 Dec 2008 01:35:36 +0000 (01:35 +0000)]
Fix whitespace in comment.
Remove TODO; icmp isn't a binary operator, so this function will never deal
with them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61020
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 15 Dec 2008 01:34:58 +0000 (01:34 +0000)]
Introducing nocapture, a parameter attribute for pointers to indicate that the
callee will not introduce any new aliases of that pointer.
The attributes had all bits allocated already, so I decided to collapse
alignment. Alignment was previously stored as a 16-bit integer from bits 16 to
32 of the attribute, but it was required to be a power of 2. Now it's stored in
log2 encoded form in five bits from 16 to 21. That gives us 11 more bits of
space.
You may have already noticed that you only need four bits to encode a 16-bit
power of two, so why five bits? Because the AsmParser accepted 32-bit
alignments, even though we couldn't store them (they were silently discarded).
Now we can store them in memory, but not in the bitcode.
The bitcode format was already storing these as 64-bit VBR integers. So, the
bitcode format stays the same, keeping the alignment values stored as 16 bit
raw values. There's some hideous code in the reader and writer that deals with
this, waiting to be ripped out the moment we run out of bits again and have to
replace the parameter attributes table encoding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61019
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 14 Dec 2008 21:38:24 +0000 (21:38 +0000)]
silence warning when asserts disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61014
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 14 Dec 2008 21:37:33 +0000 (21:37 +0000)]
silence warning when asserts disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61013
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 14 Dec 2008 21:36:23 +0000 (21:36 +0000)]
eliminate warning when asserts disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61012
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 14 Dec 2008 21:20:46 +0000 (21:20 +0000)]
another random testcase that shouldn't crash gvn and is
good for coverage with future changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61011
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sun, 14 Dec 2008 21:08:48 +0000 (21:08 +0000)]
Clarify the meaning of the NoAlias response. The plan is to refer to this from
a future version of LangRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61010
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Sun, 14 Dec 2008 19:10:35 +0000 (19:10 +0000)]
Generalize GVN's phi construciton routine to work for things other than loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61009
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Sun, 14 Dec 2008 09:43:15 +0000 (09:43 +0000)]
Reapply r60997, this time without forgetting that
target constants are allowed to have an illegal
type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61006
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Sun, 14 Dec 2008 08:01:51 +0000 (08:01 +0000)]
Fixed HTML validator warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61005
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Sun, 14 Dec 2008 07:20:36 +0000 (07:20 +0000)]
CSS cleanup:
* Lowercased all HTML element names
* Standardized spacing around { and }
* removed class "doc_table_nw": grep finds no uses
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61004
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 13 Dec 2008 23:53:00 +0000 (23:53 +0000)]
Temporarily revert r60997. It was causing this failure:
Running /Users/void/llvm/llvm.src/test/CodeGen/Generic/dg.exp ...
FAIL: /Users/void/llvm/llvm.src/test/CodeGen/Generic/asm-large-immediate.ll
Failed with exit(1) at line 1
while running: llvm-as < /Users/void/llvm/llvm.src/test/CodeGen/Generic/asm-large-immediate.ll | llc | /usr/bin/grep
68719476738
Assertion failed: ((TypesNeedLegalizing || getTypeAction(VT) == Legal) && "Illegal type introduced after type legalization?"), function HandleOp, file /Users/void/llvm/llvm.src/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp, line 493.
0 llc 0x0085392e char const* std::find<char const*, char>(char const*, char const*, char const&) + 98
1 llc 0x00853e63 llvm::sys::PrintStackTraceOnErrorSignal() + 593
2 libSystem.B.dylib 0x96cac09b _sigtramp + 43
3 libSystem.B.dylib 0xffffffff _sigtramp +
1765097359
4 libSystem.B.dylib 0x96d24ec2 raise + 26
5 libSystem.B.dylib 0x96d3447f abort + 73
6 libSystem.B.dylib 0x96d26063 __assert_rtn + 101
7 llc 0x004f9018 llvm::cast_retty<llvm::SubprogramDesc, llvm::DebugInfoDesc*>::ret_type llvm::cast<llvm::Sub
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61001
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Sat, 13 Dec 2008 22:33:38 +0000 (22:33 +0000)]
LegalizeDAG is not supposed to introduce illegal
types into the DAG if they were not already there.
Check this with an assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60997
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 13 Dec 2008 21:04:20 +0000 (21:04 +0000)]
RLE isn't smart enough to eliminate this safely yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60994
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 13 Dec 2008 18:47:40 +0000 (18:47 +0000)]
rename some tests to be more uniform in naming convention.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60988
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 13 Dec 2008 18:39:44 +0000 (18:39 +0000)]
gvn should never crash on this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60987
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 13 Dec 2008 18:37:58 +0000 (18:37 +0000)]
These messages should always be emitted when NDEBUG is unset, not when
NDEBUG is unset and -debug is passed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60986
91177308-0d34-0410-b5e6-
96231b3b80d8
Mikhail Glushenkov [Sat, 13 Dec 2008 17:51:47 +0000 (17:51 +0000)]
Add a comment to the auto-generated docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60985
91177308-0d34-0410-b5e6-
96231b3b80d8
Mikhail Glushenkov [Sat, 13 Dec 2008 17:50:58 +0000 (17:50 +0000)]
Merge llvm-rst.css and llvm.css.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60984
91177308-0d34-0410-b5e6-
96231b3b80d8
Cedric Venet [Sat, 13 Dec 2008 10:55:13 +0000 (10:55 +0000)]
Add explicit this-> for some member function in templated base class.
These call are probably dependent but VS with /Za don't seems to think so. We need to help him.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60978
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 13 Dec 2008 09:28:44 +0000 (09:28 +0000)]
Temporarily revert r60973. It's inexplicably causing a failure when self-hosting LLVM:
llvm[2]: Linking Release executable opt (without symbols)
...
Undefined symbols:
"llvm::APFloat::IEEEsingle", referenced from:
__ZN4llvm7APFloat10IEEEsingleE$non_lazy_ptr in libLLVMCore.a(Constants.o)
__ZN4llvm7APFloat10IEEEsingleE$non_lazy_ptr in libLLVMCore.a(AsmWriter.o)
__ZN4llvm7APFloat10IEEEsingleE$non_lazy_ptr in libLLVMCore.a(ConstantFold.o)
"llvm::APFloat::IEEEdouble", referenced from:
__ZN4llvm7APFloat10IEEEdoubleE$non_lazy_ptr in libLLVMCore.a(Constants.o)
__ZN4llvm7APFloat10IEEEdoubleE$non_lazy_ptr in libLLVMCore.a(AsmWriter.o)
__ZN4llvm7APFloat10IEEEdoubleE$non_lazy_ptr in libLLVMCore.a(ConstantFold.o)
ld: symbol(s) not found
This is in release mode. To replicate, compile llvm and llvm-gcc in optimized
mode. Then build llvm, in optimized mode, with the newly created compiler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60977
91177308-0d34-0410-b5e6-
96231b3b80d8
Torok Edwin [Sat, 13 Dec 2008 08:25:29 +0000 (08:25 +0000)]
Fix getFieldAs() to use the parameter instead of 6.
Add missing DIType constructor, needed by DIVariable::getType().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60976
91177308-0d34-0410-b5e6-
96231b3b80d8
Mon P Wang [Sat, 13 Dec 2008 08:16:43 +0000 (08:16 +0000)]
Remove assertion to allow promotion of a truncating store operand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60975
91177308-0d34-0410-b5e6-
96231b3b80d8
Mon P Wang [Sat, 13 Dec 2008 08:15:14 +0000 (08:15 +0000)]
Added basic support for expanding VSETCC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60974
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 13 Dec 2008 07:22:47 +0000 (07:22 +0000)]
make RLE preserve the name of the load that it replaces. This is just
a pretification of the IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60973
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Sat, 13 Dec 2008 07:18:38 +0000 (07:18 +0000)]
On big-endian machines it is wrong to do a full
width register load followed by a truncating
store for the copy, since the load will not place
the value in the lower bits. Probably partial
loads/stores can never happen here, but fix it
anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60972
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Sat, 13 Dec 2008 05:21:37 +0000 (05:21 +0000)]
Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60971
91177308-0d34-0410-b5e6-
96231b3b80d8
Mikhail Glushenkov [Sat, 13 Dec 2008 03:11:37 +0000 (03:11 +0000)]
Some more documentation tweaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60970
91177308-0d34-0410-b5e6-
96231b3b80d8
Mikhail Glushenkov [Sat, 13 Dec 2008 02:28:58 +0000 (02:28 +0000)]
More cosmetic tweaks for llvmc docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60969
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Fri, 12 Dec 2008 22:42:35 +0000 (22:42 +0000)]
Re-enable test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60968
91177308-0d34-0410-b5e6-
96231b3b80d8