Dan Gohman
bd121d9b9f
Fix Value::stripPointerCasts and BasicAA to avoid trouble on
...
code in unreachable blocks, which have have use-def cycles.
This fixes PR7514.
llvm-svn: 107071
2010-06-28 21:16:52 +00:00
Dan Gohman
b2a87fa39d
Pointers to zero-sized objects don't point to overlapping objects.
...
llvm-svn: 100789
2010-04-08 18:11:50 +00:00
Chris Lattner
23334439e9
add newlines at the end of files.
...
llvm-svn: 100705
2010-04-07 22:53:17 +00:00
Mon P Wang
484bbe6aa9
Reapply address space patch after fixing an issue in MemCopyOptimizer.
...
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
llvm-svn: 100304
2010-04-04 03:10:48 +00:00
Mon P Wang
0ccf050ca3
Revert r100191 since it breaks objc in clang
...
llvm-svn: 100199
2010-04-02 18:43:02 +00:00
Mon P Wang
a01350755e
Reapply address space patch after fixing an issue in MemCopyOptimizer.
...
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
llvm-svn: 100191
2010-04-02 18:04:15 +00:00
Bob Wilson
aae933cc81
Revert Mon Ping's change 99928, since it broke all the llvm-gcc buildbots.
...
llvm-svn: 99948
2010-03-30 22:27:04 +00:00
Mon P Wang
9351ea594a
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
...
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
A update of langref will occur in a subsequent checkin.
llvm-svn: 99928
2010-03-30 20:55:56 +00:00
Dan Gohman
5fa04f2707
Delete useless trailing semicolons.
...
llvm-svn: 92740
2010-01-05 17:55:26 +00:00
Chris Lattner
6d180b4a2c
gvn is optimizing this better now.
...
llvm-svn: 90696
2009-12-06 04:16:05 +00:00
Chris Lattner
911e5047d0
@test9 is a testcase for r89958. Before 89958, we misanalyzed the
...
first expression as P+4+4*i which we considered to possibly alias
P+4*j. Now we correctly analyze the former one as P+1+4*i.
@test10 is a sanity test that verfies that we know that P+4+4*i != P+4*i.
llvm-svn: 89960
2009-11-26 19:25:46 +00:00
Chris Lattner
ce573daf09
Implement PR1143 (at -m64) by making basicaa look through extensions. We
...
previously already handled it at -m32 because there were no i32->i64
extensions for addressing.
llvm-svn: 89959
2009-11-26 18:53:33 +00:00
Chris Lattner
d86a693b70
teach GetLinearExpression to be a bit more aggressive.
...
llvm-svn: 89955
2009-11-26 17:00:01 +00:00
Chris Lattner
9c88c96b3f
Teach basicaa that x|c == x+c when the c bits of x are clear. This
...
allows us to compile the example in readme.txt into:
LBB1_1: ## %bb
movl 4(%rdx,%rax), %ecx
movl %ecx, %esi
imull (%rdx,%rax), %esi
imull %esi, %ecx
movl %esi, 8(%rdx,%rax)
imull %ecx, %esi
movl %ecx, 12(%rdx,%rax)
movl %esi, 16(%rdx,%rax)
imull %ecx, %esi
movl %esi, 20(%rdx,%rax)
addq $16, %rax
cmpq $4000, %rax
jne LBB1_1
instead of:
LBB1_1:
movl (%rdx,%rax), %ecx
imull 4(%rdx,%rax), %ecx
movl %ecx, 8(%rdx,%rax)
imull 4(%rdx,%rax), %ecx
movl %ecx, 12(%rdx,%rax)
imull 8(%rdx,%rax), %ecx
movl %ecx, 16(%rdx,%rax)
imull 12(%rdx,%rax), %ecx
movl %ecx, 20(%rdx,%rax)
addq $16, %rax
cmpq $4000, %rax
jne LBB1_1
GCC (4.2) doesn't seem to be able to eliminate the loads in this
testcase either, it generates:
L2:
movl (%rdx), %eax
imull 4(%rdx), %eax
movl %eax, 8(%rdx)
imull 4(%rdx), %eax
movl %eax, 12(%rdx)
imull 8(%rdx), %eax
movl %eax, 16(%rdx)
imull 12(%rdx), %eax
movl %eax, 20(%rdx)
addl $4, %ecx
addq $16, %rdx
cmpl $1002, %ecx
jne L2
llvm-svn: 89952
2009-11-26 16:26:43 +00:00
Chris Lattner
677b93d4c8
teach basicaa that A[i] != A[i+1].
...
llvm-svn: 89951
2009-11-26 16:18:10 +00:00
Chris Lattner
82257f0385
rename test
...
llvm-svn: 89950
2009-11-26 16:08:41 +00:00
Chris Lattner
69e59e50f3
Change the other half of aliasGEP (which handles GEP differencing) to use DecomposeGEPExpression. This dramatically simplifies and shrinks the code by eliminating the horrible CheckGEPInstructions method, fixes a miscompilation (@test3) and makes the code more aggressive. In particular, we now handle the @test4 case, which is reduced from the SmallPtrSet constructor. Missing this caused us to emit a variable length memset instead of a fixed size one.
...
llvm-svn: 89922
2009-11-26 02:17:34 +00:00
Chris Lattner
862a3532d6
add a new random feature test
...
llvm-svn: 89921
2009-11-26 02:16:28 +00:00
Chris Lattner
632f60ccc9
remove a silly condition that doesn't make a lot of sense anymore.
...
llvm-svn: 89601
2009-11-22 16:15:59 +00:00
Kenneth Uildriks
e711736014
Make opt default to not adding a target data string and update tests that depend on target data to supply it within the test
...
llvm-svn: 85900
2009-11-03 15:29:06 +00:00
Dan Gohman
c8468855a7
Teach BasicAA how to analyze Select instructions, and make it more
...
aggressive on PHI instructions.
llvm-svn: 85158
2009-10-26 21:55:43 +00:00
Chris Lattner
eebed04912
fix test
...
llvm-svn: 84405
2009-10-18 05:03:00 +00:00
Chris Lattner
8db424f027
tighten up test3, add test3a for the converse
...
transform, which isn't happening yet.
llvm-svn: 84402
2009-10-18 04:55:26 +00:00
Chris Lattner
aff491fab6
tighten test2, add a test that it doesn't get transformed in the invalid edge case.
...
llvm-svn: 84401
2009-10-18 04:50:18 +00:00
Nick Lewycky
671ca16583
Merge tests into modref.ll. Also add a test for r84174 at Chris' behest!
...
llvm-svn: 84400
2009-10-18 04:41:36 +00:00
Nick Lewycky
d21c892821
Add a couple new testcases.
...
llvm-svn: 84385
2009-10-18 00:42:07 +00:00
Chris Lattner
1ed26100a4
replace a useless test with a useful one
...
llvm-svn: 84383
2009-10-17 23:59:51 +00:00
Nick Lewycky
0498027dec
Make use of the result of the loads even though that means adding -instcombine.
...
llvm-svn: 84125
2009-10-14 19:02:13 +00:00
Evan Cheng
907fd9c3fb
Another BasicAA fix. If a value does not alias a GEP's base pointer, then it
...
cannot alias the GEP. GEP pointer alias rule states this clearly:
A pointer value formed from a getelementptr instruction is associated with the
addresses associated with the first operand of the getelementptr.
llvm-svn: 84079
2009-10-14 06:41:49 +00:00
Evan Cheng
b193d9df99
Replace test with a simpler hand crafted one.
...
llvm-svn: 84069
2009-10-14 01:45:10 +00:00
Evan Cheng
3130aba687
Teach basic AA about PHI nodes. If all operands of a phi NoAlias another value than it's safe to declare the PHI NoAlias the value. Ditto for MustAlias.
...
llvm-svn: 84038
2009-10-13 22:02:20 +00:00
Chris Lattner
a433d8cb67
don't use dead loads as tests.
...
llvm-svn: 83985
2009-10-13 17:39:29 +00:00
Nick Lewycky
72f185f281
Teach BasicAA a little something about the atomic intrinsics: they can only
...
modify through the pointer they're given.
llvm-svn: 83959
2009-10-13 07:48:38 +00:00
Dan Gohman
c9307490ce
Eliminate more redundant llvm-as calls.
...
llvm-svn: 81540
2009-09-11 18:17:12 +00:00
Dan Gohman
205b641954
Change tests from "opt %s" to "opt < %s" so that opt doesn't see the
...
input filename so that opt doesn't print the input filename in the
output so that grep lines in the tests don't unintentionally match
strings in the input filename.
llvm-svn: 81537
2009-09-11 18:01:28 +00:00
Dan Gohman
142428ce64
Eliminate more uses of llvm-as and llvm-dis.
...
llvm-svn: 81293
2009-09-09 00:09:15 +00:00
Dan Gohman
a3ab9b3b9e
Convert a few more opt | llvm-dis to opt -S.
...
llvm-svn: 81261
2009-09-08 22:41:33 +00:00
Dan Gohman
c95df8b6d8
Use opt -S instead of piping bitcode output through llvm-dis.
...
llvm-svn: 81257
2009-09-08 22:34:10 +00:00
Dan Gohman
8d84372836
Change these tests to feed the assembly files to opt directly, instead
...
of using llvm-as, now that opt supports this.
llvm-svn: 81226
2009-09-08 16:50:01 +00:00
Chris Lattner
4c06cf3a4f
rename test so that name reflects what it is testing for.
...
llvm-svn: 80519
2009-08-30 21:36:39 +00:00
Chris Lattner
0ad4b1ca5e
convert to filecheck format.
...
llvm-svn: 80518
2009-08-30 21:36:06 +00:00
Dan Gohman
5dd6f54a5f
Teach BasicAliasAnalysis to understand constant gep indices that fall
...
beyond their associated static array type.
I believe that this fixes a legitimate bug, because BasicAliasAnalysis
already has code to check for this condition that works for non-constant
indices, however it was missing the case of constant indices. With this
change, it checks for both.
This fixes PR4267, and miscompiles of SPEC 188.ammp and 464.h264.href.
llvm-svn: 72451
2009-05-27 01:48:27 +00:00
Chris Lattner
f8afc9ecda
change this to test for an alias result more directly.
...
llvm-svn: 67046
2009-03-16 18:28:27 +00:00
Nick Lewycky
d271c19fea
Add a replacement for 2009-02-12-GEPNoalias.ll that works without -debug.
...
llvm-svn: 67011
2009-03-14 19:40:09 +00:00
Chris Lattner
5972bc6234
remove a buggy test, it is not ok to use -debug in RUN line.
...
llvm-svn: 66918
2009-03-13 18:19:34 +00:00
Nick Lewycky
f6c8dc0825
BasicAA was making the assumption that a local allocation which hadn't escaped
...
couldn't ever be the return of call instruction. However, it's quite possible
that said local allocation is itself the return of a function call. That's
what malloc and calloc are for, actually.
llvm-svn: 64442
2009-02-13 07:06:27 +00:00
Owen Anderson
c418b82207
Finish making AliasAnalysis aware of the fact that most atomic intrinsics only dereference their arguments, and enhance
...
BasicAA to make use of this fact when computing ModRef info.
llvm-svn: 63718
2009-02-04 05:16:46 +00:00
Nick Lewycky
8f96b51785
Resubmit support for the 'nocapture' attribute.
...
The problematic part of this patch is that we were out of attribute bits,
requiring some fancy bit hacking to make it fit (by shrinking alignment)
without breaking existing users or the file format.
This change will require users to rebuild llvm-gcc to match llvm.
llvm-svn: 61239
2008-12-19 06:39:12 +00:00
Bill Wendling
905350a341
Remove empty test.
...
llvm-svn: 61095
2008-12-16 19:07:17 +00:00
Bill Wendling
f807a68f2e
Temporarily revert r61019, r61030, and r61040. These were breaking LLVM Release
...
builds.
llvm-svn: 61094
2008-12-16 19:06:48 +00:00