| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
rather than calling hasConstantValue. No intended functionality change.
llvm-svn: 119352
|
| |
|
|
|
|
| |
it to get better phi node simplification.
llvm-svn: 119055
|
| |
|
|
|
|
|
|
|
|
| |
offload the work to hasConstantValue rather than do something more
complicated (such handling mutually recursive phis) because (1) it is
not clear it is worth it; and (2) if it is worth it, maybe such logic
would be better placed in hasConstantValue. Adjust some GVN tests
which are now cleaned up much further (eg: all phi nodes are removed).
llvm-svn: 119043
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SimplifyAssociativeOrCommutative) "(A op C1) op C2" -> "A op (C1 op C2)",
which previously was only done if C1 and C2 were constants, to occur whenever
"C1 op C2" simplifies (a la InstructionSimplify). Since the simplifying operand
combination can no longer be assumed to be the right-hand terms, consider all of
the possible permutations. When compiling "gcc as one big file", transform 2
(i.e. using right-hand operands) fires about 4000 times but it has to be said
that most of the time the simplifying operands are both constants. Transforms
3, 4 and 5 each fired once. Transform 6, which is an existing transform that
I didn't change, never fired. With this change, the testcase is now optimized
perfectly with one run of instcombine (previously it required instcombine +
reassociate + instcombine, and it may just have been luck that this worked).
llvm-svn: 119002
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"%z = %x and %y". If GVN can prove that %y equals %x, then it turns
this into "%z = %x and %x". With the new code, %z will be replaced
with %x everywhere (and then deleted). Previously %z would be value
numbered too, which is a waste of time. Also, while a clever value
numbering algorithm would give %z the same value number as %x, our
current one doesn't do so (at least I don't think it does). The new
logic has an essentially equivalent effect to what you would get if
%z was given the same value number as %x, i.e. it should make value
numbering smarter. While there, get hold of target data once at the
start rather than a gazillion times all over the place.
llvm-svn: 118923
|
| |
|
|
|
|
|
| |
one store dead. This is especially noticeable in
SingleSource/Benchmarks/Shootout/objinst.
llvm-svn: 118875
|
| |
|
|
|
|
| |
and vaarg instructions.
llvm-svn: 118845
|
| |
|
|
|
|
|
|
|
|
|
|
| |
testing for dereferenceable pointers into a helper function,
isDereferenceablePointer. Teach it how to reason about GEPs
with simple non-zero indices.
Also eliminate ArgumentPromtion's IsAlwaysValidPointer,
which didn't check for weak externals or out of range gep
indices.
llvm-svn: 118840
|
| |
|
|
| |
llvm-svn: 118804
|
| |
|
|
| |
llvm-svn: 118788
|
| |
|
|
|
|
| |
execute. Make Sink's predicate more precise.
llvm-svn: 118787
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
references. For example, this allows gvn to eliminate the load in
this example:
void foo(int n, int* p, int *q) {
p[0] = 0;
p[1] = 1;
if (n) {
*q = p[0];
}
}
llvm-svn: 118714
|
| |
|
|
|
|
| |
instructions instead of hard-coding operand numbers.
llvm-svn: 118698
|
| |
|
|
|
|
| |
it, and to be consistent.
llvm-svn: 118692
|
| |
|
|
|
|
| |
arbitrary memory into a helper function, and adjust some comments.
llvm-svn: 118687
|
| |
|
|
|
|
|
| |
order to reduce ((x<<30)>>24) to x<<6, check the
correct bits. PR 8547.
llvm-svn: 118665
|
| |
|
|
|
|
| |
chaining and simplify FunctionAttrs' GetModRefBehavior logic.
llvm-svn: 118660
|
| |
|
|
| |
llvm-svn: 118627
|
| |
|
|
|
|
|
| |
memory. This isn't a real improvement with present day AliasAnalysis
implementations; it's mainly for consistency.
llvm-svn: 118624
|
| |
|
|
| |
llvm-svn: 118618
|
| |
|
|
| |
llvm-svn: 118617
|
| |
|
|
| |
llvm-svn: 118430
|
| |
|
|
| |
llvm-svn: 118417
|
| |
|
|
|
|
|
|
|
|
|
|
| |
to optionally look for constant or local (alloca) memory.
Teach BasicAliasAnalysis::pointsToConstantMemory to look through Select
and Phi nodes, and to support looking for local memory.
Remove FunctionAttrs' PointsToLocalOrConstantMemory function, now that
AliasAnalysis knows all the tricks that it knew.
llvm-svn: 118412
|
| |
|
|
|
|
| |
knows about intrinsic functions.
llvm-svn: 118410
|
| |
|
|
|
|
| |
the code more self-documenting.
llvm-svn: 118171
|
| |
|
|
|
|
|
|
| |
threshold given to createFunctionInliningPass().
Both opt -O3 and clang would silently ignore the -inline-threshold option.
llvm-svn: 118117
|
| |
|
|
|
|
|
|
| |
will BECOME the low
bits are zero, not that the current low bits are zero. Fixes <rdar://problem/8606771>.
llvm-svn: 117953
|
| |
|
|
|
|
| |
it claiming not to have side-effects is no longer needed.
llvm-svn: 117789
|
| |
|
|
|
|
|
|
|
| |
consider it to be readonly. In fact, don't even consider it to be
readonly if it does a volatile load from an AllocaInst either (it
is debatable as to whether readonly would be correct or not in this
case; play safe for the moment). This fixes PR8279.
llvm-svn: 117783
|
| |
|
|
| |
llvm-svn: 117728
|
| |
|
|
| |
llvm-svn: 117727
|
| |
|
|
| |
llvm-svn: 117722
|
| |
|
|
|
|
|
|
| |
This code had previously used 2*N, where N is the mask length, to represent
undef. That is not safe because the shufflevector operands may have more
than N elements -- they don't have to match the result type.
llvm-svn: 117721
|
| |
|
|
|
|
|
|
| |
Allow splats even if they don't match either of the original shuffles,
possibly due to undef entries in the shuffles masks. Radar 8597790.
Also fix some 80-column violations.
llvm-svn: 117719
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
propagation. Instruction simplification
needs to be guaranteed never to be run on an unreachable block. However, earlier block simplifications may have
changed the CFG to make block that were reachable when we began our iteration unreachable by the time we try to
simplify them. (Note that this also means that our depth-first iterators were potentially being invalidated).
This should not have a large impact on code quality, since later runs of instcombine should pick up these simplifications.
Fixes PR8506.
llvm-svn: 117709
|
| |
|
|
|
|
| |
basic logic, added initial platform support.
llvm-svn: 117667
|
| |
|
|
| |
llvm-svn: 117510
|
| |
|
|
|
|
| |
from stores when folding in bitcasts.
llvm-svn: 117265
|
| |
|
|
|
|
|
|
|
| |
it isn't unreachable and should not be zapped. The check for the entry block
was missing in one case: a block containing a unwind instruction. While there,
do some small cleanups: "M" is not a great name for a Function* (it would be
more appropriate for a Module*), change it to "Fn"; use Fn in more places.
llvm-svn: 117224
|
| |
|
|
| |
llvm-svn: 117213
|
| |
|
|
|
|
| |
until other LLVM projects using these are cleaned up.
llvm-svn: 117200
|
| |
|
|
| |
llvm-svn: 117154
|
| |
|
|
|
|
|
| |
it looks like maybe it was supposed to be used in the
test...), so zap it (gcc-4.6 warning).
llvm-svn: 117023
|
| |
|
|
|
|
| |
uint64_t, plus fixes for places I missed before.
llvm-svn: 116875
|
| |
|
|
| |
llvm-svn: 116858
|
| |
|
|
|
|
|
| |
they do not also require them. This allows us to reduce inter-pass linkage
dependencies.
llvm-svn: 116854
|
| |
|
|
|
|
| |
use uint64_t.
llvm-svn: 116839
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
exposes an initializeMyPassFunction(), which
must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize
the pass's dependencies.
Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.
I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems
with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass
registration/creation, please send the testcase to me directly.
llvm-svn: 116820
|
| |
|
|
| |
llvm-svn: 116815
|