summaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/VectorUtils.cpp
diff options
context:
space:
mode:
authorRamkumar Ramachandra <ramkumar.ramachandra@codasip.com>2025-11-17 16:36:42 +0000
committerGitHub <noreply@github.com>2025-11-17 16:36:42 +0000
commit7659cd42578c59d1bef1313053d493171b9146a2 (patch)
treea7eccb43678d414ad01cb6b3bbc0788b78068edc /llvm/lib/Analysis/VectorUtils.cpp
parenta9633aac31cb1ec42153fb3ada815aa1572eb58f (diff)
[VectorUtils] Use PatternMatch in findScalarElement (NFC) (#168389)
Diffstat (limited to 'llvm/lib/Analysis/VectorUtils.cpp')
-rw-r--r--llvm/lib/Analysis/VectorUtils.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/VectorUtils.cpp b/llvm/lib/Analysis/VectorUtils.cpp
index 530fa9518f40..a3e9b039f922 100644
--- a/llvm/lib/Analysis/VectorUtils.cpp
+++ b/llvm/lib/Analysis/VectorUtils.cpp
@@ -317,9 +317,9 @@ Value *llvm::findScalarElement(Value *V, unsigned EltNo) {
if (InsertElementInst *III = dyn_cast<InsertElementInst>(V)) {
// If this is an insert to a variable element, we don't know what it is.
- if (!isa<ConstantInt>(III->getOperand(2)))
+ uint64_t IIElt;
+ if (!match(III->getOperand(2), m_ConstantInt(IIElt)))
return nullptr;
- unsigned IIElt = cast<ConstantInt>(III->getOperand(2))->getZExtValue();
// If this is an insert to the element we are looking for, return the
// inserted value.