[llvm-branch-commits] [clang] [Clang] Wire up -fsanitize=alloc-token (PR #156839)
https://github.com/melver edited https://github.com/llvm/llvm-project/pull/156839 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [profcheck] Update exclusion list to reflect fixes (PR #161943)
https://github.com/boomanaiden154 approved this pull request. https://github.com/llvm/llvm-project/pull/161943 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] AMDGPU: Remove unnecessary AGPR operand legalization (PR #162093)
https://github.com/arsenm ready_for_review https://github.com/llvm/llvm-project/pull/162093 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [flang] [Flang][OpenMP] Add pass to replace allocas with device shared memory (PR #161863)
@@ -128,4 +128,21 @@ def AutomapToTargetDataPass
let dependentDialects = ["mlir::omp::OpenMPDialect"];
}
+def StackToSharedPass : Pass<"omp-stack-to-shared", "mlir::func::FuncOp"> {
+ let summary = "Replaces stack allocations with shared memory.";
+ let description = [{
+`fir.alloca` operations defining values in a target region and then used
+inside of an `omp.parallel` region are replaced by this pass with
+`omp.alloc_shared_mem` and `omp.free_shared_mem`. This is also done for
Meinersbur wrote:
```suggestion
This pass replaces `fir.alloca` that are defined in target regions, but
outside of `omp.parallel` regions, with
`omp.alloc_shared_mem` and `omp.free_shared_mem`. This is also done for
```
https://github.com/llvm/llvm-project/pull/161863
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][AST] Clean up XRayFilter and NoSanitizeL before backend (PR #162119)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/162119 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] 05b5090 - Port 5b4819e to release/21.x
Author: David Blaikie
Date: 2025-10-06T14:43:40Z
New Revision: 05b5090e961f6b45ba9144d4d846e0f174d0aedf
URL:
https://github.com/llvm/llvm-project/commit/05b5090e961f6b45ba9144d4d846e0f174d0aedf
DIFF:
https://github.com/llvm/llvm-project/commit/05b5090e961f6b45ba9144d4d846e0f174d0aedf.diff
LOG: Port 5b4819e to release/21.x
Fix for the port of 665e875 to release/21.x in PR156664
Added:
Modified:
clang/test/CodeGenCXX/debug-info-structured-binding.cpp
Removed:
diff --git a/clang/test/CodeGenCXX/debug-info-structured-binding.cpp
b/clang/test/CodeGenCXX/debug-info-structured-binding.cpp
index 4a4a4d8bdfaad..8032ce85c9e25 100644
--- a/clang/test/CodeGenCXX/debug-info-structured-binding.cpp
+++ b/clang/test/CodeGenCXX/debug-info-structured-binding.cpp
@@ -10,7 +10,7 @@
// CHECK: getelementptr inbounds nuw %struct.A, ptr {{.*}}, i32 0, i32 1, !dbg
![[Y1_DEBUG_LOC:[0-9]+]]
// CHECK: getelementptr inbounds nuw %struct.A, ptr {{.*}}, i32 0, i32 1, !dbg
![[Y2_DEBUG_LOC:[0-9]+]]
// CHECK: load ptr, ptr %z2, {{.*}}!dbg ![[Z2_DEBUG_LOC:[0-9]+]]
-// CHECK: getelementptr inbounds [2 x i32], ptr {{.*}}, i64 0, i64 1, !dbg
![[A2_DEBUG_LOC:[0-9]+]]
+// CHECK: getelementptr inbounds [2 x i32], ptr {{.*}}, i{{64|32}} 0,
i{{64|32}} 1, !dbg ![[A2_DEBUG_LOC:[0-9]+]]
// CHECK: getelementptr inbounds nuw { i32, i32 }, ptr {{.*}}, i32 0, i32 1,
!dbg ![[C2_DEBUG_LOC:[0-9]+]]
// CHECK: extractelement <2 x i32> {{.*}}, i32 1, !dbg ![[V2_DEBUG_LOC:[0-9]+]]
// CHECK: ![[VAR_0]] = !DILocalVariable(name: "a"
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][AST] Clean up XRayFilter and NoSanitizeL before backend (PR #162119)
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/162119 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][AST] Clean up XRayFilter and NoSanitizeL before backend (PR #162119)
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/162119 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libc] [llvm] [libc][math] Refactor exp2f16 implementation to header-only in src/__support/math folder. (PR #161993)
https://github.com/bassiounix updated
https://github.com/llvm/llvm-project/pull/161993
>From 7f96a609a0598657529ff53dd456d2ffcee15312 Mon Sep 17 00:00:00 2001
From: bassiounix
Date: Sun, 5 Oct 2025 06:48:10 +0300
Subject: [PATCH] [libc][math] Refactor exp2f16 implementation to header-only
in src/__support/math folder.
---
libc/shared/math.h| 1 +
libc/shared/math/exp2f16.h| 29 +
libc/src/__support/math/CMakeLists.txt| 14 +++
libc/src/__support/math/exp2f16.h | 111 ++
libc/src/math/generic/CMakeLists.txt | 10 +-
libc/src/math/generic/exp2f16.cpp | 86 +-
libc/test/shared/CMakeLists.txt | 1 +
libc/test/shared/shared_math_test.cpp | 2 +-
.../llvm-project-overlay/libc/BUILD.bazel | 18 ++-
9 files changed, 177 insertions(+), 95 deletions(-)
create mode 100644 libc/shared/math/exp2f16.h
create mode 100644 libc/src/__support/math/exp2f16.h
diff --git a/libc/shared/math.h b/libc/shared/math.h
index 1262fa6f682d0..8bff70f1c5336 100644
--- a/libc/shared/math.h
+++ b/libc/shared/math.h
@@ -49,6 +49,7 @@
#include "math/exp10m1f16.h"
#include "math/exp2.h"
#include "math/exp2f.h"
+#include "math/exp2f16.h"
#include "math/expf.h"
#include "math/expf16.h"
#include "math/frexpf.h"
diff --git a/libc/shared/math/exp2f16.h b/libc/shared/math/exp2f16.h
new file mode 100644
index 0..f799511efb0d7
--- /dev/null
+++ b/libc/shared/math/exp2f16.h
@@ -0,0 +1,29 @@
+//===-- Shared exp2f16 function -*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_EXP2F16_H
+#define LLVM_LIBC_SHARED_MATH_EXP2F16_H
+
+#include "include/llvm-libc-macros/float16-macros.h"
+#include "shared/libc_common.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
+
+#include "src/__support/math/exp2f16.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::exp2f16;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT16
+
+#endif // LLVM_LIBC_SHARED_MATH_EXP2F16_H
diff --git a/libc/src/__support/math/CMakeLists.txt
b/libc/src/__support/math/CMakeLists.txt
index 203ebb4bf1760..185900efa7354 100644
--- a/libc/src/__support/math/CMakeLists.txt
+++ b/libc/src/__support/math/CMakeLists.txt
@@ -753,6 +753,20 @@ add_header_library(
libc.src.errno.errno
)
+add_header_library(
+ exp2f16
+ HDRS
+exp2f16.h
+ DEPENDS
+.expxf16_utils
+libc.src.__support.FPUtil.cast
+libc.src.__support.FPUtil.except_value_utils
+libc.src.__support.FPUtil.fenv_impl
+libc.src.__support.FPUtil.fp_bits
+libc.src.__support.FPUtil.rounding_mode
+libc.src.__support.macros.optimization
+)
+
add_header_library(
exp10
HDRS
diff --git a/libc/src/__support/math/exp2f16.h
b/libc/src/__support/math/exp2f16.h
new file mode 100644
index 0..599ba0f5411bd
--- /dev/null
+++ b/libc/src/__support/math/exp2f16.h
@@ -0,0 +1,111 @@
+//===-- Implementation header for exp2f16 ---*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_EXP2F16_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_EXP2F16_H
+
+#include "include/llvm-libc-macros/float16-macros.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
+
+#include "expxf16_utils.h"
+#include "src/__support/FPUtil/FEnvImpl.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/FPUtil/cast.h"
+#include "src/__support/FPUtil/except_value_utils.h"
+#include "src/__support/FPUtil/rounding_mode.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/optimization.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE static constexpr float16 exp2f16(float16 x) {
+
+#ifndef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+ constexpr fputil::ExceptValues EXP2F16_EXCEPTS = {{
+ // (input, RZ output, RU offset, RD offset, RN offset)
+ // x = 0x1.714p-11, exp2f16(x) = 0x1p+0 (RZ)
+ {0x11c5U, 0x3c00U, 1U, 0U, 1U},
+ // x = -0x1.558p-4, exp2f16(x) = 0x1.e34p-1 (RZ)
+ {0xad56U, 0x3b8dU, 1U, 0U, 0U},
+ // x = -0x1.d5cp-4, exp2f16(x) = 0x1.d8cp-1 (RZ)
+ {0xaf57U, 0x3b63U, 1U, 0U, 0U},
+ }};
+#endif // !LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+
+ using namespace math::expxf16_internal;
+ using FPBits = fputil::FPBits;
+ FPBits x_bits(x);
+
+ uint16_t x_u = x_bits.uintval();
+ uin
[llvm-branch-commits] [libc] [llvm] [libc][math] Refactor expm1 implementation to header-only in src/__support/math folder. (PR #162127)
https://github.com/bassiounix updated
https://github.com/llvm/llvm-project/pull/162127
>From 079611c5ba5a5e00f6283198954e3b0a7cee8179 Mon Sep 17 00:00:00 2001
From: bassiounix
Date: Mon, 6 Oct 2025 20:41:07 +0300
Subject: [PATCH 1/2] [libc][math] Refactor expm1 implementation to header-only
in src/__support/math folder.
---
libc/shared/math.h| 1 +
libc/shared/math/expm1.h | 23 +
libc/src/__support/math/CMakeLists.txt| 20 +
libc/src/__support/math/expm1.h | 518 ++
libc/src/math/generic/CMakeLists.txt | 13 +-
libc/src/math/generic/expm1.cpp | 492 +
libc/test/shared/CMakeLists.txt | 1 +
libc/test/shared/shared_math_test.cpp | 1 +
.../llvm-project-overlay/libc/BUILD.bazel | 28 +-
9 files changed, 586 insertions(+), 511 deletions(-)
create mode 100644 libc/shared/math/expm1.h
create mode 100644 libc/src/__support/math/expm1.h
diff --git a/libc/shared/math.h b/libc/shared/math.h
index bcddb39021a9c..a5c9de4fb7029 100644
--- a/libc/shared/math.h
+++ b/libc/shared/math.h
@@ -54,6 +54,7 @@
#include "math/exp2m1f16.h"
#include "math/expf.h"
#include "math/expf16.h"
+#include "math/expm1.h"
#include "math/frexpf.h"
#include "math/frexpf128.h"
#include "math/frexpf16.h"
diff --git a/libc/shared/math/expm1.h b/libc/shared/math/expm1.h
new file mode 100644
index 0..4c8dbdc013a11
--- /dev/null
+++ b/libc/shared/math/expm1.h
@@ -0,0 +1,23 @@
+//===-- Shared expm1 function ---*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_EXPM1_H
+#define LLVM_LIBC_SHARED_MATH_EXPM1_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/expm1.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::expm1;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_EXPM1_H
diff --git a/libc/src/__support/math/CMakeLists.txt
b/libc/src/__support/math/CMakeLists.txt
index aaace44d04d3b..74f17b9fd8099 100644
--- a/libc/src/__support/math/CMakeLists.txt
+++ b/libc/src/__support/math/CMakeLists.txt
@@ -886,6 +886,26 @@ add_header_library(
libc.src.__support.macros.properties.cpu_features
)
+add_header_library(
+ expm1
+ HDRS
+expm1.h
+ DEPENDS
+.common_constants
+.exp_constants
+libc.src.__support.CPP.bit
+libc.src.__support.FPUtil.dyadic_float
+libc.src.__support.FPUtil.fenv_impl
+libc.src.__support.FPUtil.fp_bits
+libc.src.__support.FPUtil.multiply_add
+libc.src.__support.FPUtil.polyeval
+libc.src.__support.FPUtil.rounding_mode
+libc.src.__support.FPUtil.triple_double
+libc.src.__support.integer_literals
+libc.src.__support.macros.optimization
+libc.src.errno.errno
+)
+
add_header_library(
range_reduction_double
HDRS
diff --git a/libc/src/__support/math/expm1.h b/libc/src/__support/math/expm1.h
new file mode 100644
index 0..2d8b3eacae4f6
--- /dev/null
+++ b/libc/src/__support/math/expm1.h
@@ -0,0 +1,518 @@
+//===-- Implementation header for expm1 -*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_EXPM1_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_EXPM1_H
+
+#include "common_constants.h" // Lookup tables EXP_M1 and EXP_M2.
+#include "exp_constants.h"
+#include "src/__support/CPP/bit.h"
+#include "src/__support/FPUtil/FEnvImpl.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/FPUtil/PolyEval.h"
+#include "src/__support/FPUtil/double_double.h"
+#include "src/__support/FPUtil/dyadic_float.h"
+#include "src/__support/FPUtil/except_value_utils.h"
+#include "src/__support/FPUtil/multiply_add.h"
+#include "src/__support/FPUtil/rounding_mode.h"
+#include "src/__support/FPUtil/triple_double.h"
+#include "src/__support/common.h"
+#include "src/__support/integer_literals.h"
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+namespace expm1_internal {
+
+#if ((LIBC_MATH & LIBC_MATH_SKIP_ACCURATE_PASS) != 0)
+#define LIBC_MATH_EXPM1_SKIP_ACCURATE_PASS
+#endif
+
+using fputil::DoubleDouble;
+using fputil::TripleDouble;
+using Float128 = typename fputil::DyadicFloat<128>;
+
+using LIBC_NAMESPACE::operator""_u128;
+
+// log2(e)
+static constexpr d
[llvm-branch-commits] [libc] [llvm] [libc][math] Refactor exp2m1f16 implementation to header-only in src/__support/math folder. (PR #162019)
https://github.com/bassiounix updated
https://github.com/llvm/llvm-project/pull/162019
>From 505022a77127b0d77854e530a3ce0919cabab916 Mon Sep 17 00:00:00 2001
From: bassiounix
Date: Sun, 5 Oct 2025 18:08:23 +0300
Subject: [PATCH] [libc][math] Refactor exp2m1f16 implementation to header-only
in src/__support/math folder.
---
libc/shared/math.h| 1 +
libc/shared/math/exp2m1f16.h | 29 +++
libc/src/__support/math/CMakeLists.txt| 18 ++
libc/src/__support/math/exp2m1f16.h | 180 ++
libc/src/math/generic/CMakeLists.txt | 14 +-
libc/src/math/generic/exp2m1f16.cpp | 155 +--
libc/test/shared/CMakeLists.txt | 1 +
libc/test/shared/shared_math_test.cpp | 1 +
.../llvm-project-overlay/libc/BUILD.bazel | 18 +-
9 files changed, 250 insertions(+), 167 deletions(-)
create mode 100644 libc/shared/math/exp2m1f16.h
create mode 100644 libc/src/__support/math/exp2m1f16.h
diff --git a/libc/shared/math.h b/libc/shared/math.h
index 0c0e8560bd40f..bcddb39021a9c 100644
--- a/libc/shared/math.h
+++ b/libc/shared/math.h
@@ -51,6 +51,7 @@
#include "math/exp2f.h"
#include "math/exp2f16.h"
#include "math/exp2m1f.h"
+#include "math/exp2m1f16.h"
#include "math/expf.h"
#include "math/expf16.h"
#include "math/frexpf.h"
diff --git a/libc/shared/math/exp2m1f16.h b/libc/shared/math/exp2m1f16.h
new file mode 100644
index 0..96a404708be18
--- /dev/null
+++ b/libc/shared/math/exp2m1f16.h
@@ -0,0 +1,29 @@
+//===-- Shared exp2m1f16 function ---*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_EXP2M1F16_H
+#define LLVM_LIBC_SHARED_MATH_EXP2M1F16_H
+
+#include "include/llvm-libc-macros/float16-macros.h"
+#include "shared/libc_common.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
+
+#include "src/__support/math/exp2m1f16.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::exp2m1f16;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT16
+
+#endif // LLVM_LIBC_SHARED_MATH_EXP2M1F16_H
diff --git a/libc/src/__support/math/CMakeLists.txt
b/libc/src/__support/math/CMakeLists.txt
index ec2d8948f615b..aaace44d04d3b 100644
--- a/libc/src/__support/math/CMakeLists.txt
+++ b/libc/src/__support/math/CMakeLists.txt
@@ -785,6 +785,24 @@ add_header_library(
libc.src.__support.macros.properties.cpu_features
)
+add_header_library(
+ exp2m1f16
+ HDRS
+exp2m1f16.h
+ DEPENDS
+.expxf16_utils
+libc.src.__support.common
+libc.src.__support.FPUtil.cast
+libc.src.__support.FPUtil.except_value_utils
+libc.src.__support.FPUtil.fenv_impl
+libc.src.__support.FPUtil.fp_bits
+libc.src.__support.FPUtil.multiply_add
+libc.src.__support.FPUtil.polyeval
+libc.src.__support.FPUtil.rounding_mode
+libc.src.__support.macros.optimization
+libc.src.__support.macros.properties.cpu_features
+)
+
add_header_library(
exp10
HDRS
diff --git a/libc/src/__support/math/exp2m1f16.h
b/libc/src/__support/math/exp2m1f16.h
new file mode 100644
index 0..0424af4aa953d
--- /dev/null
+++ b/libc/src/__support/math/exp2m1f16.h
@@ -0,0 +1,180 @@
+//===-- Implementation header for exp2m1f16 --*-
C++-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_EXP2M1F16_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_EXP2M1F16_H
+
+#include "include/llvm-libc-macros/float16-macros.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
+
+#include "src/__support/FPUtil/FEnvImpl.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/FPUtil/PolyEval.h"
+#include "src/__support/FPUtil/cast.h"
+#include "src/__support/FPUtil/except_value_utils.h"
+#include "src/__support/FPUtil/multiply_add.h"
+#include "src/__support/FPUtil/rounding_mode.h"
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/optimization.h"
+#include "src/__support/macros/properties/cpu_features.h"
+#include "src/__support/math/expxf16_utils.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE static constexpr float16 exp2m1f16(float16 x) {
+#ifndef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+ constexpr fputil::ExceptValues EXP2M1F16_EXCEPTS_LO = {{
+ // (input, RZ output, RU offset, RD offset, RN offset)
+ // x = 0x1.cf4p-13, exp2m1f16(x) = 0x1.41p-13 (RZ)
+ {0x0b3dU, 0x0904U, 1U, 0U, 1U},
+
[llvm-branch-commits] [libc] [llvm] [libc][math] Refactor exp2m1f implementation to header-only in src/__support/math folder. (PR #162017)
https://github.com/bassiounix updated
https://github.com/llvm/llvm-project/pull/162017
>From 3bca042393aa641923a6e70fa39227f9c1b7aeec Mon Sep 17 00:00:00 2001
From: bassiounix
Date: Sun, 5 Oct 2025 17:52:54 +0300
Subject: [PATCH] [libc][math] Refactor exp2m1f implementation to header-only
in src/__support/math folder.
---
libc/shared/math.h| 1 +
libc/shared/math/exp2m1f.h| 23 +++
libc/src/__support/math/CMakeLists.txt| 18 ++
libc/src/__support/math/exp2m1f.h | 195 ++
libc/src/math/generic/CMakeLists.txt | 12 +-
libc/src/math/generic/exp2m1f.cpp | 177 +---
libc/test/shared/CMakeLists.txt | 1 +
libc/test/shared/shared_math_test.cpp | 1 +
.../llvm-project-overlay/libc/BUILD.bazel | 19 +-
9 files changed, 259 insertions(+), 188 deletions(-)
create mode 100644 libc/shared/math/exp2m1f.h
create mode 100644 libc/src/__support/math/exp2m1f.h
diff --git a/libc/shared/math.h b/libc/shared/math.h
index 8bff70f1c5336..0c0e8560bd40f 100644
--- a/libc/shared/math.h
+++ b/libc/shared/math.h
@@ -50,6 +50,7 @@
#include "math/exp2.h"
#include "math/exp2f.h"
#include "math/exp2f16.h"
+#include "math/exp2m1f.h"
#include "math/expf.h"
#include "math/expf16.h"
#include "math/frexpf.h"
diff --git a/libc/shared/math/exp2m1f.h b/libc/shared/math/exp2m1f.h
new file mode 100644
index 0..ca9754774f0fc
--- /dev/null
+++ b/libc/shared/math/exp2m1f.h
@@ -0,0 +1,23 @@
+//===-- Shared exp2m1f function -*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_EXP2M1F_H
+#define LLVM_LIBC_SHARED_MATH_EXP2M1F_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/exp2m1f.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::exp2m1f;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_EXP2M1F_H
diff --git a/libc/src/__support/math/CMakeLists.txt
b/libc/src/__support/math/CMakeLists.txt
index 185900efa7354..ec2d8948f615b 100644
--- a/libc/src/__support/math/CMakeLists.txt
+++ b/libc/src/__support/math/CMakeLists.txt
@@ -767,6 +767,24 @@ add_header_library(
libc.src.__support.macros.optimization
)
+add_header_library(
+ exp2m1f
+ HDRS
+exp2m1f.h
+ DEPENDS
+.exp10f_utils
+libc.src.errno.errno
+libc.src.__support.common
+libc.src.__support.FPUtil.except_value_utils
+libc.src.__support.FPUtil.fenv_impl
+libc.src.__support.FPUtil.fp_bits
+libc.src.__support.FPUtil.multiply_add
+libc.src.__support.FPUtil.polyeval
+libc.src.__support.FPUtil.rounding_mode
+libc.src.__support.macros.optimization
+libc.src.__support.macros.properties.cpu_features
+)
+
add_header_library(
exp10
HDRS
diff --git a/libc/src/__support/math/exp2m1f.h
b/libc/src/__support/math/exp2m1f.h
new file mode 100644
index 0..e95076c9eac22
--- /dev/null
+++ b/libc/src/__support/math/exp2m1f.h
@@ -0,0 +1,195 @@
+//===-- Implementation header for exp2m1f *-
C++-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_EXP2M1F_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_EXP2M1F_H
+
+#include "exp10f_utils.h"
+#include "src/__support/FPUtil/FEnvImpl.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/FPUtil/PolyEval.h"
+#include "src/__support/FPUtil/except_value_utils.h"
+#include "src/__support/FPUtil/multiply_add.h"
+#include "src/__support/FPUtil/rounding_mode.h"
+#include "src/__support/common.h"
+#include "src/__support/libc_errno.h"
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/optimization.h"
+#include "src/__support/macros/properties/cpu_features.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE static constexpr float exp2m1f(float x) {
+#ifndef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+ constexpr size_t N_EXCEPTS_LO = 8;
+
+ constexpr fputil::ExceptValues EXP2M1F_EXCEPTS_LO = {{
+ // (input, RZ output, RU offset, RD offset, RN offset)
+ // x = 0x1.36dc8ep-36, exp2m1f(x) = 0x1.aef212p-37 (RZ)
+ {0x2d9b'6e47U, 0x2d57'7909U, 1U, 0U, 0U},
+ // x = 0x1.224936p-19, exp2m1f(x) = 0x1.926c0ep-20 (RZ)
+ {0x3611'249bU, 0x35c9'3607U, 1U, 0U, 1U},
+ // x = 0x1.d16d2p-20, exp2m1f(x) = 0x1.429becp-20 (RZ)
+ {0x35e8'b690U, 0x35a1'4df6U, 1U, 0U, 1U}
[llvm-branch-commits] [NFC][AST] Clean up XRayFilter and NoSanitizeL before backend (PR #162119)
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Vitaly Buka (vitalybuka)
Changes
I don't thin we need them after AST is destroyed.
If I am wrong we should see crashes immediately, as pointers dereferenced
unchecked.
---
Full diff: https://github.com/llvm/llvm-project/pull/162119.diff
1 Files Affected:
- (modified) clang/lib/AST/ASTContext.cpp (+3)
``diff
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 056bfe36b2a0a..6ac0767c80067 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -976,6 +976,9 @@ void ASTContext::cleanup() {
for (const auto &Value : ModuleInitializers)
Value.second->~PerModuleInitializers();
ModuleInitializers.clear();
+
+ XRayFilter.reset();
+ NoSanitizeL.reset();
}
ASTContext::~ASTContext() { cleanup(); }
``
https://github.com/llvm/llvm-project/pull/162119
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [llvm][mustache] Use single pass when tokenizing (PR #159196)
https://github.com/ilovepi updated
https://github.com/llvm/llvm-project/pull/159196
>From fbaaa82e5f64681d0307931e4832e8f4eb3d6304 Mon Sep 17 00:00:00 2001
From: Paul Kirth
Date: Mon, 15 Sep 2025 23:27:50 -0700
Subject: [PATCH] [llvm][mustache] Use single pass when tokenizing
The old implementation used many string searches over the same portions
of the strings. This version sacrifices some API niceness for perf wins.
Metric | Baseline | Single-Pass | Change
-- | | --- | ---
Time (ms) | 36.09| 35.78 | -0.86%
Cycles | 35.3M| 35.0M | -0.79%
Instructions | 86.7M| 85.8M | -1.03%
Branch Misses | 116K | 114K| -1.91%
Cache Misses | 244K | 232K| -4.98%
---
llvm/lib/Support/Mustache.cpp | 186 +-
1 file changed, 73 insertions(+), 113 deletions(-)
diff --git a/llvm/lib/Support/Mustache.cpp b/llvm/lib/Support/Mustache.cpp
index 708e79d39cd21..13fbc61ca94e4 100644
--- a/llvm/lib/Support/Mustache.cpp
+++ b/llvm/lib/Support/Mustache.cpp
@@ -368,141 +368,101 @@ struct Tag {
llvm_unreachable("Unknown json::Value::Kind");
}
-static Tag findNextTag(StringRef Template, size_t StartPos, StringRef Open,
- StringRef Close) {
- const StringLiteral TripleOpen("{{{");
- const StringLiteral TripleClose("}}}");
-
- size_t NormalOpenPos = Template.find(Open, StartPos);
- size_t TripleOpenPos = Template.find(TripleOpen, StartPos);
-
- Tag Result;
-
- // Determine which tag comes first.
- if (TripleOpenPos != StringRef::npos &&
- (NormalOpenPos == StringRef::npos || TripleOpenPos <= NormalOpenPos)) {
-// Found a triple mustache tag.
-size_t EndPos =
-Template.find(TripleClose, TripleOpenPos + TripleOpen.size());
-if (EndPos == StringRef::npos)
- return Result; // No closing tag found.
-
-Result.TagKind = Tag::Kind::Triple;
-Result.StartPosition = TripleOpenPos;
-size_t ContentStart = TripleOpenPos + TripleOpen.size();
-Result.Content = Template.substr(ContentStart, EndPos - ContentStart);
-Result.FullMatch = Template.substr(
-TripleOpenPos, (EndPos + TripleClose.size()) - TripleOpenPos);
- } else if (NormalOpenPos != StringRef::npos) {
-// Found a normal mustache tag.
-size_t EndPos = Template.find(Close, NormalOpenPos + Open.size());
-if (EndPos == StringRef::npos)
- return Result; // No closing tag found.
-
-Result.TagKind = Tag::Kind::Normal;
-Result.StartPosition = NormalOpenPos;
-size_t ContentStart = NormalOpenPos + Open.size();
-Result.Content = Template.substr(ContentStart, EndPos - ContentStart);
-Result.FullMatch =
-Template.substr(NormalOpenPos, (EndPos + Close.size()) -
NormalOpenPos);
- }
-
- return Result;
-}
-
-static std::optional>
-processTag(const Tag &T, SmallVectorImpl &Tokens, MustacheContext &Ctx)
{
- LLVM_DEBUG(dbgs() << "[Tag] " << T.FullMatch << ", Content: " << T.Content
-<< ", Kind: " << tagKindToString(T.TagKind) << "\n");
- if (T.TagKind == Tag::Kind::Triple) {
-Tokens.emplace_back(T.FullMatch, Ctx.Saver.save("&" + T.Content), '&',
Ctx);
-return std::nullopt;
- }
- StringRef Interpolated = T.Content;
- if (!Interpolated.trim().starts_with("=")) {
-char Front = Interpolated.empty() ? ' ' : Interpolated.trim().front();
-Tokens.emplace_back(T.FullMatch, Interpolated, Front, Ctx);
-return std::nullopt;
- }
- Tokens.emplace_back(T.FullMatch, Interpolated, '=', Ctx);
- StringRef DelimSpec = Interpolated.trim();
- DelimSpec = DelimSpec.drop_front(1);
- DelimSpec = DelimSpec.take_until([](char C) { return C == '='; });
- DelimSpec = DelimSpec.trim();
-
- std::pair Ret = DelimSpec.split(' ');
- LLVM_DEBUG(dbgs() << "[Set Delimiter] NewOpen: " << Ret.first
-<< ", NewClose: " << Ret.second << "\n");
- return Ret;
-}
-
// Simple tokenizer that splits the template into tokens.
-// The mustache spec allows {{{ }}} to unescape variables,
-// but we don't support that here. An unescape variable
-// is represented only by {{& variable}}.
static SmallVector tokenize(StringRef Template, MustacheContext &Ctx) {
LLVM_DEBUG(dbgs() << "[Tokenize Template] \"" << Template << "\"\n");
SmallVector Tokens;
SmallString<8> Open("{{");
SmallString<8> Close("}}");
- size_t Start = 0;
+ size_t Cursor = 0;
+ size_t TextStart = 0;
+
+ const StringLiteral TripleOpen("{{{");
+ const StringLiteral TripleClose("}}}");
- while (Start < Template.size()) {
-LLVM_DEBUG(dbgs() << "[Tokenize Loop] Start:" << Start << ", Open:'" <<
Open
- << "', Close:'" << Close << "'\n");
-Tag T = findNextTag(Template, Start, Open, Close);
+ while (Cursor < Template.size()) {
+StringRef TemplateSuffix = Template.substr(Cursor);
+StringRef TagOpen, TagClose;
+Tag::Kind Kind;
+
+// Determine which tag we've encountered.
+
[llvm-branch-commits] [llvm] [llvm][mustache] Avoid extra allocations in parseSection (PR #159199)
https://github.com/ilovepi updated https://github.com/llvm/llvm-project/pull/159199 >From 228b984eef321f8777a25db2f61865d6e858b8b8 Mon Sep 17 00:00:00 2001 From: Paul Kirth Date: Tue, 16 Sep 2025 09:40:04 -0700 Subject: [PATCH] [llvm][mustache] Avoid extra allocations in parseSection We don't need to have extra allocations when concatenating raw bodies. --- llvm/lib/Support/Mustache.cpp | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Support/Mustache.cpp b/llvm/lib/Support/Mustache.cpp index 529dd3ac761c9..1284f78e8757b 100644 --- a/llvm/lib/Support/Mustache.cpp +++ b/llvm/lib/Support/Mustache.cpp @@ -602,9 +602,16 @@ void Parser::parseSection(ASTNode *Parent, ASTNode::Type Ty, size_t Start = CurrentPtr; parseMustache(CurrentNode); const size_t End = CurrentPtr - 1; + + size_t RawBodySize = 0; + for (size_t I = Start; I < End; ++I) +RawBodySize += Tokens[I].RawBody.size(); + SmallString<128> RawBody; - for (std::size_t I = Start; I < End; I++) + RawBody.reserve(RawBodySize); + for (std::size_t I = Start; I < End; ++I) RawBody += Tokens[I].RawBody; + CurrentNode->setRawBody(Ctx.Saver.save(StringRef(RawBody))); Parent->addChild(CurrentNode); } ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [llvm][mustache] Avoid extra copy for json strings (PR #159195)
https://github.com/ilovepi updated
https://github.com/llvm/llvm-project/pull/159195
>From 6020deb100e647b16096524be961f9c61c371e81 Mon Sep 17 00:00:00 2001
From: Paul Kirth
Date: Mon, 15 Sep 2025 19:54:34 -0700
Subject: [PATCH] [llvm][mustache] Avoid extra copy for json strings
---
llvm/lib/Support/Mustache.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/llvm/lib/Support/Mustache.cpp b/llvm/lib/Support/Mustache.cpp
index 6fe1eaf4ce09a..708e79d39cd21 100644
--- a/llvm/lib/Support/Mustache.cpp
+++ b/llvm/lib/Support/Mustache.cpp
@@ -698,8 +698,7 @@ static void toMustacheString(const json::Value &Data,
raw_ostream &OS) {
return;
}
case json::Value::String: {
-auto Str = *Data.getAsString();
-OS << Str.str();
+OS << *Data.getAsString();
return;
}
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [llvm][mustache] Avoid extra copy for json strings (PR #159195)
https://github.com/ilovepi updated
https://github.com/llvm/llvm-project/pull/159195
>From 6020deb100e647b16096524be961f9c61c371e81 Mon Sep 17 00:00:00 2001
From: Paul Kirth
Date: Mon, 15 Sep 2025 19:54:34 -0700
Subject: [PATCH] [llvm][mustache] Avoid extra copy for json strings
---
llvm/lib/Support/Mustache.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/llvm/lib/Support/Mustache.cpp b/llvm/lib/Support/Mustache.cpp
index 6fe1eaf4ce09a..708e79d39cd21 100644
--- a/llvm/lib/Support/Mustache.cpp
+++ b/llvm/lib/Support/Mustache.cpp
@@ -698,8 +698,7 @@ static void toMustacheString(const json::Value &Data,
raw_ostream &OS) {
return;
}
case json::Value::String: {
-auto Str = *Data.getAsString();
-OS << Str.str();
+OS << *Data.getAsString();
return;
}
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libc] [llvm] [libc][math] Refactor expm1 implementation to header-only in src/__support/math folder. (PR #162127)
https://github.com/bassiounix created
https://github.com/llvm/llvm-project/pull/162127
None
>From b0a94c59480a72c0ecbbf59392f0157bc15458a4 Mon Sep 17 00:00:00 2001
From: bassiounix
Date: Mon, 6 Oct 2025 20:41:07 +0300
Subject: [PATCH] [libc][math] Refactor expm1 implementation to header-only in
src/__support/math folder.
---
libc/shared/math.h| 1 +
libc/shared/math/expm1.h | 23 +
libc/src/__support/math/CMakeLists.txt| 20 +
libc/src/__support/math/expm1.h | 518 ++
libc/src/math/generic/CMakeLists.txt | 13 +-
libc/src/math/generic/expm1.cpp | 492 +
libc/test/shared/CMakeLists.txt | 1 +
libc/test/shared/shared_math_test.cpp | 1 +
.../llvm-project-overlay/libc/BUILD.bazel | 28 +-
9 files changed, 586 insertions(+), 511 deletions(-)
create mode 100644 libc/shared/math/expm1.h
create mode 100644 libc/src/__support/math/expm1.h
diff --git a/libc/shared/math.h b/libc/shared/math.h
index bcddb39021a9c..a5c9de4fb7029 100644
--- a/libc/shared/math.h
+++ b/libc/shared/math.h
@@ -54,6 +54,7 @@
#include "math/exp2m1f16.h"
#include "math/expf.h"
#include "math/expf16.h"
+#include "math/expm1.h"
#include "math/frexpf.h"
#include "math/frexpf128.h"
#include "math/frexpf16.h"
diff --git a/libc/shared/math/expm1.h b/libc/shared/math/expm1.h
new file mode 100644
index 0..4c8dbdc013a11
--- /dev/null
+++ b/libc/shared/math/expm1.h
@@ -0,0 +1,23 @@
+//===-- Shared expm1 function ---*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_EXPM1_H
+#define LLVM_LIBC_SHARED_MATH_EXPM1_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/expm1.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::expm1;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_EXPM1_H
diff --git a/libc/src/__support/math/CMakeLists.txt
b/libc/src/__support/math/CMakeLists.txt
index aaace44d04d3b..74f17b9fd8099 100644
--- a/libc/src/__support/math/CMakeLists.txt
+++ b/libc/src/__support/math/CMakeLists.txt
@@ -886,6 +886,26 @@ add_header_library(
libc.src.__support.macros.properties.cpu_features
)
+add_header_library(
+ expm1
+ HDRS
+expm1.h
+ DEPENDS
+.common_constants
+.exp_constants
+libc.src.__support.CPP.bit
+libc.src.__support.FPUtil.dyadic_float
+libc.src.__support.FPUtil.fenv_impl
+libc.src.__support.FPUtil.fp_bits
+libc.src.__support.FPUtil.multiply_add
+libc.src.__support.FPUtil.polyeval
+libc.src.__support.FPUtil.rounding_mode
+libc.src.__support.FPUtil.triple_double
+libc.src.__support.integer_literals
+libc.src.__support.macros.optimization
+libc.src.errno.errno
+)
+
add_header_library(
range_reduction_double
HDRS
diff --git a/libc/src/__support/math/expm1.h b/libc/src/__support/math/expm1.h
new file mode 100644
index 0..2d8b3eacae4f6
--- /dev/null
+++ b/libc/src/__support/math/expm1.h
@@ -0,0 +1,518 @@
+//===-- Implementation header for expm1 -*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_EXPM1_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_EXPM1_H
+
+#include "common_constants.h" // Lookup tables EXP_M1 and EXP_M2.
+#include "exp_constants.h"
+#include "src/__support/CPP/bit.h"
+#include "src/__support/FPUtil/FEnvImpl.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/FPUtil/PolyEval.h"
+#include "src/__support/FPUtil/double_double.h"
+#include "src/__support/FPUtil/dyadic_float.h"
+#include "src/__support/FPUtil/except_value_utils.h"
+#include "src/__support/FPUtil/multiply_add.h"
+#include "src/__support/FPUtil/rounding_mode.h"
+#include "src/__support/FPUtil/triple_double.h"
+#include "src/__support/common.h"
+#include "src/__support/integer_literals.h"
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+namespace expm1_internal {
+
+#if ((LIBC_MATH & LIBC_MATH_SKIP_ACCURATE_PASS) != 0)
+#define LIBC_MATH_EXPM1_SKIP_ACCURATE_PASS
+#endif
+
+using fputil::DoubleDouble;
+using fputil::TripleDouble;
+using Float128 = typename fputil::DyadicFloat<128>;
+
+using LIBC_NAMESPACE::operator""_u128;
+
+// log2(e)
+static constexpr
[llvm-branch-commits] [libc] [llvm] [libc][math] Refactor exp2m1f implementation to header-only in src/__support/math folder. (PR #162017)
https://github.com/bassiounix updated
https://github.com/llvm/llvm-project/pull/162017
>From c771895c3335511f8e3f8f6361b832d071b0cd1e Mon Sep 17 00:00:00 2001
From: bassiounix
Date: Sun, 5 Oct 2025 17:52:54 +0300
Subject: [PATCH] [libc][math] Refactor exp2m1f implementation to header-only
in src/__support/math folder.
---
libc/shared/math.h| 1 +
libc/shared/math/exp2m1f.h| 23 +++
libc/src/__support/math/CMakeLists.txt| 18 ++
libc/src/__support/math/exp2m1f.h | 195 ++
libc/src/math/generic/CMakeLists.txt | 12 +-
libc/src/math/generic/exp2m1f.cpp | 177 +---
libc/test/shared/CMakeLists.txt | 1 +
libc/test/shared/shared_math_test.cpp | 1 +
.../llvm-project-overlay/libc/BUILD.bazel | 19 +-
9 files changed, 259 insertions(+), 188 deletions(-)
create mode 100644 libc/shared/math/exp2m1f.h
create mode 100644 libc/src/__support/math/exp2m1f.h
diff --git a/libc/shared/math.h b/libc/shared/math.h
index 8bff70f1c5336..0c0e8560bd40f 100644
--- a/libc/shared/math.h
+++ b/libc/shared/math.h
@@ -50,6 +50,7 @@
#include "math/exp2.h"
#include "math/exp2f.h"
#include "math/exp2f16.h"
+#include "math/exp2m1f.h"
#include "math/expf.h"
#include "math/expf16.h"
#include "math/frexpf.h"
diff --git a/libc/shared/math/exp2m1f.h b/libc/shared/math/exp2m1f.h
new file mode 100644
index 0..ca9754774f0fc
--- /dev/null
+++ b/libc/shared/math/exp2m1f.h
@@ -0,0 +1,23 @@
+//===-- Shared exp2m1f function -*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_EXP2M1F_H
+#define LLVM_LIBC_SHARED_MATH_EXP2M1F_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/exp2m1f.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::exp2m1f;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_EXP2M1F_H
diff --git a/libc/src/__support/math/CMakeLists.txt
b/libc/src/__support/math/CMakeLists.txt
index 185900efa7354..ec2d8948f615b 100644
--- a/libc/src/__support/math/CMakeLists.txt
+++ b/libc/src/__support/math/CMakeLists.txt
@@ -767,6 +767,24 @@ add_header_library(
libc.src.__support.macros.optimization
)
+add_header_library(
+ exp2m1f
+ HDRS
+exp2m1f.h
+ DEPENDS
+.exp10f_utils
+libc.src.errno.errno
+libc.src.__support.common
+libc.src.__support.FPUtil.except_value_utils
+libc.src.__support.FPUtil.fenv_impl
+libc.src.__support.FPUtil.fp_bits
+libc.src.__support.FPUtil.multiply_add
+libc.src.__support.FPUtil.polyeval
+libc.src.__support.FPUtil.rounding_mode
+libc.src.__support.macros.optimization
+libc.src.__support.macros.properties.cpu_features
+)
+
add_header_library(
exp10
HDRS
diff --git a/libc/src/__support/math/exp2m1f.h
b/libc/src/__support/math/exp2m1f.h
new file mode 100644
index 0..e95076c9eac22
--- /dev/null
+++ b/libc/src/__support/math/exp2m1f.h
@@ -0,0 +1,195 @@
+//===-- Implementation header for exp2m1f *-
C++-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_EXP2M1F_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_EXP2M1F_H
+
+#include "exp10f_utils.h"
+#include "src/__support/FPUtil/FEnvImpl.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/FPUtil/PolyEval.h"
+#include "src/__support/FPUtil/except_value_utils.h"
+#include "src/__support/FPUtil/multiply_add.h"
+#include "src/__support/FPUtil/rounding_mode.h"
+#include "src/__support/common.h"
+#include "src/__support/libc_errno.h"
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/optimization.h"
+#include "src/__support/macros/properties/cpu_features.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE static constexpr float exp2m1f(float x) {
+#ifndef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+ constexpr size_t N_EXCEPTS_LO = 8;
+
+ constexpr fputil::ExceptValues EXP2M1F_EXCEPTS_LO = {{
+ // (input, RZ output, RU offset, RD offset, RN offset)
+ // x = 0x1.36dc8ep-36, exp2m1f(x) = 0x1.aef212p-37 (RZ)
+ {0x2d9b'6e47U, 0x2d57'7909U, 1U, 0U, 0U},
+ // x = 0x1.224936p-19, exp2m1f(x) = 0x1.926c0ep-20 (RZ)
+ {0x3611'249bU, 0x35c9'3607U, 1U, 0U, 1U},
+ // x = 0x1.d16d2p-20, exp2m1f(x) = 0x1.429becp-20 (RZ)
+ {0x35e8'b690U, 0x35a1'4df6U, 1U, 0U, 1U}
[llvm-branch-commits] [libc] [llvm] [libc][math] Refactor exp2m1f16 implementation to header-only in src/__support/math folder. (PR #162019)
https://github.com/bassiounix updated
https://github.com/llvm/llvm-project/pull/162019
>From dde8fc1f9a54f276349a0acd585e0f9ba80f6e98 Mon Sep 17 00:00:00 2001
From: bassiounix
Date: Sun, 5 Oct 2025 18:08:23 +0300
Subject: [PATCH] [libc][math] Refactor exp2m1f16 implementation to header-only
in src/__support/math folder.
---
libc/shared/math.h| 1 +
libc/shared/math/exp2m1f16.h | 29 +++
libc/src/__support/math/CMakeLists.txt| 18 ++
libc/src/__support/math/exp2m1f16.h | 180 ++
libc/src/math/generic/CMakeLists.txt | 14 +-
libc/src/math/generic/exp2m1f16.cpp | 155 +--
libc/test/shared/CMakeLists.txt | 1 +
libc/test/shared/shared_math_test.cpp | 1 +
.../llvm-project-overlay/libc/BUILD.bazel | 18 +-
9 files changed, 250 insertions(+), 167 deletions(-)
create mode 100644 libc/shared/math/exp2m1f16.h
create mode 100644 libc/src/__support/math/exp2m1f16.h
diff --git a/libc/shared/math.h b/libc/shared/math.h
index 0c0e8560bd40f..bcddb39021a9c 100644
--- a/libc/shared/math.h
+++ b/libc/shared/math.h
@@ -51,6 +51,7 @@
#include "math/exp2f.h"
#include "math/exp2f16.h"
#include "math/exp2m1f.h"
+#include "math/exp2m1f16.h"
#include "math/expf.h"
#include "math/expf16.h"
#include "math/frexpf.h"
diff --git a/libc/shared/math/exp2m1f16.h b/libc/shared/math/exp2m1f16.h
new file mode 100644
index 0..96a404708be18
--- /dev/null
+++ b/libc/shared/math/exp2m1f16.h
@@ -0,0 +1,29 @@
+//===-- Shared exp2m1f16 function ---*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_EXP2M1F16_H
+#define LLVM_LIBC_SHARED_MATH_EXP2M1F16_H
+
+#include "include/llvm-libc-macros/float16-macros.h"
+#include "shared/libc_common.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
+
+#include "src/__support/math/exp2m1f16.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::exp2m1f16;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT16
+
+#endif // LLVM_LIBC_SHARED_MATH_EXP2M1F16_H
diff --git a/libc/src/__support/math/CMakeLists.txt
b/libc/src/__support/math/CMakeLists.txt
index ec2d8948f615b..aaace44d04d3b 100644
--- a/libc/src/__support/math/CMakeLists.txt
+++ b/libc/src/__support/math/CMakeLists.txt
@@ -785,6 +785,24 @@ add_header_library(
libc.src.__support.macros.properties.cpu_features
)
+add_header_library(
+ exp2m1f16
+ HDRS
+exp2m1f16.h
+ DEPENDS
+.expxf16_utils
+libc.src.__support.common
+libc.src.__support.FPUtil.cast
+libc.src.__support.FPUtil.except_value_utils
+libc.src.__support.FPUtil.fenv_impl
+libc.src.__support.FPUtil.fp_bits
+libc.src.__support.FPUtil.multiply_add
+libc.src.__support.FPUtil.polyeval
+libc.src.__support.FPUtil.rounding_mode
+libc.src.__support.macros.optimization
+libc.src.__support.macros.properties.cpu_features
+)
+
add_header_library(
exp10
HDRS
diff --git a/libc/src/__support/math/exp2m1f16.h
b/libc/src/__support/math/exp2m1f16.h
new file mode 100644
index 0..0424af4aa953d
--- /dev/null
+++ b/libc/src/__support/math/exp2m1f16.h
@@ -0,0 +1,180 @@
+//===-- Implementation header for exp2m1f16 --*-
C++-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_EXP2M1F16_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_EXP2M1F16_H
+
+#include "include/llvm-libc-macros/float16-macros.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
+
+#include "src/__support/FPUtil/FEnvImpl.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/FPUtil/PolyEval.h"
+#include "src/__support/FPUtil/cast.h"
+#include "src/__support/FPUtil/except_value_utils.h"
+#include "src/__support/FPUtil/multiply_add.h"
+#include "src/__support/FPUtil/rounding_mode.h"
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/optimization.h"
+#include "src/__support/macros/properties/cpu_features.h"
+#include "src/__support/math/expxf16_utils.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE static constexpr float16 exp2m1f16(float16 x) {
+#ifndef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+ constexpr fputil::ExceptValues EXP2M1F16_EXCEPTS_LO = {{
+ // (input, RZ output, RU offset, RD offset, RN offset)
+ // x = 0x1.cf4p-13, exp2m1f16(x) = 0x1.41p-13 (RZ)
+ {0x0b3dU, 0x0904U, 1U, 0U, 1U},
+
[llvm-branch-commits] [libc] [llvm] [libc][math] Refactor expm1 implementation to header-only in src/__support/math folder. (PR #162127)
llvmbot wrote:
@llvm/pr-subscribers-libc
Author: Muhammad Bassiouni (bassiounix)
Changes
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
---
Patch is 45.06 KiB, truncated to 20.00 KiB below, full version:
https://github.com/llvm/llvm-project/pull/162127.diff
9 Files Affected:
- (modified) libc/shared/math.h (+1)
- (added) libc/shared/math/expm1.h (+23)
- (modified) libc/src/__support/math/CMakeLists.txt (+20)
- (added) libc/src/__support/math/expm1.h (+518)
- (modified) libc/src/math/generic/CMakeLists.txt (+1-12)
- (modified) libc/src/math/generic/expm1.cpp (+2-490)
- (modified) libc/test/shared/CMakeLists.txt (+1)
- (modified) libc/test/shared/shared_math_test.cpp (+1)
- (modified) utils/bazel/llvm-project-overlay/libc/BUILD.bazel (+19-9)
``diff
diff --git a/libc/shared/math.h b/libc/shared/math.h
index bcddb39021a9c..a5c9de4fb7029 100644
--- a/libc/shared/math.h
+++ b/libc/shared/math.h
@@ -54,6 +54,7 @@
#include "math/exp2m1f16.h"
#include "math/expf.h"
#include "math/expf16.h"
+#include "math/expm1.h"
#include "math/frexpf.h"
#include "math/frexpf128.h"
#include "math/frexpf16.h"
diff --git a/libc/shared/math/expm1.h b/libc/shared/math/expm1.h
new file mode 100644
index 0..4c8dbdc013a11
--- /dev/null
+++ b/libc/shared/math/expm1.h
@@ -0,0 +1,23 @@
+//===-- Shared expm1 function ---*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_EXPM1_H
+#define LLVM_LIBC_SHARED_MATH_EXPM1_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/expm1.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::expm1;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_EXPM1_H
diff --git a/libc/src/__support/math/CMakeLists.txt
b/libc/src/__support/math/CMakeLists.txt
index aaace44d04d3b..74f17b9fd8099 100644
--- a/libc/src/__support/math/CMakeLists.txt
+++ b/libc/src/__support/math/CMakeLists.txt
@@ -886,6 +886,26 @@ add_header_library(
libc.src.__support.macros.properties.cpu_features
)
+add_header_library(
+ expm1
+ HDRS
+expm1.h
+ DEPENDS
+.common_constants
+.exp_constants
+libc.src.__support.CPP.bit
+libc.src.__support.FPUtil.dyadic_float
+libc.src.__support.FPUtil.fenv_impl
+libc.src.__support.FPUtil.fp_bits
+libc.src.__support.FPUtil.multiply_add
+libc.src.__support.FPUtil.polyeval
+libc.src.__support.FPUtil.rounding_mode
+libc.src.__support.FPUtil.triple_double
+libc.src.__support.integer_literals
+libc.src.__support.macros.optimization
+libc.src.errno.errno
+)
+
add_header_library(
range_reduction_double
HDRS
diff --git a/libc/src/__support/math/expm1.h b/libc/src/__support/math/expm1.h
new file mode 100644
index 0..2d8b3eacae4f6
--- /dev/null
+++ b/libc/src/__support/math/expm1.h
@@ -0,0 +1,518 @@
+//===-- Implementation header for expm1 -*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_EXPM1_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_EXPM1_H
+
+#include "common_constants.h" // Lookup tables EXP_M1 and EXP_M2.
+#include "exp_constants.h"
+#include "src/__support/CPP/bit.h"
+#include "src/__support/FPUtil/FEnvImpl.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/FPUtil/PolyEval.h"
+#include "src/__support/FPUtil/double_double.h"
+#include "src/__support/FPUtil/dyadic_float.h"
+#include "src/__support/FPUtil/except_value_utils.h"
+#include "src/__support/FPUtil/multiply_add.h"
+#include "src/__support/FPUtil/rounding_mode.h"
+#include "src/__support/FPUtil/triple_double.h"
+#include "src/__support/common.h"
+#include "src/__support/integer_literals.h"
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+namespace expm1_internal {
+
+#if ((LIBC_MATH & LIBC_MATH_SKIP_ACCURATE_PASS) != 0)
+#define LIBC_MATH_EXPM1_SKIP_ACCURATE_PASS
+#endif
+
+using fputil::DoubleDouble;
+using fputil::TripleDouble;
+using Float128 = typename fputil::DyadicFloat<128>;
+
+using LIBC_NAMESPACE::operator""_u128;
+
+// log2(e)
+static constexpr double LOG2_E = 0x1.71547652b82fep+0;
+
+// Error bounds:
+// Errors when using double precisi
[llvm-branch-commits] [libc] [llvm] [libc][math] Refactor expm1 implementation to header-only in src/__support/math folder. (PR #162127)
https://github.com/bassiounix ready_for_review https://github.com/llvm/llvm-project/pull/162127 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [profcheck] Update exclusion list to reflect fixes (PR #161943)
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/161943 >From d438f774dc9b8dea9e33781a3bee9ae272e6af42 Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Fri, 3 Oct 2025 21:37:27 -0700 Subject: [PATCH] [profcheck] Update exclusion list to reflect fixes --- llvm/utils/profcheck-xfail.txt | 121 - 1 file changed, 121 deletions(-) diff --git a/llvm/utils/profcheck-xfail.txt b/llvm/utils/profcheck-xfail.txt index 53187c898b093..bcadbf8b39a7f 100644 --- a/llvm/utils/profcheck-xfail.txt +++ b/llvm/utils/profcheck-xfail.txt @@ -1,11 +1,8 @@ Analysis/LoopAccessAnalysis/memcheck-ni.ll Analysis/MemorySSA/pr116227.ll -Analysis/MemorySSA/pr40038.ll Analysis/MemorySSA/pr43641.ll Analysis/MemorySSA/pr46574.ll Analysis/MemorySSA/update-remove-dead-blocks.ll -Analysis/StackSafetyAnalysis/ipa.ll -Analysis/ValueTracking/known-power-of-two-urem.ll Bitcode/fcmp-fast.ll Bitcode/flags.ll CodeGen/AArch64/cgdata-merge-local.ll @@ -70,28 +67,19 @@ CodeGen/AMDGPU/si-annotate-nested-control-flows.ll CodeGen/AMDGPU/simple-indirect-call-2.ll CodeGen/ARM/loopvectorize_pr33804.ll CodeGen/ARM/sjljeh-swifterror.ll -CodeGen/BPF/adjust-opt-icmp1.ll -CodeGen/BPF/adjust-opt-icmp2.ll -CodeGen/BPF/adjust-opt-icmp5.ll -CodeGen/BPF/adjust-opt-icmp6.ll CodeGen/Hexagon/autohvx/interleave.ll CodeGen/Hexagon/loop-idiom/hexagon-memmove1.ll CodeGen/Hexagon/loop-idiom/hexagon-memmove2.ll CodeGen/Hexagon/loop-idiom/memmove-rt-check.ll CodeGen/NVPTX/lower-ctor-dtor.ll -CodeGen/PowerPC/P10-stack-alignment.ll CodeGen/RISCV/zmmul.ll -CodeGen/SPIRV/hlsl-resources/UniqueImplicitBindingNumber.ll CodeGen/WebAssembly/memory-interleave.ll CodeGen/X86/masked_gather_scatter.ll CodeGen/X86/nocfivalue.ll DebugInfo/AArch64/ir-outliner.ll DebugInfo/assignment-tracking/X86/hotcoldsplit.ll -DebugInfo/debugify-each.ll DebugInfo/Generic/block-asan.ll DebugInfo/KeyInstructions/Generic/loop-unswitch.ll -DebugInfo/KeyInstructions/Generic/simplifycfg-branch-fold.ll -DebugInfo/simplify-cfg-preserve-dbg-values.ll DebugInfo/X86/asan_debug_info.ll Instrumentation/AddressSanitizer/aarch64be.ll Instrumentation/AddressSanitizer/adaptive_global_redzones.ll @@ -532,13 +520,9 @@ Instrumentation/TypeSanitizer/nosanitize.ll Instrumentation/TypeSanitizer/sanitize-no-tbaa.ll Instrumentation/TypeSanitizer/swifterror.ll LTO/X86/diagnostic-handler-remarks-with-hotness.ll -Other/ChangePrinters/DotCfg/print-changed-dot-cfg.ll -Other/opt-bisect-print-ir-path.ll Other/optimization-remarks-auto.ll -Other/printer.ll Other/X86/debugcounter-partiallyinlinelibcalls.ll tools/llvm-objcopy/ELF/auto-remove-add-symtab-shndx.test -tools/not/disable-symbolization.test tools/UpdateTestChecks/update_analyze_test_checks/loop-access-analysis.test tools/UpdateTestChecks/update_analyze_test_checks/loop-distribute.test tools/UpdateTestChecks/update_test_checks/argument_name_reuse.test @@ -563,14 +547,10 @@ tools/UpdateTestChecks/update_test_checks/stable_ir_values_funcs.test tools/UpdateTestChecks/update_test_checks/stable_ir_values.test tools/UpdateTestChecks/update_test_checks/tbaa-semantics-checks.test tools/UpdateTestChecks/update_test_checks/various_ir_values_dbgrecords.test -Transforms/AggressiveInstCombine/inline-strcmp-debugloc.ll Transforms/AggressiveInstCombine/lower-table-based-cttz-basics.ll Transforms/AggressiveInstCombine/lower-table-based-cttz-dereferencing-pointer.ll Transforms/AggressiveInstCombine/lower-table-based-cttz-non-argument-value.ll Transforms/AggressiveInstCombine/lower-table-based-cttz-zero-element.ll -Transforms/AggressiveInstCombine/memchr.ll -Transforms/AggressiveInstCombine/strncmp-1.ll -Transforms/AggressiveInstCombine/strncmp-2.ll Transforms/AggressiveInstCombine/trunc_select_cmp.ll Transforms/AggressiveInstCombine/trunc_select.ll Transforms/AtomicExpand/AArch64/atomicrmw-fp.ll @@ -608,7 +588,6 @@ Transforms/AtomicExpand/AMDGPU/expand-cmpxchg-flat-maybe-private.ll Transforms/AtomicExpand/ARM/atomic-expansion-v7.ll Transforms/AtomicExpand/ARM/atomic-expansion-v8.ll Transforms/AtomicExpand/ARM/atomicrmw-fp.ll -Transforms/AtomicExpand/ARM/cmpxchg-weak.ll Transforms/AtomicExpand/Hexagon/atomicrmw-fp.ll Transforms/AtomicExpand/LoongArch/atomicrmw-fp.ll Transforms/AtomicExpand/Mips/atomicrmw-fp.ll @@ -688,7 +667,6 @@ Transforms/CodeGenPrepare/NVPTX/bypass-slow-div-not-exact.ll Transforms/CodeGenPrepare/NVPTX/bypass-slow-div-special-cases.ll Transforms/CodeGenPrepare/X86/vec-shift-inseltpoison.ll Transforms/CodeGenPrepare/X86/vec-shift.ll -Transforms/Coroutines/coro-alloca-outside-frame.ll Transforms/Coroutines/coro-await-suspend-lower-invoke.ll Transforms/Coroutines/coro-await-suspend-lower.ll Transforms/Coroutines/coro-byval-param.ll @@ -829,21 +807,17 @@ Transforms/HotColdSplit/unwind.ll Transforms/HotColdSplit/update-split-loop-metadata.ll Transforms/IndirectBrExpand/basic.ll Transforms/IndVarSimplify/debugloc-rem-subst.ll -Transforms/IndVarSimplify/elimina
