[clang] [llvm] [HLSL] [DXIL] Implement the `AddUint64` HLSL function and the `UAddc` DXIL op (PR #125319)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 7 12:59:48 PST 2025


================
@@ -19105,6 +19105,51 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
     return nullptr;
 
   switch (BuiltinID) {
+  case Builtin::BI__builtin_hlsl_adduint64: {
----------------
farzonl wrote:

So the downside of what I suggested is that it would be a hybrid solution. You are writing the algorithm in  HLSL, but you are also massaging the codegen to do out args  instead of pointers, and write sema checks because we have to introduce a new builtin.

My thinking was  there would be less total codgen if we did it the way I suggested and some of the sema checks would  benefit from language rules  instead of us having to  put a bunch of effort into `HLSLSema.cpp`.   I don't have a strong opinion.  So I won't make a requirement here. 

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


More information about the cfe-commits mailing list