[llvm] r359561 - [AArch64] add tests for fdiv/frem constant folding (PR41668); NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 30 06:43:17 PDT 2019
Author: spatel
Date: Tue Apr 30 06:43:17 2019
New Revision: 359561
URL: http://llvm.org/viewvc/llvm-project?rev=359561&view=rev
Log:
[AArch64] add tests for fdiv/frem constant folding (PR41668); NFC
Added:
llvm/trunk/test/CodeGen/AArch64/fp-const-fold.ll
Added: llvm/trunk/test/CodeGen/AArch64/fp-const-fold.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/fp-const-fold.ll?rev=359561&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/fp-const-fold.ll (added)
+++ llvm/trunk/test/CodeGen/AArch64/fp-const-fold.ll Tue Apr 30 06:43:17 2019
@@ -0,0 +1,27 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=aarch64-- | FileCheck %s
+
+; https://bugs.llvm.org/show_bug.cgi?id=41668
+
+define double @constant_fold_fdiv_by_zero(double* %p) {
+; CHECK-LABEL: constant_fold_fdiv_by_zero:
+; CHECK: // %bb.0:
+; CHECK-NEXT: mov x8, #1
+; CHECK-NEXT: fmov d0, xzr
+; CHECK-NEXT: fmov d1, x8
+; CHECK-NEXT: fdiv d0, d1, d0
+; CHECK-NEXT: ret
+ %r = fdiv double 4.940660e-324, 0.0
+ ret double %r
+}
+
+define double @constant_fold_frem_by_zero(double* %p) {
+; CHECK-LABEL: constant_fold_frem_by_zero:
+; CHECK: // %bb.0:
+; CHECK-NEXT: mov x8, #1
+; CHECK-NEXT: fmov d1, xzr
+; CHECK-NEXT: fmov d0, x8
+; CHECK-NEXT: b fmod
+ %r = frem double 4.940660e-324, 0.0
+ ret double %r
+}
More information about the llvm-commits
mailing list