aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ConstantFolding.cpp
diff options
context:
space:
mode:
authorChristopher Tetreault <ctetreau@quicinc.com>2020-04-23 12:19:54 -0700
committerChristopher Tetreault <ctetreau@quicinc.com>2020-04-23 12:44:22 -0700
commit9174e0229fcbe32967addda74a7beb7bb43cf17c (patch)
tree08420b777f3a97ed48bfbf61ec57c6cf6789e2e1 /llvm/lib/Analysis/ConstantFolding.cpp
parent156afb2253eabf0e2d446dafd08e754d7b9f513a (diff)
downloadllvm-9174e0229fcbe32967addda74a7beb7bb43cf17c.zip
llvm-9174e0229fcbe32967addda74a7beb7bb43cf17c.tar.gz
llvm-9174e0229fcbe32967addda74a7beb7bb43cf17c.tar.bz2
[SVE] Remove calls to VectorType::isScalable from analysis
Reviewers: efriedma, sdesmalen, chandlerc, sunfish Reviewed By: efriedma Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77692
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index 351e36f..b2bde95 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -509,7 +509,7 @@ bool ReadDataFromGlobal(Constant *C, uint64_t ByteOffset, unsigned char *CurPtr,
Constant *FoldReinterpretLoadFromConstPtr(Constant *C, Type *LoadTy,
const DataLayout &DL) {
// Bail out early. Not expect to load from scalable global variable.
- if (LoadTy->isVectorTy() && cast<VectorType>(LoadTy)->isScalable())
+ if (isa<ScalableVectorType>(LoadTy))
return nullptr;
auto *PTy = cast<PointerType>(C->getType());
@@ -836,8 +836,7 @@ Constant *SymbolicallyEvaluateGEP(const GEPOperator *GEP,
Type *SrcElemTy = GEP->getSourceElementType();
Type *ResElemTy = GEP->getResultElementType();
Type *ResTy = GEP->getType();
- if (!SrcElemTy->isSized() ||
- (SrcElemTy->isVectorTy() && cast<VectorType>(SrcElemTy)->isScalable()))
+ if (!SrcElemTy->isSized() || isa<ScalableVectorType>(SrcElemTy))
return nullptr;
if (Constant *C = CastGEPIndices(SrcElemTy, Ops, ResTy,
@@ -2572,7 +2571,7 @@ static Constant *ConstantFoldVectorCall(StringRef Name,
// Do not iterate on scalable vector. The number of elements is unknown at
// compile-time.
- if (VTy->isScalable())
+ if (isa<ScalableVectorType>(VTy))
return nullptr;
if (IntrinsicID == Intrinsic::masked_load) {