diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2008-11-30 06:02:26 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2008-11-30 06:02:26 +0000 |
commit | 201c9776bd4197569b71fef0519f98a28d1db989 (patch) | |
tree | f23152f3c338d59a79a7407bf5a96c8eb366d2da /test/CodeGen/X86/2008-11-29-DivideConstant16bit.ll | |
parent | 3f93df5733dce50961303d571cf16e032b0809bf (diff) | |
download | external_llvm-201c9776bd4197569b71fef0519f98a28d1db989.zip external_llvm-201c9776bd4197569b71fef0519f98a28d1db989.tar.gz external_llvm-201c9776bd4197569b71fef0519f98a28d1db989.tar.bz2 |
Fix for PR2164: allow transforming arbitrary-width unsigned divides into
multiplies.
Some more cleverness would be nice, though. It would be nice if we
could do this transformation on illegal types. Also, we would
prefer a narrower constant when possible so that we can use a narrower
multiply, which can be cheaper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60283 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/2008-11-29-DivideConstant16bit.ll')
-rw-r--r-- | test/CodeGen/X86/2008-11-29-DivideConstant16bit.ll | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CodeGen/X86/2008-11-29-DivideConstant16bit.ll b/test/CodeGen/X86/2008-11-29-DivideConstant16bit.ll new file mode 100644 index 0000000..fe1870e --- /dev/null +++ b/test/CodeGen/X86/2008-11-29-DivideConstant16bit.ll @@ -0,0 +1,10 @@ +; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu | grep 63551 | count 1 +; ModuleID = '<stdin>' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" +target triple = "i686-pc-linux-gnu" + +define zeroext i16 @a(i16 zeroext %x) nounwind { +entry: + %div = udiv i16 %x, 33 ; <i32> [#uses=1] + ret i16 %div +} |