https://github.com/ficol updated 
https://github.com/llvm/llvm-project/pull/166905

>From 4e1ffa02e4493ba5c84f64e534909479a9acb3ef Mon Sep 17 00:00:00 2001
From: "Ficek, Jakub" <[email protected]>
Date: Fri, 7 Nov 2025 08:41:04 +0100
Subject: [PATCH 1/2] [clang] Support constrained fp elementwise builtins

Currently only __builtin_elementwise_sqrt emits contrained fp intrinsic and 
propagates fp options.
This commit adds this support for the rest of elementwise builtins.
---
 clang/lib/CodeGen/CGBuiltin.cpp               | 107 ++++--------------
 .../test/CodeGen/fp-contract-fast-pragma.cpp  |  52 ++++++++-
 2 files changed, 72 insertions(+), 87 deletions(-)

diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 0a2ea416e5e4d..1da63e57ac8a1 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -2727,6 +2727,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_acosf16:
     case Builtin::BI__builtin_acosl:
     case Builtin::BI__builtin_acosf128:
+    case Builtin::BI__builtin_elementwise_acos:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(
           *this, E, Intrinsic::acos, 
Intrinsic::experimental_constrained_acos));
 
@@ -2738,6 +2739,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_asinf16:
     case Builtin::BI__builtin_asinl:
     case Builtin::BI__builtin_asinf128:
+    case Builtin::BI__builtin_elementwise_asin:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(
           *this, E, Intrinsic::asin, 
Intrinsic::experimental_constrained_asin));
 
@@ -2749,6 +2751,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_atanf16:
     case Builtin::BI__builtin_atanl:
     case Builtin::BI__builtin_atanf128:
+    case Builtin::BI__builtin_elementwise_atan:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(
           *this, E, Intrinsic::atan, 
Intrinsic::experimental_constrained_atan));
 
@@ -2760,6 +2763,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_atan2f16:
     case Builtin::BI__builtin_atan2l:
     case Builtin::BI__builtin_atan2f128:
+    case Builtin::BI__builtin_elementwise_atan2:
       return RValue::get(emitBinaryMaybeConstrainedFPBuiltin(
           *this, E, Intrinsic::atan2,
           Intrinsic::experimental_constrained_atan2));
@@ -2772,6 +2776,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_ceilf16:
     case Builtin::BI__builtin_ceill:
     case Builtin::BI__builtin_ceilf128:
+    case Builtin::BI__builtin_elementwise_ceil:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(*this, E,
                                    Intrinsic::ceil,
                                    Intrinsic::experimental_constrained_ceil));
@@ -2795,6 +2800,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_cosf16:
     case Builtin::BI__builtin_cosl:
     case Builtin::BI__builtin_cosf128:
+    case Builtin::BI__builtin_elementwise_cos:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(*this, E,
                                    Intrinsic::cos,
                                    Intrinsic::experimental_constrained_cos));
@@ -2807,6 +2813,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_coshf16:
     case Builtin::BI__builtin_coshl:
     case Builtin::BI__builtin_coshf128:
+    case Builtin::BI__builtin_elementwise_cosh:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(
           *this, E, Intrinsic::cosh, 
Intrinsic::experimental_constrained_cosh));
 
@@ -2818,6 +2825,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_expf16:
     case Builtin::BI__builtin_expl:
     case Builtin::BI__builtin_expf128:
+    case Builtin::BI__builtin_elementwise_exp:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(*this, E,
                                    Intrinsic::exp,
                                    Intrinsic::experimental_constrained_exp));
@@ -2830,6 +2838,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_exp2f16:
     case Builtin::BI__builtin_exp2l:
     case Builtin::BI__builtin_exp2f128:
+    case Builtin::BI__builtin_elementwise_exp2:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(*this, E,
                                    Intrinsic::exp2,
                                    Intrinsic::experimental_constrained_exp2));
@@ -2838,6 +2847,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_exp10f16:
     case Builtin::BI__builtin_exp10l:
     case Builtin::BI__builtin_exp10f128: {
+    case Builtin::BI__builtin_elementwise_exp10:
       // TODO: strictfp support
       if (Builder.getIsFPConstrained())
         break;
@@ -2863,6 +2873,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_floorf16:
     case Builtin::BI__builtin_floorl:
     case Builtin::BI__builtin_floorf128:
+    case Builtin::BI__builtin_elementwise_floor:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(*this, E,
                                    Intrinsic::floor,
                                    Intrinsic::experimental_constrained_floor));
@@ -2875,6 +2886,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_fmaf16:
     case Builtin::BI__builtin_fmal:
     case Builtin::BI__builtin_fmaf128:
+    case Builtin::BI__builtin_elementwise_fma:
       return RValue::get(emitTernaryMaybeConstrainedFPBuiltin(*this, E,
                                    Intrinsic::fma,
                                    Intrinsic::experimental_constrained_fma));
@@ -2950,6 +2962,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_logf16:
     case Builtin::BI__builtin_logl:
     case Builtin::BI__builtin_logf128:
+    case Builtin::BI__builtin_elementwise_log:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(*this, E,
                                    Intrinsic::log,
                                    Intrinsic::experimental_constrained_log));
@@ -2962,6 +2975,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_log10f16:
     case Builtin::BI__builtin_log10l:
     case Builtin::BI__builtin_log10f128:
+    case Builtin::BI__builtin_elementwise_log10:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(*this, E,
                                    Intrinsic::log10,
                                    Intrinsic::experimental_constrained_log10));
@@ -2974,6 +2988,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_log2f16:
     case Builtin::BI__builtin_log2l:
     case Builtin::BI__builtin_log2f128:
+    case Builtin::BI__builtin_elementwise_log2:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(*this, E,
                                    Intrinsic::log2,
                                    Intrinsic::experimental_constrained_log2));
@@ -2985,6 +3000,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_nearbyintf:
     case Builtin::BI__builtin_nearbyintl:
     case Builtin::BI__builtin_nearbyintf128:
+    case Builtin::BI__builtin_elementwise_nearbyint:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(*this, E,
                                 Intrinsic::nearbyint,
                                 
Intrinsic::experimental_constrained_nearbyint));
@@ -2997,6 +3013,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_powf16:
     case Builtin::BI__builtin_powl:
     case Builtin::BI__builtin_powf128:
+    case Builtin::BI__builtin_elementwise_pow:
       return RValue::get(emitBinaryMaybeConstrainedFPBuiltin(*this, E,
                                    Intrinsic::pow,
                                    Intrinsic::experimental_constrained_pow));
@@ -3009,6 +3026,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_rintf16:
     case Builtin::BI__builtin_rintl:
     case Builtin::BI__builtin_rintf128:
+    case Builtin::BI__builtin_elementwise_rint:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(*this, E,
                                    Intrinsic::rint,
                                    Intrinsic::experimental_constrained_rint));
@@ -3021,6 +3039,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_roundf16:
     case Builtin::BI__builtin_roundl:
     case Builtin::BI__builtin_roundf128:
+    case Builtin::BI__builtin_elementwise_round:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(*this, E,
                                    Intrinsic::round,
                                    Intrinsic::experimental_constrained_round));
@@ -3033,6 +3052,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_roundevenf16:
     case Builtin::BI__builtin_roundevenl:
     case Builtin::BI__builtin_roundevenf128:
+    case Builtin::BI__builtin_elementwise_roundeven:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(*this, E,
                                    Intrinsic::roundeven,
                                    
Intrinsic::experimental_constrained_roundeven));
@@ -3045,6 +3065,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_sinf16:
     case Builtin::BI__builtin_sinl:
     case Builtin::BI__builtin_sinf128:
+    case Builtin::BI__builtin_elementwise_sin:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(*this, E,
                                    Intrinsic::sin,
                                    Intrinsic::experimental_constrained_sin));
@@ -3057,6 +3078,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_sinhf16:
     case Builtin::BI__builtin_sinhl:
     case Builtin::BI__builtin_sinhf128:
+    case Builtin::BI__builtin_elementwise_sinh:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(
           *this, E, Intrinsic::sinh, 
Intrinsic::experimental_constrained_sinh));
 
@@ -3104,6 +3126,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_tanf16:
     case Builtin::BI__builtin_tanl:
     case Builtin::BI__builtin_tanf128:
+    case Builtin::BI__builtin_elementwise_tan:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(
           *this, E, Intrinsic::tan, Intrinsic::experimental_constrained_tan));
 
@@ -3115,6 +3138,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_tanhf16:
     case Builtin::BI__builtin_tanhl:
     case Builtin::BI__builtin_tanhf128:
+    case Builtin::BI__builtin_elementwise_tanh:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(
           *this, E, Intrinsic::tanh, 
Intrinsic::experimental_constrained_tanh));
 
@@ -3126,6 +3150,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_truncf16:
     case Builtin::BI__builtin_truncl:
     case Builtin::BI__builtin_truncf128:
+    case Builtin::BI__builtin_elementwise_trunc:
       return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(*this, E,
                                    Intrinsic::trunc,
                                    Intrinsic::experimental_constrained_trunc));
@@ -3964,100 +3989,18 @@ RValue CodeGenFunction::EmitBuiltinExpr(const 
GlobalDecl GD, unsigned BuiltinID,
 
     return RValue::get(Result);
   }
