[clang] [clang] constexpr `__builtin_elementwise_abs` support (PR #152497)

Iris Shi via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 14 01:17:41 PDT 2025


================
@@ -11634,11 +11634,40 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) {
             APValue(APSInt(Elt.reverseBits(),
                            DestEltTy->isUnsignedIntegerOrEnumerationType())));
         break;
+      case Builtin::BI__builtin_elementwise_abs: {
+        APInt Val = Source.getVectorElt(EltNum).getInt().abs();
+        ResultElements.push_back(APValue(
+            APSInt(Val, DestEltTy->isUnsignedIntegerOrEnumerationType())));
+        break;
+      }
----------------
el-ev wrote:

It seems unlikely that a `__builtin_elementwise_abs` would appear here.

```suggestion
```

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


More information about the cfe-commits mailing list