github-actions[bot] wrote: <!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning: <details> <summary> You can test this locally with the following command: </summary> ``````````bash git-clang-format --diff 1335a11176f99cc54f423fe173708bd2373b59f7 fbc6393e1508155295e95f480af146d1efb6ef98 --extensions h,cpp -- clang/lib/CodeGen/CGBuiltin.cpp clang/lib/CodeGen/CGCall.cpp clang/lib/CodeGen/CGExpr.cpp clang/lib/CodeGen/CodeGenFunction.h clang/lib/Headers/hlsl/hlsl_intrinsics.h clang/lib/Sema/SemaHLSL.cpp llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp `````````` </details> <details> <summary> View the diff from clang-format here. </summary> ``````````diff diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index 3ee06bab54..9b7cf1568b 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -18839,58 +18839,62 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: { const HLSLOutArgExpr *OutArg1 = dyn_cast<HLSLOutArgExpr>(E->getArg(1)); const HLSLOutArgExpr *OutArg2 = dyn_cast<HLSLOutArgExpr>(E->getArg(2)); - auto emitSplitDouble = [](CGBuilderTy *Builder, llvm::Value* arg, llvm::Type *retType) -> std::pair<Value *, Value *> { - CallInst *CI = - Builder->CreateIntrinsic(retType, llvm::Intrinsic::dx_asuint_splitdouble, - {arg}, nullptr, "hlsl.asuint"); + auto emitSplitDouble = + [](CGBuilderTy *Builder, llvm::Value *arg, + llvm::Type *retType) -> std::pair<Value *, Value *> { + CallInst *CI = Builder->CreateIntrinsic( + retType, llvm::Intrinsic::dx_asuint_splitdouble, {arg}, nullptr, + "hlsl.asuint"); Value *arg0 = Builder->CreateExtractValue(CI, 0); - Value *arg1 = Builder->CreateExtractValue(CI, 1); + Value *arg1 = Builder->CreateExtractValue(CI, 1); return std::make_pair(arg0, arg1); - }; + }; CallArgList Args; - auto [Op1BaseLValue, Op1TmpLValue] = EmitHLSLOutArgExpr(OutArg1, Args, OutArg1->getType()); - auto [Op2BaseLValue, Op2TmpLValue] = EmitHLSLOutArgExpr(OutArg2, Args, OutArg2->getType()); + auto [Op1BaseLValue, Op1TmpLValue] = + EmitHLSLOutArgExpr(OutArg1, Args, OutArg1->getType()); + auto [Op2BaseLValue, Op2TmpLValue] = + EmitHLSLOutArgExpr(OutArg2, Args, OutArg2->getType()); llvm::Type *retType = llvm::StructType::get(Int32Ty, Int32Ty); if (!Op0->getType()->isVectorTy()) { - auto [arg0, arg1] = emitSplitDouble(&Builder, Op0, retType); + auto [arg0, arg1] = emitSplitDouble(&Builder, Op0, retType); - Builder.CreateStore(arg0, Op1TmpLValue.getAddress()); - auto *s = Builder.CreateStore(arg1, Op2TmpLValue.getAddress()); + Builder.CreateStore(arg0, Op1TmpLValue.getAddress()); + auto *s = Builder.CreateStore(arg1, Op2TmpLValue.getAddress()); - EmitWritebacks(*this, Args); - return s; + EmitWritebacks(*this, Args); + return s; } - auto *Op0VecTy = E->getArg(0)->getType()->getAs<VectorType>(); + auto *Op0VecTy = E->getArg(0)->getType()->getAs<VectorType>(); - llvm::VectorType *i32VecTy = llvm::VectorType::get( - Int32Ty, ElementCount::getFixed(Op0VecTy->getNumElements())); + llvm::VectorType *i32VecTy = llvm::VectorType::get( + Int32Ty, ElementCount::getFixed(Op0VecTy->getNumElements())); - std::pair<Value*, Value*> inserts = std::make_pair(nullptr, nullptr); + std::pair<Value *, Value *> inserts = std::make_pair(nullptr, nullptr); - for(uint64_t idx = 0; idx < Op0VecTy->getNumElements(); idx++){ - Value* op = Builder.CreateExtractElement(Op0, idx); - - auto [arg0, arg1] = emitSplitDouble(&Builder, op, retType); + for (uint64_t idx = 0; idx < Op0VecTy->getNumElements(); idx++) { + Value *op = Builder.CreateExtractElement(Op0, idx); - if(idx == 0) { - inserts.first = Builder.CreateInsertElement(i32VecTy, arg0, idx); - inserts.second = Builder.CreateInsertElement(i32VecTy, arg1, idx); - } else { - inserts.first = Builder.CreateInsertElement(inserts.first, arg0, idx); - inserts.second = Builder.CreateInsertElement(inserts.second, arg0, idx); - } + auto [arg0, arg1] = emitSplitDouble(&Builder, op, retType); + + if (idx == 0) { + inserts.first = Builder.CreateInsertElement(i32VecTy, arg0, idx); + inserts.second = Builder.CreateInsertElement(i32VecTy, arg1, idx); + } else { + inserts.first = Builder.CreateInsertElement(inserts.first, arg0, idx); + inserts.second = Builder.CreateInsertElement(inserts.second, arg0, idx); } + } - Builder.CreateStore(inserts.first, Op1TmpLValue.getAddress()); - auto *s = Builder.CreateStore(inserts.second, Op2TmpLValue.getAddress()); - EmitWritebacks(*this, Args); - return s; + Builder.CreateStore(inserts.first, Op1TmpLValue.getAddress()); + auto *s = Builder.CreateStore(inserts.second, Op2TmpLValue.getAddress()); + EmitWritebacks(*this, Args); + return s; } } return nullptr; diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 87cab538a7..5d4c7193fa 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -5479,8 +5479,9 @@ CodeGenFunction::EmitHLSLOutArgLValues(const HLSLOutArgExpr *E, QualType Ty) { return std::make_pair(BaseLV, TempLV); } -std::pair<LValue, LValue> CodeGenFunction::EmitHLSLOutArgExpr(const HLSLOutArgExpr *E, - CallArgList &Args, QualType Ty) { +std::pair<LValue, LValue> +CodeGenFunction::EmitHLSLOutArgExpr(const HLSLOutArgExpr *E, CallArgList &Args, + QualType Ty) { auto [BaseLV, TempLV] = EmitHLSLOutArgLValues(E, Ty); diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index df68e6b552..7dbb80415d 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -4299,8 +4299,8 @@ public: std::pair<LValue, LValue> EmitHLSLOutArgLValues(const HLSLOutArgExpr *E, QualType Ty); - std::pair<LValue, LValue> EmitHLSLOutArgExpr(const HLSLOutArgExpr *E, CallArgList &Args, - QualType Ty); + std::pair<LValue, LValue> EmitHLSLOutArgExpr(const HLSLOutArgExpr *E, + CallArgList &Args, QualType Ty); Address EmitExtVectorElementLValue(LValue V); `````````` </details> https://github.com/llvm/llvm-project/pull/109331 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits