| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
induction variable when the addrec to be expanded does not require
a wider type. This eliminates the need for IndVarSimplify to
micro-manage SCEV expansions, because SCEVExpander now
automatically expands them in the form that IndVarSimplify considers
to be canonical. (LSR still micro-manages its SCEV expansions,
because it's optimizing for the target, rather than for
other optimizations.)
Also, this uses the new getAnyExtendExpr, which has more clever
expression simplification logic than the IndVarSimplify code it
replaces, and this cleans up some ugly expansions in code such as
the included masked-iv.ll testcase.
llvm-svn: 73294
|
|
|
|
|
|
|
|
|
| |
immediately casted. At present, this is just a minor code
simplification. In the future, the expansion code may be able
to make better choices if it knows what the desired result
type will be.
llvm-svn: 73137
|
|
|
|
| |
llvm-svn: 72949
|
|
|
|
| |
llvm-svn: 72453
|
|
|
|
|
|
|
|
|
|
|
|
| |
possible. For example, it now emits
%p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 2, i64 %tmp, i64 1
instead of the equivalent but less obvious
%p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 0, i64 %tmp, i64 19
llvm-svn: 72452
|
|
|
|
|
|
|
| |
division operation, don't attempt to use the operation's value as
the base of a getelementptr. This fixes PR4271.
llvm-svn: 72422
|
|
|
|
|
|
| |
Also fix 80 column violation.
llvm-svn: 72371
|
|
|
|
|
|
| |
Use &Ops[0] instead, which is safe since Ops will never be empty here.
llvm-svn: 72368
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sending SCEVUnknowns to expandAddToGEP. This avoids the need for
expandAddToGEP to bend the rules and peek into SCEVUnknown
expressions.
Factor out the code for testing whether a SCEV can be factored by
a constant for use in a GEP index. This allows it to handle
SCEVAddRecExprs, by recursing.
As a result, SCEVExpander can now put more things in GEP indices,
so it emits fewer explicit mul instructions.
llvm-svn: 72366
|
|
|
|
|
|
|
|
|
|
|
| |
they are trivially dead.
Fix by clearing the rewriter cache before deleting the trivially dead
instructions.
Also make InsertedExpressions use an AssertingVH to catch these
bugs easier.
llvm-svn: 72364
|
|
|
|
|
|
|
| |
use in expanding SCEVAddExprs with GEPs. The operands of a
SCEVMulExpr need to be multiplied together, not added.
llvm-svn: 72250
|
|
|
|
|
|
|
| |
MultiSource/Benchmarks/Prolangs-C/football and a variety of other
failures.
llvm-svn: 72120
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
instructions. It attempts to create high-level multi-operand GEPs,
though in cases where this isn't possible it falls back to casting
the pointer to i8* and emitting a GEP with that. Using GEP instructions
instead of ptrtoint+arithmetic+inttoptr helps pointer analyses that
don't use ScalarEvolution, such as BasicAliasAnalysis.
Also, make the AddrModeMatcher more aggressive in handling GEPs.
Previously it assumed that operand 0 of a GEP would require a register
in almost all cases. It now does extra checking and can do more
matching if operand 0 of the GEP is foldable. This fixes a problem
that was exposed by SCEVExpander using GEPs.
llvm-svn: 72093
|
|
|
|
| |
llvm-svn: 70557
|
|
|
|
|
|
|
| |
always folded by the regular constant folder because it doesn't have
TargetData information.
llvm-svn: 70553
|
|
|
|
|
|
|
|
|
|
|
| |
with the persistent insertion point, and change IndVars to make
use of it. This fixes a bug where IndVars was holding on to a
stale insertion point and forcing the SCEVExpander to continue to
use it.
This fixes PR4038.
llvm-svn: 69892
|
|
|
|
| |
llvm-svn: 69816
|
|
|
|
|
|
|
|
|
|
|
| |
instructions in order to avoid inserting new ones. However, if
the cast instruction is the SCEVExpander's InsertPt, this
causes subsequently emitted instructions to be inserted near
the cast, and not at the location of the original insert point.
Fix this by adjusting the insert point in such cases.
This fixes PR4009.
llvm-svn: 69808
|
|
|
|
|
|
| |
to better handle inserting instructions at the end of a block.
llvm-svn: 69807
|
|
|
|
|
|
| |
the code to minimize dependencies on TargetData.
llvm-svn: 69644
|
|
|
|
| |
llvm-svn: 69450
|
|
|
|
| |
llvm-svn: 69310
|
|
|
|
|
|
|
|
| |
size from the integer, requiring zero extension or truncation. Don't
create ZExtInsts with pointer types. This fixes a regression in
consumer-jpeg.
llvm-svn: 69307
|
|
|
|
|
|
|
| |
not create ICmpInsts with operands of different types. This fixes
a regression in Applications/d/make_dparser.
llvm-svn: 69294
|
|
|
|
|
|
| |
and ptrtoint-of-inttoptr expressions. This fixes a regression in 300.twolf.
llvm-svn: 69293
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
have pointer types, though in contrast to C pointer types, SCEV
addition is never implicitly scaled. This not only eliminates the
need for special code like IndVars' EliminatePointerRecurrence
and LSR's own GEP expansion code, it also does a better job because
it lets the normal optimizations handle pointer expressions just
like integer expressions.
Also, since LLVM IR GEPs can't directly index into multi-dimensional
VLAs, moving the GEP analysis out of client code and into the SCEV
framework makes it easier for clients to handle multi-dimensional
VLAs the same way as other arrays.
Some existing regression tests show improved optimization.
test/CodeGen/ARM/2007-03-13-InstrSched.ll in particular improved to
the point where if-conversion started kicking in; I turned it off
for this test to preserve the intent of the test.
llvm-svn: 69258
|
|
|
|
|
|
| |
PR3296 and PR3302.
llvm-svn: 62160
|
|
|
|
| |
llvm-svn: 60407
|
|
|
|
| |
llvm-svn: 57433
|
|
|
|
| |
llvm-svn: 53217
|
|
|
|
| |
llvm-svn: 52614
|
|
|
|
| |
llvm-svn: 52612
|
|
|
|
| |
llvm-svn: 52464
|
|
|
|
|
|
| |
function, and make use of it in several places.
llvm-svn: 52463
|
|
|
|
|
|
|
|
|
|
|
| |
take into account the instrucion pointed by InsertPt. Thanks to it,
returning the new value of InsertPt to the InsertBinop() caller can be
avoided. The bug was, actually, in visitAddRecExpr() method which wasn't
correctly handling changes of InsertPt. There shouldn't be any
performance regression, as -gvn pass (run after -indvars) removes any
redundant binops.
llvm-svn: 52291
|
|
|
|
|
|
|
|
|
| |
Add a safety measure. It isn't safe to assume in ScalarEvolutionExpander that
all loops are in canonical form (but it should be safe for loops that have
AddRecs).
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
llvm-svn: 52275
|
|
|
|
|
|
| |
Legacy interfaces will be in place for some time. (Merge from use-diet branch.)
llvm-svn: 51200
|
|
|
|
|
|
|
|
| |
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.
llvm-svn: 49277
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Parse reversed smax and umax as smin and umin and express them with negative
or binary-not SCEVs (which are really just subtract under the hood).
Parse 'xor %x, -1' as (-1 - %x).
Remove dead code (ConstantInt::get always returns a ConstantInt).
Don't use getIntegerSCEV(-1, Ty). The first value is an int, then it gets
passed into a uint64_t. Instead, create the -1 directly from
ConstantInt::getAllOnesValue().
llvm-svn: 47360
|
|
|
|
|
|
| |
before we reuse it.
llvm-svn: 46908
|
|
|
|
| |
llvm-svn: 45418
|
|
|
|
| |
llvm-svn: 44319
|
|
|
|
|
|
|
| |
SCEV subclasses to being non-static member functions of the ScalarEvolution
class.
llvm-svn: 43224
|
|
|
|
|
|
| |
for consistency with many other transforms.
llvm-svn: 41957
|
|
|
|
|
|
| |
- Move SCEVExpander::expand() out-of-line workarounding possible toolchain bug
llvm-svn: 41197
|
|
|
|
| |
llvm-svn: 37602
|
|
|
|
|
|
|
|
|
|
| |
This created an ambiguity for expandInTy to decide when to use
sign-extension or zero-extension, but it turns out that most of its callers
don't actually need a type conversion, now that LLVM types don't have
explicit signedness. Drop expandInTy in favor of plain expand, and change
the few places that actually need a type conversion to do it themselves.
llvm-svn: 37591
|
|
|
|
|
|
| |
CodeGen/Generic/2007-04-17-lsr-crash.ll
llvm-svn: 36231
|
|
|
|
|
|
| |
less huge code that needs to be cleaned up by sdisel.
llvm-svn: 35959
|
|
|
|
|
|
| |
Constant::isNullValue() in situations where it is possible.
llvm-svn: 34821
|