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 origin/main HEAD --extensions cpp --
clang/lib/CodeGen/CGExpr.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 126cd7634..7fab46a4c 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -2637,7 +2637,7 @@ RValue CodeGenFunction::EmitLoadOfGlobalRegLValue(LValue
LV) {
return RValue::get(Call);
}
-/// Extends a scalar or vector value if needed for HLSL element stores.
+/// Extends a scalar or vector value if needed for HLSL element stores.
static llvm::Value *emitExtendForHLSLStore(CGBuilderTy &Builder,
llvm::Value *Val,
llvm::Type *ElemTy) {
@@ -2652,15 +2652,13 @@ static llvm::Value *emitExtendForHLSLStore(CGBuilderTy
&Builder,
}
/// Emit an HLSL element-wise store using GEP.
-static void emitHLSLElementStore(CGBuilderTy &Builder,
- llvm::Value *Val,
- Address DstAddr,
- llvm::Value *Idx,
- llvm::Type *DestAddrTy,
- CharUnits ElemAlign,
+static void emitHLSLElementStore(CGBuilderTy &Builder, llvm::Value *Val,
+ Address DstAddr, llvm::Value *Idx,
+ llvm::Type *DestAddrTy, CharUnits ElemAlign,
bool IsVolatile) {
llvm::Value *Zero = Builder.getInt32(0);
- Address DstElemAddr = Builder.CreateGEP(DstAddr, {Zero, Idx}, DestAddrTy,
ElemAlign);
+ Address DstElemAddr =
+ Builder.CreateGEP(DstAddr, {Zero, Idx}, DestAddrTy, ElemAlign);
Builder.CreateStore(Val, DstElemAddr, IsVolatile);
}
@@ -2684,9 +2682,10 @@ void CodeGenFunction::EmitStoreThroughLValue(RValue Src,
LValue Dst,
assert(ElemTy->getScalarSizeInBits() >= 8 &&
"vector element type must be at least byte-sized");
- llvm::Value *Val = emitExtendForHLSLStore(Builder, Src.getScalarVal(),
ElemTy);
+ llvm::Value *Val =
+ emitExtendForHLSLStore(Builder, Src.getScalarVal(), ElemTy);
- emitHLSLElementStore(Builder, Val, DstAddr, Dst.getVectorIdx(),
+ emitHLSLElementStore(Builder, Val, DstAddr, Dst.getVectorIdx(),
DestAddrTy, ElemAlign, Dst.isVolatileQualified());
return;
}
@@ -2751,9 +2750,10 @@ void CodeGenFunction::EmitStoreThroughLValue(RValue Src,
LValue Dst,
assert(ElemTy->getScalarSizeInBits() >= 8 &&
"matrix element type must be at least byte-sized");
- llvm::Value *Val = emitExtendForHLSLStore(Builder, Src.getScalarVal(),
ElemTy);
+ llvm::Value *Val =
+ emitExtendForHLSLStore(Builder, Src.getScalarVal(), ElemTy);
- emitHLSLElementStore(Builder, Val, DstAddr, Dst.getMatrixIdx(),
+ emitHLSLElementStore(Builder, Val, DstAddr, Dst.getMatrixIdx(),
DestAddrTy, ElemAlign, Dst.isVolatileQualified());
return;
}
@@ -2795,7 +2795,8 @@ void CodeGenFunction::EmitStoreThroughLValue(RValue Src,
LValue Dst,
assert(ElemTy->getScalarSizeInBits() >= 8 &&
"matrix element type must be at least byte-sized");
- llvm::Value *RowVal = emitExtendForHLSLStore(Builder,
Src.getScalarVal(), ElemTy);
+ llvm::Value *RowVal =
+ emitExtendForHLSLStore(Builder, Src.getScalarVal(), ElemTy);
llvm::MatrixBuilder MB(Builder);
@@ -2820,8 +2821,8 @@ void CodeGenFunction::EmitStoreThroughLValue(RValue Src,
LValue Dst,
MB.CreateIndex(Row, ColIdx, NumRows, NumCols, IsMatrixRowMajor);
llvm::Value *Lane = llvm::ConstantInt::get(Builder.getInt32Ty(), Col);
llvm::Value *NewElt = Builder.CreateExtractElement(RowVal, Lane);
- emitHLSLElementStore(Builder, NewElt, DstAddr, EltIndex,
- DestAddrTy, ElemAlign, Dst.isVolatileQualified());
+ emitHLSLElementStore(Builder, NewElt, DstAddr, EltIndex, DestAddrTy,
+ ElemAlign, Dst.isVolatileQualified());
}
return;
``````````
</details>
https://github.com/llvm/llvm-project/pull/177884
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits