summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/div.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-02-18 19:28:47 +0000
committerChris Lattner <sabre@nondot.org>2003-02-18 19:28:47 +0000
commit5640f333313f63ac709e99e57ae455e49ccb8fc6 (patch)
tree00954d247bebd3724f0e5f1260dea1096597f8a0 /test/Transforms/InstCombine/div.ll
parenta2881961b918c89445666aa564680eb65867610a (diff)
downloadllvm-5640f333313f63ac709e99e57ae455e49ccb8fc6.tar.gz
llvm-5640f333313f63ac709e99e57ae455e49ccb8fc6.tar.bz2
llvm-5640f333313f63ac709e99e57ae455e49ccb8fc6.tar.xz
test for a variety of new transformations:
* A & ~A == 0 * A / (2^c) == A >> c if unsigned * 0 / A == 0 * 1.0 * A == A * A * (2^c) == A << c * A ^ ~A == -1 * A | ~A == -1 * 0 % X = 0 * A % (2^c) == A & (c-1) if unsigned * A - (A & B) == A & ~B * -1 - A == ~A git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5588 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/div.ll')
-rw-r--r--test/Transforms/InstCombine/div.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/div.ll b/test/Transforms/InstCombine/div.ll
index 10daccf11c..2bcd452c23 100644
--- a/test/Transforms/InstCombine/div.ll
+++ b/test/Transforms/InstCombine/div.ll
@@ -12,3 +12,13 @@ int %test1(int %A) {
%B = div int %A, 1
ret int %B
}
+
+uint %test2(uint %A) {
+ %B = div uint %A, 8 ; => Shift
+ ret int %B
+}
+
+int %test3(int %A) {
+ %B = div int 0, %A ; => 0, don't need to keep traps
+ ret int %B
+}