| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
phi translation of complex expressions like &A[i+1]. This has the
following benefits:
1. The phi translation logic is all contained in its own class with
a strong interface and verification that it is self consistent.
2. The logic is more correct than before. Previously, if intermediate
expressions got PHI translated, we'd miss the update and scan for
the wrong pointers in predecessor blocks. @phi_trans2 is a testcase
for this.
3. We have a lot less code in memdep.
We can handle phi translation across blocks of things like @phi_trans3,
which is pretty insane :).
This patch should fix the miscompiles of 255.vortex, and I tested it
with a bootstrap of llvm-gcc, llvm-test and dejagnu of course.
llvm-svn: 90926
|
|
|
|
|
|
|
| |
because clang lowers nontrivial automatic struct/array inits to memcpy from
a global array.
llvm-svn: 90698
|
|
|
|
| |
llvm-svn: 90697
|
|
|
|
|
|
|
|
|
|
|
| |
short x(short *A) {
memset(A, 1, sizeof(*A)*100);
return A[42];
}
to 'return 257' instead of doing the load.
llvm-svn: 90695
|
|
|
|
| |
llvm-svn: 90408
|
|
|
|
|
|
|
|
| |
GVN,
per Chris' comments. Adjust testcases to match.
llvm-svn: 90304
|
|
|
|
| |
llvm-svn: 90299
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
handle cases like this:
void test(int N, double* G) {
long j;
for (j = 1; j < N - 1; j++)
G[j+1] = G[j] + G[j+1];
}
where G[1] isn't live into the loop.
llvm-svn: 90041
|
|
|
|
|
|
| |
inserted instructions. No functionality change until someone starts using it.
llvm-svn: 90039
|
|
|
|
|
|
|
| |
to inform GVN about the newly inserted values. This fixes
PR5631.
llvm-svn: 90022
|
|
|
|
|
|
|
| |
fixes PR5630 and sets the stage for the next phase of goodness (testcase
pending).
llvm-svn: 90019
|
|
|
|
|
|
|
| |
where it is not available. It's unclear how to get this inserted
computation into GVN's scalar availability sets, Owen, help? :)
llvm-svn: 89997
|
|
|
|
|
|
|
| |
translation done by memdep, and reenable gep translation
again.
llvm-svn: 89992
|
|
|
|
| |
llvm-svn: 88742
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch forbids implicit conversion of DenseMap::const_iterator to
DenseMap::iterator which was possible because DenseMapIterator inherited
(publicly) from DenseMapConstIterator. Conversion the other way around is now
allowed as one may expect.
The template DenseMapConstIterator is removed and the template parameter
IsConst which specifies whether the iterator is constant is added to
DenseMapIterator.
Actually IsConst parameter is not necessary since the constness can be
determined from KeyT but this is not relevant to the fix and can be addressed
later.
Patch by Victor Zverovich!
llvm-svn: 86636
|
|
|
|
| |
llvm-svn: 85692
|
|
|
|
| |
llvm-svn: 85609
|
|
|
|
|
|
| |
purposes for GVN/DSE.
llvm-svn: 85383
|
|
|
|
| |
llvm-svn: 85286
|
|
|
|
|
|
| |
to free()
llvm-svn: 85181
|
|
|
|
|
|
| |
subclass of AllocationInst, so it no longer is necessary.
llvm-svn: 84969
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"In the existing code, if the load and the value to replace it with are
of different types *and* target data is available, it tries to use the
target data to coerce the replacement value to the type of the load.
Otherwise, it skips all effort to handle the type mismatch and just
feeds the wrongly-typed replacement value to replaceAllUsesWith, which
triggers an assertion.
The patch replaces it with an outer if checking for type mismatch, and
an inner if-else that checks whether target data is available and, if
not, returns false rather than trying to replace the load."
Patch by Kenneth Uildriks!
llvm-svn: 84739
|
|
|
|
|
|
| |
numbering first class aggregate instructions while we're at it.
llvm-svn: 84547
|
|
|
|
| |
llvm-svn: 84533
|
|
|
|
| |
llvm-svn: 84118
|
|
|
|
|
|
|
|
| |
from GVN, this also speeds it up, inserts fewer PHI nodes (see the
testcase) and allows it to remove more loads (due to fewer PHI nodes
standing in the way).
llvm-svn: 83746
|
|
|
|
| |
llvm-svn: 83742
|
|
|
|
| |
llvm-svn: 83701
|
|
|
|
| |
llvm-svn: 82936
|
|
|
|
|
|
| |
update all the callers.
llvm-svn: 82889
|
|
|
|
|
|
| |
bootstrap problems.
llvm-svn: 82464
|
|
|
|
|
|
| |
arrays and structs, which cannot be bitcast to integers.
llvm-svn: 82460
|
|
|
|
|
|
|
| |
This doesn't kick in too much because of phi translation issues,
but this can be resolved in the future.
llvm-svn: 82447
|
|
|
|
| |
llvm-svn: 82446
|
|
|
|
| |
llvm-svn: 82444
|
|
|
|
|
|
| |
analysis, one that does the xform.
llvm-svn: 82443
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
from a piece of a large store when both are in the same block.
This allows clang to compile the testcase in PR4216 to this code:
_test_bitfield:
movl 4(%esp), %eax
movl %eax, %ecx
andl $-65536, %ecx
orl $32962, %eax
andl $40186, %eax
orl %ecx, %eax
ret
This is not ideal, but is a whole lot better than the code produced
by llvm-gcc:
_test_bitfield:
movw $-32574, %ax
orw 4(%esp), %ax
andw $-25350, %ax
movw %ax, 4(%esp)
movw 7(%esp), %cx
shlw $8, %cx
movzbl 6(%esp), %edx
orw %cx, %dx
movzwl %dx, %ecx
shll $16, %ecx
movzwl %ax, %eax
orl %ecx, %eax
ret
and dramatically better than that produced by gcc 4.2:
_test_bitfield:
pushl %ebx
call L3
"L00000000001$pb":
L3:
popl %ebx
movl 8(%esp), %eax
leal 0(,%eax,4), %edx
sarb $7, %dl
movl %eax, %ecx
andl $7168, %ecx
andl $-7201, %ebx
movzbl %dl, %edx
andl $1, %edx
sall $5, %edx
orl %ecx, %ebx
orl %edx, %ebx
andl $24, %eax
andl $-58336, %ebx
orl %eax, %ebx
orl $32962, %ebx
movl %ebx, %eax
popl %ebx
ret
llvm-svn: 82439
|
|
|
|
| |
llvm-svn: 82426
|
|
|
|
|
|
|
|
| |
so that nonlocal and partially redundant loads can use it as well.
The testcase shows examples of craziness this can handle. This triggers
*many* times in 176.gcc.
llvm-svn: 82403
|
|
|
|
|
|
| |
more generic.
llvm-svn: 82402
|
|
|
|
|
|
|
|
| |
(and load -> load) when the base pointers must alias but when
they are different types. This occurs very very frequently in
176.gcc and other code that uses bitfields a lot.
llvm-svn: 82399
|
|
|
|
| |
llvm-svn: 82355
|
|
|
|
|
|
|
|
| |
calls as to MallocInst.
Reviewed by Dan Gohman.
llvm-svn: 82300
|
|
|
|
|
|
|
|
| |
instead of a bool argument, and to do the dominator check itself.
This makes it eaiser to use when DominatorTree information is
available.
llvm-svn: 80920
|
|
|
|
| |
llvm-svn: 80766
|
|
|
|
| |
llvm-svn: 80170
|
|
|
|
| |
llvm-svn: 78948
|
|
|
|
|
|
| |
a trailing newline.
llvm-svn: 77719
|
|
|
|
| |
llvm-svn: 77685
|
|
|
|
| |
llvm-svn: 77635
|