-  case Builtin::BI__builtin_elementwise_acos:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::acos, "elt.acos"));
-  case Builtin::BI__builtin_elementwise_asin:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::asin, "elt.asin"));
-  case Builtin::BI__builtin_elementwise_atan:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::atan, "elt.atan"));
-  case Builtin::BI__builtin_elementwise_atan2:
-    return RValue::get(emitBuiltinWithOneOverloadedType<2>(
-        *this, E, Intrinsic::atan2, "elt.atan2"));
-  case Builtin::BI__builtin_elementwise_ceil:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::ceil, "elt.ceil"));
-  case Builtin::BI__builtin_elementwise_exp:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::exp, "elt.exp"));
-  case Builtin::BI__builtin_elementwise_exp2:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::exp2, "elt.exp2"));
-  case Builtin::BI__builtin_elementwise_exp10:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::exp10, "elt.exp10"));
-  case Builtin::BI__builtin_elementwise_ldexp: {
-    Value *Src = EmitScalarExpr(E->getArg(0));
-    Value *Exp = EmitScalarExpr(E->getArg(1));
-    Value *Result = Builder.CreateLdexp(Src, Exp, {}, "elt.ldexp");
-    return RValue::get(Result);
-  }
-  case Builtin::BI__builtin_elementwise_log:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::log, "elt.log"));
-  case Builtin::BI__builtin_elementwise_log2:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::log2, "elt.log2"));
-  case Builtin::BI__builtin_elementwise_log10:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::log10, "elt.log10"));
-  case Builtin::BI__builtin_elementwise_pow: {
-    return RValue::get(
-        emitBuiltinWithOneOverloadedType<2>(*this, E, Intrinsic::pow));
-  }
   case Builtin::BI__builtin_elementwise_bitreverse:
     return RValue::get(emitBuiltinWithOneOverloadedType<1>(
         *this, E, Intrinsic::bitreverse, "elt.bitreverse"));
-  case Builtin::BI__builtin_elementwise_cos:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::cos, "elt.cos"));
-  case Builtin::BI__builtin_elementwise_cosh:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::cosh, "elt.cosh"));
-  case Builtin::BI__builtin_elementwise_floor:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::floor, "elt.floor"));
   case Builtin::BI__builtin_elementwise_popcount:
     return RValue::get(emitBuiltinWithOneOverloadedType<1>(
         *this, E, Intrinsic::ctpop, "elt.ctpop"));
-  case Builtin::BI__builtin_elementwise_roundeven:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::roundeven, "elt.roundeven"));
-  case Builtin::BI__builtin_elementwise_round:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::round, "elt.round"));
-  case Builtin::BI__builtin_elementwise_rint:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::rint, "elt.rint"));
-  case Builtin::BI__builtin_elementwise_nearbyint:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::nearbyint, "elt.nearbyint"));
-  case Builtin::BI__builtin_elementwise_sin:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::sin, "elt.sin"));
-  case Builtin::BI__builtin_elementwise_sinh:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::sinh, "elt.sinh"));
-  case Builtin::BI__builtin_elementwise_tan:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::tan, "elt.tan"));
-  case Builtin::BI__builtin_elementwise_tanh:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::tanh, "elt.tanh"));
-  case Builtin::BI__builtin_elementwise_trunc:
-    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
-        *this, E, Intrinsic::trunc, "elt.trunc"));
   case Builtin::BI__builtin_elementwise_canonicalize:
     return RValue::get(emitBuiltinWithOneOverloadedType<1>(
         *this, E, Intrinsic::canonicalize, "elt.canonicalize"));
   case Builtin::BI__builtin_elementwise_copysign:
     return RValue::get(
         emitBuiltinWithOneOverloadedType<2>(*this, E, Intrinsic::copysign));
-  case Builtin::BI__builtin_elementwise_fma:
-    return RValue::get(
-        emitBuiltinWithOneOverloadedType<3>(*this, E, Intrinsic::fma));
   case Builtin::BI__builtin_elementwise_fshl:
     return RValue::get(
         emitBuiltinWithOneOverloadedType<3>(*this, E, Intrinsic::fshl));
diff --git a/clang/test/CodeGen/fp-contract-fast-pragma.cpp 
b/clang/test/CodeGen/fp-contract-fast-pragma.cpp
index 0bb01d6e17a1d..491590d4ce384 100644
--- a/clang/test/CodeGen/fp-contract-fast-pragma.cpp
+++ b/clang/test/CodeGen/fp-contract-fast-pragma.cpp
@@ -89,17 +89,59 @@ float fp_contract_6(float a, float b, float c) {
 
 
 #pragma clang fp contract(fast)
-float fp_contract_7(float a) {
+float fp_contract_7(float a, float b, float c) {
 // COMMON: _Z13fp_contract_7f
 // CHECK: tail call contract float @llvm.sqrt.f32(float %a)
+// CHECK: tail call contract float @llvm.ceil.f32(float %a)
+// CHECK: tail call contract float @llvm.sin.f32(float %a)
+// CHECK: tail call contract float @llvm.pow.f32(float %a, float %b)
+// CHECK: tail call contract float @llvm.exp.f32(float %a)
+// CHECK: tail call contract float @llvm.fma.f32(float %a, float %b, float %c)
+// CHECK: tail call contract float @llvm.nearbyint.f32(float %a)
+// CHECK: tail call contract float @llvm.log2.f32(float %a)
 // STRICT: tail call contract float 
@llvm.experimental.constrained.sqrt.f32(float %a, metadata !"round.tonearest", 
metadata !"fpexcept.strict")
-  return __builtin_sqrtf(a);
+// STRICT: tail call contract float 
@llvm.experimental.constrained.ceil.f32(float %a, metadata !"fpexcept.strict")
+// STRICT: tail call contract float 
@llvm.experimental.constrained.sin.f32(float %a, metadata !"round.tonearest", 
metadata !"fpexcept.strict")
+// STRICT: tail call contract float 
@llvm.experimental.constrained.pow.f32(float %a, float %b, metadata 
!"round.tonearest", metadata !"fpexcept.strict")
+// STRICT: tail call contract float 
@llvm.experimental.constrained.exp.f32(float %a, metadata !"round.tonearest", 
metadata !"fpexcept.strict")
+// STRICT: tail call contract float 
@llvm.experimental.constrained.fma.f32(float %a, float %b, float %c, metadata 
!"round.tonearest", metadata !"fpexcept.strict")
+// STRICT: tail call contract float 
@llvm.experimental.constrained.nearbyint.f32(float %a, metadata 
!"round.tonearest", metadata !"fpexcept.strict")
+// STRICT: tail call contract float 
@llvm.experimental.constrained.log2.f32(float %a, metadata !"round.tonearest", 
metadata !"fpexcept.strict")
+  return __builtin_sqrtf(a) +
+         __builtin_elementwise_ceil(a) +
+         __builtin_elementwise_sin(a) +
+         __builtin_elementwise_pow(a, b) +
+         __builtin_elementwise_exp(a) +
+         __builtin_elementwise_fma(a, b, c) +
+         __builtin_elementwise_nearbyint(a) +
+         __builtin_elementwise_log2(a);
 }
 
-float fp_contract_8(float a) {
+float fp_contract_8(float a, float b, float c) {
 // COMMON: _Z13fp_contract_8f
 // CHECK: tail call float @llvm.sqrt.f32(float %a)
+// CHECK: tail call float @llvm.ceil.f32(float %a)
+// CHECK: tail call float @llvm.sin.f32(float %a)
+// CHECK: tail call float @llvm.pow.f32(float %a, float %b)
+// CHECK: tail call float @llvm.exp.f32(float %a)
+// CHECK: tail call float @llvm.fma.f32(float %a, float %b, float %c)
+// CHECK: tail call float @llvm.nearbyint.f32(float %a)
+// CHECK: tail call float @llvm.log2.f32(float %a)
 // STRICT: tail call float @llvm.experimental.constrained.sqrt.f32(float %a, 
metadata !"round.tonearest", metadata !"fpexcept.strict")
-#pragma clang fp contract(off)
-  return __builtin_sqrtf(a);
+// STRICT: tail call float @llvm.experimental.constrained.ceil.f32(float %a, 
metadata !"fpexcept.strict")
+// STRICT: tail call float @llvm.experimental.constrained.sin.f32(float %a, 
metadata !"round.tonearest", metadata !"fpexcept.strict")
+// STRICT: tail call float @llvm.experimental.constrained.pow.f32(float %a, 
float %b, metadata !"round.tonearest", metadata !"fpexcept.strict")
+// STRICT: tail call float @llvm.experimental.constrained.exp.f32(float %a, 
metadata !"round.tonearest", metadata !"fpexcept.strict")
+// STRICT: tail call float @llvm.experimental.constrained.fma.f32(float %a, 
float %b, float %c, metadata !"round.tonearest", metadata !"fpexcept.strict")
+// STRICT: tail call float @llvm.experimental.constrained.nearbyint.f32(float 
%a, metadata !"round.tonearest", metadata !"fpexcept.strict")
+// STRICT: tail call float @llvm.experimental.constrained.log2.f32(float %a, 
metadata !"round.tonearest", metadata !"fpexcept.strict")
+#pragma clang fp contract(off)  
+  return __builtin_sqrtf(a) +
+         __builtin_elementwise_ceil(a) +
+         __builtin_elementwise_sin(a) +
+         __builtin_elementwise_pow(a, b) +
+         __builtin_elementwise_exp(a) +
+         __builtin_elementwise_fma(a, b, c) +
+         __builtin_elementwise_nearbyint(a) +
+         __builtin_elementwise_log2(a);
 }

>From 8513f3818b029203125edc324c5ed5d2dea3c295 Mon Sep 17 00:00:00 2001
From: "Ficek, Jakub" <[email protected]>
Date: Fri, 7 Nov 2025 09:46:08 +0100
Subject: [PATCH 2/2] fix tests

