| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
| |
inserted to replace that value must dominate all of of the basic
blocks associated with the uses of the value in the PHI, not just
one of them.
llvm-svn: 74376
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This helps it avoid reusing an instruction that doesn't dominate all
of the users, in cases where the original instruction was inserted
before all of the users were known. This may result in redundant
expansions of sub-expressions that depend on loop-unpredictable values
in some cases, however this isn't very common, and it primarily impacts
IndVarSimplify, so GVN can be expected to clean these up.
This eliminates the need for IndVarSimplify's FixUsesBeforeDefs,
which fixes several bugs.
llvm-svn: 74352
|
| |
|
|
| |
llvm-svn: 74351
|
| |
|
|
| |
llvm-svn: 74330
|
| |
|
|
| |
llvm-svn: 74285
|
| |
|
|
|
|
| |
and llvm.dbg.global_variables.
llvm-svn: 74251
|
| |
|
|
| |
llvm-svn: 74243
|
| |
|
|
|
|
|
| |
an invoke instruction, since the value isn't really live across that
edge.
llvm-svn: 74242
|
| |
|
|
| |
llvm-svn: 74240
|
| |
|
|
| |
llvm-svn: 74146
|
| |
|
|
|
|
|
|
| |
terminator, instead of after the last phi. This fixes a bug
exposed by ScalarEvolution analyzing more kinds of loops.
This fixes PR4436.
llvm-svn: 74072
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
trip counts in more cases.
Generalize ScalarEvolution's isLoopGuardedByCond code to recognize
And and Or conditions, splitting the code out into an
isNecessaryCond helper function so that it can evaluate Ands and Ors
recursively, and make SCEVExpander be much more aggressive about
hoisting instructions out of loops.
test/CodeGen/X86/pr3495.ll has an additional instruction now, but
it appears to be due to an arbitrary register allocation difference.
llvm-svn: 74048
|
| |
|
|
|
|
| |
preheader is already an instruction.
llvm-svn: 74031
|
| |
|
|
| |
llvm-svn: 73910
|
| |
|
|
| |
llvm-svn: 73906
|
| |
|
|
|
|
|
|
| |
now, this hasn't mattered, because ScalarEvolution hasn't been able
to compute trip counts for loops with multiple exits. But it will
soon.
llvm-svn: 73864
|
| |
|
|
|
|
| |
terminology that LoopInfo uses.
llvm-svn: 73863
|
| |
|
|
| |
llvm-svn: 73796
|
| |
|
|
|
|
|
| |
hand-crafted testcase which demonstrates the bug that was exposed
in 254.gap.
llvm-svn: 73793
|
| |
|
|
|
|
| |
which it isn't prepared to handle.
llvm-svn: 73787
|
| |
|
|
| |
llvm-svn: 73783
|
| |
|
|
|
|
|
|
| |
as if they were multiple uses of the same instruction. This interacts
well with the existing loadpre that j-t does to open up many new jump
threads earlier.
llvm-svn: 73768
|
| |
|
|
| |
llvm-svn: 73755
|
| |
|
|
|
|
|
| |
when it allows forming a tail call. Patch by Frits van
Bommel. This implements PR4323.
llvm-svn: 73752
|
| |
|
|
|
|
|
|
| |
strcmp -> memcmp when the lengths of the strings are unknown.
Patch by Nick Lewycky!
llvm-svn: 73751
|
| |
|
|
|
|
|
| |
as signed max tests. Along with r73717, this helps CodeGen avoid
emitting code for a maximum operation for this class of loop.
llvm-svn: 73718
|
| |
|
|
| |
llvm-svn: 73715
|
| |
|
|
|
|
|
|
|
|
|
| |
casted induction variables in cases where the cast
isn't foldable. It ended up being a pessimization in
many cases. This could be fixed, but it would require
a bunch of complicated code in IVUsers' clients. The
advantages of this approach aren't visible enough to
justify it at this time.
llvm-svn: 73706
|
| |
|
|
|
|
|
| |
C is not a low-bits mask, and add a similar instcombine for
zext((trunc(t) & C) ^ C).
llvm-svn: 73705
|
| |
|
|
|
|
| |
multiple users.
llvm-svn: 73656
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
move loads back past a check that the load address
is valid, see new testcase. The test that went
in with 72661 has exactly this case, except that
the conditional it's moving past is checking
something else; I've settled for changing that
test to reference a global, not a pointer. It
may be possible to scan all the tests you pass and
make sure none of them are checking any component
of the address, but it's not trivial and I'm not
trying to do that here.
llvm-svn: 73632
|
| |
|
|
| |
llvm-svn: 73625
|
| |
|
|
| |
llvm-svn: 73621
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
>>
>
> It doesn't matter in terms of semantics: because AnalyzeGlobal
> returned false, we're guaranteed the address of the global is never
> taken. I wouldn't be surprised if we end up generating invalid IR in
> some cases, though, because of the semantics of replaceAllUsesWith.
> Do you have a testcase that breaks?
>
>
The problem is replaceAllUsesWith asserts for type mismatch here. Try attached .bc with llvm-ld.
assert(New->getType() == getType() &&
"replaceAllUses of value with new value of different type!");
Since stack is always on address space zero, I don't think that type of GV in a different address space is ever going to match.
The other way is to allow replaceAllUsesWith to ignore address spaces while comparing types. (do we have a way to do that ?).
But then such an optimization may fail the entire idea of user wanting to place a variable into different memory space. The original idea of user might be to save on the stack space (data memory) and hence he asked the variable to be placed into different memory space (program memory). So the best bet here is to deny this optimization by checking
GV->getType()->getAddressSpace() == 0.
llvm-svn: 73605
|
| |
|
|
|
|
| |
SRem.
llvm-svn: 73598
|
| |
|
|
| |
llvm-svn: 73541
|
| |
|
|
|
|
|
| |
to ignore readonly calls, and factor it out of instcombine so
that it can be used by other passes. Patch by Frits van Bommel!
llvm-svn: 73506
|
| |
|
|
| |
llvm-svn: 73451
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
failures.
To support this, add some utility functions to Type to help support
vector/scalar-independent code. Change ConstantInt::get and
ConstantFP::get to support vector types, and add an overload to
ConstantInt::get that uses a static IntegerType type, for
convenience.
Introduce a new getConstant method for ScalarEvolution, to simplify
common use cases.
llvm-svn: 73431
|
| |
|
|
|
|
|
|
| |
problem addressed in 31284, but the patch there only
addressed the case where an invoke is the first thing in
a block.
llvm-svn: 73416
|
| |
|
|
| |
llvm-svn: 73412
|
| |
|
|
| |
llvm-svn: 73398
|
| |
|
|
| |
llvm-svn: 73362
|
| |
|
|
|
|
| |
SmallVector instead of std::vector.
llvm-svn: 73357
|
| |
|
|
| |
llvm-svn: 73355
|
| |
|
|
| |
llvm-svn: 73342
|
| |
|
|
|
|
|
|
|
|
| |
is that, for functions whose bodies are entirely guarded by an if-statement, it
can be profitable to pull the test out of the callee and into the caller.
This code has had some cursory testing, but still has a number of known issues
on the LLVM test suite.
llvm-svn: 73338
|
| |
|
|
|
|
| |
pointer. This fixes kimwitu++. Pointed out by Frits van Bommel on review!
llvm-svn: 73299
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
non-default addrspaces.
llvm-svn: 73253
|