[clang] [CIR] Upstream support for promoted types with unary plus/minus (PR #133829)
Bruno Cardoso Lopes via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 3 10:41:57 PDT 2025
================
@@ -405,3 +405,45 @@ float fpPostInc2() {
// OGCG: store float %[[A_INC]], ptr %[[A]], align 4
// OGCG: store float %[[A_LOAD]], ptr %[[B]], align 4
// OGCG: %[[B_TO_OUTPUT:.*]] = load float, ptr %[[B]], align 4
+
+_Float16 fp16UPlus(_Float16 f) {
+ return +f;
+}
+
+// CHECK: cir.func @fp16UPlus({{.*}}) -> !cir.f16
+// CHECK: %[[INPUT:.*]] = cir.load %[[F:.*]]
+// CHECK: %[[PROMOTED:.*]] = cir.cast(floating, %[[INPUT]] : !cir.f16), !cir.float
----------------
bcardosolopes wrote:
> When you say, "land the direct version first," do you mean proceed with this PR as is? That seems reasonable to me. I just wanted to make sure we're all in agreement.
Yes!
https://github.com/llvm/llvm-project/pull/133829
More information about the cfe-commits
mailing list