[clang] [llvm] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 14 01:50:08 PST 2023


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 3e8b175eec6fef1a073fb7d0d867fbc6a7837f57 4649d44cece1db0d38e00425491137c44c3aab8e -- clang/lib/CodeGen/CGExprScalar.cpp llvm/include/llvm/Analysis/TargetTransformInfoImpl.h llvm/include/llvm/IR/GetElementPtrTypeIterator.h llvm/lib/Analysis/BasicAliasAnalysis.cpp llvm/lib/Analysis/InlineCost.cpp llvm/lib/Analysis/Local.cpp llvm/lib/Analysis/LoopAccessAnalysis.cpp llvm/lib/Analysis/ValueTracking.cpp llvm/lib/CodeGen/CodeGenPrepare.cpp llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp llvm/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/lib/ExecutionEngine/Interpreter/Execution.cpp llvm/lib/IR/DataLayout.cpp llvm/lib/IR/Operator.cpp llvm/lib/IR/Value.cpp llvm/lib/Target/AArch64/AArch64FastISel.cpp llvm/lib/Target/ARM/ARMFastISel.cpp llvm/lib/Target/Mips/MipsFastISel.cpp llvm/lib/Target/PowerPC/PPCFastISel.cpp llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp llvm/lib/Target/X86/X86FastISel.cpp llvm/lib/Transforms/Scalar/SROA.cpp llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index 12da11d203..989146fd47 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -5292,8 +5292,8 @@ static GEPOffsetAndOverflow EmitGEPOffsetInBytes(Value *BasePtr, Value *GEPVal,
     } else {
       // Otherwise this is array-like indexing. The local offset is the index
       // multiplied by the element size.
-      auto *ElementSize = llvm::ConstantInt::get(
-          IntPtrTy, GTI.getSequentialElementStride(DL));
+      auto *ElementSize =
+          llvm::ConstantInt::get(IntPtrTy, GTI.getSequentialElementStride(DL));
       auto *IndexS = Builder.CreateIntCast(Index, IntPtrTy, /*isSigned=*/true);
       LocalOffset = eval(BO_Mul, ElementSize, IndexS);
     }

``````````

</details>


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


More information about the cfe-commits mailing list