---
 clang/lib/CodeGen/CGBuiltin.cpp               |   9 +-
 .../test/CodeGen/fp-contract-fast-pragma.cpp  |  52 +-----
 .../CodeGen/strictfp-elementwise-builtins.cpp | 174 ++++++++----------
 .../CodeGenHLSL/builtins/exp-overloads.hlsl   |  80 ++++----
 clang/test/CodeGenHLSL/builtins/exp.hlsl      |  48 ++---
 .../CodeGenHLSL/builtins/exp2-overloads.hlsl  |  80 ++++----
 clang/test/CodeGenHLSL/builtins/exp2.hlsl     |  48 ++---
 clang/test/CodeGenHLSL/builtins/ldexp.hlsl    |  32 ++--
 clang/test/CodeGenHLSL/builtins/lit.hlsl      |  12 +-
 .../CodeGenHLSL/builtins/round-overloads.hlsl |  80 ++++----
 clang/test/CodeGenHLSL/builtins/round.hlsl    |  48 ++---
 11 files changed, 299 insertions(+), 364 deletions(-)

diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 1da63e57ac8a1..81fef4a85827b 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -2951,7 +2951,13 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
       CodeGenFunction::CGFPOptionsRAII FPOptsRAII(*this, E);
       Value *Arg1 = EmitScalarExpr(E->getArg(0));
       Value *Arg2 = EmitScalarExpr(E->getArg(1));
-      return RValue::get(Builder.CreateFRem(Arg1, Arg2, "fmod"));
+      if (Builder.getIsFPConstrained()) {
+        Function *F = 
CGM.getIntrinsic(Intrinsic::experimental_constrained_frem,
+                                       Arg1->getType());
+        return RValue::get(Builder.CreateConstrainedFPCall(F, {Arg1, Arg2}));
+      } else {
+        return RValue::get(Builder.CreateFRem(Arg1, Arg2, "fmod"));
+      }
     }
 
     case Builtin::BIlog:
@@ -3203,6 +3209,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
     case Builtin::BI__builtin_ldexpl:
     case Builtin::BI__builtin_ldexpf16:
     case Builtin::BI__builtin_ldexpf128: {
+    case Builtin::BI__builtin_elementwise_ldexp:
       return RValue::get(emitBinaryExpMaybeConstrainedFPBuiltin(
           *this, E, Intrinsic::ldexp,
           Intrinsic::experimental_constrained_ldexp));
diff --git a/clang/test/CodeGen/fp-contract-fast-pragma.cpp 
b/clang/test/CodeGen/fp-contract-fast-pragma.cpp
index 491590d4ce384..0bb01d6e17a1d 100644
--- a/clang/test/CodeGen/fp-contract-fast-pragma.cpp
+++ b/clang/test/CodeGen/fp-contract-fast-pragma.cpp
@@ -89,59 +89,17 @@ float fp_contract_6(float a, float b, float c) {
 
 
 #pragma clang fp contract(fast)
-float fp_contract_7(float a, float b, float c) {
+float fp_contract_7(float a) {
 // COMMON: _Z13fp_contract_7f
 // CHECK: tail call contract float @llvm.sqrt.f32(float %a)
-// CHECK: tail call contract float @llvm.ceil.f32(float %a)
-// CHECK: tail call contract float @llvm.sin.f32(float %a)
-// CHECK: tail call contract float @llvm.pow.f32(float %a, float %b)
-// CHECK: tail call contract float @llvm.exp.f32(float %a)
-// CHECK: tail call contract float @llvm.fma.f32(float %a, float %b, float %c)
-// CHECK: tail call contract float @llvm.nearbyint.f32(float %a)
-// CHECK: tail call contract float @llvm.log2.f32(float %a)
 // STRICT: tail call contract float 
@llvm.experimental.constrained.sqrt.f32(float %a, metadata !"round.tonearest", 
metadata !"fpexcept.strict")
-// STRICT: tail call contract float 
@llvm.experimental.constrained.ceil.f32(float %a, metadata !"fpexcept.strict")
-// STRICT: tail call contract float 
@llvm.experimental.constrained.sin.f32(float %a, metadata !"round.tonearest", 
metadata !"fpexcept.strict")
-// STRICT: tail call contract float 
@llvm.experimental.constrained.pow.f32(float %a, float %b, metadata 
!"round.tonearest", metadata !"fpexcept.strict")
-// STRICT: tail call contract float 
@llvm.experimental.constrained.exp.f32(float %a, metadata !"round.tonearest", 
metadata !"fpexcept.strict")
-// STRICT: tail call contract float 
@llvm.experimental.constrained.fma.f32(float %a, float %b, float %c, metadata 
!"round.tonearest", metadata !"fpexcept.strict")
-// STRICT: tail call contract float 
@llvm.experimental.constrained.nearbyint.f32(float %a, metadata 
!"round.tonearest", metadata !"fpexcept.strict")
-// STRICT: tail call contract float 
@llvm.experimental.constrained.log2.f32(float %a, metadata !"round.tonearest", 
metadata !"fpexcept.strict")
-  return __builtin_sqrtf(a) +
-         __builtin_elementwise_ceil(a) +
-         __builtin_elementwise_sin(a) +
-         __builtin_elementwise_pow(a, b) +
-         __builtin_elementwise_exp(a) +
-         __builtin_elementwise_fma(a, b, c) +
-         __builtin_elementwise_nearbyint(a) +
-         __builtin_elementwise_log2(a);
+  return __builtin_sqrtf(a);
 }
 
-float fp_contract_8(float a, float b, float c) {
+float fp_contract_8(float a) {
 // COMMON: _Z13fp_contract_8f
 // CHECK: tail call float @llvm.sqrt.f32(float %a)
-// CHECK: tail call float @llvm.ceil.f32(float %a)
-// CHECK: tail call float @llvm.sin.f32(float %a)
-// CHECK: tail call float @llvm.pow.f32(float %a, float %b)
-// CHECK: tail call float @llvm.exp.f32(float %a)
-// CHECK: tail call float @llvm.fma.f32(float %a, float %b, float %c)
-// CHECK: tail call float @llvm.nearbyint.f32(float %a)
-// CHECK: tail call float @llvm.log2.f32(float %a)
 // STRICT: tail call float @llvm.experimental.constrained.sqrt.f32(float %a, 
metadata !"round.tonearest", metadata !"fpexcept.strict")
-// STRICT: tail call float @llvm.experimental.constrained.ceil.f32(float %a, 
metadata !"fpexcept.strict")
-// STRICT: tail call float @llvm.experimental.constrained.sin.f32(float %a, 
metadata !"round.tonearest", metadata !"fpexcept.strict")
-// STRICT: tail call float @llvm.experimental.constrained.pow.f32(float %a, 
float %b, metadata !"round.tonearest", metadata !"fpexcept.strict")
-// STRICT: tail call float @llvm.experimental.constrained.exp.f32(float %a, 
metadata !"round.tonearest", metadata !"fpexcept.strict")
-// STRICT: tail call float @llvm.experimental.constrained.fma.f32(float %a, 
float %b, float %c, metadata !"round.tonearest", metadata !"fpexcept.strict")
-// STRICT: tail call float @llvm.experimental.constrained.nearbyint.f32(float 
%a, metadata !"round.tonearest", metadata !"fpexcept.strict")
-// STRICT: tail call float @llvm.experimental.constrained.log2.f32(float %a, 
metadata !"round.tonearest", metadata !"fpexcept.strict")
-#pragma clang fp contract(off)  
-  return __builtin_sqrtf(a) +
-         __builtin_elementwise_ceil(a) +
-         __builtin_elementwise_sin(a) +
-         __builtin_elementwise_pow(a, b) +
-         __builtin_elementwise_exp(a) +
-         __builtin_elementwise_fma(a, b, c) +
-         __builtin_elementwise_nearbyint(a) +
-         __builtin_elementwise_log2(a);
+#pragma clang fp contract(off)
+  return __builtin_sqrtf(a);
 }
diff --git a/clang/test/CodeGen/strictfp-elementwise-builtins.cpp 
b/clang/test/CodeGen/strictfp-elementwise-builtins.cpp
index b250512efc5c7..6453d50f044aa 100644
--- a/clang/test/CodeGen/strictfp-elementwise-builtins.cpp
+++ b/clang/test/CodeGen/strictfp-elementwise-builtins.cpp
@@ -68,180 +68,170 @@ float4 strict_elementwise_minimum(float4 a, float4 b) {
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z23strict_elementwise_ceilDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_CEIL:%.*]] = tail call <4 x float> @llvm.ceil.v4f32(<4 
x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_CEIL]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.ceil.v4f32(<4 x float> [[A]], metadata 
!"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_ceil(float4 a) {
   return __builtin_elementwise_ceil(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z23strict_elementwise_acosDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_ACOS:%.*]] = tail call <4 x float> @llvm.acos.v4f32(<4 
x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_ACOS]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.acos.v4f32(<4 x float> [[A]], metadata 
!"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_acos(float4 a) {
   return __builtin_elementwise_acos(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z22strict_elementwise_cosDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_COS:%.*]] = tail call <4 x float> @llvm.cos.v4f32(<4 x 
float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_COS]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.cos.v4f32(<4 x float> [[A]], metadata 
!"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_cos(float4 a) {
   return __builtin_elementwise_cos(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z23strict_elementwise_coshDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_COSH:%.*]] = tail call <4 x float> @llvm.cosh.v4f32(<4 
x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_COSH]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.cosh.v4f32(<4 x float> [[A]], metadata 
!"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_cosh(float4 a) {
   return __builtin_elementwise_cosh(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z22strict_elementwise_expDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_EXP:%.*]] = tail call <4 x float> @llvm.exp.v4f32(<4 x 
float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_EXP]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.exp.v4f32(<4 x float> [[A]], metadata 
!"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_exp(float4 a) {
   return __builtin_elementwise_exp(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z23strict_elementwise_exp2Dv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_EXP2:%.*]] = tail call <4 x float> @llvm.exp2.v4f32(<4 
x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_EXP2]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.exp2.v4f32(<4 x float> [[A]], metadata 
!"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_exp2(float4 a) {
   return __builtin_elementwise_exp2(a);
 }
 
-// CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z24strict_elementwise_exp10Dv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
-// CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_EXP10:%.*]] = tail call <4 x float> 
@llvm.exp10.v4f32(<4 x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_EXP10]]
-//
-float4 strict_elementwise_exp10(float4 a) {
-  return __builtin_elementwise_exp10(a);
-}
-
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z24strict_elementwise_floorDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_FLOOR:%.*]] = tail call <4 x float> 
@llvm.floor.v4f32(<4 x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_FLOOR]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.floor.v4f32(<4 x float> [[A]], metadata 
!"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_floor(float4 a) {
   return __builtin_elementwise_floor(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z22strict_elementwise_logDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_LOG:%.*]] = tail call <4 x float> @llvm.log.v4f32(<4 x 
float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_LOG]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.log.v4f32(<4 x float> [[A]], metadata 
!"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_log(float4 a) {
   return __builtin_elementwise_log(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z23strict_elementwise_log2Dv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_LOG2:%.*]] = tail call <4 x float> @llvm.log2.v4f32(<4 
x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_LOG2]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.log2.v4f32(<4 x float> [[A]], metadata 
!"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_log2(float4 a) {
   return __builtin_elementwise_log2(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z24strict_elementwise_log10Dv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_LOG2:%.*]] = tail call <4 x float> @llvm.log2.v4f32(<4 
x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_LOG2]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.log2.v4f32(<4 x float> [[A]], metadata 
!"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_log10(float4 a) {
   return __builtin_elementwise_log2(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z28strict_elementwise_roundevenDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_ROUNDEVEN:%.*]] = tail call <4 x float> 
@llvm.roundeven.v4f32(<4 x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_ROUNDEVEN]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.roundeven.v4f32(<4 x float> [[A]], metadata 
!"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_roundeven(float4 a) {
   return __builtin_elementwise_roundeven(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z24strict_elementwise_roundDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_ROUND:%.*]] = tail call <4 x float> 
@llvm.round.v4f32(<4 x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_ROUND]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.round.v4f32(<4 x float> [[A]], metadata 
!"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_round(float4 a) {
   return __builtin_elementwise_round(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z23strict_elementwise_rintDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_RINT:%.*]] = tail call <4 x float> @llvm.rint.v4f32(<4 
x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_RINT]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.rint.v4f32(<4 x float> [[A]], metadata 
!"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_rint(float4 a) {
   return __builtin_elementwise_rint(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z28strict_elementwise_nearbyintDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_NEARBYINT:%.*]] = tail call <4 x float> 
@llvm.nearbyint.v4f32(<4 x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_NEARBYINT]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.nearbyint.v4f32(<4 x float> [[A]], metadata 
!"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_nearbyint(float4 a) {
   return __builtin_elementwise_nearbyint(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z23strict_elementwise_asinDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_ASIN:%.*]] = tail call <4 x float> @llvm.asin.v4f32(<4 
x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_ASIN]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.asin.v4f32(<4 x float> [[A]], metadata 
!"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_asin(float4 a) {
   return __builtin_elementwise_asin(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z22strict_elementwise_sinDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_SIN:%.*]] = tail call <4 x float> @llvm.sin.v4f32(<4 x 
float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_SIN]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.sin.v4f32(<4 x float> [[A]], metadata 
!"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_sin(float4 a) {
   return __builtin_elementwise_sin(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z23strict_elementwise_sinhDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_SINH:%.*]] = tail call <4 x float> @llvm.sinh.v4f32(<4 
x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_SINH]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.sinh.v4f32(<4 x float> [[A]], metadata 
!"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_sinh(float4 a) {
   return __builtin_elementwise_sinh(a);
@@ -258,79 +248,59 @@ float4 strict_elementwise_sqrt(float4 a) {
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z23strict_elementwise_atanDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_ATAN:%.*]] = tail call <4 x float> @llvm.atan.v4f32(<4 
x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_ATAN]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.atan.v4f32(<4 x float> [[A]], metadata 
!"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_atan(float4 a) {
   return __builtin_elementwise_atan(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z22strict_elementwise_tanDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_TAN:%.*]] = tail call <4 x float> @llvm.tan.v4f32(<4 x 
float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_TAN]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.tan.v4f32(<4 x float> [[A]], metadata 
!"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_tan(float4 a) {
   return __builtin_elementwise_tan(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z23strict_elementwise_tanhDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_TANH:%.*]] = tail call <4 x float> @llvm.tanh.v4f32(<4 
x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_TANH]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.tanh.v4f32(<4 x float> [[A]], metadata 
!"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_tanh(float4 a) {
   return __builtin_elementwise_tanh(a);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z24strict_elementwise_atan2Dv4_fS_
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]]) 
local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]]) 
local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_ATAN2:%.*]] = tail call <4 x float> 
@llvm.atan2.v4f32(<4 x float> [[A]], <4 x float> [[B]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_ATAN2]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.atan2.v4f32(<4 x float> [[A]], <4 x float> 
[[B]], metadata !"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_atan2(float4 a, float4 b) {
   return __builtin_elementwise_atan2(a, b);
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z24strict_elementwise_truncDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_TRUNC:%.*]] = tail call <4 x float> 
@llvm.trunc.v4f32(<4 x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_TRUNC]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.trunc.v4f32(<4 x float> [[A]], metadata 
!"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_trunc(float4 a) {
   return __builtin_elementwise_trunc(a);
 }
 
-// CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z31strict_elementwise_canonicalizeDv4_f
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
-// CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[ELT_CANONICALIZE:%.*]] = tail call <4 x float> 
@llvm.canonicalize.v4f32(<4 x float> [[A]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[ELT_CANONICALIZE]]
-//
-float4 strict_elementwise_canonicalize(float4 a) {
-  return __builtin_elementwise_canonicalize(a);
-}
-
-// CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z27strict_elementwise_copysignDv4_fS_
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]]) 
local_unnamed_addr #[[ATTR2]] {
-// CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> @llvm.copysign.v4f32(<4 
x float> [[A]], <4 x float> [[B]]) #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[TMP0]]
-//
-float4 strict_elementwise_copysign(float4 a, float4 b) {
-  return __builtin_elementwise_copysign(a, b);
-}
-
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z22strict_elementwise_fmaDv4_fS_S_
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]], 
<4 x float> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]], 
<4 x float> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> @llvm.fma.v4f32(<4 x 
float> [[A]], <4 x float> [[B]], <4 x float> [[C]]) #[[ATTR4]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.fma.v4f32(<4 x float> [[A]], <4 x float> [[B]], 
<4 x float> [[C]], metadata !"round.dynamic", metadata !"fpexcept.strict") 
#[[ATTR4]]
 // CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_fma(float4 a, float4 b, float4 c) {
@@ -338,9 +308,9 @@ float4 strict_elementwise_fma(float4 a, float4 b, float4 c) 
{
 }
 
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z22strict_elementwise_powDv4_fS_
-// CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]]) 
local_unnamed_addr #[[ATTR2]] {
+// CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]]) 
local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> @llvm.pow.v4f32(<4 x 
float> [[A]], <4 x float> [[B]]) #[[ATTR4]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.pow.v4f32(<4 x float> [[A]], <4 x float> [[B]], 
metadata !"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
 // CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_pow(float4 a, float4 b) {
