[compiler-rt] 496e7f3 - [VE] Disable incompatible compiler-rt tests

Simon Moll via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 11 23:41:29 PST 2021


Author: Simon Moll
Date: 2021-11-12T08:40:03+01:00
New Revision: 496e7f330c43094ab508e07cf75237e52394fa66

URL: https://github.com/llvm/llvm-project/commit/496e7f330c43094ab508e07cf75237e52394fa66
DIFF: https://github.com/llvm/llvm-project/commit/496e7f330c43094ab508e07cf75237e52394fa66.diff

LOG: [VE] Disable incompatible compiler-rt tests

Some compiler-rt tests are inherently incompatible with VE because..

* No consistent denormal support on VE. We skip denormal fp inputs in builtin tests.
* `madvise` unsupported on VE.
* Instruction alignment requirements.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D113093

Added: 
    

Modified: 
    compiler-rt/lib/profile/InstrProfilingUtil.c
    compiler-rt/test/builtins/Unit/compiler_rt_logb_test.c
    compiler-rt/test/builtins/Unit/compiler_rt_logbf_test.c
    compiler-rt/test/builtins/Unit/compiler_rt_logbl_test.c
    compiler-rt/test/builtins/Unit/compiler_rt_scalbn_test.c
    compiler-rt/test/builtins/Unit/compiler_rt_scalbnf_test.c
    compiler-rt/test/builtins/Unit/compiler_rt_scalbnl_test.c
    compiler-rt/test/builtins/Unit/enable_execute_stack_test.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/profile/InstrProfilingUtil.c b/compiler-rt/lib/profile/InstrProfilingUtil.c
