[llvm] 7780015 - [Analysis] Fix a warning
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 14 12:41:49 PST 2025
Author: Kazu Hirata
Date: 2025-02-14T12:41:43-08:00
New Revision: 778001514f4f2954be88fdc1e143c180165dadc4
URL: https://github.com/llvm/llvm-project/commit/778001514f4f2954be88fdc1e143c180165dadc4
DIFF: https://github.com/llvm/llvm-project/commit/778001514f4f2954be88fdc1e143c180165dadc4.diff
LOG: [Analysis] Fix a warning
This patch fixes:
llvm/lib/Analysis/LoopAccessAnalysis.cpp:1530:9: error: unused
variable 'Ty' [-Werror,-Wunused-variable]
Added:
Modified:
llvm/lib/Analysis/LoopAccessAnalysis.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index f6fbb499ebaba..4bdcccdae0b7e 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -1527,8 +1527,7 @@ llvm::getPtrStride(PredicatedScalarEvolution &PSE, Type *AccessTy, Value *Ptr,
if (PSE.getSE()->isLoopInvariant(PtrScev, Lp))
return 0;
- Type *Ty = Ptr->getType();
- assert(Ty->isPointerTy() && "Unexpected non-ptr");
+ assert(Ptr->getType()->isPointerTy() && "Unexpected non-ptr");
if (isa<ScalableVectorType>(AccessTy)) {
LLVM_DEBUG(dbgs() << "LAA: Bad stride - Scalable object: " << *AccessTy
<< "\n");
More information about the llvm-commits
mailing list