aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/ConstantFold.cpp
diff options
context:
space:
mode:
authorChristopher Tetreault <ctetreau@quicinc.com>2020-06-03 13:35:41 -0700
committerChristopher Tetreault <ctetreau@quicinc.com>2020-06-03 13:56:45 -0700
commit900f78a714c583dd87432a9c89f6ccade8430fac (patch)
treedb9fff11e035821f0403d29966fdb1ee462b3ac8 /llvm/lib/IR/ConstantFold.cpp
parente636e6b79ac06b13059e46b49acb4d9de204c75b (diff)
downloadllvm-900f78a714c583dd87432a9c89f6ccade8430fac.zip
llvm-900f78a714c583dd87432a9c89f6ccade8430fac.tar.gz
llvm-900f78a714c583dd87432a9c89f6ccade8430fac.tar.bz2
[SVE] Eliminate calls to default-false VectorType::get() from IR
Reviewers: efriedma, kmclaughlin, sdesmalen, dexonsmith, dblaikie Reviewed By: efriedma Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D80261
Diffstat (limited to 'llvm/lib/IR/ConstantFold.cpp')
-rw-r--r--llvm/lib/IR/ConstantFold.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp
index d090eaa..3fb49e9 100644
--- a/llvm/lib/IR/ConstantFold.cpp
+++ b/llvm/lib/IR/ConstantFold.cpp
@@ -881,7 +881,7 @@ Constant *llvm::ConstantFoldShuffleVectorInstruction(Constant *V1, Constant *V2,
// Undefined shuffle mask -> undefined value.
if (all_of(Mask, [](int Elt) { return Elt == UndefMaskElem; })) {
- return UndefValue::get(VectorType::get(EltTy, MaskNumElts));
+ return UndefValue::get(FixedVectorType::get(EltTy, MaskNumElts));
}
// If the mask is all zeros this is a splat, no need to go through all
@@ -2287,13 +2287,13 @@ Constant *llvm::ConstantFoldGetElementPtr(Type *PointeeTy, Constant *C,
Type *OrigGEPTy = PointerType::get(Ty, PtrTy->getAddressSpace());
Type *GEPTy = PointerType::get(Ty, PtrTy->getAddressSpace());
if (VectorType *VT = dyn_cast<VectorType>(C->getType()))
- GEPTy = VectorType::get(OrigGEPTy, VT->getNumElements());
+ GEPTy = FixedVectorType::get(OrigGEPTy, VT->getNumElements());
// The GEP returns a vector of pointers when one of more of
// its arguments is a vector.
for (unsigned i = 0, e = Idxs.size(); i != e; ++i) {
if (auto *VT = dyn_cast<VectorType>(Idxs[i]->getType())) {
- GEPTy = VectorType::get(OrigGEPTy, VT->getNumElements());
+ GEPTy = FixedVectorType::get(OrigGEPTy, VT->getNumElements());
break;
}
}
@@ -2528,7 +2528,7 @@ Constant *llvm::ConstantFoldGetElementPtr(Type *PointeeTy, Constant *C,
// overflow trouble.
Type *ExtendedTy = Type::getIntNTy(Div->getContext(), CommonExtendedWidth);
if (UseVector)
- ExtendedTy = VectorType::get(
+ ExtendedTy = FixedVectorType::get(
ExtendedTy,
IsPrevIdxVector
? cast<VectorType>(PrevIdx->getType())->getNumElements()