diff options
author | Chris Lattner <sabre@nondot.org> | 2011-01-01 20:12:04 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-01-01 20:12:04 +0000 |
commit | bafa117e8f2e3532f391227ebc9d4513b17edbad (patch) | |
tree | ae37f49cde3d29fd2df71b71e87340c9bb5f1b33 /test | |
parent | 124708d9b47cc53cb11d8bfed75b241b6eec86d4 (diff) | |
download | external_llvm-bafa117e8f2e3532f391227ebc9d4513b17edbad.zip external_llvm-bafa117e8f2e3532f391227ebc9d4513b17edbad.tar.gz external_llvm-bafa117e8f2e3532f391227ebc9d4513b17edbad.tar.bz2 |
add a validity check that was missed, fixing a crash on the
new testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122662 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/LoopIdiom/basic.ll | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Transforms/LoopIdiom/basic.ll b/test/Transforms/LoopIdiom/basic.ll index ef37b1d..ee93cb3 100644 --- a/test/Transforms/LoopIdiom/basic.ll +++ b/test/Transforms/LoopIdiom/basic.ll @@ -91,3 +91,26 @@ for.end: ; preds = %for.body, %entry ; CHECK-TODO: call void @llvm.memset.p0i8.i64(i8* %Base, i8 0, i64 100, i32 1, i1 false) ; CHECK-TODO-NOT: store } + +; This can't be promoted: the memset is a store of a loop variant value. +define void @test5(i8* %Base, i64 %Size) nounwind ssp { +bb.nph: ; preds = %entry + br label %for.body + +for.body: ; preds = %bb.nph, %for.body + %indvar = phi i64 [ 0, %bb.nph ], [ %indvar.next, %for.body ] + %I.0.014 = getelementptr i8* %Base, i64 %indvar + + %V = trunc i64 %indvar to i8 + store i8 %V, i8* %I.0.014, align 1 + %indvar.next = add i64 %indvar, 1 + %exitcond = icmp eq i64 %indvar.next, %Size + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body, %entry + ret void +; CHECK: @test5 +; CHECK-NOT: memset +; CHECK: ret void +} + |