[clang] Add unsigned integer overloads for abs (PR #128257)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 21 19:30:11 PST 2025


================
@@ -94,3 +122,60 @@ double3 test_abs_double3(double3 p0) { return abs(p0); }
 // CHECK-LABEL: define noundef nofpclass(nan inf) <4 x double> @_Z16test_abs_double4
 // CHECK: call reassoc nnan ninf nsz arcp afn <4 x double> @llvm.fabs.v4f64(
 double4 test_abs_double4(double4 p0) { return abs(p0); }
+
+
+// CHECK-LABEL: define {{.*}}hlsl3abs{{.*}}(i32
+// CHECK: [[Alloca:%.*]] = alloca i32
----------------
farzonl wrote:

should we maybe drop the `-disable-llvm-passes` so that we can see the constexpr optomize away the alloca, load and store?

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


More information about the cfe-commits mailing list