@@ -350,8 +320,8 @@ float4 strict_elementwise_pow(float4 a, float4 b) {
 // CHECK-LABEL: define dso_local noundef <4 x float> 
@_Z23strict_elementwise_fmodDv4_fS_
 // CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]]) 
local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:    [[FMOD:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.frem.v4f32(<4 x float> [[A]], <4 x float> [[B]], 
metadata !"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
-// CHECK-NEXT:    ret <4 x float> [[FMOD]]
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call <4 x float> 
@llvm.experimental.constrained.frem.v4f32(<4 x float> [[A]], <4 x float> [[B]], 
metadata !"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4]]
+// CHECK-NEXT:    ret <4 x float> [[TMP0]]
 //
 float4 strict_elementwise_fmod(float4 a, float4 b) {
   return __builtin_elementwise_fmod(a, b);
diff --git a/clang/test/CodeGenHLSL/builtins/exp-overloads.hlsl 
b/clang/test/CodeGenHLSL/builtins/exp-overloads.hlsl
index df34beeba7a8c..c22f012421e3a 100644
--- a/clang/test/CodeGenHLSL/builtins/exp-overloads.hlsl
+++ b/clang/test/CodeGenHLSL/builtins/exp-overloads.hlsl
@@ -3,86 +3,86 @@
 // RUN:  FileCheck %s --check-prefixes=CHECK
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
{{.*}}test_exp_double
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(
-// CHECK: ret float %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp.f32(
+// CHECK: ret float [[EXP]]
 float test_exp_double(double p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
{{.*}}test_exp_double2
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp.v2f32
-// CHECK: ret <2 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp.v2f32
+// CHECK: ret <2 x float> [[EXP]]
 float2 test_exp_double2(double2 p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
{{.*}}test_exp_double3
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp.v3f32
-// CHECK: ret <3 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp.v3f32
+// CHECK: ret <3 x float> [[EXP]]
 float3 test_exp_double3(double3 p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
{{.*}}test_exp_double4
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp.v4f32
-// CHECK: ret <4 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp.v4f32
+// CHECK: ret <4 x float> [[EXP]]
 float4 test_exp_double4(double4 p0) { return exp(p0); }
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
{{.*}}test_exp_int
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(
-// CHECK: ret float %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp.f32(
+// CHECK: ret float [[EXP]]
 float test_exp_int(int p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
{{.*}}test_exp_int2
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp.v2f32
-// CHECK: ret <2 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp.v2f32
+// CHECK: ret <2 x float> [[EXP]]
 float2 test_exp_int2(int2 p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
{{.*}}test_exp_int3
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp.v3f32
-// CHECK: ret <3 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp.v3f32
+// CHECK: ret <3 x float> [[EXP]]
 float3 test_exp_int3(int3 p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
{{.*}}test_exp_int4
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp.v4f32
-// CHECK: ret <4 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp.v4f32
+// CHECK: ret <4 x float> [[EXP]]
 float4 test_exp_int4(int4 p0) { return exp(p0); }
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
{{.*}}test_exp_uint
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(
-// CHECK: ret float %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp.f32(
+// CHECK: ret float [[EXP]]
 float test_exp_uint(uint p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
{{.*}}test_exp_uint2
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp.v2f32
-// CHECK: ret <2 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp.v2f32
+// CHECK: ret <2 x float> [[EXP]]
 float2 test_exp_uint2(uint2 p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
{{.*}}test_exp_uint3
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp.v3f32
-// CHECK: ret <3 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp.v3f32
+// CHECK: ret <3 x float> [[EXP]]
 float3 test_exp_uint3(uint3 p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
{{.*}}test_exp_uint4
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp.v4f32
-// CHECK: ret <4 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp.v4f32
+// CHECK: ret <4 x float> [[EXP]]
 float4 test_exp_uint4(uint4 p0) { return exp(p0); }
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
{{.*}}test_exp_int64_t
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(
-// CHECK: ret float %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp.f32(
+// CHECK: ret float [[EXP]]
 float test_exp_int64_t(int64_t p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
{{.*}}test_exp_int64_t2
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp.v2f32
-// CHECK: ret <2 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp.v2f32
+// CHECK: ret <2 x float> [[EXP]]
 float2 test_exp_int64_t2(int64_t2 p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
{{.*}}test_exp_int64_t3
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp.v3f32
-// CHECK: ret <3 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp.v3f32
+// CHECK: ret <3 x float> [[EXP]]
 float3 test_exp_int64_t3(int64_t3 p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
{{.*}}test_exp_int64_t4
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp.v4f32
-// CHECK: ret <4 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp.v4f32
+// CHECK: ret <4 x float> [[EXP]]
 float4 test_exp_int64_t4(int64_t4 p0) { return exp(p0); }
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
{{.*}}test_exp_uint64_t
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(
-// CHECK: ret float %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp.f32(
+// CHECK: ret float [[EXP]]
 float test_exp_uint64_t(uint64_t p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
{{.*}}test_exp_uint64_t2
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp.v2f32
-// CHECK: ret <2 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp.v2f32
+// CHECK: ret <2 x float> [[EXP]]
 float2 test_exp_uint64_t2(uint64_t2 p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
{{.*}}test_exp_uint64_t3
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp.v3f32
-// CHECK: ret <3 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp.v3f32
+// CHECK: ret <3 x float> [[EXP]]
 float3 test_exp_uint64_t3(uint64_t3 p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
{{.*}}test_exp_uint64_t4
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp.v4f32
-// CHECK: ret <4 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp.v4f32
+// CHECK: ret <4 x float> [[EXP]]
 float4 test_exp_uint64_t4(uint64_t4 p0) { return exp(p0); }
diff --git a/clang/test/CodeGenHLSL/builtins/exp.hlsl 
b/clang/test/CodeGenHLSL/builtins/exp.hlsl
index d50ef021eecb8..56efb03d1f98b 100644
--- a/clang/test/CodeGenHLSL/builtins/exp.hlsl
+++ b/clang/test/CodeGenHLSL/builtins/exp.hlsl
@@ -6,47 +6,47 @@
 // RUN:  FileCheck %s --check-prefixes=CHECK,NO_HALF
 
 // NATIVE_HALF-LABEL: define hidden noundef nofpclass(nan inf) half 
@_Z13test_exp_half
-// NATIVE_HALF: %elt.exp = call reassoc nnan ninf nsz arcp afn half 
@llvm.exp.f16(
-// NATIVE_HALF: ret half %elt.exp
+// NATIVE_HALF: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn half 
@llvm.exp.f16(
+// NATIVE_HALF: ret half [[EXP]]
 // NO_HALF-LABEL: define hidden noundef nofpclass(nan inf) float 
@_Z13test_exp_half
-// NO_HALF: %elt.exp = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(
-// NO_HALF: ret float %elt.exp
+// NO_HALF: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp.f32(
+// NO_HALF: ret float [[EXP]]
 half test_exp_half(half p0) { return exp(p0); }
 // NATIVE_HALF-LABEL: define hidden noundef nofpclass(nan inf) <2 x half> 
@_Z14test_exp_half2
-// NATIVE_HALF: %elt.exp = call reassoc nnan ninf nsz arcp afn <2 x half> 
@llvm.exp.v2f16
-// NATIVE_HALF: ret <2 x half> %elt.exp
+// NATIVE_HALF: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x half> 
@llvm.exp.v2f16
+// NATIVE_HALF: ret <2 x half> [[EXP]]
 // NO_HALF-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
@_Z14test_exp_half2
-// NO_HALF: %elt.exp = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp.v2f32(
-// NO_HALF: ret <2 x float> %elt.exp
+// NO_HALF: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp.v2f32(
+// NO_HALF: ret <2 x float> [[EXP]]
 half2 test_exp_half2(half2 p0) { return exp(p0); }
 // NATIVE_HALF-LABEL: define hidden noundef nofpclass(nan inf) <3 x half> 
@_Z14test_exp_half3
-// NATIVE_HALF: %elt.exp = call reassoc nnan ninf nsz arcp afn <3 x half> 
@llvm.exp.v3f16
-// NATIVE_HALF: ret <3 x half> %elt.exp
+// NATIVE_HALF: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x half> 
@llvm.exp.v3f16
+// NATIVE_HALF: ret <3 x half> [[EXP]]
 // NO_HALF-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
@_Z14test_exp_half3
-// NO_HALF: %elt.exp = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp.v3f32(
-// NO_HALF: ret <3 x float> %elt.exp
+// NO_HALF: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp.v3f32(
+// NO_HALF: ret <3 x float> [[EXP]]
 half3 test_exp_half3(half3 p0) { return exp(p0); }
 // NATIVE_HALF-LABEL: define hidden noundef nofpclass(nan inf) <4 x half> 
@_Z14test_exp_half4
-// NATIVE_HALF: %elt.exp = call reassoc nnan ninf nsz arcp afn <4 x half> 
@llvm.exp.v4f16
-// NATIVE_HALF: ret <4 x half> %elt.exp
+// NATIVE_HALF: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x half> 
@llvm.exp.v4f16
+// NATIVE_HALF: ret <4 x half> [[EXP]]
 // NO_HALF-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
@_Z14test_exp_half4
-// NO_HALF: %elt.exp = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp.v4f32(
-// NO_HALF: ret <4 x float> %elt.exp
+// NO_HALF: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp.v4f32(
+// NO_HALF: ret <4 x float> [[EXP]]
 half4 test_exp_half4(half4 p0) { return exp(p0); }
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
@_Z14test_exp_float
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(
-// CHECK: ret float %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp.f32(
+// CHECK: ret float [[EXP:%.*]]
 float test_exp_float(float p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
@_Z15test_exp_float2
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp.v2f32
-// CHECK: ret <2 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp.v2f32
+// CHECK: ret <2 x float> [[EXP]]
 float2 test_exp_float2(float2 p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
@_Z15test_exp_float3
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp.v3f32
-// CHECK: ret <3 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp.v3f32
+// CHECK: ret <3 x float> [[EXP]]
 float3 test_exp_float3(float3 p0) { return exp(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
@_Z15test_exp_float4
-// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp.v4f32
-// CHECK: ret <4 x float> %elt.exp
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp.v4f32
+// CHECK: ret <4 x float> [[EXP]]
 float4 test_exp_float4(float4 p0) { return exp(p0); }
diff --git a/clang/test/CodeGenHLSL/builtins/exp2-overloads.hlsl 
b/clang/test/CodeGenHLSL/builtins/exp2-overloads.hlsl
index 20482777a18de..a8a6f3ba76b4f 100644
--- a/clang/test/CodeGenHLSL/builtins/exp2-overloads.hlsl
+++ b/clang/test/CodeGenHLSL/builtins/exp2-overloads.hlsl
@@ -3,86 +3,86 @@
 // RUN:  FileCheck %s --check-prefixes=CHECK
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
{{.*}}test_exp2_double
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn float @llvm.exp2.f32(
-// CHECK: ret float %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp2.f32(
+// CHECK: ret float [[EXP2]]
 float test_exp2_double(double p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
{{.*}}test_exp2_double2
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp2.v2f32
-// CHECK: ret <2 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp2.v2f32
+// CHECK: ret <2 x float> [[EXP2]]
 float2 test_exp2_double2(double2 p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
{{.*}}test_exp2_double3
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp2.v3f32
-// CHECK: ret <3 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp2.v3f32
+// CHECK: ret <3 x float> [[EXP2]]
 float3 test_exp2_double3(double3 p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
{{.*}}test_exp2_double4
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp2.v4f32
-// CHECK: ret <4 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp2.v4f32
+// CHECK: ret <4 x float> [[EXP2]]
 float4 test_exp2_double4(double4 p0) { return exp2(p0); }
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
{{.*}}test_exp2_int
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn float @llvm.exp2.f32(
-// CHECK: ret float %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp2.f32(
+// CHECK: ret float [[EXP2]]
 float test_exp2_int(int p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
{{.*}}test_exp2_int2
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp2.v2f32
-// CHECK: ret <2 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp2.v2f32
+// CHECK: ret <2 x float> [[EXP2]]
 float2 test_exp2_int2(int2 p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
{{.*}}test_exp2_int3
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp2.v3f32
-// CHECK: ret <3 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp2.v3f32
+// CHECK: ret <3 x float> [[EXP2]]
 float3 test_exp2_int3(int3 p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
{{.*}}test_exp2_int4
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp2.v4f32
-// CHECK: ret <4 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp2.v4f32
+// CHECK: ret <4 x float> [[EXP2]]
 float4 test_exp2_int4(int4 p0) { return exp2(p0); }
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
{{.*}}test_exp2_uint
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn float @llvm.exp2.f32(
-// CHECK: ret float %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp2.f32(
+// CHECK: ret float [[EXP2]]
 float test_exp2_uint(uint p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
{{.*}}test_exp2_uint2
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp2.v2f32
-// CHECK: ret <2 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp2.v2f32
+// CHECK: ret <2 x float> [[EXP2]]
 float2 test_exp2_uint2(uint2 p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
{{.*}}test_exp2_uint3
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp2.v3f32
-// CHECK: ret <3 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp2.v3f32
+// CHECK: ret <3 x float> [[EXP2]]
 float3 test_exp2_uint3(uint3 p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
{{.*}}test_exp2_uint4
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp2.v4f32
-// CHECK: ret <4 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp2.v4f32
+// CHECK: ret <4 x float> [[EXP2]]
 float4 test_exp2_uint4(uint4 p0) { return exp2(p0); }
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
{{.*}}test_exp2_int64_t
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn float @llvm.exp2.f32(
-// CHECK: ret float %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp2.f32(
+// CHECK: ret float [[EXP2]]
 float test_exp2_int64_t(int64_t p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
{{.*}}test_exp2_int64_t2
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp2.v2f32
-// CHECK: ret <2 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp2.v2f32
+// CHECK: ret <2 x float> [[EXP2]]
 float2 test_exp2_int64_t2(int64_t2 p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
{{.*}}test_exp2_int64_t3
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp2.v3f32
-// CHECK: ret <3 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp2.v3f32
+// CHECK: ret <3 x float> [[EXP2]]
 float3 test_exp2_int64_t3(int64_t3 p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
{{.*}}test_exp2_int64_t4
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp2.v4f32
-// CHECK: ret <4 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp2.v4f32
+// CHECK: ret <4 x float> [[EXP2]]
 float4 test_exp2_int64_t4(int64_t4 p0) { return exp2(p0); }
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
{{.*}}test_exp2_uint64_t
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn float @llvm.exp2.f32(
-// CHECK: ret float %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp2.f32(
+// CHECK: ret float [[EXP2]]
 float test_exp2_uint64_t(uint64_t p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
{{.*}}test_exp2_uint64_t2
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp2.v2f32
-// CHECK: ret <2 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp2.v2f32
+// CHECK: ret <2 x float> [[EXP2]]
 float2 test_exp2_uint64_t2(uint64_t2 p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
{{.*}}test_exp2_uint64_t3
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp2.v3f32
-// CHECK: ret <3 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp2.v3f32
+// CHECK: ret <3 x float> [[EXP2]]
 float3 test_exp2_uint64_t3(uint64_t3 p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
{{.*}}test_exp2_uint64_t4
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp2.v4f32
-// CHECK: ret <4 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp2.v4f32
+// CHECK: ret <4 x float> [[EXP2]]
 float4 test_exp2_uint64_t4(uint64_t4 p0) { return exp2(p0); }
diff --git a/clang/test/CodeGenHLSL/builtins/exp2.hlsl 
b/clang/test/CodeGenHLSL/builtins/exp2.hlsl
index ed8cfcf47b04b..b4d9c411681d1 100644
--- a/clang/test/CodeGenHLSL/builtins/exp2.hlsl
+++ b/clang/test/CodeGenHLSL/builtins/exp2.hlsl
@@ -6,47 +6,47 @@
 // RUN:  FileCheck %s --check-prefixes=CHECK,NO_HALF
 
 // NATIVE_HALF-LABEL: define hidden noundef nofpclass(nan inf) half 
@_Z14test_exp2_half
-// NATIVE_HALF: %elt.exp2 = call reassoc nnan ninf nsz arcp afn half 
@llvm.exp2.f16(
-// NATIVE_HALF: ret half %elt.exp2
+// NATIVE_HALF: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn half 
@llvm.exp2.f16(
+// NATIVE_HALF: ret half [[EXP2]]
 // NO_HALF-LABEL: define hidden noundef nofpclass(nan inf) float 
@_Z14test_exp2_half
-// NO_HALF: %elt.exp2 = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp2.f32(
-// NO_HALF: ret float %elt.exp2
+// NO_HALF: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp2.f32(
+// NO_HALF: ret float [[EXP2]]
 half test_exp2_half(half p0) { return exp2(p0); }
 // NATIVE_HALF-LABEL: define hidden noundef nofpclass(nan inf) <2 x half> 
@_Z15test_exp2_half2
-// NATIVE_HALF: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x half> 
@llvm.exp2.v2f16
-// NATIVE_HALF: ret <2 x half> %elt.exp2
+// NATIVE_HALF: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x half> 
@llvm.exp2.v2f16
+// NATIVE_HALF: ret <2 x half> [[EXP2]]
 // NO_HALF-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
@_Z15test_exp2_half2
-// NO_HALF: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp2.v2f32(
-// NO_HALF: ret <2 x float> %elt.exp2
+// NO_HALF: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp2.v2f32(
+// NO_HALF: ret <2 x float> [[EXP2]]
 half2 test_exp2_half2(half2 p0) { return exp2(p0); }
 // NATIVE_HALF-LABEL: define hidden noundef nofpclass(nan inf) <3 x half> 
@_Z15test_exp2_half3
-// NATIVE_HALF: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x half> 
@llvm.exp2.v3f16
-// NATIVE_HALF: ret <3 x half> %elt.exp2
+// NATIVE_HALF: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x half> 
@llvm.exp2.v3f16
+// NATIVE_HALF: ret <3 x half> [[EXP2]]
 // NO_HALF-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
@_Z15test_exp2_half3
-// NO_HALF: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp2.v3f32(
-// NO_HALF: ret <3 x float> %elt.exp2
+// NO_HALF: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp2.v3f32(
+// NO_HALF: ret <3 x float> [[EXP2]]
 half3 test_exp2_half3(half3 p0) { return exp2(p0); }
 // NATIVE_HALF-LABEL: define hidden noundef nofpclass(nan inf) <4 x half> 
@_Z15test_exp2_half4
-// NATIVE_HALF: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x half> 
@llvm.exp2.v4f16
-// NATIVE_HALF: ret <4 x half> %elt.exp2
+// NATIVE_HALF: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x half> 
@llvm.exp2.v4f16
+// NATIVE_HALF: ret <4 x half> [[EXP2]]
 // NO_HALF-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
@_Z15test_exp2_half4
-// NO_HALF: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp2.v4f32(
-// NO_HALF: ret <4 x float> %elt.exp2
+// NO_HALF: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp2.v4f32(
+// NO_HALF: ret <4 x float> [[EXP2]]
 half4 test_exp2_half4(half4 p0) { return exp2(p0); }
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
@_Z15test_exp2_float
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn float @llvm.exp2.f32(
-// CHECK: ret float %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp2.f32(
+// CHECK: ret float [[EXP2]]
 float test_exp2_float(float p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
@_Z16test_exp2_float2
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp2.v2f32
-// CHECK: ret <2 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp2.v2f32
+// CHECK: ret <2 x float> [[EXP2]]
 float2 test_exp2_float2(float2 p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
@_Z16test_exp2_float3
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp2.v3f32
-// CHECK: ret <3 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp2.v3f32
+// CHECK: ret <3 x float> [[EXP2]]
 float3 test_exp2_float3(float3 p0) { return exp2(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
@_Z16test_exp2_float4
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp2.v4f32
-// CHECK: ret <4 x float> %elt.exp2
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp2.v4f32
+// CHECK: ret <4 x float> [[EXP2]]
 float4 test_exp2_float4(float4 p0) { return exp2(p0); }
diff --git a/clang/test/CodeGenHLSL/builtins/ldexp.hlsl 
b/clang/test/CodeGenHLSL/builtins/ldexp.hlsl
index 012adc588ddfa..2dec126788956 100644
--- a/clang/test/CodeGenHLSL/builtins/ldexp.hlsl
+++ b/clang/test/CodeGenHLSL/builtins/ldexp.hlsl
@@ -1,49 +1,49 @@
 // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple 
dxil-pc-shadermodel6.3-library %s -fnative-half-type -fnative-int16-type 
-emit-llvm -disable-llvm-passes -o - | FileCheck %s
 
 // CHECK-LABEL: define linkonce_odr hidden noundef nofpclass(nan inf) half 
@_ZN4hlsl8__detail10ldexp_implIDhEET_S2_S2_
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn half 
@llvm.exp2.f16(half %{{.*}})
-// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn half %elt.exp2, %{{.*}}
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn half 
@llvm.exp2.f16(half %{{.*}})
+// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn half [[EXP2]], %{{.*}}
 // CHECK: ret half %mul
 half test_ldexp_half(half X, half Exp) { return ldexp(X, Exp); }
 
 // CHECK-LABEL: define linkonce_odr hidden noundef nofpclass(nan inf) <2 x 
half> @_ZN4hlsl8__detail10ldexp_implIDv2_DhEET_S3_S3_
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x half> 
@llvm.exp2.v2f16(<2 x half> %{{.*}})
-// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <2 x half> %elt.exp2, 
%{{.*}}
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x half> 
@llvm.exp2.v2f16(<2 x half> %{{.*}})
+// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <2 x half> [[EXP2]], 
%{{.*}}
 // CHECK: ret <2 x half> %mul
 half2 test_ldexp_half2(half2 X, half2 Exp) { return ldexp(X, Exp); }
 
 // CHECK-LABEL: define linkonce_odr hidden noundef nofpclass(nan inf) <3 x 
half> @_ZN4hlsl8__detail10ldexp_implIDv3_DhEET_S3_S3_
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x half> 
@llvm.exp2.v3f16(<3 x half> %{{.*}})
-// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <3 x half> %elt.exp2, 
%{{.*}}
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x half> 
@llvm.exp2.v3f16(<3 x half> %{{.*}})
+// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <3 x half> [[EXP2]], 
%{{.*}}
 // CHECK: ret <3 x half> %mul
 half3 test_ldexp_half3(half3 X, half3 Exp) { return ldexp(X, Exp); }
 
 // CHECK-LABEL: define linkonce_odr hidden noundef nofpclass(nan inf) <4 x 
half> @_ZN4hlsl8__detail10ldexp_implIDv4_DhEET_S3_S3_
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x half> 
@llvm.exp2.v4f16(<4 x half> %{{.*}})
-// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <4 x half> %elt.exp2, 
%{{.*}}
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x half> 
@llvm.exp2.v4f16(<4 x half> %{{.*}})
+// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <4 x half> [[EXP2]], 
%{{.*}}
 // CHECK: ret <4 x half> %mul
 half4 test_ldexp_half4(half4 X, half4 Exp) { return ldexp(X, Exp); }
 
 // CHECK-LABEL: define linkonce_odr hidden noundef nofpclass(nan inf) float 
@_ZN4hlsl8__detail10ldexp_implIfEET_S2_S2_
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp2.f32(float %{{.*}})
-// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn float %elt.exp2, %{{.*}}
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp2.f32(float %{{.*}})
+// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn float [[EXP2]], %{{.*}}
 // CHECK: ret float %mul
 float test_ldexp_float(float X, float Exp) { return ldexp(X, Exp); }
 
 // CHECK-LABEL: define linkonce_odr hidden noundef nofpclass(nan inf) <2 x 
float> @_ZN4hlsl8__detail10ldexp_implIDv2_fEET_S3_S3_
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp2.v2f32(<2 x float> %{{.*}})
-// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <2 x float> %elt.exp2, 
%{{.*}}
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.exp2.v2f32(<2 x float> %{{.*}})
+// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <2 x float> [[EXP2]], 
%{{.*}}
 // CHECK: ret <2 x float> %mul
 float2 test_ldexp_float2(float2 X, float2 Exp) { return ldexp(X, Exp); }
 
 // CHECK-LABEL: define linkonce_odr hidden noundef nofpclass(nan inf) <3 x 
float> @_ZN4hlsl8__detail10ldexp_implIDv3_fEET_S3_S3_
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp2.v3f32(<3 x float> %{{.*}})
-// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <3 x float> %elt.exp2, 
%{{.*}}
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.exp2.v3f32(<3 x float> %{{.*}})
+// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <3 x float> [[EXP2]], 
%{{.*}}
 // CHECK: ret <3 x float> %mul
 float3 test_ldexp_float3(float3 X, float3 Exp) { return ldexp(X, Exp); }
 
 // CHECK-LABEL: define linkonce_odr hidden noundef nofpclass(nan inf) <4 x 
float> @_ZN4hlsl8__detail10ldexp_implIDv4_fEET_S3_S3_
-// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp2.v4f32(<4 x float> %{{.*}})
-// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <4 x float> %elt.exp2, 
%{{.*}}
+// CHECK: [[EXP2:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.exp2.v4f32(<4 x float> %{{.*}})
+// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <4 x float> [[EXP2]], 
%{{.*}}
 // CHECK: ret <4 x float> %mul
 float4 test_ldexp_float4(float4 X, float4 Exp) { return ldexp(X, Exp); }
diff --git a/clang/test/CodeGenHLSL/builtins/lit.hlsl 
b/clang/test/CodeGenHLSL/builtins/lit.hlsl
index c0b109a75906b..b7979960de9f6 100644
--- a/clang/test/CodeGenHLSL/builtins/lit.hlsl
+++ b/clang/test/CodeGenHLSL/builtins/lit.hlsl
@@ -7,9 +7,9 @@
 // CHECK: %vecinit2.i = insertelement <4 x half> %{{.*}}, half 0xH3C00, i32 3
 // CHECK: %cmp4.i = fcmp reassoc nnan ninf nsz arcp afn olt half %{{.*}}, 
0xH0000
 // CHECK: %hlsl.or.i = or i1 %{{.*}}, %cmp4.i
-// CHECK: %elt.log.i = call reassoc nnan ninf nsz arcp afn half 
@llvm.log.f16(half %{{.*}})
-// CHECK: %mul.i = fmul reassoc nnan ninf nsz arcp afn half %elt.log.i, %{{.*}}
-// CHECK: %elt.exp.i = call reassoc nnan ninf nsz arcp afn half 
@llvm.exp.f16(half %mul.i)
+// CHECK: [[LOG:%.*]] = call reassoc nnan ninf nsz arcp afn half 
@llvm.log.f16(half %{{.*}})
+// CHECK: %mul.i = fmul reassoc nnan ninf nsz arcp afn half [[LOG]], %{{.*}}
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn half 
@llvm.exp.f16(half %mul.i)
 // CHECK: %hlsl.select7.i = select reassoc nnan ninf nsz arcp afn i1 %{{.*}}, 
half 0xH0000, half %{{.*}}
 // CHECK: %vecins.i = insertelement <4 x half> %{{.*}}, half %hlsl.select7.i, 
i32 2
 // CHECK: ret <4 x half> %{{.*}}
@@ -22,9 +22,9 @@ half4 test_lit_half(half NDotL, half NDotH, half M) { return 
lit(NDotL, NDotH, M
 // CHECK: %vecinit2.i = insertelement <4 x float> %{{.*}}, float 1.000000e+00, 
i32 3
 // CHECK: %cmp4.i = fcmp reassoc nnan ninf nsz arcp afn olt float %{{.*}}, 
0.000000e+00
 // CHECK: %hlsl.or.i = or i1 %{{.*}}, %cmp4.i
-// CHECK: %elt.log.i = call reassoc nnan ninf nsz arcp afn float 
@llvm.log.f32(float %{{.*}})
-// CHECK: %mul.i = fmul reassoc nnan ninf nsz arcp afn float %elt.log.i, 
%{{.*}}
-// CHECK: %elt.exp.i = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp.f32(float %mul.i)
+// CHECK: [[LOG:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.log.f32(float %{{.*}})
+// CHECK: %mul.i = fmul reassoc nnan ninf nsz arcp afn float [[LOG]], %{{.*}}
+// CHECK: [[EXP:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.exp.f32(float %mul.i)
 // CHECK: %hlsl.select7.i = select reassoc nnan ninf nsz arcp afn i1 %{{.*}}, 
float 0.000000e+00, float %{{.*}}
 // CHECK: %vecins.i = insertelement <4 x float> %{{.*}}, float 
%hlsl.select7.i, i32 2
 // CHECK: ret <4 x float> %{{.*}}
diff --git a/clang/test/CodeGenHLSL/builtins/round-overloads.hlsl 
b/clang/test/CodeGenHLSL/builtins/round-overloads.hlsl
index 3b07fcec064d8..5719d9d92991e 100644
--- a/clang/test/CodeGenHLSL/builtins/round-overloads.hlsl
+++ b/clang/test/CodeGenHLSL/builtins/round-overloads.hlsl
@@ -3,86 +3,86 @@
 // RUN:  FileCheck %s --check-prefixes=CHECK
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
{{.*}}test_round_double
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn float 
@llvm.roundeven.f32(
-// CHECK: ret float %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.roundeven.f32(
+// CHECK: ret float [[ROUNDEVEN]]
 float test_round_double(double p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
{{.*}}test_round_double2
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.roundeven.v2f32
-// CHECK: ret <2 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.roundeven.v2f32
+// CHECK: ret <2 x float> [[ROUNDEVEN]]
 float2 test_round_double2(double2 p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
{{.*}}test_round_double3
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.roundeven.v3f32
-// CHECK: ret <3 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.roundeven.v3f32
+// CHECK: ret <3 x float> [[ROUNDEVEN]]
 float3 test_round_double3(double3 p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
{{.*}}test_round_double4
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.roundeven.v4f32
-// CHECK: ret <4 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.roundeven.v4f32
+// CHECK: ret <4 x float> [[ROUNDEVEN]]
 float4 test_round_double4(double4 p0) { return round(p0); }
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
{{.*}}test_round_int
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn float 
@llvm.roundeven.f32(
-// CHECK: ret float %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.roundeven.f32(
+// CHECK: ret float [[ROUNDEVEN]]
 float test_round_int(int p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
{{.*}}test_round_int2
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.roundeven.v2f32
-// CHECK: ret <2 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.roundeven.v2f32
+// CHECK: ret <2 x float> [[ROUNDEVEN]]
 float2 test_round_int2(int2 p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
{{.*}}test_round_int3
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.roundeven.v3f32
-// CHECK: ret <3 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.roundeven.v3f32
+// CHECK: ret <3 x float> [[ROUNDEVEN]]
 float3 test_round_int3(int3 p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
{{.*}}test_round_int4
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.roundeven.v4f32
-// CHECK: ret <4 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.roundeven.v4f32
+// CHECK: ret <4 x float> [[ROUNDEVEN]]
 float4 test_round_int4(int4 p0) { return round(p0); }
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
{{.*}}test_round_uint
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn float 
@llvm.roundeven.f32(
-// CHECK: ret float %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.roundeven.f32(
+// CHECK: ret float [[ROUNDEVEN]]
 float test_round_uint(uint p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
{{.*}}test_round_uint2
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.roundeven.v2f32
-// CHECK: ret <2 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.roundeven.v2f32
+// CHECK: ret <2 x float> [[ROUNDEVEN]]
 float2 test_round_uint2(uint2 p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
{{.*}}test_round_uint3
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.roundeven.v3f32
-// CHECK: ret <3 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.roundeven.v3f32
+// CHECK: ret <3 x float> [[ROUNDEVEN]]
 float3 test_round_uint3(uint3 p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
{{.*}}test_round_uint4
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.roundeven.v4f32
-// CHECK: ret <4 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.roundeven.v4f32
+// CHECK: ret <4 x float> [[ROUNDEVEN]]
 float4 test_round_uint4(uint4 p0) { return round(p0); }
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
{{.*}}test_round_int64_t
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn float 
@llvm.roundeven.f32(
-// CHECK: ret float %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.roundeven.f32(
+// CHECK: ret float [[ROUNDEVEN]]
 float test_round_int64_t(int64_t p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
{{.*}}test_round_int64_t2
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.roundeven.v2f32
-// CHECK: ret <2 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.roundeven.v2f32
+// CHECK: ret <2 x float> [[ROUNDEVEN]]
 float2 test_round_int64_t2(int64_t2 p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
{{.*}}test_round_int64_t3
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.roundeven.v3f32
-// CHECK: ret <3 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.roundeven.v3f32
+// CHECK: ret <3 x float> [[ROUNDEVEN]]
 float3 test_round_int64_t3(int64_t3 p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
{{.*}}test_round_int64_t4
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.roundeven.v4f32
-// CHECK: ret <4 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.roundeven.v4f32
+// CHECK: ret <4 x float> [[ROUNDEVEN]]
 float4 test_round_int64_t4(int64_t4 p0) { return round(p0); }
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
{{.*}}test_round_uint64_t
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn float 
@llvm.roundeven.f32(
-// CHECK: ret float %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.roundeven.f32(
+// CHECK: ret float [[ROUNDEVEN]]
 float test_round_uint64_t(uint64_t p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
{{.*}}test_round_uint64_t2
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.roundeven.v2f32
-// CHECK: ret <2 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.roundeven.v2f32
+// CHECK: ret <2 x float> [[ROUNDEVEN]]
 float2 test_round_uint64_t2(uint64_t2 p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
{{.*}}test_round_uint64_t3
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.roundeven.v3f32
-// CHECK: ret <3 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.roundeven.v3f32
+// CHECK: ret <3 x float> [[ROUNDEVEN]]
 float3 test_round_uint64_t3(uint64_t3 p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
{{.*}}test_round_uint64_t4
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.roundeven.v4f32
-// CHECK: ret <4 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.roundeven.v4f32
+// CHECK: ret <4 x float> [[ROUNDEVEN]]
 float4 test_round_uint64_t4(uint64_t4 p0) { return round(p0); }
diff --git a/clang/test/CodeGenHLSL/builtins/round.hlsl 
b/clang/test/CodeGenHLSL/builtins/round.hlsl
index 0d4afee6ba9a8..8161b0c1c3256 100644
--- a/clang/test/CodeGenHLSL/builtins/round.hlsl
+++ b/clang/test/CodeGenHLSL/builtins/round.hlsl
@@ -6,47 +6,47 @@
 // RUN:  FileCheck %s --check-prefixes=CHECK,NO_HALF
 
 // NATIVE_HALF-LABEL: define hidden noundef nofpclass(nan inf) half 
@_Z15test_round_half
-// NATIVE_HALF: %elt.roundeven = call reassoc nnan ninf nsz arcp afn half 
@llvm.roundeven.f16(
-// NATIVE_HALF: ret half %elt.roundeven
+// NATIVE_HALF: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn half 
@llvm.roundeven.f16(
+// NATIVE_HALF: ret half [[ROUNDEVEN]]
 // NO_HALF-LABEL: define hidden noundef nofpclass(nan inf) float 
@_Z15test_round_half
-// NO_HALF: %elt.roundeven = call reassoc nnan ninf nsz arcp afn float 
@llvm.roundeven.f32(
-// NO_HALF: ret float %elt.roundeven
+// NO_HALF: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.roundeven.f32(
+// NO_HALF: ret float [[ROUNDEVEN]]
 half test_round_half(half p0) { return round(p0); }
 // NATIVE_HALF-LABEL: define hidden noundef nofpclass(nan inf) <2 x half> 
@_Z16test_round_half2
-// NATIVE_HALF: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <2 x 
half> @llvm.roundeven.v2f16
-// NATIVE_HALF: ret <2 x half> %elt.roundeven
+// NATIVE_HALF: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x 
half> @llvm.roundeven.v2f16
+// NATIVE_HALF: ret <2 x half> [[ROUNDEVEN:%.*]]
 // NO_HALF-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
@_Z16test_round_half2
-// NO_HALF: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.roundeven.v2f32(
-// NO_HALF: ret <2 x float> %elt.roundeven
+// NO_HALF: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x 
float> @llvm.roundeven.v2f32(
+// NO_HALF: ret <2 x float> [[ROUNDEVEN]]
 half2 test_round_half2(half2 p0) { return round(p0); }
 // NATIVE_HALF-LABEL: define hidden noundef nofpclass(nan inf) <3 x half> 
@_Z16test_round_half3
-// NATIVE_HALF: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <3 x 
half> @llvm.roundeven.v3f16
-// NATIVE_HALF: ret <3 x half> %elt.roundeven
+// NATIVE_HALF: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x 
half> @llvm.roundeven.v3f16
+// NATIVE_HALF: ret <3 x half> [[ROUNDEVEN:%.*]]
 // NO_HALF-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
@_Z16test_round_half3
-// NO_HALF: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.roundeven.v3f32(
-// NO_HALF: ret <3 x float> %elt.roundeven
+// NO_HALF: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x 
float> @llvm.roundeven.v3f32(
+// NO_HALF: ret <3 x float> [[ROUNDEVEN]]
 half3 test_round_half3(half3 p0) { return round(p0); }
 // NATIVE_HALF-LABEL: define hidden noundef nofpclass(nan inf) <4 x half> 
@_Z16test_round_half4
-// NATIVE_HALF: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <4 x 
half> @llvm.roundeven.v4f16
-// NATIVE_HALF: ret <4 x half> %elt.roundeven
+// NATIVE_HALF: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x 
half> @llvm.roundeven.v4f16
+// NATIVE_HALF: ret <4 x half> [[ROUNDEVEN:%.*]]
 // NO_HALF-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
@_Z16test_round_half4
-// NO_HALF: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.roundeven.v4f32(
-// NO_HALF: ret <4 x float> %elt.roundeven
+// NO_HALF: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x 
float> @llvm.roundeven.v4f32(
+// NO_HALF: ret <4 x float> [[ROUNDEVEN]]
 half4 test_round_half4(half4 p0) { return round(p0); }
 
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float 
@_Z16test_round_float
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn float 
@llvm.roundeven.f32(
-// CHECK: ret float %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn float 
@llvm.roundeven.f32(
+// CHECK: ret float [[ROUNDEVEN]]
 float test_round_float(float p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> 
@_Z17test_round_float2
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.roundeven.v2f32
-// CHECK: ret <2 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> 
@llvm.roundeven.v2f32
+// CHECK: ret <2 x float> [[ROUNDEVEN]]
 float2 test_round_float2(float2 p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> 
@_Z17test_round_float3
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.roundeven.v3f32
-// CHECK: ret <3 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> 
@llvm.roundeven.v3f32
+// CHECK: ret <3 x float> [[ROUNDEVEN]]
 float3 test_round_float3(float3 p0) { return round(p0); }
 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> 
@_Z17test_round_float4
-// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.roundeven.v4f32
-// CHECK: ret <4 x float> %elt.roundeven
+// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> 
@llvm.roundeven.v4f32
+// CHECK: ret <4 x float> [[ROUNDEVEN]]
 float4 test_round_float4(float4 p0) { return round(p0); }

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to