Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
llvm-epi-0.8
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Roger Ferrer
llvm-epi-0.8
Commits
16db6123
Commit
16db6123
authored
12 years ago
by
Michael Ilseman
Browse files
Options
Downloads
Patches
Plain Diff
Fast-math test for SimplifyInstruction: fold multiply by 0
llvm-svn: 168649
parent
be9137a5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/0007-Fast-math-test-for-SimplifyInstruction-fold-multiply.patch
+55
-0
55 additions, 0 deletions
...ast-math-test-for-SimplifyInstruction-fold-multiply.patch
with
55 additions
and
0 deletions
llvm/0007-Fast-math-test-for-SimplifyInstruction-fold-multiply.patch
0 → 100644
+
55
−
0
View file @
16db6123
From a3d62a84e2805fc54fe721610de350cf23469aa4 Mon Sep 17 00:00:00 2001
From: Michael Ilseman <milseman@apple.com>
Date: Thu, 15 Nov 2012 10:04:58 -0800
Subject: [PATCH 7/8] Fast-math test for SimplifyInstruction: fold multiply by
0
---
test/Transforms/InstSimplify/fast-math.ll | 35 +++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 test/Transforms/InstSimplify/fast-math.ll
diff --git a/test/Transforms/InstSimplify/fast-math.ll b/test/Transforms/InstSimplify/fast-math.ll
new file mode 100644
index 0000000..e4b3ea3
--- /dev/null
+++ b/test/Transforms/InstSimplify/fast-math.ll
@@ -0,0 +1,35 @@
+; RUN: opt < %s -instsimplify -S | FileCheck %s
+
+;; x * 0 ==> 0 when no-nans and no-signed-zero
+; CHECK: mul_zero_1
+define float @mul_zero_1(float %a) {
+ %b = fmul nsz nnan float %a, 0.0
+; CHECK: ret float 0.0
+ ret float %b
+}
+; CHECK: mul_zero_2
+define float @mul_zero_2(float %a) {
+ %b = fmul fast float 0.0, %a
+; CHECK: ret float 0.0
+ ret float %b
+}
+
+;; x * 0 =/=> 0 when there could be nans or -0
+; CHECK: no_mul_zero_1
+define float @no_mul_zero_1(float %a) {
+ %b = fmul nsz float %a, 0.0
+; CHECK: ret float %b
+ ret float %b
+}
+; CHECK: no_mul_zero_2
+define float @no_mul_zero_2(float %a) {
+ %b = fmul nnan float %a, 0.0
+; CHECK: ret float %b
+ ret float %b
+}
+; CHECK: no_mul_zero_3
+define float @no_mul_zero_3(float %a) {
+ %b = fmul float %a, 0.0
+; CHECK: ret float %b
+ ret float %b
+}
--
1.7.12.2 (Apple Git-36)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment