[llvm] [LLVM] Fix typo "CxtI" (PR #226137)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 24 05:07:39 PDT 2026
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,h -- llvm/include/llvm/Analysis/ConstantFolding.h llvm/include/llvm/Analysis/InstructionSimplify.h llvm/include/llvm/Analysis/LazyValueInfo.h llvm/include/llvm/Analysis/Loads.h llvm/include/llvm/Analysis/SimplifyQuery.h llvm/include/llvm/Analysis/TargetFolder.h llvm/include/llvm/Analysis/TargetTransformInfo.h llvm/include/llvm/Analysis/TargetTransformInfoImpl.h llvm/include/llvm/Analysis/ValueTracking.h llvm/include/llvm/CodeGen/BasicTTIImpl.h llvm/include/llvm/Transforms/InstCombine/InstCombiner.h llvm/include/llvm/Transforms/Scalar/JumpThreading.h llvm/include/llvm/Transforms/Utils/Local.h llvm/lib/Analysis/BasicAliasAnalysis.cpp llvm/lib/Analysis/ConstantFolding.cpp llvm/lib/Analysis/InstructionSimplify.cpp llvm/lib/Analysis/LazyValueInfo.cpp llvm/lib/Analysis/Loads.cpp llvm/lib/Analysis/ScalarEvolution.cpp llvm/lib/Analysis/TargetTransformInfo.cpp llvm/lib/Analysis/ValueTracking.cpp llvm/lib/MC/MCPseudoProbe.cpp llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp llvm/lib/Target/ARM/ARMTargetTransformInfo.h llvm/lib/Target/BPF/BPFTargetTransformInfo.h llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h llvm/lib/Target/Lanai/LanaiTargetTransformInfo.h llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.h llvm/lib/Target/X86/X86TargetTransformInfo.cpp llvm/lib/Target/X86/X86TargetTransformInfo.h llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp llvm/lib/Transforms/InstCombine/InstCombineInternal.h llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp llvm/lib/Transforms/Scalar/JumpThreading.cpp llvm/lib/Transforms/Scalar/MergeICmps.cpp llvm/lib/Transforms/Utils/Local.cpp llvm/lib/Transforms/Utils/SimplifyCFG.cpp llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPCostAnalysis.cpp llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPCostAnalysis.h llvm/lib/Transforms/Vectorize/VectorCombine.cpp llvm/unittests/Analysis/ValueTrackingTest.cpp llvm/unittests/FileCheck/FileCheckTest.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/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
index 56e549091..c0249d0c5 100644
--- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h
+++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
@@ -1102,9 +1102,8 @@ public:
// TODO: Handle more cost kinds.
if (CostKind != TTI::TCK_RecipThroughput)
- return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind,
- Opd1Info, Opd2Info,
- Args, CtxI);
+ return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Opd1Info,
+ Opd2Info, Args, CtxI);
std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(Ty);
@@ -1154,8 +1153,8 @@ public:
// similarly to what getCastInstrCost() does.
if (auto *VTy = dyn_cast<FixedVectorType>(Ty)) {
InstructionCost Cost = thisT()->getArithmeticInstrCost(
- Opcode, VTy->getScalarType(), CostKind, Opd1Info, Opd2Info,
- Args, CtxI);
+ Opcode, VTy->getScalarType(), CostKind, Opd1Info, Opd2Info, Args,
+ CtxI);
// Return the cost of multiple scalar invocation plus the cost of
// inserting and extracting the values.
SmallVector<Type *> Tys(Args.size(), Ty);
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index b15cee2fd..e0afa5507 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -1843,9 +1843,10 @@ ValueLatticeElement LazyValueInfoImpl::getValueAt(Value *V, Instruction *CtxI) {
return Result;
}
-ValueLatticeElement LazyValueInfoImpl::
-getValueOnEdge(Value *V, BasicBlock *FromBB, BasicBlock *ToBB,
- Instruction *CtxI) {
+ValueLatticeElement LazyValueInfoImpl::getValueOnEdge(Value *V,
+ BasicBlock *FromBB,
+ BasicBlock *ToBB,
+ Instruction *CtxI) {
LLVM_DEBUG(dbgs() << "LVI Getting edge value " << *V << " from '"
<< FromBB->getName() << "' to '" << ToBB->getName()
<< "'\n");
diff --git a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp
index 3d24eb4a2..fe4c9cb76 100644
--- a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp
@@ -272,8 +272,8 @@ InstructionCost HexagonTTIImpl::getArithmeticInstrCost(
ArrayRef<const Value *> Args, const Instruction *CtxI) const {
// TODO: Handle more cost kinds.
if (CostKind != TTI::TCK_RecipThroughput)
- return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Op1Info,
- Op2Info, Args, CtxI);
+ return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Op1Info, Op2Info,
+ Args, CtxI);
if (Ty->isVectorTy()) {
if (!isHVXVectorType(Ty) && Ty->isFPOrFPVectorTy())
diff --git a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
index 0383f9ed6..d5c3bf828 100644
--- a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
+++ b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
@@ -608,8 +608,8 @@ InstructionCost PPCTTIImpl::getArithmeticInstrCost(
// TODO: Handle more cost kinds.
if (CostKind != TTI::TCK_RecipThroughput)
- return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Op1Info,
- Op2Info, Args, CtxI);
+ return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Op1Info, Op2Info,
+ Args, CtxI);
// Fallback to the default implementation.
InstructionCost Cost = BaseT::getArithmeticInstrCost(
diff --git a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
index 06f84c78a..a4e0c38c5 100644
--- a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
@@ -615,8 +615,8 @@ InstructionCost SystemZTTIImpl::getArithmeticInstrCost(
// TODO: Handle more cost kinds.
if (CostKind != TTI::TCK_RecipThroughput)
- return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Op1Info,
- Op2Info, Args, CtxI);
+ return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Op1Info, Op2Info,
+ Args, CtxI);
if (CtxI && Ty && !Ty->isVectorTy() && isFoldableRMW(CtxI, Ty))
return TTI::TCC_Free;
// TODO: return a good value for BB-VECTORIZER that includes the
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
index 6e6c8c83e..d4c7b0975 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
+++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
@@ -364,9 +364,12 @@ private:
const Value *RHS, const Instruction &CtxI,
bool IsSigned) const {
switch (Opcode) {
- case Instruction::Add: return willNotOverflowAdd(LHS, RHS, CtxI, IsSigned);
- case Instruction::Sub: return willNotOverflowSub(LHS, RHS, CtxI, IsSigned);
- case Instruction::Mul: return willNotOverflowMul(LHS, RHS, CtxI, IsSigned);
+ case Instruction::Add:
+ return willNotOverflowAdd(LHS, RHS, CtxI, IsSigned);
+ case Instruction::Sub:
+ return willNotOverflowSub(LHS, RHS, CtxI, IsSigned);
+ case Instruction::Mul:
+ return willNotOverflowMul(LHS, RHS, CtxI, IsSigned);
default: llvm_unreachable("Unexpected opcode for overflow query");
}
}
@@ -518,9 +521,9 @@ public:
return nullptr; // Don't do anything with FI
}
- OverflowResult computeOverflow(
- Instruction::BinaryOps BinaryOp, bool IsSigned,
- Value *LHS, Value *RHS, Instruction *CtxI) const;
+ OverflowResult computeOverflow(Instruction::BinaryOps BinaryOp, bool IsSigned,
+ Value *LHS, Value *RHS,
+ Instruction *CtxI) const;
/// Performs a few simplifications for operators which are associative
/// or commutative.
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
index 573e1e028..97b59d593 100644
--- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
@@ -611,9 +611,8 @@ bool JumpThreadingPass::computeValueKnownInPredecessorsImpl(
if (Constant *KC = getKnownConstant(InVal, Preference)) {
Result.emplace_back(KC, PN->getIncomingBlock(i));
} else {
- Constant *CI = LVI->getConstantOnEdge(InVal,
- PN->getIncomingBlock(i),
- BB, CtxI);
+ Constant *CI =
+ LVI->getConstantOnEdge(InVal, PN->getIncomingBlock(i), BB, CtxI);
if (Constant *KC = getKnownConstant(CI, Preference))
Result.emplace_back(KC, PN->getIncomingBlock(i));
}
diff --git a/llvm/unittests/Analysis/ValueTrackingTest.cpp b/llvm/unittests/Analysis/ValueTrackingTest.cpp
index 6458f7145..2e7c0f3ae 100644
--- a/llvm/unittests/Analysis/ValueTrackingTest.cpp
+++ b/llvm/unittests/Analysis/ValueTrackingTest.cpp
@@ -1407,25 +1407,26 @@ TEST_F(ValueTrackingTest, canCreatePoisonOrUndef) {
}
TEST_F(ValueTrackingTest, computePtrAlignment) {
- parseAssembly("declare i1 @f_i1()\n"
- "declare ptr @f_i8p()\n"
- "declare void @llvm.assume(i1)\n"
- "define void @test() {\n"
- " %A = call ptr @f_i8p()\n"
- " %cond = call i1 @f_i1()\n"
- " %CtxI = add i32 0, 0\n"
- " br i1 %cond, label %BB1, label %EXIT\n"
- "BB1:\n"
- " %CtxI2 = add i32 0, 0\n"
- " %cond2 = call i1 @f_i1()\n"
- " call void @llvm.assume(i1 true) [ \"align\"(ptr %A, i64 16) ]\n"
- " br i1 %cond2, label %BB2, label %EXIT\n"
- "BB2:\n"
- " %CtxI3 = add i32 0, 0\n"
- " ret void\n"
- "EXIT:\n"
- " ret void\n"
- "}");
+ parseAssembly(
+ "declare i1 @f_i1()\n"
+ "declare ptr @f_i8p()\n"
+ "declare void @llvm.assume(i1)\n"
+ "define void @test() {\n"
+ " %A = call ptr @f_i8p()\n"
+ " %cond = call i1 @f_i1()\n"
+ " %CtxI = add i32 0, 0\n"
+ " br i1 %cond, label %BB1, label %EXIT\n"
+ "BB1:\n"
+ " %CtxI2 = add i32 0, 0\n"
+ " %cond2 = call i1 @f_i1()\n"
+ " call void @llvm.assume(i1 true) [ \"align\"(ptr %A, i64 16) ]\n"
+ " br i1 %cond2, label %BB2, label %EXIT\n"
+ "BB2:\n"
+ " %CtxI3 = add i32 0, 0\n"
+ " ret void\n"
+ "EXIT:\n"
+ " ret void\n"
+ "}");
AssumptionCache AC(*F);
DominatorTree DT(*F);
const DataLayout &DL = M->getDataLayout();
``````````
</details>
https://github.com/llvm/llvm-project/pull/226137
More information about the llvm-commits
mailing list