================
@@ -685,7 +685,28 @@ static mlir::Value emitCommonNeonBuiltinExpr(
     mlir::Value result = cgf.getBuilder().createXor(loc, ops[0], ops[1]);
     return cgf.getBuilder().createBitcast(result, ty);
   }
-  case NEON::BI__builtin_neon_vaddhn_v:
+  case NEON::BI__builtin_neon_vaddhn_v: {
+    cir::VectorType srcTy =
+        cgf.getBuilder().getExtendedOrTruncatedElementVectorType(
+            vTy, /*isExtended=*/true, /*isSigned=*/false);
+
+    // %sum = add <4 x i32> %lhs, %rhs
+    ops[0] = cgf.getBuilder().createBitcast(ops[0], srcTy);
+    ops[1] = cgf.getBuilder().createBitcast(ops[1], srcTy);
----------------
iamvickynguyen wrote:

You're right that the bitcast part in `ARM.cpp` is dead

https://github.com/llvm/llvm-project/blob/a7263bea29efd710a1207afe5641fad54692284d/clang/lib/CodeGen/TargetBuiltins/ARM.cpp#L1193-L1199

`getExtendedElementVectorType` only extends the size, so `CreateBitCast` with 
the same type in and type out is a no-op.

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

Reply via email to