[PATCH] D97070: [ValueTypes] Assert if changeVectorElementType is called on a simple type with an extended element type.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 19 17:35:59 PST 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGbaab7978787d: [ValueTypes] Assert if changeVectorElementType is called on a simple type with… (authored by craig.topper).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97070/new/
https://reviews.llvm.org/D97070
Files:
llvm/include/llvm/CodeGen/ValueTypes.h
llvm/lib/CodeGen/ValueTypes.cpp
Index: llvm/lib/CodeGen/ValueTypes.cpp
===================================================================
--- llvm/lib/CodeGen/ValueTypes.cpp
+++ llvm/lib/CodeGen/ValueTypes.cpp
@@ -15,11 +15,13 @@
using namespace llvm;
EVT EVT::changeExtendedTypeToInteger() const {
+ assert(isExtended() && "Type is not extended!");
LLVMContext &Context = LLVMTy->getContext();
return getIntegerVT(Context, getSizeInBits());
}
EVT EVT::changeExtendedVectorElementTypeToInteger() const {
+ assert(isExtended() && "Type is not extended!");
LLVMContext &Context = LLVMTy->getContext();
EVT IntTy = getIntegerVT(Context, getScalarSizeInBits());
return getVectorVT(Context, IntTy, getVectorNumElements(),
@@ -27,6 +29,7 @@
}
EVT EVT::changeExtendedVectorElementType(EVT EltVT) const {
+ assert(isExtended() && "Type is not extended!");
LLVMContext &Context = LLVMTy->getContext();
return getVectorVT(Context, EltVT, getVectorElementCount());
}
Index: llvm/include/llvm/CodeGen/ValueTypes.h
===================================================================
--- llvm/include/llvm/CodeGen/ValueTypes.h
+++ llvm/include/llvm/CodeGen/ValueTypes.h
@@ -100,8 +100,11 @@
/// Return a VT for a vector type whose attributes match ourselves
/// with the exception of the element type that is chosen by the caller.
EVT changeVectorElementType(EVT EltVT) const {
- if (isSimple() && EltVT.isSimple())
+ if (isSimple()) {
+ assert(EltVT.isSimple() &&
+ "Can't change simple vector VT to have extended element VT");
return getSimpleVT().changeVectorElementType(EltVT.getSimpleVT());
+ }
return changeExtendedVectorElementType(EltVT);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97070.325123.patch
Type: text/x-patch
Size: 1715 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210220/be069be5/attachment.bin>
More information about the llvm-commits
mailing list