diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-07-18 09:53:21 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-07-18 09:53:21 +0000 |
commit | 8be17397c08cf768f33016f42e6a75a3f214d331 (patch) | |
tree | 1972f98ba5af2f77dc9957c02efb1fc0e80874e1 /test | |
parent | 191a0aee4f58f86d697e9eed57205a59e3920b4d (diff) | |
download | external_llvm-8be17397c08cf768f33016f42e6a75a3f214d331.zip external_llvm-8be17397c08cf768f33016f42e6a75a3f214d331.tar.gz external_llvm-8be17397c08cf768f33016f42e6a75a3f214d331.tar.bz2 |
Add combine: X sdiv (1 << Y) -> X udiv (1 << Y) when X doesn't have the
sign bit set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76304 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/InstCombine/sdiv-shift.ll | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/sdiv-shift.ll b/test/Transforms/InstCombine/sdiv-shift.ll new file mode 100644 index 0000000..3fba05d --- /dev/null +++ b/test/Transforms/InstCombine/sdiv-shift.ll @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep div + +define i32 @a(i16 zeroext %x, i32 %y) nounwind { +entry: + %conv = zext i16 %x to i32 + %s = shl i32 2, %y + %d = sdiv i32 %conv, %s + ret i32 %d +} |