[llvm] [SandboxIR] Add missing VectorType functions (PR #107650)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 9 12:04:37 PDT 2024
================
@@ -317,7 +317,32 @@ class StructType : public Type {
class VectorType : public Type {
public:
static VectorType *get(Type *ElementType, ElementCount EC);
- // TODO: add missing functions
+ static VectorType *get(Type *ElementType, unsigned NumElements,
+ bool Scalable) {
+ return VectorType::get(ElementType,
+ ElementCount::get(NumElements, Scalable));
+ }
+ // Needs tests
+ Type *getElementType() const;
+
+ static VectorType *get(Type *ElementType, const VectorType *Other) {
+ return VectorType::get(ElementType, Other->getElementCount());
+ }
+
+ inline ElementCount getElementCount() const {
+ return cast<llvm::VectorType>(LLVMTy)->getElementCount();
+ }
+ static VectorType *getInteger(Context &Ctx, VectorType *VTy);
----------------
Sterling-Augustine wrote:
done
https://github.com/llvm/llvm-project/pull/107650
More information about the llvm-commits
mailing list