index 59bc0bebf4b84..d563e333aca83 100644
--- a/compiler-rt/lib/profile/InstrProfilingUtil.c
+++ b/compiler-rt/lib/profile/InstrProfilingUtil.c
@@ -353,6 +353,10 @@ COMPILER_RT_VISIBILITY void lprofRestoreSigKill() {
 
 COMPILER_RT_VISIBILITY int lprofReleaseMemoryPagesToOS(uintptr_t Begin,
                                                        uintptr_t End) {
+#if defined(__ve__)
+  // VE doesn't support madvise.
+  return 0;
+#else
   size_t PageSize = getpagesize();
   uintptr_t BeginAligned = lprofRoundUpTo((uintptr_t)Begin, PageSize);
   uintptr_t EndAligned = lprofRoundDownTo((uintptr_t)End, PageSize);
@@ -367,4 +371,5 @@ COMPILER_RT_VISIBILITY int lprofReleaseMemoryPagesToOS(uintptr_t Begin,
 #endif
   }
   return 0;
+#endif
 }

diff  --git a/compiler-rt/test/builtins/Unit/compiler_rt_logb_test.c b/compiler-rt/test/builtins/Unit/compiler_rt_logb_test.c
index 77ecd064935a1..2c1be875b0b88 100644
--- a/compiler-rt/test/builtins/Unit/compiler_rt_logb_test.c
+++ b/compiler-rt/test/builtins/Unit/compiler_rt_logb_test.c
@@ -6,6 +6,10 @@
 #include "fp_lib.h"
 
 int test__compiler_rt_logb(fp_t x) {
+#if defined(__ve__)
+  if (fpclassify(x) == FP_SUBNORMAL)
+    return 0;
+#endif
   fp_t crt_value = __compiler_rt_logb(x);
   fp_t libm_value = logb(x);
   // Compare the values, considering all NaNs equivalent, as the spec doesn't

diff  --git a/compiler-rt/test/builtins/Unit/compiler_rt_logbf_test.c b/compiler-rt/test/builtins/Unit/compiler_rt_logbf_test.c
index 30482f1cd248d..e28fd54260fd2 100644
--- a/compiler-rt/test/builtins/Unit/compiler_rt_logbf_test.c
+++ b/compiler-rt/test/builtins/Unit/compiler_rt_logbf_test.c
@@ -7,6 +7,10 @@
 #include <stdio.h>
 
 int test__compiler_rt_logbf(fp_t x) {
+#if defined(__ve__)
+  if (fpclassify(x) == FP_SUBNORMAL)
+    return 0;
+#endif
   fp_t crt_value = __compiler_rt_logbf(x);
   fp_t libm_value = logbf(x);
   // `!=` operator on fp_t returns false for NaNs so also check if operands are

diff  --git a/compiler-rt/test/builtins/Unit/compiler_rt_logbl_test.c b/compiler-rt/test/builtins/Unit/compiler_rt_logbl_test.c
index 1bbc9e382eb15..d3e8c4f7f9765 100644
--- a/compiler-rt/test/builtins/Unit/compiler_rt_logbl_test.c
+++ b/compiler-rt/test/builtins/Unit/compiler_rt_logbl_test.c
@@ -9,6 +9,10 @@
 #if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
 
 int test__compiler_rt_logbl(fp_t x) {
+#if defined(__ve__)
+  if (fpclassify(x) == FP_SUBNORMAL)
+    return 0;
+#endif
   fp_t crt_value = __compiler_rt_logbl(x);
   fp_t libm_value = logbl(x);
   // Compare the values, considering all NaNs equivalent, as the spec doesn't

diff  --git a/compiler-rt/test/builtins/Unit/compiler_rt_scalbn_test.c b/compiler-rt/test/builtins/Unit/compiler_rt_scalbn_test.c
index 44cd48c5e1143..e1cda63246fd0 100644
--- a/compiler-rt/test/builtins/Unit/compiler_rt_scalbn_test.c
+++ b/compiler-rt/test/builtins/Unit/compiler_rt_scalbn_test.c
@@ -9,6 +9,10 @@
 #include "fp_lib.h"
 
 int test__compiler_rt_scalbn(const char *mode, fp_t x, int y) {
+#if defined(__ve__)
+  if (fpclassify(x) == FP_SUBNORMAL)
+    return 0;
+#endif
   fp_t crt_value = __compiler_rt_scalbn(x, y);
   fp_t libm_value = scalbn(x, y);
   // Consider +/-0 unequal, but disregard the sign/payload of NaN.

diff  --git a/compiler-rt/test/builtins/Unit/compiler_rt_scalbnf_test.c b/compiler-rt/test/builtins/Unit/compiler_rt_scalbnf_test.c
index 7c6554bb157f3..dfa34232604fe 100644
--- a/compiler-rt/test/builtins/Unit/compiler_rt_scalbnf_test.c
+++ b/compiler-rt/test/builtins/Unit/compiler_rt_scalbnf_test.c
@@ -9,6 +9,10 @@
 #include "fp_lib.h"
 
 int test__compiler_rt_scalbnf(const char *mode, fp_t x, int y) {
+#if defined(__ve__)
+  if (fpclassify(x) == FP_SUBNORMAL)
+    return 0;
+#endif
   fp_t crt_value = __compiler_rt_scalbnf(x, y);
   fp_t libm_value = scalbnf(x, y);
   // Consider +/-0 unequal, but disregard the sign/payload of NaN.

diff  --git a/compiler-rt/test/builtins/Unit/compiler_rt_scalbnl_test.c b/compiler-rt/test/builtins/Unit/compiler_rt_scalbnl_test.c
index e520e83b9b2bd..70b29890b982f 100644
--- a/compiler-rt/test/builtins/Unit/compiler_rt_scalbnl_test.c
+++ b/compiler-rt/test/builtins/Unit/compiler_rt_scalbnl_test.c
@@ -11,6 +11,10 @@
 #if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
 
 int test__compiler_rt_scalbnl(const char *mode, fp_t x, int y) {
+#if defined(__ve__)
+  if (fpclassify(x) == FP_SUBNORMAL)
+    return 0;
+#endif
   fp_t crt_value = __compiler_rt_scalbnl(x, y);
   fp_t libm_value = scalbnl(x, y);
   // Consider +/-0 unequal, but disregard the sign/payload of NaN.

diff  --git a/compiler-rt/test/builtins/Unit/enable_execute_stack_test.c b/compiler-rt/test/builtins/Unit/enable_execute_stack_test.c
index 6bfa674b47b3c..eb1fa97797ac8 100644
--- a/compiler-rt/test/builtins/Unit/enable_execute_stack_test.c
+++ b/compiler-rt/test/builtins/Unit/enable_execute_stack_test.c
@@ -29,7 +29,11 @@ memcpy_f(void *dst, const void *src, size_t n) {
 
 int main()
 {
+#if defined(__ve__)
+    unsigned char execution_buffer[128] __attribute__((__aligned__(8)));
+#else
     unsigned char execution_buffer[128];
+#endif
     // mark stack page containing execution_buffer to be executable
     __enable_execute_stack(execution_buffer);
 	


        


More information about the llvm-commits mailing list