[llvm] 7d3306f - [llvm] Fix warnings
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 23 10:58:02 PST 2023
Author: Kazu Hirata
Date: 2023-01-23T10:57:56-08:00
New Revision: 7d3306fa4285f99cc6d2cf128ed4bd6050b8373c
URL: https://github.com/llvm/llvm-project/commit/7d3306fa4285f99cc6d2cf128ed4bd6050b8373c
DIFF: https://github.com/llvm/llvm-project/commit/7d3306fa4285f99cc6d2cf128ed4bd6050b8373c.diff
LOG: [llvm] Fix warnings
This patch fixes:
llvm/lib/IR/DataLayout.cpp:942:13: warning: unused variable ‘VecTy’
[-Wunused-variable]
llvm/lib/Transforms/IPO/OpenMPOpt.cpp:2899:27: warning: unused
variable ‘MI’ [-Wunused-variable]
Added:
Modified:
llvm/lib/IR/DataLayout.cpp
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
Removed:
################################################################################
diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp
index 289d525d1f517..379c6d577b4e6 100644
--- a/llvm/lib/IR/DataLayout.cpp
+++ b/llvm/lib/IR/DataLayout.cpp
@@ -939,7 +939,7 @@ std::optional<APInt> DataLayout::getGEPIndexForOffset(Type *&ElemTy,
return getElementIndex(getTypeAllocSize(ElemTy), Offset);
}
- if (auto *VecTy = dyn_cast<VectorType>(ElemTy)) {
+ if (isa<VectorType>(ElemTy)) {
// Vector GEPs are partially broken (e.g. for overaligned element types),
// and may be forbidden in the future, so avoid generating GEPs into
// vectors. See https://discourse.llvm.org/t/67497
diff --git a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
index a3ed1685773e1..b2356ef346dae 100644
--- a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -2896,7 +2896,7 @@ ChangeStatus AAExecutionDomainFunction::updateImpl(Attributor &A) {
}
// Check the pointer(s) of a memory intrinsic explicitly.
- if (MemIntrinsic *MI = dyn_cast<MemIntrinsic>(&I)) {
+ if (isa<MemIntrinsic>(&I)) {
if (!ED.EncounteredNonLocalSideEffect &&
AA::isPotentiallyAffectedByBarrier(A, I, *this))
ED.EncounteredNonLocalSideEffect = true;
More information about the llvm-commits
mailing list