aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/urem-i8-constant.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-11-26 23:46:11 +0000
committerDan Gohman <gohman@apple.com>2007-11-26 23:46:11 +0000
commit77003040b21816725dc1ca3a55111044d36ac21f (patch)
tree1d1442c3f403517891e7ab3940371e08660e7639 /test/CodeGen/X86/urem-i8-constant.ll
parentaa91792d6c51f0671f896c26ff1b541621974081 (diff)
downloadexternal_llvm-77003040b21816725dc1ca3a55111044d36ac21f.zip
external_llvm-77003040b21816725dc1ca3a55111044d36ac21f.tar.gz
external_llvm-77003040b21816725dc1ca3a55111044d36ac21f.tar.bz2
Don't lower srem/urem X%C to X-X/C*C unless the division is actually
optimized. This avoids creating illegal divisions when the combiner is running after legalize; this fixes PR1815. Also, it produces better code in the included testcase by avoiding the subtract and multiply when the division isn't optimized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44341 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/urem-i8-constant.ll')
-rw-r--r--test/CodeGen/X86/urem-i8-constant.ll6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/CodeGen/X86/urem-i8-constant.ll b/test/CodeGen/X86/urem-i8-constant.ll
new file mode 100644
index 0000000..8a43333
--- /dev/null
+++ b/test/CodeGen/X86/urem-i8-constant.ll
@@ -0,0 +1,6 @@
+; RUN: llvm-as < %s | llc -march=x86 | not grep mul
+
+define i8 @foo(i8 %tmp325) {
+ %t546 = urem i8 %tmp325, 37
+ ret i8 %t546
+}