[llvm] [AMDGPU][PromoteAlloca] Correctly handle a variable vector index (PR #83597)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 1 09:25:44 PST 2024
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 92fe6c61f900d6479f7ab708784c9e62d7523768 bc3871f70d552718ee7157f79c3fdb01842e7803 -- llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
index ebd48f4082..c87c34731f 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
@@ -457,7 +457,8 @@ static Value *promoteAllocaUserToVector(
// We're storing the full vector, we can handle this without knowing CurVal.
Type *AccessTy = Val->getType();
TypeSize AccessSize = DL.getTypeStoreSize(AccessTy);
- if (AccessSize == VecStoreSize && isa<Constant>(Index) && cast<Constant>(Index)->isZeroValue()) {
+ if (AccessSize == VecStoreSize && isa<Constant>(Index) &&
+ cast<Constant>(Index)->isZeroValue()) {
if (AccessTy->isPtrOrPtrVectorTy())
Val = CreateTempPtrIntCast(Val, AccessTy);
else if (VectorTy->isPtrOrPtrVectorTy())
``````````
</details>
https://github.com/llvm/llvm-project/pull/83597
More information about the llvm-commits
mailing list