diff options
author | Devang Patel <dpatel@apple.com> | 2007-09-19 20:18:51 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-09-19 20:18:51 +0000 |
commit | f2038b1d9325b23e73a20b57fcb3508f4dda1817 (patch) | |
tree | 2872fdb290cab0399ba44fe2e73d555c39771df2 /test | |
parent | fab7eff0faf126d66af4717a77deb6cfd429788a (diff) | |
download | external_llvm-f2038b1d9325b23e73a20b57fcb3508f4dda1817.zip external_llvm-f2038b1d9325b23e73a20b57fcb3508f4dda1817.tar.gz external_llvm-f2038b1d9325b23e73a20b57fcb3508f4dda1817.tar.bz2 |
Avoid unsafe promotion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42149 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/LICM/2007-09-17-PromoteValue.ll | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/Transforms/LICM/2007-09-17-PromoteValue.ll b/test/Transforms/LICM/2007-09-17-PromoteValue.ll index acbbabf..e9ba9e1 100644 --- a/test/Transforms/LICM/2007-09-17-PromoteValue.ll +++ b/test/Transforms/LICM/2007-09-17-PromoteValue.ll @@ -23,4 +23,39 @@ clear_modes.exit: ; preds = %blah.i unreachable } +define i32 @f(i8* %ptr) { +entry: + br label %loop.head + +loop.head: ; preds = %cond.true, %entry + %x = phi i8* [ %ptr, %entry ], [ %ptr.i, %cond.true ] ; <i8*> [#uses=1] + %tmp3.i = icmp ne i8* %ptr, %x ; <i1> [#uses=1] + br i1 %tmp3.i, label %cond.true, label %exit + +cond.true: ; preds = %loop.head + %ptr.i = getelementptr i8* %ptr, i32 0 ; <i8*> [#uses=2] + store i8 0, i8* %ptr.i + br label %loop.head + +exit: ; preds = %loop.head + ret i32 0 +} + +define i32 @f2(i8* %p, i8* %q) { +entry: + br label %loop.head + +loop.head: ; preds = %cond.true, %entry + %tmp3.i = icmp eq i8* null, %q ; <i1> [#uses=1] + br i1 %tmp3.i, label %exit, label %cond.true + +cond.true: ; preds = %loop.head + %ptr.i = getelementptr i8* %p, i32 0 ; <i8*> [#uses=2] + store i8 0, i8* %ptr.i + br label %loop.head + +exit: ; preds = %loop.head + ret i32 0 +} + declare void @exit(i32) |