[clang] [llvm] Adding support of AMDLIBM vector library (PR #78560)

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 19 03:46:07 PST 2024


================
@@ -0,0 +1,332 @@
+; RUN: opt -vector-library=AMDLIBM -passes=inject-tli-mappings,loop-vectorize -S < %s | FileCheck %s
+
+; Test to verify that when math headers are built with
+; __FINITE_MATH_ONLY__ enabled, causing use of __<func>_finite
+; function versions, vectorization can map these to vector versions.
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+declare float @__expf_finite(float) #0
+
+; CHECK-LABEL: @exp_f32
+; CHECK: <4 x float> @amd_vrs4_expf
----------------
RKSimon wrote:

Add RUNs for avx2 / avx512 capable targets to ensure amd_vrs8_expf / amd_vrs16_expf etc. are used when appropriate? 

https://github.com/llvm/llvm-project/pull/78560


More information about the cfe-commits mailing list