mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-04 06:51:56 +00:00
[SVE] Bail from cstfp_pred_ty before walking scalable vector
Summary: Bail out in cstfp_pred_ty before calling getNumElements and walking the vector if the vector is scalable. Reviewers: efriedma, lebedev.ri, fhahn, sdesmalen, fpetrogalli Reviewed By: sdesmalen Subscribers: tschuett, rkruppe, psnobl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D81617
This commit is contained in:
parent
13331477c0
commit
3a726bc993
@ -333,6 +333,10 @@ template <typename Predicate> struct cstfp_pred_ty : public Predicate {
|
||||
if (const auto *CF = dyn_cast_or_null<ConstantFP>(C->getSplatValue()))
|
||||
return this->isValue(CF->getValueAPF());
|
||||
|
||||
// Number of elements of a scalable vector unknown at compile time
|
||||
if (isa<ScalableVectorType>(V->getType()))
|
||||
return false;
|
||||
|
||||
// Non-splat vector constant: check each element for a match.
|
||||
unsigned NumElts = cast<VectorType>(V->getType())->getNumElements();
|
||||
assert(NumElts != 0 && "Constant vector with no elements?");
|
||||
|
Loading…
Reference in New Issue
Block a user