summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstSimplify
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-04-01 19:05:11 +0000
committerSanjay Patel <spatel@rotateright.com>2017-04-01 19:05:11 +0000
commit8b5ad3f00edd0c3a558dc34df95c424d538bfbb3 (patch)
tree6fbf77c26d3e49b156a2ed2d90cb5bd11ed9b44a /llvm/test/Transforms/InstSimplify
parentee0f5cc41f3702b3d71b04eaefd0af9594a8f144 (diff)
downloadbcm5719-llvm-8b5ad3f00edd0c3a558dc34df95c424d538bfbb3.tar.gz
bcm5719-llvm-8b5ad3f00edd0c3a558dc34df95c424d538bfbb3.zip
[InstSimplify] add constant folding for fdiv/frem
Also, add a helper function so we don't have to repeat this code for each binop. llvm-svn: 299309
Diffstat (limited to 'llvm/test/Transforms/InstSimplify')
-rw-r--r--llvm/test/Transforms/InstSimplify/fdiv.ll6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/test/Transforms/InstSimplify/fdiv.ll b/llvm/test/Transforms/InstSimplify/fdiv.ll
index 3499ae53093..6643afd8147 100644
--- a/llvm/test/Transforms/InstSimplify/fdiv.ll
+++ b/llvm/test/Transforms/InstSimplify/fdiv.ll
@@ -3,8 +3,7 @@
define float @fdiv_constant_fold() {
; CHECK-LABEL: @fdiv_constant_fold(
-; CHECK-NEXT: [[F:%.*]] = fdiv float 3.000000e+00, 2.000000e+00
-; CHECK-NEXT: ret float [[F]]
+; CHECK-NEXT: ret float 1.500000e+00
;
%f = fdiv float 3.0, 2.0
ret float %f
@@ -12,8 +11,7 @@ define float @fdiv_constant_fold() {
define float @frem_constant_fold() {
; CHECK-LABEL: @frem_constant_fold(
-; CHECK-NEXT: [[F:%.*]] = frem float 3.000000e+00, 2.000000e+00
-; CHECK-NEXT: ret float [[F]]
+; CHECK-NEXT: ret float 1.000000e+00
;
%f = frem float 3.0, 2.0
ret float %f
OpenPOWER on IntegriCloud